query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
/ / Helper methods /
private static function areAllOperationsSuccessful (array $result) : bool { return HashMap::from($result) ->all(function ($key, $value) { return $value === true; // can be true or Memcached::RES_* }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function _i() {\n }", "private function __() {\n }", "private function static_things()\n\t{\n\n\t\t# code...\n\t}", "public function custom()\n\t{\n\t}", "public function getAlternate() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "public function inOriginal();", "abstract protected function external();", "abstract public function getPasiekimai();", "abstract protected function content();", "public function temporality();", "abstract protected function _process();", "abstract protected function _process();", "public function boleta()\n\t{\n\t\t//\n\t}", "protected function test9() {\n\n }", "public function get_data()\n\t\t{\t\t// Should there be a common method for this?\n\t\t}", "final private function __construct() {}", "final private function __construct() {}", "public function ogs()\r\n {\r\n }", "function extract()\n {\n }", "public function extra();", "private function method2()\n\t{\n\t}", "public function nadar()\n {\n }", "function getFrom();", "abstract protected function data();", "abstract public function information();", "function get_result($item)\n {\n }", "final private function __construct(){\r\r\n\t}", "private function __construct()\t{}", "public function ex4()\n {\n }", "abstract function get();", "private function aFunc()\n {\n }", "function getContent() ;", "public function getHelper()\n {\n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function getItem() ;", "abstract protected function _prepare();", "private function method1()\n\t{\n\t}", "public function masodik()\n {\n }", "abstract public function get() ;", "public function operations();", "protected function __init__() { }", "private function __construct () {}", "public function serch()\n {\n }", "private final function __construct() {}", "public static function dummy() {}", "abstract protected function _preProcess();", "abstract protected function attributes();", "public function oops () {\n }", "public function _strings_for_pot()\n {\n }", "protected function _refine() {\n\n\t}", "public function access();", "protected function parse() {}", "function getDescription() ;", "protected final function __construct() {}", "function _prepare() {}", "public function andar()\n {\n }", "public static function get_data(){\n\n }", "private function __construct() {}", "function PrimaryReturn($otype){\r\n}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.686044", "0.55582243", "0.54197454", "0.5378807", "0.52885926", "0.5266212", "0.5230826", "0.5230826", "0.5230826", "0.5230826", "0.51971245", "0.5183846", "0.51716727", "0.51364625", "0.5133516", "0.5123286", "0.5123286", "0.51191944", "0.51110005", "0.5092386", "0.50830626", "0.50830626", "0.5082921", "0.50817454", "0.50804466", "0.50671417", "0.5056176", "0.5056008", "0.50557536", "0.5036379", "0.5024342", "0.5019597", "0.5018414", "0.50126594", "0.49978036", "0.49923506", "0.4989351", "0.49813765", "0.49705285", "0.49705285", "0.49705285", "0.49700516", "0.49697995", "0.49679726", "0.49676144", "0.49656597", "0.49565062", "0.49479306", "0.49403423", "0.49353144", "0.49278116", "0.49268338", "0.4921857", "0.49192512", "0.49191055", "0.4914571", "0.49134365", "0.490101", "0.48983496", "0.48960266", "0.48942733", "0.4892208", "0.48912662", "0.4887327", "0.48871815", "0.4886694", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037", "0.48860037" ]
0.0
-1
set the elequent relationship with doctors table (many to one)
public function doctor(){ return $this->belongsTo(Doctor::class,'doctor_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function doctor_id()\n {\n return $this->belongsToMany(doctor_id::class);\n }", "public function Doctors()\n {\n return $this->belongsToMany('App\\Doctor')->using('App\\DoctorSpeciality');\n }", "public function setRelations() {}", "protected\tfunction\tsetRelations() {}", "protected\tfunction\tsetRelations() {}", "public function setupAssociations() \n {\n \n }", "public function doctors()\n {\n return $this->hasMany('App\\JobPractitioner');\n }", "public function getDoctor()\n {\n return $this->hasOne(Doctor::className(), ['id' => 'id']);\n }", "public function doctor()\n {\n return $this->belongsTo(User::class, 'doctor_id');\n }", "public function doctor()\n {\n return $this->belongsTo('App\\Models\\Doctor');\n }", "public function initialize()\n {\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('alias' => 'Datospersonales'));\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('foreignKey' => true));\n }", "public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }", "public function doctor() {\n return $this->belongsTo(Doctor::class, 'doc_id');\n }", "public function initialize()\n {\n $this->hasMany('informacion_id', 'Informacionadicional', 'informacion_id', array('alias' => 'Informacionadicional'));\n $this->belongsTo('informacion_adicionalId', 'Adicional', 'adicional_id', array('alias' => 'Adicional'));\n }", "public function setdoctorIdArray($val){\t\n\t\t\t$this->doctorIdArray = $val;\t\t\t\t\n\t\t\treturn $this;\n\t}", "public function getId0()\n {\n return $this->hasOne(Doctor::className(), ['id' => 'id']);\n }", "public function assigned(){\n return new manytomany_link($this, 'patient', 'staffpatient');\n\t}", "public function initialize()\n {\n $this->belongsTo('id_deuda', 'NbDeudas', 'id_deuda', array('alias' => 'NbDeudas'));\n $this->belongsTo('id_deuda', 'Nbdeudas', 'id_deuda', array('foreignKey' => true));\n }", "public function testCrossAssociation() {\n\t\t$ARTPost = new ARTPost(array('title' => 'lala', 'message' => '', 'writer_id' => 1));\n\t\t$ARTComment = new ARTComment(array('message' => 'coment1 lala1'));\n\t\t$ARTComment->Post = $ARTPost;\n\t\t$ARTPost->Comments[] = $ARTComment;\n\t\t$ARTPost->save();\n\t\t$this->assertCount(1, $ARTPost->Comments);\n\n\t\t$ARTPost->id = 666;\n\t\t$ARTPost->save();\n\t\t$this->assertCount(1, $ARTPost->Comments);\n\t}", "public function doctor()\n {\n return $this->belongsTo('App\\Customer');\n }", "public function moviesDirected(){\n return $this->belongsToMany('App\\Movie', 'director_movie', 'id_director', 'id_movie'); \n }", "public function initialize()\n {\n $this->hasMany('id', 'Aulas', 'id_materia', array('alias' => 'Aulas'));\n $this->hasMany('id', 'Aulas', 'id_materia', NULL);\n }", "public function buildRelations()\n {\n $this->addRelation('Marca', 'Marca', RelationMap::MANY_TO_ONE, array('idmarca' => 'idmarca', ), 'CASCADE', 'CASCADE');\n $this->addRelation('Proveedor', 'Proveedor', RelationMap::MANY_TO_ONE, array('idproveedor' => 'idproveedor', ), 'CASCADE', 'CASCADE');\n }", "public function initialize()\n {\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaExcusa', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaFacturacion', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo', 'CobActaconteo', 'id_actaconteo', array(\n 'reusable' => true\n ));\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n\t{\n $this->addRelation('Organisatie', 'Organisatie', RelationMap::MANY_TO_ONE, array('organisatie_id' => 'id', ), null, null);\n $this->addRelation('Contact', 'Contact', RelationMap::ONE_TO_MANY, array('id' => 'persoon_id', ), null, null);\n\t}", "public function educacion_distancia(){\n\t\treturn $this->hasOne('App\\EducacionDistancia', 'EDi_ID_Asp');\n\t}", "public function buildRelations()\n\t{\n $this->addRelation('CuadreCaja', 'CuadreCaja', RelationMap::MANY_TO_ONE, array('id_cuadre_caja' => 'id_cuadre_caja', ), 'RESTRICT', null);\n $this->addRelation('PersonaRelatedByIdPersona', 'Persona', RelationMap::MANY_TO_ONE, array('id_persona' => 'id_persona', ), 'RESTRICT', null);\n $this->addRelation('PersonaRelatedByIdAutoriza', 'Persona', RelationMap::MANY_TO_ONE, array('id_autoriza' => 'id_persona', ), 'RESTRICT', null);\n\t}", "public function doctorsVisits()\n {\n return $this->hasMany(Visit::class, 'doctor_id');\n }", "private function createRelation()\n {\n $this->createBuilder();\n }", "public function candidato() { \n return $this->belongsTo(Candidato::class); ///, '','id'\n }", "public function isAddToRelationship();", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function people (){\n\n \treturn $this->belongsTo(People::class);\n }", "public function associate($entity)\n {\n // The Mapper will retrieve this association within the object model, we won't be using\n // the foreign key attribute inside the parent Entity.\n //\n //$this->parent->setEntityAttribute($this->foreignKey, $entity->getEntityAttribute($this->otherKey));\n //\n // Instead, we'll just add the object to the Entity's attribute\n\n $this->parent->setEntityAttribute($this->relation, $entity->getEntityObject());\n }", "public function initialize()\n {\n $this->hasMany('groep_id', 'Gebruikers', 'groep_id', array('alias' => 'Gebruikers'));\n $this->hasMany('groep_id', 'Groep_permissies', 'groep_id', array('alias' => 'Groep_permissies'));\n }", "public function initialize()\n {\n $this->hasMany('cd', 'ShouhinMrs', 'shu_souko_mr_cd', array('alias' => 'ShouhinMrs'));\n $this->hasMany('cd', 'ShiireMeisaiDts', 'souko_mr_cd', array('alias' => 'ShiireMeisaiDts'));\n $this->hasMany('cd', 'UriageMeisaiDts', 'souko_mr_cd', array('alias' => 'UriageMeisaiDts'));\n $this->belongsTo('tantou_mr_cd', 'TantouMrs', 'cd', array('alias' => 'TantouMrs'));\n }", "protected static function _relations() {\n\n\t}", "public function actors(){\n return $this->belongsToMany(User::class,'cast_crews', 'role_id', 'user_id');\n }", "public function initialize()\n {\n $this->hasMany('id_tipobeneficio', 'Documentosbeneficios', 'id_tipobeneficio', array('alias' => 'Documentosbeneficios'));\n $this->hasMany('id_tipobeneficio', 'Documentosbeneficios', 'id_tipobeneficio', NULL);\n }", "public function buildRelations()\n {\n $this->addRelation('ArtRequest', 'ArtRequestORM\\\\ArtRequest', RelationMap::ONE_TO_MANY, array('event_id' => 'event_id', ), 'CASCADE', 'CASCADE', 'ArtRequests');\n }", "private function _set_relationships()\n {\n if(empty($this->_relationships))\n {\n $options = array('has_one','has_many','has_many_pivot');\n foreach($options as $option)\n {\n if(isset($this->{$option}) && !empty($this->{$option}))\n {\n foreach($this->{$option} as $key => $relation)\n {\n $foreign_model = (is_array($relation)) ? $relation[0] : $relation;\n $foreign_model_name = strtolower($foreign_model);\n $this->load->model($foreign_model_name);\n $foreign_table = $this->{$foreign_model_name}->table;\n if($option=='has_many_pivot')\n {\n $tables = array($this->table, $foreign_table);\n sort($tables);\n $pivot_table = $tables[0].'_'.$tables[1];\n $foreign_key = (is_array($relation)) ? $relation[1] : $this->{$foreign_model_name}->primary;\n $local_key = (is_array($relation) && isset($relation[2])) ? $relation[2] : $this->primary;\n }\n else\n {\n $foreign_key = (is_array($relation)) ? $relation[1] : singular($this->table) . '_id';\n $local_key = (is_array($relation) && isset($relation[2])) ? $relation[2] : $this->primary;\n }\n $this->_relationships[$key] = array('relation' => $option, 'relation_key' => $key, 'foreign_model' => $foreign_model_name, 'foreign_table' => $foreign_table, 'foreign_key' => $foreign_key, 'local_key' => $local_key);\n ($option == 'has_many_pivot') ? ($this->_relationships[$key]['pivot_table'] = $pivot_table) : FALSE;\n\n }\n }\n }\n }\n }", "public function buildRelations()\n\t{\n $this->addRelation('SftOrganismo', 'SftOrganismo', RelationMap::ONE_TO_MANY, array('id' => 'id_pais', ), 'SET NULL', 'CASCADE');\n $this->addRelation('SftPersona', 'SftPersona', RelationMap::ONE_TO_MANY, array('id' => 'id_paisdocidentificacion', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('GenPaisI18n', 'GenPaisI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', 'CASCADE');\n\t}", "public function initialize()\n {\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', array('alias' => 'Cargaestudiantes'));\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', array('alias' => 'Datosprofesiona'));\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', NULL);\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', NULL);\n }", "public function one_to_one()\n {\n }", "public function buildRelations()\n {\n $this->addRelation('Banco', 'Banco', RelationMap::MANY_TO_ONE, array('idbanco' => 'idbanco', ), 'CASCADE', 'CASCADE');\n }", "protected function addRelation()\n {\n $fromTable = $this->ask('Enter the name of the parent table');\n $this->checkInput($fromTable);\n $toTable = $this->ask('Enter the name of the child table');\n $this->checkInput($toTable);\n $relationColumn = $this->ask('Enter the column which is going to be referenced (default is \\'id\\')', 'id');\n $action = $this->choice('Action to be taken for column (default is \\'cascade\\')', ['cascade', 'restrict', 'set null'], 'cascade');\n $this->service->addRelation($fromTable, $toTable, $relationColumn, $action);\n }", "private function belongsTo($array){\n\t\t$result = $this->parseRelation($array);\n\t\t$model = $result['model'];\n\t\t$forKey = $result['forKey'];\n\t\tif(!$this->isSelected)$this->selectOne();\n\t\t$forId = $this->columns[$forKey];\n\t\t$entity = new $model($forId);\n\t\treturn $entity;\n\t}", "public function initialize()\n {\n $this->belongsTo('id_categoria_gastos', 'CategoriaGastos', 'id_categoria_gastos', array('alias' => 'CategoriaGastos'));\n $this->belongsTo('id_presupuesto', 'Presupuesto', 'id_presupuesto', array('alias' => 'Presupuesto'));\n }", "public function buildRelations()\n {\n $this->addRelation('Contrarecibo', 'Contrarecibo', RelationMap::MANY_TO_ONE, array('idcontrarecibo' => 'idcontrarecibo', ), 'CASCADE', 'CASCADE');\n }", "public function initialize() {\n\n $this->belongsTo(\"users_id\", \"Aiden\\Models\\Users\", \"id\", [\"alias\" => \"User\"]);\n $this->belongsTo(\"councils_id\", \"Aiden\\Models\\Councils\", \"id\", [\"alias\" => \"Council\"]);\n\n }", "public function assistant(){\n \treturn $this->belongsTo(Assistant::class, 'id');\n }", "public function treatments() \n {\n return $this->belongsToMany(Treatment::class); \n }", "public function cidade(){\n return $this->belongsTo('App\\Cidade');\n\n }", "public function buildRelations()\n\t{\n $this->addRelation('Genero', 'Genero', RelationMap::MANY_TO_ONE, array('id_genero' => 'id', ), null, 'CASCADE');\n $this->addRelation('Tematica', 'Tematica', RelationMap::MANY_TO_ONE, array('id_tematica' => 'id', ), null, 'CASCADE');\n $this->addRelation('Autor', 'Autor', RelationMap::MANY_TO_ONE, array('id_autor' => 'id', ), null, 'CASCADE');\n $this->addRelation('Materia', 'Materia', RelationMap::MANY_TO_ONE, array('id_materia' => 'id', ), null, 'CASCADE');\n $this->addRelation('Tipopublicacion', 'Tipopublicacion', RelationMap::MANY_TO_ONE, array('id_tipopublicacion' => 'id', ), null, 'CASCADE');\n\t}", "public function initialize()\n {\n $this->belongsTo('cons_order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n $this->belongsTo('order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n }", "public function initialize() {\n\n // Relation to DasUsers\n $this->belongsTo('id', 'Aiden\\Models\\DasUsers', 'users_id', ['alias' => 'DasUsers']);\n\n // Relation to Phrases\n $this->hasMany('id', 'Aiden\\Models\\UsersPhrases', 'users_id', [\"alias\" => \"Phrases\"]);\n\n // Relation to Das\n $this->hasManyToMany('id', 'Aiden\\Models\\DasUsers', 'users_id', 'das_id', 'Aiden\\Models\\Das', 'id', ['alias' => 'Das']);\n\n // Relation to Councils\n $this->hasManyToMany('id', 'Aiden\\Models\\UsersCouncils', 'users_id', 'councils_id', 'Aiden\\Models\\Councils', 'id', ['alias' => 'Councils']);\n\n }", "public function buildRelations()\n {\n $this->addRelation('Moneda', 'Moneda', RelationMap::MANY_TO_ONE, array('moneda_id' => 'id', ), null, null);\n $this->addRelation('Usuario', 'Usuario', RelationMap::MANY_TO_ONE, array('usuario_id' => 'id', ), null, null);\n $this->addRelation('Negocio', 'Negocio', RelationMap::ONE_TO_MANY, array('id' => 'requerimiento_id', ), null, null, 'Negocios');\n $this->addRelation('DireccionRequerimiento', 'DireccionRequerimiento', RelationMap::ONE_TO_MANY, array('id' => 'requerimiento_id', ), null, null, 'DireccionRequerimientos');\n }", "public function buildRelations()\n {\n $this->addRelation('Denomination', 'Denomination\\\\Denomination', RelationMap::MANY_TO_ONE, array('denomination_id' => 'id', ), null, null);\n $this->addRelation('ProfessionalCategory', 'ProfessionalCategory\\\\ProfessionalCategory', RelationMap::MANY_TO_ONE, array('professional_category_id' => 'id', ), null, null);\n $this->addRelation('Country', 'Country\\\\Country', RelationMap::MANY_TO_ONE, array('country_of_birth_id' => 'id', ), null, null);\n $this->addRelation('Migration', 'Migration\\\\Migration', RelationMap::ONE_TO_MANY, array('id' => 'person_id', ), null, null, 'Migrations');\n }", "public function tutor(){\n \treturn $this->belongsTo(tutor::class,'id_tutor');\n }", "public function buildRelations()\n\t{\n $this->addRelation('Aviso', 'Aviso', RelationMap::MANY_TO_ONE, array('aviso_id' => 'id', ), 'RESTRICT', null);\n $this->addRelation('Usuario', 'Usuario', RelationMap::MANY_TO_ONE, array('usuario_id' => 'id', ), 'RESTRICT', null);\n\t}", "public function conjuntos(){\n\n return $this->belongsToMany('Conjunto','administrador_conjunto','administrador_id','conjunto_id');\n\n }", "public function Onderdil(){ \n return $this->hasMany('App\\Models\\Onderdil', 'idOnderdil'); \n }", "public function setUp() {\n\t\t// A book\n\t\t$this->hasOne('Blipoteka_Book as book', array('local' => 'book_id', 'foreign' => 'book_id', 'onDelete' => 'CASCADE', 'onUpdate' => 'CASCADE'));\n\t\t// User who borrows a book\n\t\t$this->hasOne('Blipoteka_User as borrower', array('local' => 'borrower_id', 'foreign' => 'user_id', 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'));\n\t\t// User who lends a book\n\t\t$this->hasOne('Blipoteka_User as lender', array('local' => 'lender_id', 'foreign' => 'user_id', 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'));\n\t}", "public function addAssociationTarget($target)\n {\n }", "public function direccion(){\r\n return $this->belongsTo('direccion');\r\n }", "public function initialize()\n {\n $this->hasMany('cd_desconto', 'App\\Models\\PdvVendasHasItens', 'cd_desconto', array('alias' => 'PdvVendasHasItens'));\n $this->belongsTo('cd_caixa', 'App\\Models\\PdvCaixa', 'cd_caixa', array('alias' => 'PdvCaixa'));\n $this->belongsTo('cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('cd_unidade_negocio', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->belongsTo('cd_usuario_criacao', 'App\\Models\\Usuario', 'cd_usuario', array('alias' => 'Usuario'));\n }", "public function peliculas(){\n //retornar tipo de relacion\n return $this->belongsToMany('App\\Pelicula','pelicula_director');\n }", "public function initialize()\n {\n $this->hasMany('idmov', 'App\\Models\\MovEstoque', 'movimentacao_manual_estoque_idmov', array('alias' => 'MovEstoque'));\n $this->hasMany('idmov', 'App\\Models\\MovimentacaoManualEstoqueItem', 'idmov', array('alias' => 'MovimentacaoManualEstoqueItem'));\n $this->belongsTo('cd_ordem_servico_reparo', 'App\\Models\\OrdemServicoReparo', 'cd_ordem_servico', array('alias' => 'OrdemServicoReparo'));\n $this->belongsTo('cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->belongsTo('requerente', 'App\\Models\\Empresa', 'cd_empresa', array('alias' => 'Empresa'));\n $this->belongsTo('usuario_responsavel', 'App\\Models\\Usuario', 'cd_usuario', array('alias' => 'Usuario'));\n }", "public function doctor()\n {\n return $this->belongsTo('App\\User');\n }", "public function setFlexFormRelations() {}", "public function coordinacion()\n {\n \treturn $this->belongsTo('App\\Coordinacion','tCoordinacion_idCoordinacion', 'idCoordinacion');\n }", "public function initialize()\n {\n $this->hasMany(\"members_id\", \"\\Event\\Model\\Events\", \"members_id\", ['alias' => 'Events']);\n }", "public function setUp()\n {\n parent::setUp();\n $this->hasOne('WebsiteIdiomas', array(\n 'local' => 'id_idioma',\n 'foreign' => 'cod_id'));\n }", "public function candidatos(): HasMany\n {\n return $this->hasMany(VotosModel::class, 'votacao_id', 'id')\n ->select('votos.candidato_id', 'votos.id as voto_id', 'votos.votacao_id', 'users.id as user_id', 'users.name')\n ->join('users', function($j) {\n return $j->on('votos.candidato_id', '=', 'users.id');\n })->orderBy('users.name', 'ASC');\n }", "public function alumnos()\n {\n \treturn $this->belongsToMany('App\\Alumno');\n }", "public function initialize()\n {\n \t$this->belongsTo('id_usuario', 'IbcUsuario', 'id_usuario', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_periodo', 'CobPeriodo', 'id_periodo', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_contrato', 'CobActaconteo', 'id_contrato', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_ajuste_reportado', 'CobAjusteReportado', 'id_ajuste_reportado', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_actaconteo_persona_facturacion', 'CobActaconteoPersonaFacturacion', 'id_actaconteo_persona_facturacion', array(\n \t\t\t'reusable' => true\n \t));\n }", "public function testCategory()\n {\n $category = factory(Category::class)->make();\n $category->save();\n $category2 = factory(Category::class)->make();\n $category2->save();\n $user = factory(\\App\\User::class)->create();\n $user->save();\n $user->categories()->attach($category->id);\n $user->categories()->attach($category2->id);\n $this->assertTrue(true);\n}", "public function educacion_superior(){\n\t\treturn $this->hasMany('App\\EducacionSuperior', 'Sup_ID_Asp');\n\t}", "public function buildRelations()\n {\n $this->addRelation('Contact', 'Contact', RelationMap::MANY_TO_ONE, array('contact_id' => 'id', ), null, null);\n $this->addRelation('State', 'State', RelationMap::MANY_TO_ONE, array('state_id' => 'id', ), null, null);\n $this->addRelation('School', 'School', RelationMap::ONE_TO_MANY, array('id' => 'sponsor_id', ), null, null, 'Schools');\n }", "public function diemthamquans()\n {\n return $this->belongsToMany(DiaDiem::class, 'tourdulich_diemthamquan', 'id_tour', 'id_diemthamquan');\n }", "public function proveedor(){\n return $this->belongsTo(Proveedor::class,'idproveedor','id');\n }", "public function initialize()\n {\n $this->belongsTo(\n 'users_id',\n Users::class,\n 'id',\n ['alias' => 'user']\n );\n\n $this->belongsTo(\n 'companies_id',\n Companies::class,\n 'id',\n ['alias' => 'company']\n );\n\n $this->setSource('users_associated_company');\n }", "public function initialize()\n {\n $this->hasMany(\"id\", \"Modules\\Models\\Orders\", \"member_id\", array(\n 'alias' => 'orders'\n ));\n }", "public function buildRelations()\n {\n $this->addRelation('Country', 'Slashworks\\\\AppBundle\\\\Model\\\\Country', RelationMap::MANY_TO_ONE, array('country_id' => 'id', ), null, 'CASCADE');\n $this->addRelation('RemoteApp', 'Slashworks\\\\AppBundle\\\\Model\\\\RemoteApp', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'SET NULL', 'CASCADE', 'RemoteApps');\n $this->addRelation('UserCustomerRelation', 'Slashworks\\\\AppBundle\\\\Model\\\\UserCustomerRelation', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'CASCADE', 'UserCustomerRelations');\n }" ]
[ "0.6275189", "0.62609303", "0.6099701", "0.59726", "0.59726", "0.58849114", "0.58725625", "0.5836912", "0.5676113", "0.56342417", "0.5605745", "0.55591893", "0.55083656", "0.550836", "0.5481891", "0.54708076", "0.5459929", "0.5450194", "0.54204273", "0.5391431", "0.53664666", "0.53343153", "0.53248775", "0.5303826", "0.5291382", "0.5291382", "0.5291382", "0.5291382", "0.5291382", "0.5291382", "0.5291382", "0.5291382", "0.5291382", "0.5270704", "0.52684695", "0.5242294", "0.52405804", "0.5222248", "0.5220192", "0.52146035", "0.52098405", "0.52098405", "0.52098405", "0.52098405", "0.52098405", "0.52098405", "0.52098405", "0.52098405", "0.5199021", "0.5193444", "0.5191138", "0.51888174", "0.5182915", "0.51687986", "0.51621634", "0.5154435", "0.5123722", "0.51194626", "0.5108905", "0.5105832", "0.510261", "0.5098415", "0.50926775", "0.5086713", "0.507927", "0.5071177", "0.50661004", "0.506547", "0.5043265", "0.5039321", "0.50388706", "0.5036992", "0.5036704", "0.5033446", "0.5019219", "0.5009926", "0.4998281", "0.49962318", "0.49949014", "0.49903673", "0.49864027", "0.49800226", "0.49772218", "0.49728042", "0.49709076", "0.49642506", "0.4960273", "0.49569255", "0.4954804", "0.495274", "0.49477962", "0.49468827", "0.49450108", "0.4936414", "0.49337527", "0.49273908", "0.49256265", "0.49244976", "0.49212566", "0.49175787" ]
0.6161951
2
set the elequent relationship with doctors table (one to many)
public function appointments(){ return $this->hasMany(Appointment::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Doctors()\n {\n return $this->belongsToMany('App\\Doctor')->using('App\\DoctorSpeciality');\n }", "public function doctor_id()\n {\n return $this->belongsToMany(doctor_id::class);\n }", "public function setRelations() {}", "public function doctor(){\n return $this->belongsTo(Doctor::class,'doctor_id');\n }", "protected\tfunction\tsetRelations() {}", "protected\tfunction\tsetRelations() {}", "public function doctors()\n {\n return $this->hasMany('App\\JobPractitioner');\n }", "public function setupAssociations() \n {\n \n }", "public function doctor()\n {\n return $this->belongsTo(User::class, 'doctor_id');\n }", "public function getDoctor()\n {\n return $this->hasOne(Doctor::className(), ['id' => 'id']);\n }", "public function doctor()\n {\n return $this->belongsTo('App\\Models\\Doctor');\n }", "public function initialize()\n {\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('alias' => 'Datospersonales'));\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('foreignKey' => true));\n }", "public function initialize()\n {\n $this->hasMany('informacion_id', 'Informacionadicional', 'informacion_id', array('alias' => 'Informacionadicional'));\n $this->belongsTo('informacion_adicionalId', 'Adicional', 'adicional_id', array('alias' => 'Adicional'));\n }", "public function doctor() {\n return $this->belongsTo(Doctor::class, 'doc_id');\n }", "public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }", "public function doctorsVisits()\n {\n return $this->hasMany(Visit::class, 'doctor_id');\n }", "public function initialize()\n {\n $this->belongsTo('id_deuda', 'NbDeudas', 'id_deuda', array('alias' => 'NbDeudas'));\n $this->belongsTo('id_deuda', 'Nbdeudas', 'id_deuda', array('foreignKey' => true));\n }", "public function moviesDirected(){\n return $this->belongsToMany('App\\Movie', 'director_movie', 'id_director', 'id_movie'); \n }", "public function doctor()\n {\n return $this->belongsTo('App\\Customer');\n }", "public function assigned(){\n return new manytomany_link($this, 'patient', 'staffpatient');\n\t}", "public function setdoctorIdArray($val){\t\n\t\t\t$this->doctorIdArray = $val;\t\t\t\t\n\t\t\treturn $this;\n\t}", "public function initialize()\n {\n $this->hasMany('id', 'Aulas', 'id_materia', array('alias' => 'Aulas'));\n $this->hasMany('id', 'Aulas', 'id_materia', NULL);\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function initialize()\n {\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaExcusa', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaFacturacion', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo', 'CobActaconteo', 'id_actaconteo', array(\n 'reusable' => true\n ));\n }", "public function initialize()\n {\n $this->hasMany('groep_id', 'Gebruikers', 'groep_id', array('alias' => 'Gebruikers'));\n $this->hasMany('groep_id', 'Groep_permissies', 'groep_id', array('alias' => 'Groep_permissies'));\n }", "public function buildRelations()\n {\n $this->addRelation('Marca', 'Marca', RelationMap::MANY_TO_ONE, array('idmarca' => 'idmarca', ), 'CASCADE', 'CASCADE');\n $this->addRelation('Proveedor', 'Proveedor', RelationMap::MANY_TO_ONE, array('idproveedor' => 'idproveedor', ), 'CASCADE', 'CASCADE');\n }", "public function testCrossAssociation() {\n\t\t$ARTPost = new ARTPost(array('title' => 'lala', 'message' => '', 'writer_id' => 1));\n\t\t$ARTComment = new ARTComment(array('message' => 'coment1 lala1'));\n\t\t$ARTComment->Post = $ARTPost;\n\t\t$ARTPost->Comments[] = $ARTComment;\n\t\t$ARTPost->save();\n\t\t$this->assertCount(1, $ARTPost->Comments);\n\n\t\t$ARTPost->id = 666;\n\t\t$ARTPost->save();\n\t\t$this->assertCount(1, $ARTPost->Comments);\n\t}", "public function getId0()\n {\n return $this->hasOne(Doctor::className(), ['id' => 'id']);\n }", "public function actors(){\n return $this->belongsToMany(User::class,'cast_crews', 'role_id', 'user_id');\n }", "public function buildRelations()\n\t{\n $this->addRelation('Organisatie', 'Organisatie', RelationMap::MANY_TO_ONE, array('organisatie_id' => 'id', ), null, null);\n $this->addRelation('Contact', 'Contact', RelationMap::ONE_TO_MANY, array('id' => 'persoon_id', ), null, null);\n\t}", "public function buildRelations()\n\t{\n $this->addRelation('CuadreCaja', 'CuadreCaja', RelationMap::MANY_TO_ONE, array('id_cuadre_caja' => 'id_cuadre_caja', ), 'RESTRICT', null);\n $this->addRelation('PersonaRelatedByIdPersona', 'Persona', RelationMap::MANY_TO_ONE, array('id_persona' => 'id_persona', ), 'RESTRICT', null);\n $this->addRelation('PersonaRelatedByIdAutoriza', 'Persona', RelationMap::MANY_TO_ONE, array('id_autoriza' => 'id_persona', ), 'RESTRICT', null);\n\t}", "protected static function _relations() {\n\n\t}", "public function educacion_distancia(){\n\t\treturn $this->hasOne('App\\EducacionDistancia', 'EDi_ID_Asp');\n\t}", "public function people (){\n\n \treturn $this->belongsTo(People::class);\n }", "public function initialize()\n {\n $this->hasMany('cd', 'ShouhinMrs', 'shu_souko_mr_cd', array('alias' => 'ShouhinMrs'));\n $this->hasMany('cd', 'ShiireMeisaiDts', 'souko_mr_cd', array('alias' => 'ShiireMeisaiDts'));\n $this->hasMany('cd', 'UriageMeisaiDts', 'souko_mr_cd', array('alias' => 'UriageMeisaiDts'));\n $this->belongsTo('tantou_mr_cd', 'TantouMrs', 'cd', array('alias' => 'TantouMrs'));\n }", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function initialize()\n {\n $this->hasMany('id_tipobeneficio', 'Documentosbeneficios', 'id_tipobeneficio', array('alias' => 'Documentosbeneficios'));\n $this->hasMany('id_tipobeneficio', 'Documentosbeneficios', 'id_tipobeneficio', NULL);\n }", "public function initialize()\n {\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', array('alias' => 'Cargaestudiantes'));\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', array('alias' => 'Datosprofesiona'));\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', NULL);\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', NULL);\n }", "public function treatments() \n {\n return $this->belongsToMany(Treatment::class); \n }", "public function buildRelations()\n {\n $this->addRelation('ArtRequest', 'ArtRequestORM\\\\ArtRequest', RelationMap::ONE_TO_MANY, array('event_id' => 'event_id', ), 'CASCADE', 'CASCADE', 'ArtRequests');\n }", "public function candidato() { \n return $this->belongsTo(Candidato::class); ///, '','id'\n }", "public function buildRelations()\n\t{\n $this->addRelation('SftOrganismo', 'SftOrganismo', RelationMap::ONE_TO_MANY, array('id' => 'id_pais', ), 'SET NULL', 'CASCADE');\n $this->addRelation('SftPersona', 'SftPersona', RelationMap::ONE_TO_MANY, array('id' => 'id_paisdocidentificacion', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('GenPaisI18n', 'GenPaisI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', 'CASCADE');\n\t}", "public function initialize() {\n\n $this->belongsTo(\"users_id\", \"Aiden\\Models\\Users\", \"id\", [\"alias\" => \"User\"]);\n $this->belongsTo(\"councils_id\", \"Aiden\\Models\\Councils\", \"id\", [\"alias\" => \"Council\"]);\n\n }", "public function conjuntos(){\n\n return $this->belongsToMany('Conjunto','administrador_conjunto','administrador_id','conjunto_id');\n\n }", "public function initialize() {\n\n // Relation to DasUsers\n $this->belongsTo('id', 'Aiden\\Models\\DasUsers', 'users_id', ['alias' => 'DasUsers']);\n\n // Relation to Phrases\n $this->hasMany('id', 'Aiden\\Models\\UsersPhrases', 'users_id', [\"alias\" => \"Phrases\"]);\n\n // Relation to Das\n $this->hasManyToMany('id', 'Aiden\\Models\\DasUsers', 'users_id', 'das_id', 'Aiden\\Models\\Das', 'id', ['alias' => 'Das']);\n\n // Relation to Councils\n $this->hasManyToMany('id', 'Aiden\\Models\\UsersCouncils', 'users_id', 'councils_id', 'Aiden\\Models\\Councils', 'id', ['alias' => 'Councils']);\n\n }", "public function tutor(){\n \treturn $this->belongsTo(tutor::class,'id_tutor');\n }", "public function initialize()\n {\n $this->belongsTo('id_categoria_gastos', 'CategoriaGastos', 'id_categoria_gastos', array('alias' => 'CategoriaGastos'));\n $this->belongsTo('id_presupuesto', 'Presupuesto', 'id_presupuesto', array('alias' => 'Presupuesto'));\n }", "public function coordinacion()\n {\n \treturn $this->belongsTo('App\\Coordinacion','tCoordinacion_idCoordinacion', 'idCoordinacion');\n }", "public function buildRelations()\n {\n $this->addRelation('Denomination', 'Denomination\\\\Denomination', RelationMap::MANY_TO_ONE, array('denomination_id' => 'id', ), null, null);\n $this->addRelation('ProfessionalCategory', 'ProfessionalCategory\\\\ProfessionalCategory', RelationMap::MANY_TO_ONE, array('professional_category_id' => 'id', ), null, null);\n $this->addRelation('Country', 'Country\\\\Country', RelationMap::MANY_TO_ONE, array('country_of_birth_id' => 'id', ), null, null);\n $this->addRelation('Migration', 'Migration\\\\Migration', RelationMap::ONE_TO_MANY, array('id' => 'person_id', ), null, null, 'Migrations');\n }", "private function _set_relationships()\n {\n if(empty($this->_relationships))\n {\n $options = array('has_one','has_many','has_many_pivot');\n foreach($options as $option)\n {\n if(isset($this->{$option}) && !empty($this->{$option}))\n {\n foreach($this->{$option} as $key => $relation)\n {\n $foreign_model = (is_array($relation)) ? $relation[0] : $relation;\n $foreign_model_name = strtolower($foreign_model);\n $this->load->model($foreign_model_name);\n $foreign_table = $this->{$foreign_model_name}->table;\n if($option=='has_many_pivot')\n {\n $tables = array($this->table, $foreign_table);\n sort($tables);\n $pivot_table = $tables[0].'_'.$tables[1];\n $foreign_key = (is_array($relation)) ? $relation[1] : $this->{$foreign_model_name}->primary;\n $local_key = (is_array($relation) && isset($relation[2])) ? $relation[2] : $this->primary;\n }\n else\n {\n $foreign_key = (is_array($relation)) ? $relation[1] : singular($this->table) . '_id';\n $local_key = (is_array($relation) && isset($relation[2])) ? $relation[2] : $this->primary;\n }\n $this->_relationships[$key] = array('relation' => $option, 'relation_key' => $key, 'foreign_model' => $foreign_model_name, 'foreign_table' => $foreign_table, 'foreign_key' => $foreign_key, 'local_key' => $local_key);\n ($option == 'has_many_pivot') ? ($this->_relationships[$key]['pivot_table'] = $pivot_table) : FALSE;\n\n }\n }\n }\n }\n }", "public function buildRelations()\n {\n $this->addRelation('Banco', 'Banco', RelationMap::MANY_TO_ONE, array('idbanco' => 'idbanco', ), 'CASCADE', 'CASCADE');\n }", "public function buildRelations()\n {\n $this->addRelation('Moneda', 'Moneda', RelationMap::MANY_TO_ONE, array('moneda_id' => 'id', ), null, null);\n $this->addRelation('Usuario', 'Usuario', RelationMap::MANY_TO_ONE, array('usuario_id' => 'id', ), null, null);\n $this->addRelation('Negocio', 'Negocio', RelationMap::ONE_TO_MANY, array('id' => 'requerimiento_id', ), null, null, 'Negocios');\n $this->addRelation('DireccionRequerimiento', 'DireccionRequerimiento', RelationMap::ONE_TO_MANY, array('id' => 'requerimiento_id', ), null, null, 'DireccionRequerimientos');\n }", "public function alumnos()\n {\n \treturn $this->belongsToMany('App\\Alumno');\n }", "public function educacion_superior(){\n\t\treturn $this->hasMany('App\\EducacionSuperior', 'Sup_ID_Asp');\n\t}", "public function initialize()\n {\n $this->belongsTo('cons_order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n $this->belongsTo('order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n }", "protected function addRelation()\n {\n $fromTable = $this->ask('Enter the name of the parent table');\n $this->checkInput($fromTable);\n $toTable = $this->ask('Enter the name of the child table');\n $this->checkInput($toTable);\n $relationColumn = $this->ask('Enter the column which is going to be referenced (default is \\'id\\')', 'id');\n $action = $this->choice('Action to be taken for column (default is \\'cascade\\')', ['cascade', 'restrict', 'set null'], 'cascade');\n $this->service->addRelation($fromTable, $toTable, $relationColumn, $action);\n }", "public function buildRelations()\n {\n $this->addRelation('Contrarecibo', 'Contrarecibo', RelationMap::MANY_TO_ONE, array('idcontrarecibo' => 'idcontrarecibo', ), 'CASCADE', 'CASCADE');\n }", "private function createRelation()\n {\n $this->createBuilder();\n }", "public function initialize()\n {\n $this->hasMany('cd_desconto', 'App\\Models\\PdvVendasHasItens', 'cd_desconto', array('alias' => 'PdvVendasHasItens'));\n $this->belongsTo('cd_caixa', 'App\\Models\\PdvCaixa', 'cd_caixa', array('alias' => 'PdvCaixa'));\n $this->belongsTo('cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('cd_unidade_negocio', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->belongsTo('cd_usuario_criacao', 'App\\Models\\Usuario', 'cd_usuario', array('alias' => 'Usuario'));\n }", "public function initialize()\n {\n $this->hasMany(\"members_id\", \"\\Event\\Model\\Events\", \"members_id\", ['alias' => 'Events']);\n }", "public function buildRelations()\n\t{\n $this->addRelation('Aviso', 'Aviso', RelationMap::MANY_TO_ONE, array('aviso_id' => 'id', ), 'RESTRICT', null);\n $this->addRelation('Usuario', 'Usuario', RelationMap::MANY_TO_ONE, array('usuario_id' => 'id', ), 'RESTRICT', null);\n\t}", "public function initialize()\n {\n $this->hasMany('idmov', 'App\\Models\\MovEstoque', 'movimentacao_manual_estoque_idmov', array('alias' => 'MovEstoque'));\n $this->hasMany('idmov', 'App\\Models\\MovimentacaoManualEstoqueItem', 'idmov', array('alias' => 'MovimentacaoManualEstoqueItem'));\n $this->belongsTo('cd_ordem_servico_reparo', 'App\\Models\\OrdemServicoReparo', 'cd_ordem_servico', array('alias' => 'OrdemServicoReparo'));\n $this->belongsTo('cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->belongsTo('requerente', 'App\\Models\\Empresa', 'cd_empresa', array('alias' => 'Empresa'));\n $this->belongsTo('usuario_responsavel', 'App\\Models\\Usuario', 'cd_usuario', array('alias' => 'Usuario'));\n }", "public function associate($entity)\n {\n // The Mapper will retrieve this association within the object model, we won't be using\n // the foreign key attribute inside the parent Entity.\n //\n //$this->parent->setEntityAttribute($this->foreignKey, $entity->getEntityAttribute($this->otherKey));\n //\n // Instead, we'll just add the object to the Entity's attribute\n\n $this->parent->setEntityAttribute($this->relation, $entity->getEntityObject());\n }", "public function cidade(){\n return $this->belongsTo('App\\Cidade');\n\n }", "public function leaseAdmin() \n {\n return $this->belongsTo(LeaseAdmin::class, 'id', 'persons_id');\n }", "public function doctor()\n {\n return $this->belongsTo('App\\User');\n }", "public function direccion(){\r\n return $this->belongsTo('direccion');\r\n }", "public function buildRelations()\n\t{\n $this->addRelation('Genero', 'Genero', RelationMap::MANY_TO_ONE, array('id_genero' => 'id', ), null, 'CASCADE');\n $this->addRelation('Tematica', 'Tematica', RelationMap::MANY_TO_ONE, array('id_tematica' => 'id', ), null, 'CASCADE');\n $this->addRelation('Autor', 'Autor', RelationMap::MANY_TO_ONE, array('id_autor' => 'id', ), null, 'CASCADE');\n $this->addRelation('Materia', 'Materia', RelationMap::MANY_TO_ONE, array('id_materia' => 'id', ), null, 'CASCADE');\n $this->addRelation('Tipopublicacion', 'Tipopublicacion', RelationMap::MANY_TO_ONE, array('id_tipopublicacion' => 'id', ), null, 'CASCADE');\n\t}", "public function peliculas(){\n //retornar tipo de relacion\n return $this->belongsToMany('App\\Pelicula','pelicula_director');\n }", "public function assistant(){\n \treturn $this->belongsTo(Assistant::class, 'id');\n }", "public function initialize()\n {\n \t$this->belongsTo('id_usuario', 'IbcUsuario', 'id_usuario', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_periodo', 'CobPeriodo', 'id_periodo', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_contrato', 'CobActaconteo', 'id_contrato', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_ajuste_reportado', 'CobAjusteReportado', 'id_ajuste_reportado', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_actaconteo_persona_facturacion', 'CobActaconteoPersonaFacturacion', 'id_actaconteo_persona_facturacion', array(\n \t\t\t'reusable' => true\n \t));\n }", "public function setFlexFormRelations() {}", "abstract function relations();", "public function initialize()\n {\n $this->belongsTo(\"hotel_id\", \"Hotels\", \"id\");\n $this->belongsTo(\"user_id\", \"User\", \"id\");\n $this->hasMany(\"id\", \"Transaction\", \"reservation_id\");\n }", "public function buildRelations()\n\t{\n\t\t$this->addRelation('Cargo', 'Cargo', RelationMap::MANY_TO_ONE, array('cargo_id' => 'id', ), null, null);\n\t\t$this->addRelation('Departamento', 'Departamento', RelationMap::MANY_TO_ONE, array('departamento_id' => 'id', ), null, null);\n\t\t$this->addRelation('Endereco', 'Endereco', RelationMap::MANY_TO_ONE, array('endereco_id' => 'id', ), null, null);\n\t\t$this->addRelation('Perfil', 'Perfil', RelationMap::MANY_TO_ONE, array('perfil_id' => 'id', ), null, null);\n\t\t$this->addRelation('Auditoria', 'Auditoria', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'Auditorias');\n\t\t$this->addRelation('AvaliacaoRespostaForum', 'AvaliacaoRespostaForum', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'AvaliacaoRespostaForums');\n\t\t$this->addRelation('ColetaPesquisa', 'ColetaPesquisa', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'ColetaPesquisas');\n\t\t$this->addRelation('ComentarioNoticia', 'ComentarioNoticia', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'ComentarioNoticias');\n\t\t$this->addRelation('CurtidaForum', 'CurtidaForum', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'CurtidaForums');\n\t\t$this->addRelation('Noticia', 'Noticia', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'Noticias');\n\t\t$this->addRelation('Pesquisa', 'Pesquisa', RelationMap::ONE_TO_MANY, array('id' => 'criador_id', ), null, null, 'Pesquisas');\n\t\t$this->addRelation('PesquisaHabilitada', 'PesquisaHabilitada', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'PesquisaHabilitadas');\n\t\t$this->addRelation('Premio', 'Premio', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'Premios');\n\t\t$this->addRelation('RespostaForum', 'RespostaForum', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'RespostaForums');\n\t\t$this->addRelation('SolicitacaoResgateRelatedByAprovadorId', 'SolicitacaoResgate', RelationMap::ONE_TO_MANY, array('id' => 'aprovador_id', ), null, null, 'SolicitacaoResgatesRelatedByAprovadorId');\n\t\t$this->addRelation('SolicitacaoResgateRelatedBySolicitanteId', 'SolicitacaoResgate', RelationMap::ONE_TO_MANY, array('id' => 'solicitante_id', ), null, null, 'SolicitacaoResgatesRelatedBySolicitanteId');\n\t}", "public function candidatos(): HasMany\n {\n return $this->hasMany(VotosModel::class, 'votacao_id', 'id')\n ->select('votos.candidato_id', 'votos.id as voto_id', 'votos.votacao_id', 'users.id as user_id', 'users.name')\n ->join('users', function($j) {\n return $j->on('votos.candidato_id', '=', 'users.id');\n })->orderBy('users.name', 'ASC');\n }", "public function diemthamquans()\n {\n return $this->belongsToMany(DiaDiem::class, 'tourdulich_diemthamquan', 'id_tour', 'id_diemthamquan');\n }", "public function departamentos(){\n return $this->belongsTo('App\\Departamento', 'departamento_id');\n }", "function userelation($relation) { atkuse(\"relation\" , $relation); }", "public function acudientes(){\n return $this->belongsToMany('App\\Acudiente');\n }", "public function initialize()\n {\n $this->hasMany(\"id\", \"Modules\\Models\\Orders\", \"member_id\", array(\n 'alias' => 'orders'\n ));\n }", "public function initialize()\n {\n $this->hasMany('id', 'AppCustomer', 'app_id', NULL);\n $this->hasMany('id', 'AppPrivileges', 'app_id', NULL);\n }", "public function Onderdil(){ \n return $this->hasMany('App\\Models\\Onderdil', 'idOnderdil'); \n }", "public function follows(){\n return $this->belongsToMany('App\\Dog', 'follows', 'user_id', 'dog_id');\n }", "public function buildRelations()\n {\n $this->addRelation('Country', 'Slashworks\\\\AppBundle\\\\Model\\\\Country', RelationMap::MANY_TO_ONE, array('country_id' => 'id', ), null, 'CASCADE');\n $this->addRelation('RemoteApp', 'Slashworks\\\\AppBundle\\\\Model\\\\RemoteApp', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'SET NULL', 'CASCADE', 'RemoteApps');\n $this->addRelation('UserCustomerRelation', 'Slashworks\\\\AppBundle\\\\Model\\\\UserCustomerRelation', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'CASCADE', 'UserCustomerRelations');\n }", "public function run()\n {\n Session::find(1)->teachers()->attach(1);\n Session::find(2)->teachers()->attach(1);\n Session::find(1)->teachers()->attach(2);\n Session::find(2)->teachers()->attach(2);\n }" ]
[ "0.63511616", "0.6261712", "0.61661685", "0.61463666", "0.60656327", "0.60656327", "0.5989586", "0.58130467", "0.57360387", "0.5723047", "0.5661872", "0.56098366", "0.553843", "0.5511714", "0.5456143", "0.54550177", "0.5437431", "0.54333895", "0.54201764", "0.5389901", "0.53834194", "0.537527", "0.5325144", "0.5325144", "0.5325144", "0.5325144", "0.5325144", "0.5325144", "0.5325144", "0.5325144", "0.5325144", "0.5313773", "0.52948815", "0.5291973", "0.52751607", "0.52725357", "0.5264348", "0.5264294", "0.52583814", "0.52485704", "0.52345747", "0.5232802", "0.5230811", "0.52250487", "0.52250487", "0.52250487", "0.52250487", "0.52250487", "0.52250487", "0.52250487", "0.52250487", "0.516972", "0.5167174", "0.5141863", "0.5138406", "0.51321256", "0.5129906", "0.5104237", "0.5095106", "0.50879234", "0.5081296", "0.50800914", "0.5076853", "0.5073824", "0.5070875", "0.5067675", "0.50672734", "0.5063767", "0.50631946", "0.5057978", "0.5054234", "0.50504357", "0.5050397", "0.50493026", "0.50388694", "0.50377285", "0.50319266", "0.5031892", "0.50313514", "0.503098", "0.50297225", "0.50234604", "0.5020281", "0.50083965", "0.50064236", "0.49962264", "0.4992484", "0.49826315", "0.49802876", "0.4979249", "0.4976628", "0.4974552", "0.4973756", "0.49700385", "0.4966884", "0.49623287", "0.49603346", "0.49600962", "0.4956497", "0.4956392", "0.49519038" ]
0.0
-1
return all the prescriptions issued to the patient through the intermediate class Appointment
public function prescriptions() { return $this->hasManyThrough( Prescription::class, Appointment::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prescriptions() {\n return $this->hasManyThrough('App\\Prescription', 'App\\Patient', 'clinic_id', 'patient_id', 'id');\n }", "public function getAppointments()\n {\n return $this->hasMany(Appointment::className(), ['id' => 'id']);\n }", "public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }", "public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }", "public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }", "public function appointments()\n {\n return $this->belongsToMany('App\\Appointment', 'appointment_details', 'patient_id', 'appointment_id');\n }", "public function show(Request $request)\n {\n \n $Appointment_id=$request->Appointment_id;\n \n $Appointment = DB::table(\"appointments\")\n ->where([[\"appointments.Appointment_id\", \"=\", $Appointment_id]])\n ->join(\"prescriptions\", \"prescriptions.Appointment_id\", \"=\", \"appointments.Appointment_id\")\n ->get()->toArray(); \n\n $Appointment[0]->Medicine_Type = explode(',', $Appointment[0]->Medicine_Type);\n $Appointment[0]->Medicine_name = explode(',', $Appointment[0]->Medicine_name);\n $Appointment[0]->Medicine_quantity = explode(',', $Appointment[0]->Medicine_quantity);\n $Appointment[0]->Medicine_time = explode(',', $Appointment[0]->Medicine_time);\n $morning = 0; \n $afternoon = 1; \n $night = 2;\n $prescriptionData = []; \n //return $Appointment_Record[0]->Medicine_name; \n for($i=0; $i<count($Appointment[0]->Medicine_name); $i++)\n {\n $prescriptionValue = []; \n $prescriptionValue[\"Medicine_Type\"] = $Appointment[0]->Medicine_Type[$i];\n $prescriptionValue[\"Medicine_name\"] = $Appointment[0]->Medicine_name[$i];\n $prescriptionValue[\"Medicine_quantity\"] = $Appointment[0]->Medicine_quantity[$i];\n $prescriptionValue[\"morning\"] = $Appointment[0]->Medicine_time[$morning];\n $morning = $morning + 3; \n $prescriptionValue[\"afternoon\"] = $Appointment[0]->Medicine_time[$afternoon];\n $afternoon = $afternoon + 3; \n\n $prescriptionValue[\"night\"] = $Appointment[0]->Medicine_time[$night];\n $night = $night + 3; \n\n array_push($prescriptionData, $prescriptionValue); \n } \n $response = [\n 'prescriptionData' => $prescriptionData,\n 'code' => 200\n ];\n\n return response($response,300);\n \n\n }", "public function getAppointments()\n {\n $search['office'] = (auth()->user()->offices->count()) ? auth()->user()->offices->first()->id : '';\n\n $search['date1'] = isset($search['date1']) ? Carbon::parse($search['date1']) : '';\n $search['date2'] = isset($search['date2']) ? Carbon::parse($search['date2']) : '';\n \n $appointments = $this->appointmentRepo->findAllByDoctorWithoutPagination(request('medic'),$search);\n\n return $appointments;\n \n }", "public function appointments(){\n return $this->hasMany(Appointment::class);\n }", "public function index()\n\t{\n $patient_id = Input::get('id');\n $patient = Patient::find($patient_id);\n $appointments = $patient->appointments()->has('prescription')->get();\n\n return View::make('prescriptions.index', compact('appointments'));\n\t}", "public function appointments()\n {\n //the relationship means that the class midwife can associate with many appointments\n return $this->hasMany(Appointment::class);\n }", "function get_patient_queue()\n {\n return Appointments::whereStatus(2)->get();\n }", "public function get_prescription ($appointment_hash = NULL)\n {\n $page_data = NULL;\n $prescriptions_arr = array();\n\n if (get_data('term') == NULL)\n {\n return;\n }\n /*Fetching Patient details from third party database via curl request*/\n $prescriptions = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n 'action' => 'getformulary',\n 'lookfor' => get_data('term'),\n )));\n\n $prescriptions = !empty($prescriptions) ? json_decode($prescriptions) : array();\n\n /*Converting to autocomplete understandable format*/\n if (!empty($prescriptions))\n {\n foreach ($prescriptions as $val)\n {\n $prescriptions_arr[] = array('id' => current($val)->vpid, 'value' => current($val)->nm, 'unit_price' => current($val)->UnitPrice);\n }\n }\n exit(json_encode($prescriptions_arr));\n }", "public function prescriptions()\n\t{\n\t\treturn $this->hasMany('OEMR\\\\Models\\\\Prescription');\n\t}", "public function getAllApp()\n {\n $sql = \"SELECT * FROM appointment\";\n $values=array();\n \n $ap=$this->getInfo($sql,$values);\n\n return $ap;\n }", "public function getFollowUpAppointments($notification)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n try {\n $notificationType = $notification->getType()->getValue();\n\n $currentDateTime = \"STR_TO_DATE('\" . DateTimeService::getNowDateTimeInUtc() . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingEnd BETWEEN DATE_SUB({$currentDateTime}, INTERVAL 172800 SECOND) AND {$currentDateTime}\n AND DATE_ADD(a.bookingEnd, INTERVAL {$notification->getTimeAfter()->getValue()} SECOND)\n < {$currentDateTime}\n AND a.notifyParticipants = 1 \n AND cb.status = 'approved' \n AND a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_appointment_follow_up' \n AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "public function appointments()\n {\n return view('patient.pending-appointments');\n }", "public function appointment()\n {\n return $this->hasMany('App\\Models\\Appointment');\n }", "public function appointments(): HasMany\n {\n return $this->hasMany(Appointment::class);\n }", "protected function getPendingAppointments($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n// $curr_date = date('Y-m-d H:i:s', time());\n// $curr_date_bfr_30min = date('Y-m-d H:i:s', time() - 1800);\n// $curr_date_bfr_1hr = date('Y-m-d H:i:s', time() - 3600);\n\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.status,a.booking_type from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.status = 1 and a.mas_id = '\" . $this->User['entityId'] . \"' order by a.appointment_dt DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"'\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0)\n return $this->_getStatusMessage(30, $selectAppntsQry);\n\n $pending_appt = array();\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pending_appt[] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'],\n 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('H:i', strtotime($appnt['appointment_dt'])),\n 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'], 'bookType' => $appnt['booking_type']);\n }\n\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'appointments' => $pending_appt); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }", "public function Appointment() {\n return $this->hasMany('App\\TIME');\n }", "public function incidents()\n {\n return $this->belongsToMany(\n 'App\\Incident', 'prescriptions', 'management_id', 'incident_id'\n )\n ->using('App\\Prescription')\n ->withPivot('doctor_id')\n ->withTimestamps();\n }", "public function fetchData()\n {\n $invoice = InvoiceAppointment::leftjoin('appointments as appt','appt.id','invoice_appointment.detail_id')\n ->leftjoin('appointment_status as appt_stat','appt_stat.appt_id','invoice_appointment.detail_id')\n ->where(fn($query) => $query\n ->where( 'appt.name', 'like', '%' . $this->search . '%')\n ->orWhere('invoice_appointment.total', 'like', '%' . $this->search . '%')\n )\n ->orderBy($this->sortBy, $this->sortDirection)\n ->paginate($this->perPage);\n $this->invappt = $invoice;\n\n /*For notifications*/\n $appoint = Appointment::leftjoin('appointment_status as apts','apts.appt_id','appointments.id')\n ->where('apts.status','Pending')\n ->latest()->get();\n $this->appt = $appoint;\n }", "public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$appointment = strtotime($participation->appointment); \n\t\t\tif ($appointment > strtotime('tomorrow') && $appointment <= strtotime('tomorrow + 1 day')) \n\t\t\t{\t\t\t\t\t\n\t\t\t\treset_language(L::DUTCH);\n\t\t\t\t\n\t\t\t\t$participant = $this->participationModel->get_participant_by_participation($participation->id);\n\t\t\t\t$experiment = $this->participationModel->get_experiment_by_participation($participation->id);\n\t\t\t\t$message = email_replace('mail/reminder', $participant, $participation, $experiment);\n\t\t\n\t\t\t\t$this->email->clear();\n\t\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $participant->email);\n\t\t\t\t$this->email->subject('Babylab Utrecht: Herinnering deelname');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}", "public function getAppointments ($id){\n $appointmentRequest = AppointmentRequest::where('id',$id)->first();\n $appointmentRequestId=$id;\n $parentId = $appointmentRequest->parent_id;\n //Retrieve parent and student details corresponding to the appointment request\n $parentDetails = UserDetails::where('user_id',$parentId)->first();\n $parentName = $parentDetails->name;\n $parentContact = $appointmentRequest->parentContact;\n $studentDetails = Student::where('parent_id',$parentId)->first();\n $studentId = $studentDetails->id;\n $studentName = $studentDetails->name;\n $gradeId = $studentDetails->grade_id;\n $gradeDetails = Grade::where('id',$gradeId)->first();\n $gradeName = $gradeDetails->grade_name;\n $reasonOfAppointment = $appointmentRequest->reasonOfAppointment;\n $cancellationReason = $appointmentRequest->cancellationReason;\n $requestType = $appointmentRequest->requestType;\n if($requestType == \"Parent Request\")\n $requestedBy = \"Parent\";\n else\n $requestedBy = \"You\";\n //Retrieve appointment slot corresponding to the appointment request\n $slotId=$appointmentRequest->teacherAppointmentsSlot_id;\n $slot = TeacherAppointmentSlots::where('id',$slotId)->first();\n $booked= $slot->isBooked;\n $awaited = $appointmentRequest->isAwaited;\n $confirmed = $appointmentRequest->isApproved;\n $cancelled = $appointmentRequest->isCancel;\n if ($awaited==1 && $confirmed==0 && $cancelled==0){\n $status = \"Awaited\";\n }\n elseif ($awaited==0 && $confirmed==1 && $cancelled==0){\n $status = \"Confirmed\";\n }\n elseif($awaited==0 && $confirmed==0 && $cancelled==1) {\n $status=\"Cancelled\";\n }\n else{\n $status = \"Invalid Status\";\n }\n //Retrieve appointment event corresponding to the appointment slot\n $eventId = $slot->calendarEventsId;\n $event = CalendarEvent::where('id',$eventId)->first();\n $title=$event->title;\n $start=$event->start;\n $end=$event->end;\n $teacherId = $appointmentRequest->teacher_id;\n $contactNo = $appointmentRequest->contactNo;\n $appointmentDetails= array(\n 'requestId' => $appointmentRequestId,\n 'parentName'=>$parentName,\n 'parentContact'=>$parentContact,\n 'studentId'=>$studentId,\n 'studentName'=>$studentName,\n 'grade'=>$gradeName,\n 'eventId'=>$eventId,\n 'title'=>$title,\n 'reasonOfAppointment'=>$reasonOfAppointment,\n 'cancellationReason'=>$cancellationReason,\n 'start'=>$start,\n 'end'=>$end,\n 'requestedBy'=>$requestedBy,\n 'status'=>$status,\n 'contact'=>$contactNo,\n 'teacherId'=>$teacherId\n );\n return $appointmentDetails;\n }", "public function getAppointments($id)\n {\n $search = request()->all();\n $search['date1'] = isset($search['date1']) ? Carbon::parse($search['date1']) : '';\n $search['date2'] = isset($search['date2']) ? Carbon::parse($search['date2']) : '';\n\n $appointments = $this->appointmentRepo->findAllByDoctorWithoutPagination($id, $search);\n \n return $appointments;\n \n }", "public function getApPmts()\n {\n return $this->hasMany(ApPmt::className(), ['currency_id' => 'currency_id']);\n }", "protected function getPendingAppts($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n// $curr_date = date('Y-m-d H:i:s', time());\n// $curr_date_bfr_30min = date('Y-m-d H:i:s', time() - 1800);\n// $curr_date_bfr_1hr = date('Y-m-d H:i:s', time() - 3600);\n\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appt_lat,a.appt_long,a.appointment_dt,a.appointment_id,a.drop_addr2,a.drop_addr1,a.extra_notes,a.address_line1,a.address_line2,a.status,a.appt_type from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.status = 2 and a.appt_type = 2 and a.mas_id = '\" . $this->User['entityId'] . \"' order by a.appointment_dt DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"'\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0)\n return $this->_getStatusMessage(30, $selectAppntsQry);\n\n $pending_appt = array();\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pending_appt[date('Y-m-d', strtotime($appnt['appointment_dt']))][] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'], 'bid' => $appnt['appointment_id'],\n 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('H:i', strtotime($appnt['appointment_dt'])), 'dropLine1' => urldecode($appnt['drop_addr1']), 'dropLine2' => urldecode($appnt['drop_addr2']),\n 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'], 'bookType' => $appnt['booking_type']);\n }\n\n $finalArr = array();\n\n foreach ($pending_appt as $date => $penAppt) {\n $finalArr[] = array('date' => $date, 'appt' => $penAppt);\n }\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'appointments' => $finalArr); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }", "public function allAdopters()\n {\n return $this\n ->belongsToMany('App\\Person', 'animal_adopter')\n ->withTimestamps()\n ->withPivot('returned_at');\n }", "public function getPrescriptionByPatient($patientId)\n {\n $prescriptions = null;\n\n try\n {\n $query = DB::table('patient as p')->select('pp.id as prescription_id', 'pp.unique_id as unique_id', 'pp.patient_id', 'p.pid', 'p.name', 'pp.prescription_date');\n $query->join('patient_prescription as pp', 'pp.patient_id', '=', 'p.patient_id');\n $query->where('pp.patient_id', '=', $patientId);\n $query->orderBy('pp.id', 'DESC');\n\n $prescriptions = $query->get();\n }\n catch(QueryException $queryEx)\n {\n throw new HospitalException(null, ErrorEnum::PRESCRIPTION_LIST_ERROR, $queryEx);\n }\n catch(Exception $exc)\n {\n throw new HospitalException(null, ErrorEnum::PRESCRIPTION_LIST_ERROR, $exc);\n }\n\n return $prescriptions;\n }", "protected function getMasterAppointments($args) {\n\n if ($args['ent_appnt_dt'] == '' || $args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n $args['ent_appnt_dt'] = urldecode($args['ent_appnt_dt']);\n\n $dates = explode('-', $args['ent_appnt_dt']);\n\n if (count($dates) == 3) {\n $endDate = date('Y-m-d', strtotime('+7 day', strtotime($args['ent_appnt_dt'])));\n $selectStr = \" DATE(a.appointment_dt) between '\" . $args['ent_appnt_dt'] . \"' and '\" . $endDate . \"'\";\n } else {\n $args['ent_appnt_dt'] = $args['ent_appnt_dt'] . '-01';\n $endDate = date('Y-m-d', strtotime('+1 month', strtotime($args['ent_appnt_dt'])));\n $selectStr = \" YEAR(a.appointment_dt) = '\" . (int) $dates[0] . \"' and MONTH(a.appointment_dt) = '\" . (int) $dates[1] . \"'\";\n }\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appointment_id,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.drop_addr1,a.drop_addr2,a.drop_lat,a.drop_long,a.complete_dt,a.start_dt,a.arrive_dt,a.status,a.payment_status,a.amount,a.distance_in_mts,(select count(appointment_id) from appointment where status = 1 and mas_id = '\" . $this->User['entityId'] . \"') as pen_count from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.mas_id = '\" . $this->User['entityId'] . \"' and \" . $selectStr . \" and a.status NOT IN (1,3,4,5,10) order by a.appointment_id DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"' a.status NOT in (1,3,4,7) and\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0) {\n\n $selectPenCountQry = \"select count(*) as count from appointment where status = 1 and mas_id = '\" . $this->User['entityId'] . \"'\";\n $countArr = mysql_fetch_assoc(mysql_query($selectPenCountQry, $this->db->conn));\n $errMsgArr = $this->_getStatusMessage(30, 2);\n\n $date = $args['ent_appnt_dt'];\n\n while ($date <= $endDate) {\n\n $sortedApnts[] = array('date' => $date, 'appt' => array());\n $date = date('Y-m-d', strtotime('+1 day', strtotime($date)));\n }\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'penCount' => $countArr['count'], 'refIndex' => array(), 'appointments' => $sortedApnts, 't' => $selectAppntsQry);\n }\n\n $appointments = $daysArr = array();\n\n $pendingCount = 0;\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pendingCount = $appnt['pen_count'];\n\n $aptdate = date('Y-m-d', strtotime($appnt['appointment_dt']));\n\n $durationSec = (abs(strtotime($appnt['complete_dt']) - strtotime($appnt['start_dt'])) / 60);\n\n $durationMin = round($durationSec, 2);\n\n// if ($appnt['status'] == '1')\n// $status = 'Booking requested';\n// else if ($appnt['status'] == '2')\n// $status = 'Driver accepted.';\n// else if ($appnt['status'] == '3')\n// $status = 'Driver rejected.';\n// else if ($appnt['status'] == '4')\n// $status = 'You have cancelled.';\n// else if ($appnt['status'] == '5')\n// $status = 'Driver have cancelled.';\n// else\n if ($appnt['status'] == '6')\n $status = 'Driver is on the way.';\n else if ($appnt['status'] == '7')\n $status = 'Driver arrived.';\n else if ($appnt['status'] == '8')\n $status = 'Booking started.';\n else if ($appnt['status'] == '9')\n $status = 'Booking completed.';\n// else if ($appnt['status'] == '10')\n// $status = 'Booking expired.';\n else\n $status = 'Status unavailable.';\n\n $appointments[$aptdate][] = array('pPic' => $appnt['profile_pic'], 'email' => $appnt['email'], 'statCode' => $appnt['status'], 'status' => $status,\n 'fname' => $appnt['first_name'], 'apntTime' => date('h:i a', strtotime($appnt['appointment_dt'])), 'bid' => $appnt['appointment_id'], 'apptDt' => $appnt['appointment_dt'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'payStatus' => ($appnt['payment_status'] == '') ? 0 : $appnt['payment_status'],\n 'dropLine1' => urldecode($appnt['drop_addr1']), 'duration' => round($durationMin, 2), 'distance' => round($appnt['distance_in_mts'] / $this->distanceMetersByUnits, 2), 'amount' => $appnt['amount']);\n\n\n// $appointments[$aptdate][] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'], 'status' => $appnt['status'], 'pickupDt' => $appnt['arrive_dt'], 'dropDt' => $appnt['complete_dt'],\n// 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('h:i a', strtotime($appnt['appointment_dt'])),\n// 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n// 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'],\n// 'dropLine1' => urldecode($appnt['drop_addr1']), 'dropLine2' => urldecode($appnt['drop_addr2']), 'dropLat' => (double) $appnt['drop_lat'], 'dropLong' => (double) $appnt['drop_long'], 'duration' => $durationMin, 'distanceMts' => $appnt['distance_in_mts'], 'amount' => $appnt['amount']);\n }\n $refIndexes = $sortedApnts = array();\n $date = date('Y-m-d', strtotime($args['ent_appnt_dt']));\n\n while ($date < $endDate) {\n\n $empty_arr = array();\n\n if (is_array($appointments[$date])) {\n $sortedApnts[] = array('date' => $date, 'appt' => $appointments[$date]);\n $num = date('j', strtotime($date));\n $refIndexes[] = $num;\n } else {\n $sortedApnts[] = array('date' => $date, 'appt' => $empty_arr);\n }\n\n $date = date('Y-m-d', strtotime('+1 day', strtotime($date)));\n }\n//print_r($sortedApnts);\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'penCount' => $pendingCount, 'refIndex' => $refIndexes, 'appointments' => $sortedApnts); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }", "public function showAll() {\n return response()->json(Appointment::all());\n }", "public function viewappointments(){\n $appointments_table = TableRegistry::get('Appointments');\n $appointments = $appointments_table->find()->contain(['Users','Patients'])->order(['appointment_date'=>'DESC']);\n $this->set('appointments', $appointments);\n $this->viewBuilder()->setLayout('backend');\n }", "public function get_appointment_detail($appointment_id) {\n\n $prescription_query = \"\n SELECT\n drug_name,\n prescription_drug_id, \n prescription_generic_name,\n prescription_unit_id,\n prescription_unit_value,\n prescription_frequency_id,\n prescription_frequency_value,\n prescription_frequency_instruction,\n prescription_intake,\n prescription_intake_instruction,\n prescription_duration,\n prescription_duration_value,\n prescription_diet_instruction,\n prescription_next_follow_up\n FROM \" . TBL_APPOINTMENTS . \" \n \n JOIN \" . TBL_PRESCRIPTION_REPORTS . \"\n ON prescription_appointment_id=appointment_id AND prescription_status=1\n JOIN \" . TBL_DRUGS . \"\n ON drug_id=prescription_drug_id AND drug_status=1\n WHERE\n prescription_appointment_id=\" . $appointment_id . \" AND\n prescription_status=1 AND\n prescription_share_status=1 AND \n drug_status=1\n \";\n\n $prescription_data = $this->get_all_rows_by_query($prescription_query);\n\n $vital_query = \"\n SELECT\n vital_signature_reports_weight,\n vital_signature_reports_bloodpressure,\n vital_signature_reports_pulse,\n vital_signature_reports_temperature,\n vital_signature_reports_resp_rate\n FROM \" . TBL_VITAL_REPORTS . \" \n WHERE\n vital_signature_reports_status=1 AND \n vital_signature_reports_share_status=1 AND \n vital_signature_reports_appointment_id=\" . $appointment_id . \" \n \";\n\n $vital_data = $this->get_all_rows_by_query($vital_query);\n\n $clinical_notes_query = \"\n SELECT\n clinical_notes_reports_kco,\n clinical_notes_reports_complaints,\n clinical_notes_reports_observation,\n clinical_notes_reports_diagnoses,\n clinical_notes_reports_add_notes\n FROM \" . TBL_CLINICAL_REPORTS . \" \n WHERE\n clinical_notes_reports_status=1 AND \n clinical_notes_reports_share_status=1 AND \n clinical_notes_reports_appointment_id=\" . $appointment_id . \" \n \";\n\n $clinical_data = $this->get_all_rows_by_query($clinical_notes_query);\n\n $procedure_query = \"\n SELECT\n procedure_report_procedure_text,\n procedure_report_note\n FROM \" . TBL_PROCEDURE_REPORTS . \" \n WHERE\n procedure_report_status=1 AND \n procedure_report_share_status=1 AND\n procedure_report_appointment_id=\" . $appointment_id . \" \n \";\n\n $procedure_data = $this->get_all_rows_by_query($procedure_query);\n\n return array(\n \"prescription_data\" => $prescription_data,\n \"clinical_data\" => $clinical_data,\n \"procedure_data\" => $procedure_data,\n \"vital_data\" => $vital_data\n );\n }", "public function getAppointments(){\n\t\tif (Auth::user()->type==4) {\n\t\t\t# code...\n\t\t\treturn redirect()->back(); \n\t\t}\n\t\t$todays = $this->getTodayAppointments(); \n\t\treturn view('appointments.nurseAppointments',compact('todays'));\n\t}", "public function index()\n {\n return ApplicantResource::collection(Applicant::all());\n }", "public function patientAppointment() {\n $loggedUser = Sentinel::getUser();\n\n # Get the profile of the logged in User\n $profile = new UserProfile;\n $profile = $profile->find($loggedUser->id);\n\n # Some info of the logged in user\n $user = array(\"fullname\" => $profile->fullname, \"profile_type\" => $profile->profile_type);\n\n # Return all Doctors with their complete profile\n $users = new User();\n $users = $users::with('userProfile')\n ->whereHas('userProfile', function ($query) {\n $query->where('profile_type', '=', 'doctor');\n })->get();\n\n # All Appointment\n $userAppointment = Appointment::where('patient_id', '=', $loggedUser->id)->get();\n\n return view('Dashboard.patient.appointments', compact('user', 'users', 'userAppointment'));\n }", "public function viewprescriptions(){\n \n $prescriptions_table = TableRegistry::get('Prescriptions');\n $prescriptions = $prescriptions_table->find()->contain(['Users','Patients','Diagnosisreports','Labtests'])\n ->order(['creation_timestamp'=>'Desc']);\n $this->set('prescriptions', $prescriptions);\n $this->viewBuilder()->setLayout('backend');\n }", "public function getCustomersNextDayAppointments($notificationType)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n $startCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(0, 0, 0)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $endCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(23, 59, 59)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n try {\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n a.zoomMeeting AS appointment_zoom_meeting,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.customFields AS booking_customFields,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingStart BETWEEN $startCurrentDate AND $endCurrentDate\n AND cb.status = 'approved'\n AND a.notifyParticipants = 1 AND\n a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_appointment_next_day_reminder' AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "public function index($patient_id)\n {\n $previousPregnancies = PreviousPregnancy::orderBy('year', 'asc')->paginate();\n\n return PreviousPregnancyResource::collection($previousPregnancies);\n }", "public function index()\n {\n \n return response(\n [\n 'error'=> false,\n 'data'=> SubscriptionAppointment::all()\n ]\n ,201);\n }", "public static function getInvoicesByAppointment(int $appId): array {\n $cols = implode(',', self::getColumns());\n $table = self::getTableName();\n $sql = \"SELECT $cols FROM $table WHERE appointment_id = :id\";\n $invs = array();\n $db = DBEngine::getInstance();\n try {\n $db->open();\n } catch (\\Exception $e) {\n return $invs;\n }\n $rows = $db->fetchAll($sql, array(':id' => $appId));\n $db->close();\n if ($rows) {\n foreach ($rows as $row) {\n $invs[] = self::createInstanceFromRow($row);\n }\n }\n return $invs;\n }", "public function getApInvs()\n {\n return $this->hasMany(ApInv::className(), ['currency_id' => 'currency_id']);\n }", "public function getProvidersNextDayAppointments($notificationType)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n $startCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(0, 0, 0)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $endCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(23, 59, 59)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n try {\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n a.zoomMeeting AS appointment_zoom_meeting,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.customFields AS booking_customFields,\n cb.persons AS booking_persons, \n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingStart BETWEEN $startCurrentDate AND $endCurrentDate\n AND cb.status = 'approved' \n AND a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'provider_appointment_next_day_reminder' AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "public function getPrescriptions($hospitalId, $doctorId)\n {\n $prescriptions = null;\n\n try\n {\n $query = DB::table('patient as p')->select('pp.id as prescription_id', 'pp.unique_id as unique_id', 'p.patient_id', 'p.pid', 'p.name', 'pp.prescription_date');\n $query->join('patient_prescription as pp', 'pp.patient_id', '=', 'p.patient_id');\n $query->where('pp.hospital_id', '=', $hospitalId);\n $query->where('pp.doctor_id', '=', $doctorId);\n $query->orderBy('pp.id', 'DESC');\n\n $prescriptions = $query->get();\n }\n catch(QueryException $queryEx)\n {\n throw new HospitalException(null, ErrorEnum::PRESCRIPTION_LIST_ERROR, $queryEx);\n }\n catch(Exception $exc)\n {\n throw new HospitalException(null, ErrorEnum::PRESCRIPTION_LIST_ERROR, $exc);\n }\n\n return $prescriptions;\n }", "public function resume(): array {\n\t\t\t\n\t\t\t$data =\n\t\t\t [\n\t\t\t\t'apartment' => $this->apartment,\n\t\t\t\t'stay' => [\n\t\t\t\t 'check_in' => $this->check_in->format('d-m-Y'),\n\t\t\t\t 'check_out' => $this->check_out->format('d-m-Y'),\n\t\t\t\t 'requests' => $this->special_requests\n\t\t\t\t],\n\t\t\t\t'pending_upgrades' => [],\n\t\t\t ];\n\t\t\tforeach ($this->bookedServices as $bookedService) {\n\t\t\t\t$data['pending_upgrades'][] = $bookedService->slug;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}", "public function toArray($request)\n {\n return [\n 'id' => $this->id,\n 'start_date' => optional($this->start_date)->format('Y-m-d H:i'),\n 'end_date' => optional($this->end_date)->format('Y-m-d H:i'),\n 'patient' => PersonResource::make(optional($this->patient->person)),\n 'doctor' => DoctorResource::make(optional($this->doctor)),\n 'type' => AppointmentsTypeResource::make(optional($this->type))\n ];\n }", "public function index()\n {\n \n if(Auth::user()->getRoleNames()->first() == 'patient')\n {\n $dp = DB::table('appointments')->where('patient_id', Auth::user()->patient->id)->get();\n }\n else if(Auth::user()->getRoleNames()->first() == 'physician')\n {\n $dp = DB::table('appointments')->where('physician_id', Auth::user()->physician->id)->get();\n }\n else if(Auth::user()->getRoleNames()->first() == 'nurse')\n {\n $dp = DB::table('appointments')->where('nurse_id', Auth::user()->nurse->id)->get();\n }\n else{\n $dp = DB::table('appointments')->get();\n }\n $dp_obj = $dp->map(function ($element){\n $startdatetime = new Carbon($element->start_date_time);\n $enddatetime = new Carbon($element->end_date_time);\n $patient = Patient::find($element->patient_id)->user->name;\n $physician = Physician::find($element->physician_id)->user->name;\n $nurse = Nurse::find($element->nurse_id)->user->name;\n return [\n 'patient' => $patient, \n 'physician' => $physician,\n 'nurse' => $nurse,\n 'url' => url('admin/appointments'),\n 'id' => $element->id,\n 'exaroom' => $element->examinationroom,\n 'startdatetime' => $startdatetime->toDayDateTimeString(),\n 'enddatetime' => $enddatetime->toDayDateTimeString()\n ];\n });\n $physicians = Physician::all();\n $patients = Patient::all();\n $nurses = Nurse::all();\n return view('backend.appointments.index', compact('dp_obj', 'patients', 'physicians', 'nurses'));\n }", "public function labsDiagnostiAppointments()\n {\n return view('patient.pending-appointments');\n }", "public function all()\n {\n $appointments = Appointment::with('concern')->orderBy('appointment_at', 'asc')->get();\n $patients = Patient::all();\n $list = $patients->pluck('uniquePatient', 'id')->toArray();\n return view('Appointments.All', compact('appointments', 'list'));\n }", "public function getAvailableApplicants($pid) {\n $applicants = DB::table('preferences')\n ->join('applicants', 'applicants.aid', '=', 'preferences.id_from')\n ->where('preferences.program_id', '=', $pid)\n ->whereIn('preferences.status', [1, -1])\n ->where('preferences.pr_kind', '=', 1)\n ->select('applicants.*')\n ->distinct()\n ->get();\n\n return $applicants;\n }", "public function susPrestaciones()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Prestacion' , 'clave_beneficiario' , 'clave_beneficiario');\t\n\t}", "public function patient_prescribe()\n {\n return view('hact.reports.arv.patient_prescribe');\n }", "public function toArray($request)\n {\n return [\n 'id' => $this->id,\n 'day' => $this->day,\n 'from' => $this->from,\n 'to' => $this->to,\n 'payment_method' => $this->payment_method,\n 'payment_id' => $this->payment_id,\n $this->mergeWhen($request->route()->getName() == 'appointments.index', [\n 'bookings' => BookingResource::collection($this->bookings),\n ]),\n $this->mergeWhen($request->route()->getName() == 'appointments.show', [\n 'doctor' => new DoctorResource($this->doctor),\n 'clinic' => new ClinicResource($this->doctor->clinic),\n 'bookings' => BookingResource::collection($this->bookings),\n ]),\n $this->mergeWhen($request->doctors, [\n 'doctor' => new DoctorResource($this->doctor)\n ]),\n $this->mergeWhen($request->clinics, [\n 'clinic' => new ClinicResource($this->doctor->clinic)\n ])\n ];\n }", "public function psubscriptions(){\n return $this->hasMany(Psubscription::class);\n }", "public function datatables_all_appointments()\n {\n // $request = $client->get('https://acuityscheduling.com/api/v1/appointments');\n // $appointments = json_decode($request->getBody()->getContents());\n // echo '<pre>';\n // print_r($appointments);\n // exit;\n\n // DB::connection()->enableQueryLog();\n\n $appointments = Appointment::with('customer')\n ->where('acuity_action','scheduled') \n ->orderBy('appointment_date','desc')\n ->get();\n // $queries = DB::getQueryLog();\n // allQuery($queries);\n\n // die;\n\n return DataTables::of($appointments)\n ->addColumn('action', function ($appointment) {\n return '<a href=\"/appointments/'.$appointment->id.'/edit\"><i class=\"fa fa-pencil\"></i></a>';\n })\n ->make(true);\n }", "public function prescription()\n {\n return $this->hasOne('App\\Model\\PreScription','request_id');\n }", "public function attendanceApprovals()\n {\n return $this->hasMany('App\\Models\\AttendanceApproval', 'regno', 'personnel_no');\n }", "public function PlannedAttendance()\n {\n return $this->hasMany('App\\Models\\PlannedAttendance');\n }", "public static function getPreinscripciones($id){ \r\n $conexion = Database::get(); \r\n \r\n $consulta = \"SELECT c.* FROM cursos c, preinscripciones p, usuarios u WHERE u.id = $id \r\n \t\t\tAND p.id_curso = c.id AND u.id= p.id_usuario AND c.activo = 1 ORDER BY p.timestamp ASC;\";\r\n \r\n $resultados = $conexion->query($consulta); \r\n $cursos = array();\r\n while ($curso = $resultados->fetch_object('CursoModel'))\r\n \t$cursos[] = $curso;\r\n \r\n $resultados->free();\r\n\t\t\t\r\n return $cursos;\r\n //return $portadas;\r\n }", "public function index(Request $request)\n {\n if ($request->has('technician_id'))\n {\n $appointments = Appointment::where('technician_id',$request->technician_id)->get();\n foreach ($appointments as $ap)\n {\n $ap->user;\n\n }\n unset($ap);\n\n }else\n {\n $appointments = Appointment::where('user_id',$request->user_id)->get();\n }\n\n return response (['appointments' => AppointmentResource::collection($appointments), 'message' => 'Retrieved successfully'], 200);\n }", "public function users()\n {\n return $this->belongsToMany(User::class, 'appointments');\n }", "public function eventRepetitions()\n {\n return $this->hasMany('DavideCasiraghi\\LaravelEventsCalendar\\Models\\EventRepetition', 'event_id');\n }", "public function index()\n {\n $patient = Patient::getAppointments(Auth::user()->id);\n return view('patient.appointment.index', compact('patient'));\n }", "public function listInscriptions()\n {\n $slug_socio = Auth()->user()->Socio->slugSocio;\n return Inscription::listaInscripciones($slug_socio);\n }", "public function getAll()\n {\n return\n DB::table('attendances')\n ->select(\n 'id',\n 'code',\n 'name',\n 'description',\n 'permit_code as permitCode'\n )\n ->where([\n ['tenant_id', $this->requester->getTenantId()],\n ['company_id', $this->requester->getCompanyId()]\n ])\n ->get();\n }", "public function toArray($request)\n {\n Resource::withoutWrapping();\n $id = $this->id;\n return [\n 'id' => $id,\n 'barber' => $this->barber,\n 'date' => $this->date,\n 'time' => $this->time,\n '_links' => [\n 'self' => [\n \"href\" => \"http://gbhavelaar.nl/api/appointments/\".$id\n ],\n 'collection' => [\n \"href\" => \"http://gbhavelaar.nl/api/appointments\"\n ]\n\n ]\n\n ];\n }", "public function getAllIncReslt() {\n $inc = IncidenceModel::where('id_estado', 6)->get();\n\n return $inc;\n }", "public function getWaitingApplicants()\n {\n $builder = $this->createQueryBuilder('a');\n $subQueryBuilder = $this->_em->createQueryBuilder();\n $subQuery = $subQueryBuilder\n ->select('1')\n ->from('MentorshipMasterBundle:Application', 'apl')\n ->where($subQueryBuilder->expr()->isNull('apl.finishedAt'))\n ->andWhere(\n $subQueryBuilder->expr()->eq('apl.applicant', 'a')\n )->getDQL();\n $query = $this\n ->createQueryBuilder('a')\n ->distinct()\n ->where('a.isActive = TRUE')\n ->andWhere(\n $builder->expr()->not(\n $builder->expr()->exists($subQuery)\n )\n )\n ->getQuery();\n $cacheId = self::getCacheId(self::CACHE_ID_WAITING_APPLICANTS_SET);\n $query->useResultCache(true, 3600, $cacheId);\n return $query->getResult();\n }", "public function invigilators()\n {\n return $this->belongsToMany(Professor::class, 'timetable_schedule_invigilators', 'timetable_schedule_id', 'invigilator_id');\n }", "public function todayAppointments(){\n $today = Carbon::today()->format('Y-m-d');\n//dd($today);\n return $this->appointments()->whereDate('date',$today)->orderby('date','asc');\n }", "public function index()\n {\n return Applicant::all();\n }", "function cicleinscription_get_vacancies_remaning(){\n\t\n}", "function get_my_appointments() {\n global $conn;\n global $user;\n\n $statement = $conn->prepare(\"SELECT a.id, a.costumer, a.date, a.time, a.status, a.price AS totalPrice,\n b.appointment, b.service, \n c.price\n FROM appointments a, appointment_services b, services c\n WHERE a.costumer = ? AND b.appointment = a.id AND c.name = b.service\n ORDER BY a.id DESC\");\n $statement->execute([$user->id]);\n\n $rows = $statement->fetchAll();\n\n $appointments = [];\n\n foreach($rows as $row) {\n $actual = intval($row[\"id\"]);\n\n $appointments[$actual] = [\n \"id\" => $row[\"id\"],\n \"costumer\" => $row[\"costumer\"],\n \"date\" => $row[\"date\"],\n \"time\" => $row[\"time\"],\n \"status\" => $row[\"status\"],\n \"service\" => $row[\"service\"] . \", \" . (isset($appointments[$actual][\"service\"]) ? $appointments[$actual][\"service\"] : \"\"),\n \"price\" => intval($row[\"price\"]) + (isset($appointments[$actual][\"price\"]) ? intval($appointments[$actual][\"price\"]) : 0),\n \"totalPrice\" => intval($row[\"totalPrice\"])\n ];\n }\n \n foreach($appointments as $appointment) {\n echo '\n <tr>\n <th scope=\"row\">#'.$appointment[\"id\"].'</th>\n <td>'.substr($appointment[\"service\"],0,-2).'</td>\n <td>&euro; '. ($appointment[\"status\"] == \"Booked\" ? $appointment[\"price\"] : $appointment[\"totalPrice\"]).'</td>\n <td>'.$appointment[\"date\"].' - '.$appointment[\"time\"].'</td>\n <td>'.$appointment[\"status\"].'</td>\n </tr>\n ';\n }\n}", "public function index()\n {\n $doc_timeslot = Doctor_timeslot::paginate(5);\n return response(array(\n 'error' => true,\n 'patient_presciption' =>$doc_timeslot->toArray(),\n ),200);\n }", "function findAccessiblePatients($id, $allPatients, $sameSite) {\n $query = $this->getAccessiblePatientsQuery($id, $allPatients, \n\t $sameSite);\n $patients = $this->query($query[0] . $query[1]);\n\n $patients = $this->afterFind($patients);\n\n $thisProject = ClassRegistry::init('Project');\n $allProjects = \n $thisProject->find('all', \n array('recursive' => -1));\n // re-key to Project.id\n $allProjects = Hash::combine($allProjects, '{n}.Project.id', '{n}');\n// $this->log(__CLASS__ . '.' . __FUNCTION__ . '(), allProjects: ' . print_r($allProjects, true), LOG_DEBUG);\n\n $currentGmt = $this->currentGmt();\n\n // retrieve appts and add to data model\n foreach ($patients as &$patient){\n\n $appt = $this->Appointment->find('first', array(\n 'conditions' => array(\n 'Appointment.patient_id' => $patient['Patient']['id'],\n 'Appointment.datetime > \"' . $currentGmt . '\"'\n ),\n 'order' => 'Appointment.datetime DESC',\n 'recursive' => -1));\n if ($appt) {\n $patient['Patient']['next_appt_dt'] \n = $appt['Appointment']['datetime'];\n// $this->log(__CLASS__ . '.' . __FUNCTION__ . '(), found upcoming appt for patient id ' . $patient['Patient']['id'] . ': ' . print_r($appt, true), LOG_DEBUG);\n }\n else $patient['Patient']['next_appt_dt'] = '';\n \n $latestAppt = $this->Appointment->find('first', array(\n 'conditions' => array(\n 'Appointment.patient_id' => $patient['Patient']['id']\n ),\n 'order' => 'Appointment.datetime DESC',\n 'recursive' => -1));\n if ($latestAppt) {\n $patient['Patient']['latest_appt_dt'] \n = $latestAppt['Appointment']['datetime'];\n }\n else $patient['Patient']['latest_appt_dt'] = ''; \n\n $patient['SurveySession'] = array();\n $patient['SurveySession']['last_session_proj'] = '--';\n $patient['SurveySession']['last_session_date'] = '--';\n $patient['SurveySession']['last_session_status'] = '--';\n\n $lastSession = $this->SurveySession->find('first', array(\n 'conditions' => array(\n 'SurveySession.patient_id' => $patient['Patient']['id']\n ),\n 'order' => 'SurveySession.id DESC',\n 'recursive' => -1\n ));\n// $this->log(__CLASS__ . '.' . __FUNCTION__ . '(), lastSession for patient id ' . $patient['Patient']['id'] . ': ' . print_r($lastSession, true), LOG_DEBUG);\n\n if (!$lastSession)\n continue;\n\n $lastSession = $lastSession['SurveySession'];\n\n $lastSessionsProjectId = $lastSession['project_id'];\n if (!isset($allProjects[$lastSessionsProjectId]))\n continue; // on the rare occasion that this project id no longer exists \n// $this->log(__CLASS__ . '.' . __FUNCTION__ . '(), lastSessionsProjectId for patient id ' . $patient['Patient']['id'] . ': ' . print_r($lastSessionsProjectId, true), LOG_DEBUG);\n\n $patient['SurveySession']['last_session_proj'] \n = $allProjects[$lastSessionsProjectId]['Project']['Title'];\n $patient['SurveySession']['last_session_date'] \n = $lastSession['reportable_datetime'];\n \n if ($lastSession['finished'] == 1)\n $patient['SurveySession']['last_session_status'] = 'finished';\n elseif ($lastSession['partial_finalization'] == 1)\n $patient['SurveySession']['last_session_status'] \n = 'partially finished';\n else\n $patient['SurveySession']['last_session_status'] = 'in process';\n\n }// foreach ($patients as &$patient){\n\n return $patients;\n //return $this->afterFind($patients); // not needed for the fields the calling fxn cares about\n }", "public function channelingDataSummary()\n {\n $appointments = Auth::user()->patient->appointments->whereIn('status', [\n Appointments::COMPLETED,\n Appointments::PENDING,\n Appointments::PAID,\n Appointments::CONFIRMED,\n ])->sortBy('date');\n $lastAppointment = $appointments->filter(function ($appointment) {\n return now()->toDateTimeString() > $appointment->date . \" \" . $appointment->time;\n })->last();\n $nextAppointment = $appointments->filter(function ($appointment) {\n return now()->toDateTimeString() < $appointment->date . \" \" . $appointment->time;\n })->first();\n $prescription = Prescription::whereIn('appointment_id', $appointments->pluck('id'))->get()\n ->sortByDesc(function ($prescription) {\n return $prescription->treatments_end_date;\n })->first();\n\n return ResponseHelper::findSuccess('Explorations Data', [\n 'lastAppointment' => $lastAppointment ? $lastAppointment->date : \"N/A\",\n 'nextAppointment' => $nextAppointment ? $nextAppointment->date : \"N/A\",\n 'reportsPendingAppointments' => $appointments->where('status', Appointments::PENDING)\n ->count(),\n 'treatmentsEnd' => $prescription ? $prescription->treatments_end_date : \"N/A\"\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new TabelAppointmentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $appointmentList = $this->connection->getValue();\n foreach ($appointmentList as $key => $appointment) {\n # code...\n if(array_key_exists('approved', $appointment) && $appointment['approved'] == false){\n unset($appointmentList[$key]);\n }\n }\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'appointmentList' => $appointmentList\n ]);\n }", "public function getUnpaidInvoicesList(InvoiceListingFilter $filter): Collection;", "public function getCurrentApplicants()\n {\n $builder = $this->createQueryBuilder('a');\n $subQueryBuilder = $this->_em->createQueryBuilder();\n $subQuery = $subQueryBuilder\n ->select('apl')\n ->from('MentorshipMasterBundle:Application', 'apl')\n ->where('apl.applicant = a')\n ->andWhere('apl.finishedAt IS NULL')\n ->getQuery();\n $query = $builder\n ->where($builder->expr()->exists($subQuery->getDQL()))\n ->getQuery();\n $cacheId = self::getCacheId(self::CACHE_ID_ACTIVE_APPLICANTS_SET);\n $query->useResultCache(true, 3600, $cacheId);\n return $query->getResult();\n }", "public function schedule() {\n $result = $this->toArray();\n $rehearsal_id = $this->id;\n $songs = $this->songs()->orderBy('pivot_start', 'ASC')->with(['players' => function ($p) use ($rehearsal_id) {\n $p->with(['availabilities' => function ($a) use ($rehearsal_id) {\n $a->where('rehearsal_id', $rehearsal_id);\n }]);\n }]);\n $result['songs'] = $songs->get()->toArray();\n return $result;\n }", "public function getAppointmentsFromRange(\\DateTime $startDate, \\DateTime $endDate) {\r\n $appointmentsArray = array();\r\n\r\n foreach($this->appointments as $key => $appointment) {\r\n if($appointment->isInRange($startDate, $endDate)) {\r\n $appointmentsArray[] = $appointment;\r\n }\r\n }\r\n\r\n return $appointmentsArray;\r\n }", "public function index()\n {\n $appointments = Appointment::with('doctor','patient')->paginate(25);\n\n return view('appointments.index', compact('appointments'));\n }", "function findAppointmentsDue(){\n\t$db = dbConnect();\n\n\t$sql = \"SELECT id FROM Appointment WHERE start_date > date_add(NOW(),INTERVAL 15 MINUTE) AND start_date <= date_add(NOW(),INTERVAL 30 MINUTE) AND status = 2 AND (type = 0 OR type = 1)\";\n\n\t$results = $db->query($sql);\n\n\treturn $results;\n}", "private function getAllApplicants() {\n $applicants = DB::table('crew')\n ->leftJoin('crewfasttrack', 'crewfasttrack.APPLICANTNO', '=', 'crew.APPLICANTNO')\n ->leftJoin('fasttrack', 'fasttrack.fasttrack', '=', 'crewfasttrack.FASTTRACKCODE')\n ->leftJoin('crewscholar', 'crewscholar.APPLICANTNO', '=', 'crew.APPLICANTNO')\n ->leftJoin('scholar', 'scholar.SCHOLASTICCODE', '=', 'crewscholar.SCHOLASTICCODE')\n ->leftJoin('crewchange', function ($join) {\n $join->on('crewchange.APPLICANTNO', '=', 'crew.APPLICANTNO')\n ->where('crewchange.DATEEMB', DB::raw(\"(select max(crewchange.DATEEMB) from crewchange where crewchange.APPLICANTNO = crew.APPLICANTNO )\"))\n ->groupby('crewchange.APPLICANTNO');\n })\n ->leftJoin('rank', 'rank.RANKCODE', '=', 'crewchange.RANKCODE')\n ->leftJoin('vessel', function ($join) {\n $join->on('vessel.VESSELCODE', '=', 'crewchange.VESSELCODE')\n ->whereDate('crewchange.DATEEMB', '<', Carbon::now())\n ->whereDate('crewchange.DATEDISEMB', '>', Carbon::now());\n })\n ->select('crew.APPLICANTNO', 'crew.CREWCODE', 'crew.FNAME', 'crew.GNAME', 'crew.MNAME', 'crew.STATUS', \n 'crew.UTILITY', 'scholar.DESCRIPTION', 'fasttrack.FASTTRACK', 'rank.RANK', 'vessel.VESSEL')->paginate(15);\n return $applicants;\n }", "function getSpeakersListForResolution($num) {\n $speakerOrder = getSpeakersListOrder();\n $resSpeakerOrder = array();\n foreach ($speakerOrder as $speaker) {\n $amendmentRow = getAmendmentRow($speaker['id'],$num);\n if ($amendmentRow != null) {\n if ($amendmentRow['status'] == 'approved') {\n array_push($resSpeakerOrder,$amendmentRow['country_id']);\n }\n }\n }\n return $resSpeakerOrder;\n}", "public static function grantWAPsToRangers(): mixed\n {\n list ($people, $startYear) = self::findRangersWhoNeedWAPs();\n self::grantAccessDocumentToPeople($people, AccessDocument::WAP, setting('TAS_DefaultWAPDate'), current_year());\n\n return [$people, $startYear];\n }", "public function applicants()\n {\n return $this->members()->wherePivot('role', '=', Member::ROLE_APPLICANT)->get();\n }", "public function prescriptionsDataSummary()\n {\n $prescriptions = Prescription::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->get();\n $prescriptionBills = $prescriptions->whereIn('status', [Prescriptions::PENDING_PRESCRIPTION, Prescriptions::CONFIRMED_PRESCRIPTION])->count();\n $internalPrescriptions = $prescriptions->where('status', Prescriptions::NEW_PRESCRIPTION)->count();\n $paidPrescriptions = $prescriptions->where('status', Prescriptions::PAID_PRESCRIPTION)->count();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'total_prescriptions' => $prescriptions->count(),\n 'prescription_bills' => $prescriptionBills,\n 'internal_prescriptions' => $internalPrescriptions,\n 'paid_prescriptions' => $paidPrescriptions\n ]);\n }", "public function check_paient_appointment($requested_data) {\n $check_patient_appointment_sql = \"\n SELECT \n appointment_date,\n user_first_name,\n user_last_name,\n user_phone_number,\n doctor_detail_speciality,\n appointment_clinic_id,\n clinic_name,\n clinic_contact_number,\n clinic_email,\n address_name,\n GROUP_CONCAT(DISTINCT(doctor_qualification_degree)) AS doctor_qualification\n FROM \n \" . TBL_APPOINTMENTS . \"\n LEFT JOIN \n \" . TBL_USERS . \" ON appointment_doctor_user_id=user_id\n LEFT JOIN \n \" . TBL_DOCTOR_DETAILS . \" ON user_id = doctor_detail_doctor_id\n LEFT JOIN \n \" . TBL_ADDRESS . \" ON address_user_id = appointment_clinic_id AND address_type = 2\n LEFT JOIN \n \" . TBL_CLINICS . \" ON appointment_clinic_id = clinic_id\n LEFT JOIN\n \" . TBL_DOCTOR_EDUCATIONS . \" ON appointment_doctor_user_id = doctor_qualification_user_id AND doctor_qualification_status = 1\n WHERE\n appointment_user_id='\" . $requested_data['patient_id'] . \"' AND \n appointment_doctor_user_id='\" . $requested_data['doctor_id'] . \"' AND \n appointment_id='\" . $requested_data['appointment_id'] . \"'\n \";\n\n $check_patient_appointment = $this->Common_model->get_single_row_by_query($check_patient_appointment_sql);\n\n return $check_patient_appointment;\n }", "public function toArray($request)\n {\n //return parent::toArray($request);\n\n return [\n 'id' => $this->id,\n 'prescriptionType_id' => $this->prescriptionType_id,\n 'patient_id' => $this->patient_id,\n 'patient_userid' => $this->patient_userid,\n 'doctor_id' => $this->doctor_id,\n 'doctor_userid' => $this->doctor_userid,\n 'appointment_id' => $this->appointment_id,\n 'identifier' => $this->identifier,\n 'chief_complains' => $this->chief_complains,\n 'on_examinations' => $this->on_examinations,\n 'provisional_diagnosis' => $this->provisional_diagnosis,\n 'differential_diagnosis' => $this->differential_diagnosis,\n 'lab_workup' => $this->lab_workup,\n 'advices' => $this->advices,\n 'reason' => $this->reason,\n 'height' => $this->height,\n 'weight' => $this->weight,\n 'pulse' => $this->pulse,\n 'blood_pressure' => $this->blood_pressure,\n 'quantity_med' => $this->quantity_med,\n 'next_visit' => $this->next_visit->format('d/m/Y'),\n 'created_at' => $this->created_at->format('d/m/Y'),\n 'updated_at' => $this->updated_at->format('d/m/Y'),\n ];\n }", "public function incidences() {\n return $this->hasMany(Incidence::class);\n }", "function getAppointmentByDate($start, $end, $status = ['scheduled'], $type = [], $getFull = FALSE, $page = 0, $pageSize = 10, $patient_id = null, $pdo = null)\n\t{\n\n\t\t$type = (isset($type) && sizeof($type) > 0) ? \"AND g.type IN ('\" . implode($type, \"', '\") . \"')\" : \"\";\n\t\t$Patient = ($patient_id != null && $patient_id != '') ? ' AND g.patient_id = ' . $patient_id : '';\n\t\t$sql = \"SELECT p.*, g.patient_id FROM appointment p LEFT JOIN appointment_group g ON p.group_id=g.id LEFT JOIN appointment_clinic c ON c.id=g.clinic_id WHERE DATE(start_time) BETWEEN '\" . $start . \"' AND '\" . $end . \"' AND `status` IN ('\" . implode($status, \"', '\") . \"'){$type}{$Patient} /*AND g.department_id IS NULL*/ ORDER BY FIELD(status, 'Scheduled', 'Active', 'Completed', 'Missed' , 'Cancelled'), Date(start_time), end_time DESC\";\n\t\t//error_log($sql);\n\t\t$total = 0;\n\t\ttry {\n\t\t\t$pdo = $pdo == null ? $this->conn->getPDO() : $pdo;\n\t\t\t$stmt = $pdo->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t\t$stmt->execute();\n\t\t\t$total = $stmt->rowCount();\n\t\t} catch (PDOException $e) {\n\t\t\terror_log(\"ERROR: Failed to return total number of records\");\n\t\t}\n\n\t\t$page = ($page > 0) ? $page : 0;\n\t\t$offset = ($page > 0) ? $pageSize * $page : 0;\n\n\t\ttry {\n\t\t\t$pdo = $pdo == null ? $this->conn->getPDO() : $pdo;\n\t\t\t$sql .= \" LIMIT $offset, $pageSize\";\n\t\t\t//error_log($sql);\n\t\t\t$appoints = array();\n\t\t\t$stmt = $pdo->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t\t$stmt->execute();\n\t\t\twhile ($row = $stmt->fetch(PDO::FETCH_NAMED, PDO::FETCH_ORI_NEXT)) {\n\t\t\t\t$appoint = new Appointment();\n\t\t\t\t$appoint->setId($row['id']);\n\t\t\t\tif ($getFull) {\n\t\t\t\t\t$group = (new AppointmentGroupDAO())->getAppointmentGroup($row['group_id'], TRUE, $pdo);\n\t\t\t\t\t$editor = (new StaffDirectoryDAO())->getStaff($row['editor_id'], FALSE, $pdo);\n\t\t\t\t} else {\n\t\t\t\t\t$group = new AppointmentGroup();\n\t\t\t\t\t$group->setId($row['group_id']);\n\t\t\t\t\t$editor = new StaffDirectory();\n\t\t\t\t\t$editor->setId($row['editor_id']);\n\t\t\t\t}\n\t\t\t\t$appoint->setGroup($group);\n\t\t\t\t$appoint->setStartTime((explode(\" \", $row['start_time'])[1] === \"00:00:00\") ? explode(\" \", $row['start_time'])[0] : $row['start_time']);\n\t\t\t\t$appoint->setEndTime($row['end_time'] === null ? null : (explode(\" \", $row['end_time'])[1] === \"00:00:00\") ? explode(\" \", $row['end_time'])[0] : $row['end_time']);\n\t\t\t\t$appoint->setAttendedTime($row['attended_time']);\n\t\t\t\t$appoint->setStatus(($row['status'] === \"Scheduled\" && strtotime(explode(\" \", $row['start_time'])[0]) < strtotime(date(\"Y-m-d\"))) ? \"Missed\" : $row['status']);\n\t\t\t\t$appoint->setEditor($editor);\n\t\t\t\t\n\t\t\t\t$appoints[] = $appoint;\n\t\t\t}\n\t\t\t$stmt = null;\n\t\t} catch (PDOException $e) {\n\t\t\t$stmt = null;\n\t\t\t$appoints = array();\n\t\t}\n\t\t$results = (object)null;\n\t\t$results->data = $appoints;\n\t\t$results->total = $total;\n\t\t$results->page = $page;\n\n\t\treturn $results;\n\t}", "public function getPrequestList(){\n return $this->_get(5);\n }", "public function getApptForSpecialist($id){\n\t\t$user=User::findOrFail($id);\n\t\t$profile=$user->profiles; \n\t\t$appointments=$user->appointments->where('available','1');\n\t\treturn view('appointments.availAppointments',compact('appointments','profile')); \n\t}", "public function get_appointment_activity($instructorId)\n\t{\n\n\t\t$query = $this->db->query(\"SELECT * FROM `appointments` LEFT JOIN `users_details` ON `appointments`.`user_id` = `users_details`.`id` WHERE `instructor_id` = '\".$instructorId.\"' AND DATE(book_datetime) >= DATE_SUB(CURRENT_DATE, INTERVAL 1 WEEK)\");\n\t\tif($query->num_rows()){\n\t\t\t$result = $query->result_array();\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t}", "public function podcasts()\n {\n return PodcastResource::collection(\\Auth::user()->artist->podcasts);\n }", "public function reservations() {\n return $this->hasMany('App\\Reservation')->getResults();\n }", "public function index()\n {\n $id = Auth::id();\n $user = User::find($id);\n $prescriptions = $user->prescriptions()->get();\n //dd(compact($user, $prescriptions));\n\n return view('prescriptions.prescriptions', compact('prescriptions'));\n }", "public function getAppointmentsListJSON() {\nglobal $_LW;\n$output=[];\nforeach($_LW->dbo->query('select', 'id, title', 'livewhale_appointments', false, 'title ASC')->run() as $res2) { // loop through and add appointments\n\t$output[]=['id'=>$res2['id'], 'title'=>$res2['title']];\n};\nreturn json_encode($output);\n}" ]
[ "0.7060157", "0.6855971", "0.65665466", "0.65665466", "0.65665466", "0.6546537", "0.65306604", "0.6474078", "0.643309", "0.6346216", "0.631028", "0.6279422", "0.6258811", "0.6211584", "0.6199713", "0.61197203", "0.6111887", "0.608494", "0.59529245", "0.5883215", "0.5769721", "0.57527363", "0.57455283", "0.56068873", "0.5600764", "0.55906415", "0.5555037", "0.55541766", "0.554107", "0.55304813", "0.5529534", "0.550783", "0.5493162", "0.546711", "0.5465458", "0.545681", "0.5448616", "0.54483813", "0.5444396", "0.544097", "0.54407066", "0.54260653", "0.5415451", "0.5415044", "0.5414077", "0.5378616", "0.5362261", "0.53487873", "0.53396285", "0.53379303", "0.53320825", "0.53099954", "0.528295", "0.5275133", "0.5267427", "0.5253609", "0.52484363", "0.52468395", "0.5226465", "0.5219272", "0.5213379", "0.52111864", "0.519458", "0.518754", "0.5181399", "0.51692647", "0.51487505", "0.5144123", "0.51434904", "0.51432186", "0.51117486", "0.5107566", "0.5104393", "0.50989723", "0.5098886", "0.5085209", "0.5084447", "0.50649697", "0.5054263", "0.5049368", "0.5044403", "0.5036725", "0.5036661", "0.5035751", "0.5029583", "0.5026404", "0.5023863", "0.5015131", "0.5015024", "0.50075877", "0.5005421", "0.50031245", "0.50011975", "0.5001145", "0.4998127", "0.49896106", "0.49876624", "0.4982975", "0.4979391", "0.49787828" ]
0.82217264
0
get the patient profile image
public function avatar(){ if($this->avatar){ return asset('/avatars/patients/'.$this->avatar); }else{ return "https://www.gravatar.com/avatar/{{md5(trim($this->fname))}}?d=mm&s=150" ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProfilePicture();", "public function getProfileImage() {\r\n $profileImage = SystemSetting::getByKey(\"ARC_USER_IMAGE\", $this->id);\r\n if (!empty($profileImage->value)) {\r\n return system\\Helper::arcGetPath() . \"assets/profile/\" . $profileImage->value;\r\n }\r\n return system\\Helper::arcGetPath() . \"assets/profile/placeholder.png\";\r\n }", "public function getProfileImg()\n {\n return $this->profile_img;\n }", "public function getProfilePicture()\n\t{\n\t\treturn $this->info['profile_picture'];\n\t}", "public function getProfileImg()\n {\n return $this->profileImg;\n }", "public function getProfilePicture()\n {\n return $this->profilePicture;\n }", "public function getRiderProfilePictureAttribute()\n {\n $profile_picture=ProfilePicture::where('user_id',$this->attributes['user_id'])->first();\n return isset($profile_picture)?$profile_picture->src:url('images/user.jpeg');\n }", "public function getProfileImage(){\n\t\t// To hook into this function we could use a an event:\n\t\t// $event = new CEvent();\n\t\t// $this->onGetProfileImage($event)\n\t\t// // then if the event has been handled \n\t\t// if($event->handled)\n\t\t// // we know another function has handled the event and found us an image url for this user\n\t\t// // it could store this in the event object\n\t\t// return $event->params->imageUrl \n\t\t\n\t\t// Display guest photo\n\t\treturn Yii::app()->controller->createWidget('nii.widgets.Gravatar',array('email'=>$this->email))->getUrl();\n\t}", "public function getImageProfile() {\n\t\t$basePath = Yii::getAlias ( '@web' );\n\t\t\n\t\t$usuarioFacebook = $this->entUsuariosFacebook;\n\t\t\n\t\tif(empty($usuarioFacebook)){\n\t\t\tif ($this->txt_imagen) {\n\t\t\t\treturn $basePath . '/profiles/' . $this->txt_token.\"/\". $this->txt_imagen;\n\t\t\t}\n\t\t\t\n\t\t\treturn $basePath . '/webAssets/images/site/user.png';\n\t\t}\n\t\t\n\t\treturn 'http://graph.facebook.com/'.$usuarioFacebook->id_facebook.'/picture';\n\t\t\n\t}", "protected function getProfileImage()\n {\n $path = $this->_getImageBasePath() . $this->_getImageName();\n\n if(!file_exists($this->_getFullImagePath($path))) {\n //reszise and return path to new resized image\n //@todo resize\n $originImage = $this->_getImageName(false);\n if(file_exists($this->_getFullImagePath($originImage))) {\n //resize it and return path to resized image\n //if it can't resized, return default image\n } else {\n return $this->_getDefaultImage();\n }\n } else {\n return $path;\n }\n\n\n }", "public function getProfileImage()\n {\n if ($this instanceof \\humhub\\modules\\space\\models\\Space) {\n return new \\humhub\\libs\\ProfileImage($this->guid, 'default_space');\n }\n return new \\humhub\\libs\\ProfileImage($this->guid);\n }", "public function getAvatar()\n {\n return $this->getProfilePicture();\n }", "public function getProfilePictureFile()\n {\n return $this->profile_picture_file;\n }", "public function profilePicture()\n {\n if ($this->picture) {\n return \"/storage/{$this->picture}\";\n }\n\n return 'http://i.pravatar.cc/200';\n }", "public function getProfPic() {\n $response = $this->getRequest(\"me\");\n $response = json_decode($response->getBody()->getContents());\n \n if (count($response->{\"images\"}) == 0) {\n return null;\n } else {\n return $response->{\"images\"}[0]->{\"url\"};\n }\n }", "public function getAvatar()\n\t{\n\t\treturn $this->instance->profile;\n\t}", "public function getProfileAvatar()\n {\n return view('profilePicture');\n }", "function displayProfilePic()\n {\n global $db;\n $image = $db->query(\"SELECT userProfilePic FROM users WHERE id= '{$_SESSION['id']}' \") ;\n return $image;\n }", "function get_user_profile_pic() {\n $ci = & get_instance();\n $sessionData = $ci->session->userdata('user_data');\n if (!empty($sessionData))\n return $ci->db->select('thumb_nail,prof_image,status')->from('upkepr_user_profile')->where('user_id', $sessionData['user_id'])->get()->row_array();\n else\n return false;\n}", "public function getAvatar() {\n return (new Query())->select('profile_photo')->from('user_cv')\n ->where(['user_id' => $this->id, 'is_default' => true])\n ->limit(1)->scalar();\n }", "public function getAvatar()\n {\n return $this->profile->getAvatar();\n }", "public function profilePicPath()\n {\n \treturn $this->defaultProfilePicPath;\n }", "public function get_avatar()\n\t{\n\t\treturn $this->user_loader->get_avatar($this->get_data('from_user_id'));\n\t}", "public function getPicture()\n {\n return $this->picture;\n }", "public function getPicture()\n {\n return $this->picture;\n }", "public function getSpotifyProfilePicture()\n {\n return $this->spotifyProfilePicture;\n }", "public function getProfileImage()\n {\n if ($this->configuration->useRawImage()) {\n $imageUrl = $this->configuration->getMediaPublicDirectory() . 'catalog/product' . $this->getImage();\n } else {\n $storeId = $this->getStore()->getId();\n $this->appEmulation->startEnvironmentEmulation($storeId, \\Magento\\Framework\\App\\Area::AREA_FRONTEND, true);\n $imageUrl = $this->imageBuilder->setProduct($this)\n ->setImageId('product_base_image')\n ->create()\n ->getImageUrl();\n $this->appEmulation->stopEnvironmentEmulation();\n }\n\n return $imageUrl;\n }", "public function getProfileImageURL()\n {\n return 'https://avatars3.githubusercontent.com/u/4479918?v=4&s=460';\n }", "public function getPatchProfileImg() {\n if(empty($this->patchProfileImg))\n return \"/Treinamento2020/img/profileImages/Newbie\".imgExtension;\n return $this->patchProfileImg;\n }", "public function get_user_image() {\n\t\tloggedOnly();\n\n\t\t// Pega o usuario logado\n\t\t$user = auth();\n\n\t\t// Busca a imagem\n\t\tif( $user->midia_id ) {\n\t\t\tif( $image = $user->belongsTo( 'midia' ) ) {\n\t\t\t\treturn resolve( $image->path() );\n\t\t\t} return resolve( base_url( 'public/images/empty.jpg' ) );\n\t\t} return resolve( base_url( 'public/images/empty.jpg' ) );\n\t}", "protected function _getProfilePicturePath()\n {\n if ($this->_properties['profile_picture_dir'] && $this->getOriginal('profile_picture')) {\n return '../files/users/profile_picture/' . $this->_properties['profile_picture_dir'] . '/square_' . $this->getOriginal('profile_picture'); \n }\n return 'default-profile_picture.png';\n }", "public function getAvatar($identity);", "function getprofileimage($username){\n $user = DB::table('users')->where('username', $username)->first();\n $profileimage = $user->profileimage;\n if($profileimage == \"\"){\n\t$profileimagepath = \"/images/user.png\";\n return($profileimagepath);\n }\n $profileimagepath = \"/image/\".$username.\"/profileimage/\".$profileimage;\n return($profileimagepath);\n}", "public function getPicture()\n\t{\n\t\treturn $this->picture;\n\t}", "public function getPicture() {\n return $this->picture;\n }", "protected function getAvatar()\n\t{\n\t\treturn $this->avatar();\n\t}", "public function showProfilePic()\n {\n \n \n }", "function getPicture(){\r\n return $this->picture;\r\n }", "function get_profile_pic($img)\n{\n\tdefine('UPLOAD_DIR', 'ProfilePics/');\n\t$img \t= str_replace('data:image/png;base64,', '', $img);\n\t$img \t= str_replace(' ', '+', $img);\n\t$data \t= base64_decode($img);\n $file \t= UPLOAD_DIR . uniqid() . '.jpg';\n $success = file_put_contents($file, $data);\n \n\treturn $success ? $file : 'some problem occured';\n}", "public function getUserAvatar(){\n return($this->userAvatar);\n }", "public function getProfileBannerImage()\n {\n\n return new \\humhub\\libs\\ProfileBannerImage($this->guid);\n }", "public function getAvatar()\n {\n // so that updated images happen when users change their avatar. Also fixes #9822\n if (!isset($this->data['avatar'])) {\n $ui = app(UserInfoRepository::class)->getByID($this->data['id']);\n if ($ui) {\n $this->data['avatar'] = $ui->getUserAvatar()->getPath();\n }\n }\n return $this->data['avatar'];\n }", "public function getAvatar()\n {\n return $this->getImageurl();\n }", "private function getProfImage($root) {\n\t\t$image = $root->find('div[class=instructor-bio] img', 0);\n\t\tif (!$image) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn $this->url . $image->getAttribute('src');\n\t}", "public static function rb_get_model_image($PID = NULL){\r\n\r\n\t\t\tglobal $wpdb;\r\n\r\n\t\t\tif(empty($PID) or is_null($PID)) return false;\r\n\r\n\t\t\t$profile_id = \"SELECT * FROM \". table_agency_profile .\r\n\t\t\t\t\t\t\" WHERE ProfileID = \" . $PID;\r\n\r\n\t\t\t$get_id = $wpdb->get_row($profile_id);\r\n\r\n\t\t\tif(count($get_id) > 0){\r\n\r\n\t\t\t\t$get_image = \"SELECT ProfileMediaURL FROM \". table_agency_profile_media .\r\n\t\t\t\t\t\t\t\t\" WHERE ProfileID = \" .$get_id->ProfileID . \" AND ProfileMediaPrimary = 1\";\r\n\r\n\t\t\t\t$get_res = $wpdb->get_row($get_image);\r\n\r\n\t\t\t\tif(count($get_res) > 0){\r\n\r\n\t\t\t\t\t$image = get_bloginfo('wpurl'). \"/wp-content/uploads/profile-media/\". $get_id->ProfileGallery.\"/\". $get_res->ProfileMediaURL;\r\n\r\n\t\t\t\t\treturn $image;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn \"\";\r\n\r\n\t\t}", "public function getProfilePhotoUrlAttribute(): string\n {\n return $this->profile_photo_path && $this->photoExists()\n ? Storage::disk($this->profilePhotoDisk())->url($this->profile_photo_path)\n : $this->filamentDefaultAvatar();\n }", "public function getWebPicture();", "public function getPhoto() {\n if(isset($this->photo) && !empty($this->photo)) {\n return Yii::getAlias('@web'). '/' . $this->photo;\n }\n return Yii::$app->params['defaultProfileImage'];\n }", "public function getAvatar(): string;", "public function getPhoto() {\n return DATADIR . 'alumni/' . $this->shortName . '.jpg';\n }", "public function picture()\n {\n if ($this->image->exists()) {\n return resource_url('images/users/' .basename($this->image->path));\n }\n\n // Fallback to AdminLTE's default image.\n return vendor_url('dist/img/avatar5.png', 'almasaeed2010/adminlte');\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->user['avatar'];\n }", "public function getAvatarImage() : string\n {\n $imagePlaceholder = asset('storage/images/profiles') . '/' . Auth::user()->avatar;\n\n if(empty(Auth::user()->avatar)) {\n $imagePlaceholder = asset('img/user-image-placeholder.png');\n }\n\n return $imagePlaceholder;\n }", "public function AvatarURL() {\n\t\t\n\t\tif (!empty($this->profil)) {\n\t\t\t\n\t\t\treturn $this->profil['user']['avatar150'];\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "function fc_get_jomSocial_avatar(){\r\n\t$user =& CFactory::getUser($userid);\r\n\t\r\n\t// Retrieve the avatar.\r\n\treturn correct_avatar_path($user->getThumbAvatar());\r\n}", "public function avatarUser()\n {\n return asset(\"storage/images/$this->avatar\");\n }", "function pull_member_image($member_id) {\n $this->db->where('member_id',$member_id);\n $this->db->select('image');\n $query = $this->db->get('members_tbl');\n $query = $query->row();\n return $query->image;\n }", "public function getProfileImageURL()\n {\n return 'https://s.gravatar.com/avatar/9ff2a97e7faf3529f1b78f1f737ebca0?s=80';\n }", "public function picture_url() {\n return $this->_adaptee->user_photo(\"\", true);\n }", "public function getImage()\n {\n return $this->get('image');\n }", "public function getImg_avatar()\r\n {\r\n return $this->img_avatar;\r\n }", "public function get_profile_pic($UserId){\r\n\t\t \t$this->sql = \"Select profile_pic from \".$this->tables['User'].\" WHERE Id= '\".$UserId.\"' \";\r\n\t \t\treturn $this->query($this->sql,1);\r\n\t\t}", "private function getProfileImage($id)\n\t{\n\t\t$url = 'https://graph.facebook.com/' . $id . '/picture';\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, true);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$a = curl_exec($ch);\n\t\t$url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n\t\tcurl_close($ch);\n\t\treturn $url;\n\t}", "function get_user_profile_pic( $user_id, $height = 100, $width = 100 ) {\n\t$user_data = get_userdata( intval( $user_id ) );\n\n\tif ( $user_data ->user_photo != '' ) {\n\t\t$img_data = '<img name=\"user_photo\" class=\"agent_photo\" id=\"user_photo\" src=\"' . $user_data ->user_photo . '\" width=\"' . $width . '\" height=\"' . $height . '\" />';\n\t} else {\n\n\t\t\t$img_data = '<img name=\"user_photo\" class=\"agent_photo\" id=\"user_photo\" src=\"' . get_bloginfo( 'template_directory' ) . '/images/avatar_post.png\" width=\"' . $width . '\" height=\"' . $height . '\" />';\n\t}\n\n\t\techo $img_data;\n}", "public function get_picture(){ return $this->_picture;}", "public function profileimageAction() {\n\t\ttry{\t\t\t\n\t\t\t$this->view->UserProfileImage = $this->session->UserProfileImage; //$UserProfileImage['0']['image_path'];\n\t\t}catch (Exception $e){\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "public function getImage($filename)\n {\n\n // $path = $req->input('me');\n // $p = public_path().\"/profile/\".$filename;\n $file_path = public_path('profile/' . $filename);\n return Storage::download($file_path);\n }", "public function getPicture(){\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->condition = \"emp_id = :EMPID\";\n\t\t$criteria->params[':EMPID'] = $this->emp_id;\n\t\t$criteria->select = \"pic,location_pic\";\n\t\t$empl_pic = Employees::model()->find($criteria);\n\t\treturn \t$empl_pic;\n\t}", "public static function getInfo($selected_uid) {\n\t$sql=<<<EOM\n\t select username, profile_fields as image\n\t from users\n\t where id = '$selected_uid'\n\t limit 1;\nEOM;\n $query = DB::query($sql);\n $result = $query->execute();\n return $result[0];\n }", "public function get_image() {\r\n return $this->image;\r\n }", "public function addProfileImage() {\n\n\t\t\n\t\t$upload_path = LITHIUM_APP_PATH.\"/resources/tmp/images/\";\n $temp_file = Upload::handleUpload('test',$upload_path);\n\n $thumb = new \\app\\libraries\\jiles\\images\\Thumbnail($upload_path.$temp_file);\n\t\t$file_name = $this->_session['_id'].'.jpg';\n $thumb->createThumbnail(null,200);\n\n\t $thumb->save(LITHIUM_APP_PATH.\"/webroot/img/members/profile/\".$file_name);\n\n $thumb->createThumbnail(50,50);\n\n\t\t\n $thumb->save(LITHIUM_APP_PATH.\"/webroot/img/members/small/\".$file_name);\n \n \n // add time stamp on so that the picture will refresh in the view.\n\t\t\n $result = array(\"success\"=>true,\"file\"=>\"/img/members/profile/\".$file_name.\"?\".strtotime('now'));\n echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);\n \n\t\t die();\n\t\t\t\n\t\t\n\t}", "public function userProfilePicImage($id, $image)\n {\n return Image::make(storage_path() . '/users/id/' . $id . '/uploads/images/profile-pics/' . $image)->response();\n }", "protected function _getAvatar()\n {\n $avatar = null;\n if (isset($this->social_accounts[0])) {\n $avatar = $this->social_accounts[0]['avatar'];\n }\n\n return $avatar;\n }", "public function getOppoAvatar()\n {\n return $this->get(self::_OPPO_AVATAR);\n }", "public static function requestProfilePicture($userID)\n {\n if ($picture = UserModel::fetchProfilePicture($userID))\n return $picture;\n \n return NULL;\n }", "public static function getUserLoginAvatar() {\n return Yii::$app->session->get(UserHelper::SESSION_AVATAR);\n }", "public function getAbsolutePicture();", "function fc_get_easySocial_avatar(){\r\n\t$user = Foundry::user();\r\n\t\r\n\t// Retrieve the avatar.\r\n\treturn correct_avatar_path($user->getAvatar());\r\n}", "public function avatar() {\n return $this->avatar_path ? Storage::url($this->avatar_path) : '/images/svg/avatar_default.svg';\n }", "public function getAvatar()\n {\n return $this->Avatar;\n }", "public function getAvatar()\n {\n return $this->Avatar;\n }", "public function getProfileImageImageId() {\n\t\treturn($this->profileImageImageId);\n\t}", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getPictureFile()\n {\n return $this->pictureFile;\n }", "public function getPictureFile()\n {\n return $this->pictureFile;\n }", "public function getProfileImageAttribute($value)\n {\n return is_null($value) || empty($value) ? 'img/male.png' : $value;\n }", "function get_display_photo(){\n\t$display_photo = get_profile( 'photo' );\n\tif ( empty($display_photo) || !file_exists(abspath('/contents/images/profile/'.$display_photo)) )\n\t\treturn false;\n\n\treturn get_image_link( \"/images/profile/$display_photo\", \"default\" );\n}", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n if($this->image == null){\n return \"https://place-hold.it/50x50\";\n }\n else return IMG_PATH.\"/\".$this->image;\n }", "public static function get_image($user_id);" ]
[ "0.8321862", "0.79486233", "0.79157096", "0.78564686", "0.7784165", "0.7752854", "0.75825727", "0.7528041", "0.7527411", "0.7451663", "0.73926395", "0.7361501", "0.73354685", "0.732236", "0.71695954", "0.7114947", "0.70576984", "0.69770116", "0.69759905", "0.69674", "0.69664526", "0.6907862", "0.68582535", "0.6842483", "0.6842483", "0.6825431", "0.6809945", "0.6790404", "0.6780903", "0.6768728", "0.6754242", "0.67495024", "0.674449", "0.67351943", "0.6723666", "0.6716444", "0.67103773", "0.6705511", "0.6675628", "0.66558844", "0.66323245", "0.6632209", "0.6631644", "0.662841", "0.662826", "0.6625092", "0.66109264", "0.6604917", "0.65702367", "0.65670234", "0.65571076", "0.65537226", "0.65537226", "0.65537226", "0.65537226", "0.6553149", "0.6545932", "0.65175015", "0.65131813", "0.64978397", "0.6486191", "0.6483092", "0.6477124", "0.64657927", "0.64478254", "0.6443174", "0.6440764", "0.64357364", "0.6434485", "0.6428125", "0.64220595", "0.6407526", "0.6379193", "0.63786715", "0.6376815", "0.63725966", "0.63469636", "0.6346643", "0.63375366", "0.63374984", "0.6335707", "0.63339525", "0.63308364", "0.63229984", "0.6316723", "0.6316723", "0.63035357", "0.6295951", "0.6295951", "0.6295951", "0.6295951", "0.6295951", "0.6295951", "0.6283709", "0.6283709", "0.6282774", "0.6257429", "0.62572527", "0.62544304", "0.62534064" ]
0.69587517
21
The patient age (Carbon)
public function age(){ return $this->dob->age; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAgeAttribute ()\n\t{\n\t\treturn \\Carbon\\Carbon::parse($this->birthdate)->age;\n\t}", "public function getAgeAttribute()\n\t{\n\t\treturn now()->diffInYears($this->birthdate);\n\t}", "public function getAgeAttribute() {\n return Carbon::createFromDate($this->attributes['DOB'])->age;\n }", "public function getAge()\n {\n //function qui calcule l'age de leleve \n $now = new \\DateTime('now');\n $age = $this->getDateNaissance();\n $difference = $now->diff($age);\n\n return $difference->format('%y Ans');\n }", "public function getAge()\n {\n if ($this->age) {\n return $this->age;\n }\n\n $this->age = $this->getBirthDate()->diff(new \\DateTime())->y;\n\n return $this->age;\n }", "private function getAge()\n {\n return $this->getAge($this->dob);\n }", "public function getAge()\n {\n\n return $this->age;\n \n }", "public function getAgeAttribute($value)\n {\n return Carbon::parse($this->birthdate)->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public function getAge() {\n return $this->age;\n }", "public function getAge() {\n date_default_timezone_set('America/New_York');\n list($year,$month,$day) = explode(\"-\",$this->birthDate);\n $year_diff = date(\"Y\") - $year;\n $month_diff = date(\"m\") - $month;\n $day_diff = date(\"d\") - $day;\n if ($month_diff < 0 || ($month_diff == 0 && $day_diff < 0)) {\n $year_diff--;\n }\n return $year_diff;\n }", "public function getage()\n {\n return $this->age;\n }", "function getAge() {\n return $this->age;\n }", "public function getAge() { return $this->age; }", "public function getAge()\n {\n // future dates have no age\n return max(0, $this->difference(self::now())->getYears());\n }", "public function getAge()\n {\n return 14;\n }", "public function getAge()\n {\n return 14;\n }", "public function getAge()\n\t{\n\t\t$date_birthday = $this->getAnswer('birthday');\n\t\t$date_birthday = convert_date_to_age($date_birthday);\n\t\treturn $date_birthday;\n\n\t}", "public function age()\r\n {\r\n\r\n // Note that A DOB object is based on a date-range and the exact date is\r\n // usually unknown so for age calculation the the middle of the range is\r\n // assumed to be the real date-of-birth.\r\n\r\n if (!empty($this->date_range))\r\n {\r\n $dob = $this->date_range->middle();\r\n $today = new DateTime('now', new DateTimeZone('GMT'));\r\n\r\n $diff = $today->format('Y') - $dob->format('Y');\r\n\r\n if ($dob->format('z') > $today->format('z'))\r\n {\r\n $diff -= 1;\r\n }\r\n\r\n return $diff;\r\n }\r\n return;\r\n }", "public function age() {\n $years = ((integer) date('Y')) - $this->year;\n\n if (((integer) date('n')) < $this->month) {\n $years -= 1;\n }\n else if (((integer) date('n')) == $this->month) {\n if (((integer) date('j')) < $this->day) {\n $years -= 1;\n }\n }\n\n return $years;\n }", "public function getAge()\n {\n if ($dob = $this->getDob()) {\n $now = new \\Datetime('now');\n $today['month'] = $now->format('m');\n $today['day'] = $now->format('d');\n $today['year'] = $now->format('Y');\n\n $years = $today['year'] - $dob->format('Y');\n\n if ($today['month'] <= $dob->format('m')) {\n if ($dob->format('m') == $today['month']) {\n if ($dob->format('d') > $today['day'])\n $years--;\n } else\n $years--;\n }\n\n return $years;\n }\n\n return null;\n }", "public function getAge();", "public function getAge();", "public function getAge()\n {\n $this->checkJMBG();\n\n $timestamp = $this->getBirthdayTimeStamp();\n $now = time();\n $diff = $now - $timestamp;\n return date('Y', $diff) - 1970;\n }", "public function getAgeFrom() {\n return $this->ageFrom;\n }", "public function getAge()\n {\n return 20;\n }", "public function getUserAge();", "public function getProfileAge() {\n\t\treturn (TIME_NOW - $this->registrationDate) / 86400;\n\t}", "public function getAge() {\n\t\tif ($this->birthday) {\n\t\t\t// split date\n\t\t\t$year = $month = $day = 0;\n\t\t\t$optionValue = explode('-', $this->birthday);\n\t\t\tif (isset($optionValue[0])) $year = intval($optionValue[0]);\n\t\t\tif (isset($optionValue[1])) $month = intval($optionValue[1]);\n\t\t\tif (isset($optionValue[2])) $day = intval($optionValue[2]);\n\t\t\t\n\t\t\t// calc\n\t\t\tif ($year) {\n\t\t\t\t$age = DateUtil::formatDate('%Y', null, false, true) - $year;\n\t\t\t\tif (intval(DateUtil::formatDate('%m', null, false, true)) < intval($month)) $age--;\n\t\t\t\telse if (intval(DateUtil::formatDate('%m', null, false, true)) == intval($month) && DateUtil::formatDate('%e', null, false, true) < intval($day)) $age--;\n\t\t\t\treturn $age;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "public function getMoyenneAgeActors(){\n $ageMoyActors = DB::table('actors')\n ->avg(DB::raw('TIMESTAMPDIFF( YEAR, dob, NOW())'));\n return number_format($ageMoyActors, 1);\n }", "public function determineAge() {\n $timeInOneYear = 365.256 * 24 * 60 * 60;\n $yearsofAge = floor((strtotime(date('Y')) - strtotime($this->year.'-12-31'))/ $timeInOneYear);\n\n $this->age = $yearsofAge;\n\n return (int) $yearsofAge;\n }", "public function getageEc()\n {\n return $this->age_ec;\n }", "public function get_age($dob){\n\t\treturn floor((time() - strtotime($dob))/31556926);\n\t}", "public function getMarAge()\n {\n return $this->mar_age;\n }", "public function getageEu()\n {\n return $this->age_eu;\n }", "function getAge($birthDate){\n $birthDate = explode('/', $birthDate);\n $birthYear = $birthDate[2];\n $date = date('Y');\n $age = date_diff(date_create($birthYear), date_create($date));\n \n return $age->format('%Y');\n}", "public function calcAgeCalculatesAgeOfTimestampDataProvider() {}", "public function getAge() {\n // Age of oldest entry.\n $old = $this->database->select('watchdog', 'w')\n ->fields('w', ['timestamp'])\n ->orderBy('wid', 'ASC')\n ->range(0, 1)\n ->execute()\n ->fetchField();\n\n // Age of newest entry.\n $new = $this->database->select('watchdog', 'w')\n ->fields('w', ['timestamp'])\n ->orderBy('wid', 'DESC')\n ->range(0, 1)\n ->execute()\n ->fetchField();\n\n // If two different days...\n if (date('Y-m-d', $old) != date('Y-m-d', $new)) {\n return $this->t(\"Age of messages: From @from to @to (@days days)\", [\n '@from' => date('Y-m-d', $old),\n '@to' => date('Y-m-d', $new),\n '@days' => round(($new - $old) / 86400, 2),\n ]);\n }\n // Same day; don't calculate number of days.\n return $this->t(\"Age of messages: From @from to @to\", [\n '@from' => date('Y-m-d', $old),\n '@to' => date('Y-m-d', $new),\n ]);\n }", "public function getPassengerAge(){\n\t\t\n\t\treturn $this->passengerAge;\n\t}", "public function cheffism_age_function($atts) {\n extract(shortcode_atts(array(\n 'date' => '11/04/1985',\n 'format' => 'dd/MM/YYYY'\n ), $atts));\n\n //explode the date to get month, day and year\n $date = explode(\"/\", $date);\n //get age from date or birthdate\n $age = (date(\"md\", date(\"U\", mktime(0, 0, 0, $date[1], $date[0], $date[2]))) > date(\"md\")\n ? ((date(\"Y\") - $date[2]) - 1)\n : (date(\"Y\") - $date[2]));\n\n return $age;\n }", "function findAge(\\DateTimeInterface $birthDate)\n {\n return $birthDate->diff(new DateTime())->y;\n }", "public function getAgeTimeUnit()\n {\n return $this->ageTimeUnit;\n }", "private function ageChaton() { \n $datenow = new DateTime(\"now\");\n $result = date('Y-m-d', strtotime('-365 day')); //-12 mois\n\n return $result;\n }", "public function getEquipYearsOfUseAttribute()\n {\n $equip_years_of_use = 0;\n\n if (isset($this->equip_date_of_release) && $this->equip_date_of_release != NULL) {\n $dateNow = new DateTime();\n $dateOfStart = date_create($this->equip_date_of_release);\n $diff = date_diff($dateNow, $dateOfStart);\n $equip_years_of_use = $diff->y;\n }\n\n return $equip_years_of_use;\n }", "function get_age($date_of_birth) //day-month-year\n\t\t{\n\t\t\t$bdate = explode(\"-\", $date_of_birth);\n\t\t\t$day\t= isset($bdate[0]) ? (int)$bdate[0] : 0;\n\t\t\t$month\t= isset($bdate[1]) ? (int)$bdate[1] : 0;\n\t\t\t$year\t= isset($bdate[2]) ? (int)$bdate[2] : 0;\n\t\t\tif ($year)\n\t\t\t{\n\t\t\t\t$age = date(\"Y\") - $year;\n\t\t\t\tif (($month > date(\"m\")) || ($month == date(\"m\") && date(\"d\") < $day))\n\t\t\t\t{\n\t\t\t\t\t$age -= 1;\n\t\t\t\t}\n\t\t\t\treturn $age;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function getFullAge()\n\t{\n\t\t$birthDate = $this->birthDate;\n\t\t$span = $birthDate->diff(new DateTime());\n\t\t$delimeter = \", \"; // string used to separate time span denominaotrs\n\t\t$output = false;\n\t\t\n\t\t$map = array(\n\t\t\t'years' => $span->y,\n\t\t\t'months' => $span->m,\n\t\t\t'days' => $span->d,\n\t\t\t'hours' => $span->h,\n\t\t\t'minutes' => $span->i,\n\t\t\t'seconds' => $span->s,\n\t\t);\n\t\t\n\t\t// parse the map array to format the time denominators for output\n\t\tforeach($map as $denominator=>$value) {\n\t\t\t// if the value for the denominator is 0 then skip it\n\t\t\tif ($value == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// if there is output already then add delimeter string\n\t\t\tif ($output) {\n\t\t\t\t$output .= $delimeter;\n\t\t\t}\n\t\t\t\n\t\t\t$output .= sprintf('%s %s',\n\t\t\t\t$value,\n\t\t\t\t$denominator\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "public function getDifferenceInYears();", "public function getageBu()\n {\n return $this->age_bu;\n }", "function ageCalculator($dob){\n if(!empty($dob)){\n $birthdate = new DateTime($dob);\n $today = new DateTime('today');\n $age = $birthdate->diff($today)->y;\n return $age;\n }else{\n return 0;\n }\n}", "function ageCalculator($dob)\n{\n\tif(!empty($dob))\n\t{\n\t\t$birthdate = new DateTime($dob);\n\t\t$today = new DateTime('today');\n\t\t$age = $birthdate->diff($today)->y;\n\t\treturn $age;\n\t}\n\telse\n\t{\n\t\treturn 0;\n\t}\n}", "public function getageBc()\n {\n return $this->age_bc;\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 GetAge($dob) \r\n\t\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t\t$dob=explode(\"/\",$dob); \r\n\t\t\t\t\t\t\t\t\t\t$curMonth = date(\"m\");\r\n\t\t\t\t\t\t\t\t\t\t$curDay = date(\"j\");\r\n\t\t\t\t\t\t\t\t\t\t$curYear = date(\"Y\");\r\n\t\t\t\t\t\t\t\t\t\t$age = $curYear - $dob[2]; \r\n\t\t\t\t\t\t\t\t\t\tif($curMonth<$dob[1] || ($curMonth==$dob[1] && $curDay<$dob[0])) \r\n\t\t\t\t\t\t\t\t\t\t\t$age--; \r\n\t\t\t\t\t\t\t\t\t\treturn $age; \r\n\t\t\t\t\t\t\t\t\t}", "static function calculateAge($birthDate) {\n if (empty($birthDate)) {\n return 0;\n }\n $birthDay = new DateTime($birthDate);\n $toDay = new DateTime(date('Y-m-d'));\n $dateDiff = $toDay->diff($birthDay);\n $age = $dateDiff->y;\n return $age;\n }", "function calcularIdade($birthDate){\n\n\t\t\t\t//explode the date to get month, day and year\n\t\t\t\t$birthDate = explode(\"/\", $birthDate);\n\n\t\t\t\t//get age from date or birthdate\n\t\t\t\t$age = (date(\"md\", date(\"U\", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date(\"md\") ? ((date(\"Y\") - $birthDate[2]) - 1) : (date(\"Y\") - $birthDate[2]));\n\t\t\t\treturn $age;\n\t\t}", "function age($date)\n{\n\t// PHP décompose la date saisie dans l'ordre défini\n list($annee, $mois, $jour) = explode ('/', $date);\n $TSN = strtotime($annee.\"/\".$mois.\"/\".$jour);\n $TS = strtotime(date(\"Y/m/d\"));\n\n $Age = ($TS-$TSN)/(365*3600*24);\n return round($Age);\n}", "public function get_age_text(): string;", "public function calcAgeDataProvider() {}", "function twig_age_filter($birthdate)\n{\n if (!$birthdate instanceof \\DateTime) $birthdate = new \\DateTime($birthdate);\n $age = $birthdate->diff(new \\DateTime())->y;\n\n return $age;\n}", "public function getDateOfBirth()\n {\n return $this->dateOfBirth;\n }", "public function getDateOfBirth()\n {\n return $this->dateOfBirth;\n }", "public function getBirth()\n {\n return $this->birth;\n }", "function getAge($dob) { \n $dob = explode(\"/\", $dob); \n $curMonth = date(\"m\");\n $curDay = date(\"j\");\n $curYear = date(\"Y\");\n // echo \"curYear: $curYear\";\n $age = $curYear - $dob[2]; \n if($curMonth<$dob[0] || ($curMonth==$dob[0] && $curDay<$dob[1])) \n $age--; \n return $age; \n}", "function Age ($date, $year = true, $month = false, $day = false)\r{\r\t$byear = substr ($date, 0, 4);\r\t$bmonth = substr ($date, 5, 2);\r\t$bday = substr ($date, 7, 2);\r\r\t$today = getdate();\r\t$tyear = $today['year'];\r\t$tmonth = $today['mon'];\r\t$tday = $today['mday'];\r\r\t$years = $tyear - $byear + ($bmonth > $tmonth ? -1 : 0);\r\t$months = $tmonth - $bmonth;\r\tif ($months < 0) $months += 12;\r\t$days = $tday - $bday;\r\tif ($days < 0) $months += 31;\r\r\tif ($year) $result = $years . ' years';\r\telse $months += 12 * $years;\r\r\tif ($month) $result .= ' ' . $months . ' months';\r\telse $days += $months * 31;\r\r\tif ($day) $result .= ' ' . $days . ' days';\r\r\treturn $result;\r}", "function dob2age($myTimestamp) {\n // Separate parts of DOB timestamp\n $matches = array();\n preg_match('/(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)/',\n $myTimestamp, $matches\n );\n //var_dump($matches);\n $dobYear = (int)$matches[1];\n $dobMonth = (int)$matches[2];\n $dobDay = (int)$matches[3];\n //echo \"DOB year=$dobYear month=$dobMonth day=$dobDay<br>\";\n\n $nowYear = (int)strftime('%Y');\n $nowMonth = (int)strftime('%m');\n $nowDay = (int)strftime('%d');\n //echo \"Now year=$nowYear month=$nowMonth day=$nowDay<br>\";\n // Calculate age\n if ($dobMonth < $nowMonth) {\n\n // Born in a month before this month\n $age = $nowYear - $dobYear;\n }\n elseif ($dobMonth == $nowMonth) {\n // Born in this month\n if ($dobDay <= $nowDay) {\n // Born before or on this day\n $age = $nowYear - $dobYear;\n }\n else {\n // Born after today in this month\n $age = $nowYear - $dobYear - 1;\n }\n }\n else {\n // Born in a month after this month\n $age = $nowYear - $dobYear - 1;\n }\n //echo \"age=$age years<br>\";\n return $age;\n }", "public function getAge(int $unit = self::AGE_SECONDS) : float {\n switch ($unit) {\n default:\n return $this->age;\n case self::AGE_MINUTES:\n return $this->age / 60;\n case self::AGE_HOURS:\n return $this->age / 60 / 60;\n case self::AGE_DAYS:\n return $this->age / 60 / 60 / 24;\n }\n }", "function age($naiss){\n list($y,$m,$d) = explode('-',$naiss);// list créer un tableau\n $diff = date('m') - $m;\n if( $diff < 0 ){\n //le mois de naissance de la personne n'est pas encore le bon, par rapport au mois en cours, donc elle \"perd\" 1an (y++)\n $y++;\n }elseif($diff == 0 && (date('d') - $d < 0)){\n $y++;\n }\n return date('Y') - $y;\n }", "public function getDateofBirth() {\n return $this->dateOfBirth;\n }", "public function getMaxAge()\n {\n\n }", "function calcAge($birthday)\n{\n\n \n if (strtotime($birthday)) {\n\n $birthday = date_parse($birthday);\n $currentDate = date_parse(date(\"Y-m-d\", time()));\n\n $year = $currentDate['year'] - $birthday['year'];\n $month = $currentDate['month'] - $birthday['month'];\n $day = $currentDate['day'] - $birthday['day'];\n\n if ($day < 0) {\n $day = 30 + $day;\n $month--;\n }\n\n if ($month < 0) {\n $month = 12 + $month;\n $year--;\n }\n\n return [\n 'year' => $year,\n 'month' => $month,\n 'day' => $day,\n ];\n\n }\n\n\n}", "function getYear()\r\n {\r\n return $this->ano;\r\n }", "public function getMaxAge()\n {\n return $this->maxAge;\n }", "public function getMaxAge()\n {\n return $this->maxAge;\n }", "public function getMaxAgeInDays() {\n\t\treturn $this->maxAgeInDays;\n\t}", "public function getMaxAge()\n\t{\n\t\treturn $this->maxage;\n\t}", "public function getBirthDate()\n {\n return $this->birth_date;\n }", "public function getMaxAge(): int {\n return $this->configuration['max_age'];\n }", "public static function getAge($date) {\r\n $d = new DateTime($date);\r\n $t = new DateTime(self::currentDateTime(self::datePattern));\r\n $interval = $t->diff($d);\r\n \r\n $years = $interval->format(\"%Y\");\r\n if($years == date(self::dateYear,time()))\r\n {\r\n return 0;\r\n }\r\n else\r\n {\r\n return $years;\r\n } \r\n }", "public function getMinAge()\n {\n return $this->minAge;\n }", "public function getMinAge()\n {\n return $this->minAge;\n }", "public function getBirthdate()\r\n {\r\n return $this->birthdate;\r\n }", "public function getBirthDate()\n {\n return $this->birthDate;\n }", "public function age($date){\n $date = str_replace(\"/\",\"-\",$date);\n $date = date('Y/m/d',strtotime($date));\n $today = date('Y/m/d');\n $age = $today - $date;\n return $age;\n}", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "function getAge($birthday)\n{\n if (strtotime($birthday)) {\n $date = new DateTime($birthday);\n $now = new DateTime();\n $interval = $now->diff($date);\n return $interval;\n }\n}", "function calculAge($date){\n\n$timestamp = strtotime($date); // en seconde\nreturn ceil((time() - $timestamp) / (60 * 60 * 24 * 365)); //calcul de l'age en arrondit\n}", "public function get_year_permastruct()\n {\n }", "public function checkAge()\n {\n Validator::extend('check_age', function ($attribute, $value, $parameters, $validator) {\n $request = app(\\Illuminate\\Http\\Request::class);\n $dob = $request->date_of_birth;\n $dobValue = explode('-', $dob);\n if ($dobValue[0] && $dobValue[1] && $dobValue[2]) {\n $today = new DateTime();\n $birthdate = new DateTime($dob);\n $interval = $today->diff($birthdate);\n $age = (int)$interval->format('%y');\n if ($age>=18) {\n return true;\n } else {\n return false;\n }\n }\n });\n }", "function age_to_birthdate($age)\n{\n $age_int = intval(trim((string)$age));\n $now = new \\DateTime();\n $bday = $now->sub(new \\DateInterval(\"P\" . $age_int . \"Y6M\"));\n return $bday->format(\\DateTime::ATOM);\n}", "public function getYear() {}", "public function getPasswordAge()\n {\n $date = \\MUtil_Date::ifDate(\n $this->_getVar('user_password_last_changed'),\n array(\\Gems_Tracker::DB_DATETIME_FORMAT, \\Gems_Tracker::DB_DATE_FORMAT, \\Zend_Date::ISO_8601)\n );\n if ($date instanceof \\MUtil_Date) {\n return abs($date->diffDays());\n } else {\n return 0;\n }\n }", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "function DetermineAgeGET_DOB_Prod ($YYYYMMDD_In) {\n $yIn=substr($YYYYMMDD_In, 0, 4);\n $mIn=substr($YYYYMMDD_In, 4, 2);\n $dIn=substr($YYYYMMDD_In, 6, 2);\n\n $ddiff = date(\"d\") - $dIn;\n $mdiff = date(\"m\") - $mIn;\n $ydiff = date(\"Y\") - $yIn;\n\n // Check If Birthday Month Has Been Reached\n if ($mdiff < 0)\n {\n // Birthday Month Not Reached\n // Subtract 1 Year From Age\n $ydiff--;\n } elseif ($mdiff==0)\n {\n // Birthday Month Currently\n // Check If BirthdayDay Passed\n if ($ddiff < 0)\n {\n //Birthday Not Reached\n // Subtract 1 Year From Age\n $ydiff--;\n }\n }\n return $ydiff;\n }", "public function getBirthDate()\n {\n return $this->birthDate;\n }", "public function getBirthdate(): DateTime\n {\n return $this->birthdate;\n }" ]
[ "0.81948006", "0.8007337", "0.79492533", "0.77728236", "0.7741789", "0.7667064", "0.75684774", "0.7524171", "0.7499724", "0.7499724", "0.7499724", "0.7499724", "0.7499724", "0.7499724", "0.7485814", "0.7448111", "0.744472", "0.7380098", "0.7378432", "0.73762304", "0.7349635", "0.7349635", "0.730962", "0.71918195", "0.71542495", "0.71336335", "0.71085024", "0.71085024", "0.70678085", "0.70629185", "0.7061338", "0.70463085", "0.69968206", "0.69687694", "0.69427156", "0.6869441", "0.6845518", "0.67825186", "0.6686117", "0.6680017", "0.66702336", "0.6638522", "0.66146946", "0.6603002", "0.6585859", "0.6570891", "0.6535822", "0.6502286", "0.64973104", "0.64692044", "0.64305335", "0.64297926", "0.6375563", "0.6353497", "0.6328894", "0.6328667", "0.6327538", "0.6324542", "0.6311637", "0.6300029", "0.6298438", "0.62836754", "0.6274817", "0.6262148", "0.6259348", "0.6259348", "0.62584984", "0.62442565", "0.62418115", "0.6210941", "0.6206546", "0.61764437", "0.61544394", "0.61480695", "0.61430633", "0.614233", "0.61193895", "0.61193895", "0.6113576", "0.61048806", "0.6082477", "0.6067824", "0.6050264", "0.60434264", "0.60434264", "0.603942", "0.60263896", "0.60195386", "0.6014877", "0.5994639", "0.5993057", "0.59729797", "0.59703547", "0.59629947", "0.5957536", "0.5951043", "0.5946366", "0.59461313", "0.594352", "0.5924912" ]
0.7745454
4
get the Patient full name return string (fname .lname)
public function fullName(){ $title = ($this->gender=='Male')? 'Mr.': 'Ms.'; return $title.' '.$this->fname. ' '. $this->lname ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFullname()\n {\n return $this->firstname . ' ' . $this->lastname;\n }", "public function getFullName(){\n\n return \"{$this->firstname}{$this->lastname}\";\n }", "public function getFullName()\n {\n return \"{$this->lastname} {$this->firstname} {$this->patronymic}\";\n }", "function getFullName()\n\t\t{\n\t\t\treturn $this->firstname.\" \".$this->lastname;\n\t\t}", "function getFullName()\n\t\t{\n\t\t\treturn $this->firstname.\" \".$this->Fname.\" \".$this->lastname;\n\t\t}", "function getFullName()\n\t\t{\n\t\t\treturn $this->firstname.\" \".$this->Fname.\" \".$this->lastname;\n\t\t}", "public function getFullName()\n {\n return \"{$this->first_name} {$this->last_name}\";\n }", "public function fullName()\n\t{\n\t\treturn \"{$this->first_name} {$this->last_name}\";\n\t}", "public function GetFullName()\n\t\t{\n\t\t\treturn $this->GetAttribute('first_name').' '.$this->GetAttribute('last_name');\n\t\t}", "public function getFullname() {\n return $this->getFirstName() . \" \" . $this->getLastName();\n }", "public function getFullname() {\n $fullname = sprintf(\n '%s %s',\n $this->getFirstname(),\n $this->getLastname()\n );\n\n return trim($fullname);\n }", "public function getFullName()\r\n\t{\r\n\t\treturn sprintf('%s %s', $this['firstName'], $this['lastName']);\r\n\t}", "function getFullName()\r\n\t{\r\n\t\treturn $this->getFirstName() . \" \" . $this->getLastName();\r\n\t}", "public function getFullName():string\n {\n return $this->firstName . \" \" . $this->lastName;\n }", "public function getFullName(){\n\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n\n return $first_name.' '.$last_name;\n }", "public function fullName()\n\t{\n\t\treturn trim(\"{$this->first_name} {$this->last_name}\");\n\t}", "private function make_full_name() {\n return $this->firstname . \" \" . $this->infix . \" \" . $this->lastname;\n }", "public function getFullName(): string\n {\n return sprintf('%s %s', $this->firstName, $this->lastName);\n }", "public function showfullname()\n {\n return $this->getFirstname() . ' ' . $this->getLastname();\n }", "public function getFullName() {\n return $this->firstname . ' ' . $this->lastname;\n }", "public function getFullName(): string\n {\n return sprintf('%s %s', $this->getGivenName(), $this->getLastname());\n }", "public function getFullName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function fullName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function fullName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function fullName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function fullName()\n {\n return $this->getAttribute('first_name').' '.$this->getAttribute('last_name');\n }", "public function getFullname()\n\t{\n\t\treturn $this->fullname();\n\t}", "protected function _getFullName()\n {\n return 'ID:'. $this->_properties['id'] . ' ' .\n\t\t$this->_properties['firstName'] . ' ' .\n $this->_properties['lastName'];\n }", "public function getFullname()\n {\n return $this->fullname;\n }", "public function getFullname()\n {\n return $this->fullname;\n }", "public function getFullName()\n\t{\n\t\treturn \"{$this->nombre} {$this->ape_p} {$this->ape_m}\";\n\t}", "public function getFullName()\n {\n return $this->firstName.' '.$this->lastName;\n }", "public function getFullNameShort() {\r\n $fullNameShort = $this->firstName .' '. $this->lastName;\r\n return $fullNameShort;\r\n }", "public function getFullName()\n {\n return $this->getFirstName().' '.$this->getLastName();\n }", "public function getFullName()\n {\n return $this->getFirstName().' '.$this->getLastName();\n }", "public function fullName()\n {\n return $this->forename.' '.$this->surname;\n }", "protected function _getRealName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function GetFullName()\n {\n return $this->firstname . \" \" . $this->lastname . \" (\" . $this->username . \")\";\n }", "public function getFullName()\n {\n return $this->firstName . ' ' . $this->lastName;\n }", "public function fullName()\n {\n if (isset($this->last_name)) {\n return $this->first_name . ' ' . $this->last_name;\n } else {\n return $this->first_name;\n }\n }", "public function getFullName()\n {\n return $this->getFirstName() . \" \" . $this->getLastName();\n }", "public function getFullNameWithLogin()\n\t{\n\t\treturn \"{$this->firstname} {$this->lastname} ({$this->login})\";\n\t}", "public function fullName() {\n return $this->getFirstName() . \" \" . $this->getLastName();\n }", "public function getFullname(): string;", "public function getFullNameAttribute() : string\n {\n if ($this->middle_initial) return $this->first_name . ' ' . $this->middle_initial . '. ' . $this->last_name;\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullname() {\n return $this->fullname;\n }", "public function fullName(){\n\t\treturn $this->first.' '.$this->last;\n\t}", "public function getFullName()\n {\n $fullName = $this->first_name . ' ' . $this->last_name;\n\n return $fullName;\n }", "public function getFullname()\n {\n $fullname = trim($this->getName().' '.$this->getLastName());\n return (!$fullname) ? $this->getEmail() : $fullname;\n }", "public function getFullName() {\n return $this->getFirstName() . ' ' . $this->getLastName();\n }", "public function get_fullname(){\n\t\treturn $this->_fullname;\n\t}", "public function getFullName(){\n\t\treturn $this->nombre.' '.$this->apellido;\n\t}", "public function getFullnameAttribute()\n {\n return $this->attributes['firstname'] . ' ' . $this->attributes['lastname'];\n }", "public function getFullnameAttribute()\n {\n return $this->attributes['firstname'] . ' ' . $this->attributes['lastname'];\n }", "public function getFullnameAttribute()\n {\n return $this->attributes['firstname'] . ' ' . $this->attributes['lastname'];\n }", "public function getFullNameAttribute(): string\n\t{\n\t\treturn implode_not_empty(' ', [$this->name, $this->last_name]);\n\t}", "public function getFullNameAttribute()\n {\n return \"{$this->last_name} {$this->first_name} {$this->middle_name}\";\n }", "public function getFullNameAttribute()\n {\n $implode = [];\n\n if ($this->salutation) {\n $implode[] = ucwords($this->salutation);\n }\n if ($this->first_name) {\n $implode[] = $this->first_name;\n }\n\n if ($this->last_name) {\n $implode[] = $this->last_name;\n }\n return implode(' ', $implode);\n }", "public function getFullNameAttribute()\n {\n return $this->getAttributeFromArray('first_name') . ' ' . $this->getAttributeFromArray('last_name');\n }", "public function getFullName() {\n $author = $this->getAuthor()->one();\n if ($author == null) {\n return null;\n }\n $this->firstName = $author->firstname;\n $this->lastName = $author->lastname;\n return $this->lastName . ' ' . $this->firstName;\n }", "public function getFullname()\r\n\t{\r\n\t\treturn $this->FullName;\t\t\r\n\t}", "public function getFullname() {\n return $this->getName();\n }", "public function getFullnameAttribute()\n {\n return \"{$this->lastname}, {$this->firstname} {$this->mi}\";\n }", "public function getFullNameAttribute()\n {\n return \"{$this->first_name} {$this->last_name}\";\n }", "public function getFullNameAttribute()\n {\n return \"{$this->first_name} {$this->last_name}\";\n }", "public function getFullNameAttribute()\n {\n return \"{$this->first_name} {$this->last_name}\";\n }", "public function getFullNameAttribute()\n {\n return \"{$this->last_name} {$this->first_name}\";\n }", "function getRHUL_FullName() {\n return getRHUL_FirstName() . \" \" . getRHUL_LastName();\n}", "public function getFullNameAttribute()\n {\n return $this->attributes['first_name'] . ' ' . $this->attributes['last_name'];\n }", "public function getName () {\n\n if( $this->first_name && $this->last_name ) {\n $fullName = $this->first_name.' '.$this->last_name;\n return $fullName;\n }\n\n if($this->first_name) {\n return $this->first_name;\n }\n // otherwise\n return null;\n }", "public function getFullNameAttribute()\n {\n return ucfirst($this->first_name).' '.ucfirst($this->last_name);\n }", "public function get_full_name()\n\t\t{\n\t\t\treturn $this->name().($this->suffix() ? '.'.$this->suffix():'');\n\t\t}", "public function getFullName()\n {\n if (! $this->_getVar('user_name')) {\n $name = ltrim($this->_getVar('user_first_name') . ' ') .\n ltrim($this->_getVar('user_surname_prefix') . ' ') .\n $this->_getVar('user_last_name');\n\n if (! $name) {\n // Use obfuscated login name\n $name = $this->getLoginName();\n $name = substr($name, 0, 3) . str_repeat('*', max(5, strlen($name) - 2));\n }\n\n $this->_setVar('user_name', $name);\n\n // \\MUtil_Echo::track($name);\n }\n\n return $this->_getVar('user_name');\n }", "public function name() {\r\n $name = $this->first_name . ' ' . $this->last_name;\r\n return $name;\r\n }", "public function getSpouseFullName()\n {\n return $this->getSpouseFirstName().' '.$this->getSpouseLastName();\n }", "protected function getFullNameAttribute()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullNameAttribute()\n {\n return preg_replace('/\\s+/', ' ', $this->firstname . ' ' . $this->middlename . ' ' . $this->lastname);\n }", "public function getFullName()\n\t{\n\t\t// but accessible using \"offsetGet()\" and \"offsetSet()\"\n\t\t// these two methods are the \"getter\" and \"setter\" for ArrayObject\n\t\treturn $this->offsetGet('firstName') \n\t\t\t . ' ' \n\t\t\t . $this->offsetGet('lastName');\n\t}", "public function getFullNameAttribute()\n {\n return $this->prename . ' ' . $this->lastname;\n }", "public function getUserFullName() {\n return $this->first_name . ' ' . $this->last_name;\n }", "function getStudentFullName() {\n\t\treturn Locale::translate('plugins.generic.thesis.studentFullName', array('lastName' => $this->getData('studentLastName'), 'firstName' => $this->getData('studentFirstName'), 'middleName' => $this->getData('studentMiddleName')));\n\t}", "public function getFullName()\n {\n return $this->fullName;\n }", "public function getName()\n {\n $result = null;\n if (isset($this->userInfo['first_name']) && isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['first_name'] . ' ' . $this->userInfo['last_name'];\n } elseif (isset($this->userInfo['first_name']) && !isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['first_name'];\n } elseif (!isset($this->userInfo['first_name']) && isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['last_name'];\n }\n return $result;\n }", "function getName(){\n\t\tglobal $_CON;\n\t\tglobal $userEIN;\n\t\t$sqlSearch = mysqli_query($_CON,\"SELECT teacher_fname, teacher_lname FROM teachers_table WHERE teacher_ein='$userEIN' \");\n\t\t$row = mysqli_fetch_array($sqlSearch);\n\t\t$fname = $row['teacher_fname'];\n\t\t$lname = $row['teacher_lname'];\n\t\t$fullname = \"$fname $lname\";\n\t\treturn $fullname;\n\t}", "public function getFullNameAttribute()\n {\n return $this->first.' '.$this->last;\n }", "public function getFullname(){\n\t \treturn $this->filename.'.'.$this->extension;\n\t }", "public function getShortName() {\n return trim(ucwords(trim($this->firstName)) . ' ' . strtoupper(substr(trim($this->lastName), 0, 1))) . '.';\n }", "public function fullName(){\n $fullName=parent::fullName();\n return $fullName.\", Policier \".$this->grade.\" <br/>\"; \n }", "public function getFullNameAttribute()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullNameAttribute()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullNameAttribute()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullNameAttribute()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "protected function helper_fullname_format() {\n\n $fake = new stdClass();\n $fake->lastname = 'LLLL';\n $fake->firstname = 'FFFF';\n $fullname = get_string('fullnamedisplay', '', $fake);\n if (strpos($fullname, 'LLLL') < strpos($fullname, 'FFFF')) {\n return 'lf';\n } else {\n return 'fl';\n }\n }", "public function name()\n {\n return $this->first_name .' ' .$this->last_name;\n }", "public function getShortName()\n {\n return trim($this->first_name . ' ' . ($this->last_name ? $this->last_name{0} . '.' : ''));\n }", "public function getFullNameAttribute(): ?string\n {\n $result = '';\n if (!empty($this->first_name)) {\n $result = $this->first_name;\n }\n if (!empty($this->last_name)) {\n if (strlen($result) > 0) {\n $result .= ' ';\n }\n $result .= $this->last_name;\n }\n\n return strlen($result) > 0 ? $result : null;\n }", "public function getGivenName(): string\n {\n return $this->export('GivenNamePart');\n }", "public function getDisplayName() {\r\n $displayName = $this->fname.' '.$this->lname;\r\n if(strlen($displayName) <= 1) {\r\n $displayName = explode('@',$this->email);\r\n return($displayName[0]);\r\n }\r\n return($displayName);\r\n }", "public function getShortName() {\r\n $displayName = $this->fname;\r\n if(strlen($displayName) <= 1) {\r\n $displayName = explode('@',$this->email);\r\n return($displayName[0]);\r\n }\r\n return($displayName);\r\n }" ]
[ "0.81022704", "0.8075574", "0.8052038", "0.8025944", "0.8014175", "0.8014175", "0.7943", "0.79390204", "0.78893054", "0.78847337", "0.788409", "0.78804046", "0.78659165", "0.7848581", "0.7846206", "0.78433394", "0.78234", "0.78224725", "0.7802384", "0.7787938", "0.7785376", "0.77797556", "0.77797556", "0.77740055", "0.77740055", "0.77740055", "0.77692324", "0.7744549", "0.77164674", "0.770597", "0.7672303", "0.7656744", "0.7651936", "0.76504236", "0.7646054", "0.7646054", "0.76453155", "0.7643867", "0.76389605", "0.76219046", "0.76181686", "0.76087946", "0.75944287", "0.7587779", "0.7580221", "0.7577669", "0.7566417", "0.7561772", "0.7558837", "0.7553313", "0.75527203", "0.75465024", "0.75225174", "0.7477736", "0.7477736", "0.7477736", "0.7462072", "0.74608415", "0.74583906", "0.74402004", "0.74355", "0.7421459", "0.7406971", "0.74044365", "0.74026656", "0.74026656", "0.74026656", "0.7384786", "0.7384376", "0.7373274", "0.73466384", "0.73318624", "0.73214144", "0.732066", "0.72984564", "0.7274158", "0.7264469", "0.7249767", "0.7248978", "0.72480583", "0.7247694", "0.7235748", "0.7221876", "0.72091454", "0.7195529", "0.71835953", "0.71774876", "0.7167243", "0.7161247", "0.7159906", "0.7159906", "0.7159906", "0.7159906", "0.7154853", "0.7153228", "0.71447146", "0.7142651", "0.7139571", "0.71300846", "0.7111965" ]
0.7740121
28
get the Patient Address
public function fullAddress(){ return ' '.$this->house. ' '. $this->address. ', '. $this->postcode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}", "public function getAddress()\n {\n \treturn $this->address;\n }", "public function getAddress(){\r\n\t\treturn $this->address;\r\n\t}", "public function getAddress()\n\t{\n\t\treturn $this->data['address'];\n\t}", "public function getAddress()\n {\n return $this->get('address')->value;\n }", "public function getaddress(){\n $address = $this->_run('getaddress');\n return $address;\n }", "public function getAddress() {}", "public function getAddress()\r\n {\r\n return $this->address;\r\n }", "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 getAdress()\n {\n return $this->adress;\n }", "public function getAdress()\n {\n return $this->adress;\n }", "public function getAddress()\n {\n return $this->address;\n }", "function address() { return ($this->address); }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n\t{\n\t\treturn $this->address;\n\t}", "public function getAddress()\n\t{\n\t\treturn $this->address;\n\t}", "public function getAddress();", "public function getAddress();", "public function getAddress() {\n //return the value address\n return $this->Address;\n }", "public function getAddress(): string\n {\n return $this->address;\n }", "public function getAddress() {\n return $this->address;\n }", "public function getAddress(): Address\n {\n return $this->address;\n }", "public function getAddress(): Address {\n return $this->address;\n }", "public function getAddress() {\n\t\treturn $this->address;\n\t}", "public function getAddress() {\n\t\treturn $this->address;\n\t}", "public function getApplicantAddressOne()\n {\n return $this->getProperty('applicant_address_one');\n }", "public function address(): string\n {\n return $this->address;\n }", "public function getAddress() {\n\n return $this->address;\n\n }", "public function getResidenceAddress()\n {\n return $this->residenceAddress;\n }", "public function getAddr()\n {\n $addr = new Application_Model_Impl_Addr();\n $addr\n ->setId(App_Formatting::emptyToNull($this->addrId->getValue()))\n ->setStreet(App_Formatting::emptyToNull($this->street->getValue()))\n ->setCity(App_Formatting::emptyToNull($this->city->getValue()))\n ->setState(App_Formatting::emptyToNull($this->state->getValue()))\n ->setZip(App_Formatting::emptyToNull($this->zip->getValue()))\n ->setParish(App_Formatting::emptyToNull($this->resideParish->getValue()));\n\n if ($this->_hasAptField) {\n $addr->setApt(App_Formatting::emptyToNull($this->apt->getValue()));\n }\n\n return $addr;\n }", "public function getAddress() {\n\t\t$address = current($this->getAddresses()->toArray());\n\t\treturn $address;\n\t}", "public function getAddress()\n {\n $address = null;\n if ($data = $this->getLocationData()) {\n $address = Address::create();\n $address->update($data);\n $address->ID = 0; //ensure not in db\n }\n\n return $address;\n }", "public function getAddress()\n {\n if (array_key_exists(\"address\", $this->_propDict)) {\n return $this->_propDict[\"address\"];\n } else {\n return null;\n }\n }", "public function getAddress1()\n {\n return parent::getValue('address1');\n }", "public function getAddressData()\n {\n return $this->address_data;\n }", "function getAddress($single){\n\t\t\t$list = $this -> makeRequest('GET', '/list', array(\n\t\t\t\t'password'=>$_SESSION['walletpass'],\n\t\t\t\t'confirmations'=>4\n\t\t\t\t));\n\n\t\t\tif($single){\n\t\t\t\treturn $list['addresses'][0]['address'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $list['addresses'];\n\t\t\t}\n\t\t}", "public function get_adresse();", "public function getAddr()\n {\n return $this->addr->getAddr();\n }", "public function getAddress():?string\n {\n return $this->address;\n }", "public function getApplicantAddressTwo()\n {\n return $this->getProperty('applicant_address_two');\n }", "public function address() {\n\t\treturn $this->has_one('Address');\n\t}", "public function getFormattedAddress()\n {\n return $this->formattedAddress;\n }", "public function getAddress(): ?string\n {\n return $this->address;\n }", "public function getAddress() {\n\t\t//return $this->findParentRow(new Model_DbTable_Address());\n\t\tif ($this->_address) { } else {\n\t\t\tforeach ($this->_rowset->getLoadRows(new Model_DbTable_Address(), 'address') as $row) {\n\t\t\t\tif ($row->id == $this->idAddress) {\n\t\t\t\t\t$this->_address = $row;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t }\n\t return $this->_address;\n\t}", "public function getAddress1()\n {\n return $this->fv_address1;\n }", "public function getAddress(){\n\t\treturn $this->sourceAddress;\n\t}", "public function getAddress1()\n {\n return $this->getValue('nb_icontact_prospect_address_1');\n }", "public function getFormattedAddress()\n {\n return $this->FormattedAddress;\n }", "public function getCorrespondentAddress() {\n\t\treturn self::$_correspondentAddress;\n\t}", "public function getBillingAddress();", "public function getBillingAddress();", "public function getAddress()\n {\n //Read it as select * from address, person where address.relatedmodel_id = person.id AND person.id = customer.person_id\n //Thus when via is used second param in the link correspond to via column in the relation.\n return $this->hasOne(Address::className(), ['relatedmodel_id' => 'id'])\n ->where('relatedmodel = :rm AND type = :type', [':rm' => 'Person', ':type' => Address::TYPE_DEFAULT])\n ->via('person');\n }", "public function getAddress()\n {\n return $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address;\n }", "public function getBillingAddress() : Address;", "public function getAddr()\n {\n return $this->addr;\n }", "public function getAddressNote()\n {\n return (string) $this->json()->address_note;\n }", "public function get_adresse()\n {\n return $this->_adresse;\n }", "public function getAddressAttribute()\n {\n return $this->addresses()->where('type', 'permanent')->first();\n }", "public function getAddr() : string\n {\n return $this->addr;\n }", "public function getAddress1()\n {\n return $this->address1;\n }", "public function getAddress1()\n {\n return $this->address1;\n }", "public function getAddress1()\r\n {\r\n return $this->_address1;\r\n }", "function viewAddress(){\r\n $payment = new managePaymentModel();\r\n $payment->cust_ID = $_SESSION['cust_ID'];\r\n return $payment->viewAddress();\r\n }", "public function getFullAddressAttribute(){\n\n \treturn \"{$this->street} {$this->number}. {$this->dept}{$this->floor} - ({$this->postal_code}). {$this->city} - {$this->country}\";\n }", "public function getAddress()\n {\n return $this->billingAddress;\n }", "public function getEventAddress() \n {\n return $this->_fields['EventAddress']['FieldValue'];\n }", "public function getAddress() {\n\t\t\t# Default StyleSheet\n\t\t\tif (! $_REQUEST[\"stylesheet\"]) $_REQUEST[\"stylesheet\"] = 'network.address.xsl';\n\t\t\t$response = new \\HTTP\\Response();\n\t\n\t\t\t# Initiate Domain Object\n\t\t\t$address = new \\Network\\IPAddress();\n\t\t\tif (! isset($_REQUEST['address'])) $this->error(\"address required\");\n\t\n\t\t\t$address->get($_REQUEST['address']);\n\t\n\t\t\t# Error Handling\n\t\t\tif ($address->error()) $this->error($address->error());\n\t\t\telseif ($address->id) {\n\t\t\t\t$response->address = $address;\n\t\t\t\t$response->success = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$response->success = 0;\n\t\t\t\t$response->error = \"Address not found\";\n\t\t\t}\n\t\n\t\t\tapi_log('network',$_REQUEST,$response);\n\t\n\t\t\t# Send Response\n\t\t\tprint $this->formatOutput($response);\n\t\t}", "public function getAdresse()\n {\n return $this->adresse;\n }", "public function getAdresse()\n {\n return $this->adresse;\n }", "public function getAddress()\n {\n return implode(' ', $this->address);\n }", "public function getAddressId() \n {\n return $this->address_id;\n }", "public function getFullAddressAttribute()\n {\n return $this->street.' '.$this->city.', '.$this->state.' '.$this->zipcode;\n }", "public static function getLoggedInUserFullAddress()\n {\n \t$userId = Auth::getUser()->ID;\n \t$user = self::select('address1','zip','city','state')->where('ID', $userId)->first();\n \t$address = str_ireplace(\" \",\"+\",$user->address1).',+'.$user->zip.',+'.str_ireplace(\" \",\"+\",$user->city).',+'.str_ireplace(\" \",\"+\",$user->state);\n \treturn $address;\n }", "public function getStreet();", "public function getUserAddress() {\n\t\treturn ($this->userStreet);\n\t}", "public function getFormatedAddress()\n\t{\n\t\tif (!$this->formatedAddress)\n\t\t{\n\t\t\t$this->formatAddress();\n\t\t}\n\n\t\treturn $this->formatedAddress;\n\t}", "public function getAddress() : ?string \n {\n if ( ! $this->hasAddress()) {\n $this->setAddress($this->getDefaultAddress());\n }\n return $this->address;\n }", "public function getAddress()\n {\n $cityName = '';\n $countryName = '';\n\n if (!empty($this->getCity())) {\n $cityName = $this->getCity()->getName();\n $countryName = $this->getCity()->getCountryName();\n }\n\n $address = array(\n $this->getStreet(),\n $this->getDistrict(),\n $this->getZipCode(),\n $cityName,\n $countryName\n );\n\n return implode(\", \", array_filter($address));\n }" ]
[ "0.74457544", "0.74345577", "0.74237263", "0.7400296", "0.7385982", "0.734468", "0.7312193", "0.7306137", "0.729366", "0.72571164", "0.72571164", "0.72482026", "0.7222612", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.7220979", "0.72095364", "0.72095364", "0.7209443", "0.7209443", "0.71969", "0.7178247", "0.71594024", "0.7152798", "0.71161187", "0.71111524", "0.71111524", "0.71014196", "0.704139", "0.7028999", "0.69789577", "0.6863392", "0.68606496", "0.67919314", "0.6782469", "0.67560244", "0.6709517", "0.66937333", "0.66883373", "0.663459", "0.66315913", "0.66044366", "0.6590814", "0.657473", "0.6563768", "0.6554894", "0.6550897", "0.65483564", "0.65338635", "0.65314627", "0.6519063", "0.6510903", "0.6510903", "0.64950746", "0.64926165", "0.6490221", "0.6477123", "0.6472036", "0.64670485", "0.64642614", "0.6464039", "0.6458113", "0.6458113", "0.6437779", "0.6434109", "0.6431007", "0.64243793", "0.6420768", "0.64145625", "0.641443", "0.641443", "0.640915", "0.64053106", "0.63901025", "0.6389209", "0.6388409", "0.63819504", "0.63816816", "0.6377141", "0.6356664" ]
0.6746702
56
return all appointments for today
public function todayAppointments(){ $today = Carbon::today()->format('Y-m-d'); //dd($today); return $this->appointments()->whereDate('date',$today)->orderby('date','asc'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAppointments()\n {\n $search['office'] = (auth()->user()->offices->count()) ? auth()->user()->offices->first()->id : '';\n\n $search['date1'] = isset($search['date1']) ? Carbon::parse($search['date1']) : '';\n $search['date2'] = isset($search['date2']) ? Carbon::parse($search['date2']) : '';\n \n $appointments = $this->appointmentRepo->findAllByDoctorWithoutPagination(request('medic'),$search);\n\n return $appointments;\n \n }", "public function getAllApp()\n {\n $sql = \"SELECT * FROM appointment\";\n $values=array();\n \n $ap=$this->getInfo($sql,$values);\n\n return $ap;\n }", "public function getAppointments()\n {\n return $this->hasMany(Appointment::className(), ['id' => 'id']);\n }", "public function getAppointments($id)\n {\n $search = request()->all();\n $search['date1'] = isset($search['date1']) ? Carbon::parse($search['date1']) : '';\n $search['date2'] = isset($search['date2']) ? Carbon::parse($search['date2']) : '';\n\n $appointments = $this->appointmentRepo->findAllByDoctorWithoutPagination($id, $search);\n \n return $appointments;\n \n }", "public function getAppointments(){\n\t\tif (Auth::user()->type==4) {\n\t\t\t# code...\n\t\t\treturn redirect()->back(); \n\t\t}\n\t\t$todays = $this->getTodayAppointments(); \n\t\treturn view('appointments.nurseAppointments',compact('todays'));\n\t}", "public function appointments()\n {\n return view('patient.pending-appointments');\n }", "public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$appointment = strtotime($participation->appointment); \n\t\t\tif ($appointment > strtotime('tomorrow') && $appointment <= strtotime('tomorrow + 1 day')) \n\t\t\t{\t\t\t\t\t\n\t\t\t\treset_language(L::DUTCH);\n\t\t\t\t\n\t\t\t\t$participant = $this->participationModel->get_participant_by_participation($participation->id);\n\t\t\t\t$experiment = $this->participationModel->get_experiment_by_participation($participation->id);\n\t\t\t\t$message = email_replace('mail/reminder', $participant, $participation, $experiment);\n\t\t\n\t\t\t\t$this->email->clear();\n\t\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $participant->email);\n\t\t\t\t$this->email->subject('Babylab Utrecht: Herinnering deelname');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}", "public function showAll() {\n return response()->json(Appointment::all());\n }", "public function datatables_all_appointments()\n {\n // $request = $client->get('https://acuityscheduling.com/api/v1/appointments');\n // $appointments = json_decode($request->getBody()->getContents());\n // echo '<pre>';\n // print_r($appointments);\n // exit;\n\n // DB::connection()->enableQueryLog();\n\n $appointments = Appointment::with('customer')\n ->where('acuity_action','scheduled') \n ->orderBy('appointment_date','desc')\n ->get();\n // $queries = DB::getQueryLog();\n // allQuery($queries);\n\n // die;\n\n return DataTables::of($appointments)\n ->addColumn('action', function ($appointment) {\n return '<a href=\"/appointments/'.$appointment->id.'/edit\"><i class=\"fa fa-pencil\"></i></a>';\n })\n ->make(true);\n }", "public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }", "public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }", "public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }", "public function viewappointments(){\n $appointments_table = TableRegistry::get('Appointments');\n $appointments = $appointments_table->find()->contain(['Users','Patients'])->order(['appointment_date'=>'DESC']);\n $this->set('appointments', $appointments);\n $this->viewBuilder()->setLayout('backend');\n }", "public function getTodayBookingList()\n {\n return DB::table('bookings')\n ->leftJoin('users', 'users.id', '=', 'bookings.user_id')\n ->leftJoin('rooms', 'rooms.id', '=', 'bookings.room_id')\n ->whereBetween('booking_time', [\n date('Y-m-d 00:00:01'),\n date('Y-m-d 23:59:59')\n ])\n ->select(\n 'bookings.booking_time', 'bookings.total_person', 'bookings.noted',\n 'users.id as user_id', 'users.email', 'rooms.room_name'\n )\n ->get()\n ->toArray();\n }", "private function getTodayAdvertisements() {\n \treturn AdvertisementQuery::create()\n\t\t\t\t->filterByCurrent()\n\t\t\t\t->filterByBillboard($this)\n\t\t\t\t->find();\n }", "public function todaySchedules(): HasMany\n {\n return $this->schedules()->whereDate('created_at', today());\n }", "function findAppointmentsDue(){\n\t$db = dbConnect();\n\n\t$sql = \"SELECT id FROM Appointment WHERE start_date > date_add(NOW(),INTERVAL 15 MINUTE) AND start_date <= date_add(NOW(),INTERVAL 30 MINUTE) AND status = 2 AND (type = 0 OR type = 1)\";\n\n\t$results = $db->query($sql);\n\n\treturn $results;\n}", "public function getTodayTimes()\n {\n return $this->get(self::_TODAY_TIMES);\n }", "public function getTodayTimes()\n {\n return $this->get(self::_TODAY_TIMES);\n }", "public function appointments(){\n return $this->hasMany(Appointment::class);\n }", "public function get_all_events()\n {\n // get today date for check past events or not\n $todayData = date(\"m/d/Y\");\n // get option from database\n $past_events_option = get_option('past_events');\n // preparing sql query\n $sql = \"SELECT * FROM $this->tableName \";\n if ($past_events_option != 'yes') {\n $sql .= \"WHERE `date` >= \" . $todayData;\n }\n global $wpdb;\n $allevents = $wpdb->get_results($sql);\n return $allevents;\n }", "function get_appointment_times($db, $appointments) {\n $unavailable_times = array();\n $available_times = array();\n foreach ($appointments as $appointment) {\n array_push($unavailable_times, date(\"Y-m-d H:i:s\", strtotime($appointment['appt_time'])));\n }\n foreach ($unavailable_times as $unavailable_time) {\n $possible_time = date(\"Y-m-d H:i:s\", strtotime($unavailable_time . \"+1 hour\"));\n if (!in_array($possible_time, $unavailable_times)) {\n array_push($available_times, $possible_time);\n }\n }\n return $available_times;\n}", "public function getAllUpcomingEvents()\n {\n return $this->createQueryBuilder('d')\n ->having('d.date >= :today')\n ->setParameter('today', date('Y-m-d'))\n ->orderBy('d.date', 'ASC')\n ->getQuery()\n ->getResult();\n }", "public function getCustomersNextDayAppointments($notificationType)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n $startCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(0, 0, 0)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $endCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(23, 59, 59)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n try {\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n a.zoomMeeting AS appointment_zoom_meeting,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.customFields AS booking_customFields,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingStart BETWEEN $startCurrentDate AND $endCurrentDate\n AND cb.status = 'approved'\n AND a.notifyParticipants = 1 AND\n a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_appointment_next_day_reminder' AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "function getAllAppointments(){\n global $db;\n $sql='SELECT firstname, lastname, date, time, location FROM `users`, `appointments` WHERE users.user_id = appointments.user_id ORDER BY date ASC';\n $statement = $db->prepare($sql); \n $statement->execute();\n $result = $statement->fetchAll();\n $statement->closeCursor();\n return $result; \n}", "public function actionIndex() {\n $searchModel = new AppointmentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "protected function getPendingAppointments($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n// $curr_date = date('Y-m-d H:i:s', time());\n// $curr_date_bfr_30min = date('Y-m-d H:i:s', time() - 1800);\n// $curr_date_bfr_1hr = date('Y-m-d H:i:s', time() - 3600);\n\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.status,a.booking_type from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.status = 1 and a.mas_id = '\" . $this->User['entityId'] . \"' order by a.appointment_dt DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"'\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0)\n return $this->_getStatusMessage(30, $selectAppntsQry);\n\n $pending_appt = array();\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pending_appt[] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'],\n 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('H:i', strtotime($appnt['appointment_dt'])),\n 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'], 'bookType' => $appnt['booking_type']);\n }\n\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'appointments' => $pending_appt); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }", "public function appointments()\n {\n //the relationship means that the class midwife can associate with many appointments\n return $this->hasMany(Appointment::class);\n }", "public function index()\n {\n $appointments = Appointment::all();\n return view('admin.appointments.index')->with([\n 'appointments' => $appointments\n ]);\n }", "function get_appointments($db) {\n $query = \"SELECT service_id, appt_time, cust_email, cust_comments from Appointments\";\n\n $statement = $db->prepare($query);\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\n $statement->closeCursor();\n return $result;\n}", "protected function getMasterAppointments($args) {\n\n if ($args['ent_appnt_dt'] == '' || $args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n $args['ent_appnt_dt'] = urldecode($args['ent_appnt_dt']);\n\n $dates = explode('-', $args['ent_appnt_dt']);\n\n if (count($dates) == 3) {\n $endDate = date('Y-m-d', strtotime('+7 day', strtotime($args['ent_appnt_dt'])));\n $selectStr = \" DATE(a.appointment_dt) between '\" . $args['ent_appnt_dt'] . \"' and '\" . $endDate . \"'\";\n } else {\n $args['ent_appnt_dt'] = $args['ent_appnt_dt'] . '-01';\n $endDate = date('Y-m-d', strtotime('+1 month', strtotime($args['ent_appnt_dt'])));\n $selectStr = \" YEAR(a.appointment_dt) = '\" . (int) $dates[0] . \"' and MONTH(a.appointment_dt) = '\" . (int) $dates[1] . \"'\";\n }\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appointment_id,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.drop_addr1,a.drop_addr2,a.drop_lat,a.drop_long,a.complete_dt,a.start_dt,a.arrive_dt,a.status,a.payment_status,a.amount,a.distance_in_mts,(select count(appointment_id) from appointment where status = 1 and mas_id = '\" . $this->User['entityId'] . \"') as pen_count from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.mas_id = '\" . $this->User['entityId'] . \"' and \" . $selectStr . \" and a.status NOT IN (1,3,4,5,10) order by a.appointment_id DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"' a.status NOT in (1,3,4,7) and\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0) {\n\n $selectPenCountQry = \"select count(*) as count from appointment where status = 1 and mas_id = '\" . $this->User['entityId'] . \"'\";\n $countArr = mysql_fetch_assoc(mysql_query($selectPenCountQry, $this->db->conn));\n $errMsgArr = $this->_getStatusMessage(30, 2);\n\n $date = $args['ent_appnt_dt'];\n\n while ($date <= $endDate) {\n\n $sortedApnts[] = array('date' => $date, 'appt' => array());\n $date = date('Y-m-d', strtotime('+1 day', strtotime($date)));\n }\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'penCount' => $countArr['count'], 'refIndex' => array(), 'appointments' => $sortedApnts, 't' => $selectAppntsQry);\n }\n\n $appointments = $daysArr = array();\n\n $pendingCount = 0;\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pendingCount = $appnt['pen_count'];\n\n $aptdate = date('Y-m-d', strtotime($appnt['appointment_dt']));\n\n $durationSec = (abs(strtotime($appnt['complete_dt']) - strtotime($appnt['start_dt'])) / 60);\n\n $durationMin = round($durationSec, 2);\n\n// if ($appnt['status'] == '1')\n// $status = 'Booking requested';\n// else if ($appnt['status'] == '2')\n// $status = 'Driver accepted.';\n// else if ($appnt['status'] == '3')\n// $status = 'Driver rejected.';\n// else if ($appnt['status'] == '4')\n// $status = 'You have cancelled.';\n// else if ($appnt['status'] == '5')\n// $status = 'Driver have cancelled.';\n// else\n if ($appnt['status'] == '6')\n $status = 'Driver is on the way.';\n else if ($appnt['status'] == '7')\n $status = 'Driver arrived.';\n else if ($appnt['status'] == '8')\n $status = 'Booking started.';\n else if ($appnt['status'] == '9')\n $status = 'Booking completed.';\n// else if ($appnt['status'] == '10')\n// $status = 'Booking expired.';\n else\n $status = 'Status unavailable.';\n\n $appointments[$aptdate][] = array('pPic' => $appnt['profile_pic'], 'email' => $appnt['email'], 'statCode' => $appnt['status'], 'status' => $status,\n 'fname' => $appnt['first_name'], 'apntTime' => date('h:i a', strtotime($appnt['appointment_dt'])), 'bid' => $appnt['appointment_id'], 'apptDt' => $appnt['appointment_dt'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'payStatus' => ($appnt['payment_status'] == '') ? 0 : $appnt['payment_status'],\n 'dropLine1' => urldecode($appnt['drop_addr1']), 'duration' => round($durationMin, 2), 'distance' => round($appnt['distance_in_mts'] / $this->distanceMetersByUnits, 2), 'amount' => $appnt['amount']);\n\n\n// $appointments[$aptdate][] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'], 'status' => $appnt['status'], 'pickupDt' => $appnt['arrive_dt'], 'dropDt' => $appnt['complete_dt'],\n// 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('h:i a', strtotime($appnt['appointment_dt'])),\n// 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n// 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'],\n// 'dropLine1' => urldecode($appnt['drop_addr1']), 'dropLine2' => urldecode($appnt['drop_addr2']), 'dropLat' => (double) $appnt['drop_lat'], 'dropLong' => (double) $appnt['drop_long'], 'duration' => $durationMin, 'distanceMts' => $appnt['distance_in_mts'], 'amount' => $appnt['amount']);\n }\n $refIndexes = $sortedApnts = array();\n $date = date('Y-m-d', strtotime($args['ent_appnt_dt']));\n\n while ($date < $endDate) {\n\n $empty_arr = array();\n\n if (is_array($appointments[$date])) {\n $sortedApnts[] = array('date' => $date, 'appt' => $appointments[$date]);\n $num = date('j', strtotime($date));\n $refIndexes[] = $num;\n } else {\n $sortedApnts[] = array('date' => $date, 'appt' => $empty_arr);\n }\n\n $date = date('Y-m-d', strtotime('+1 day', strtotime($date)));\n }\n//print_r($sortedApnts);\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'penCount' => $pendingCount, 'refIndex' => $refIndexes, 'appointments' => $sortedApnts); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }", "public function getAppointmentsList() {\nglobal $_LW;\ninclude $_LW->INCLUDES_DIR_PATH.'/core/modules/core/includes/class.livewhale_manager.php'; // include manager class\n$_LW->module='appointments';\n$GLOBALS['manager_appointments']=$_LW->showManager('<ul id=\"manager_appointments\" class=\"manager simple list-group\"/>', '<li id=\"item{id}\" class=\"{class} list-group-item\">\n\t{checkbox}\n\t<h5>{title}</h5>\n\t{appointments}\n</li>', 'managerQuery', 'formatManager');\nreturn $_LW->xphp->parseString('<xphp var=\"manager_appointments\"/>');\n}", "public function appointments(): HasMany\n {\n return $this->hasMany(Appointment::class);\n }", "public function getProvidersNextDayAppointments($notificationType)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n $startCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(0, 0, 0)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $endCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(23, 59, 59)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n try {\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n a.zoomMeeting AS appointment_zoom_meeting,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.customFields AS booking_customFields,\n cb.persons AS booking_persons, \n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingStart BETWEEN $startCurrentDate AND $endCurrentDate\n AND cb.status = 'approved' \n AND a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'provider_appointment_next_day_reminder' AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "function get_my_appointments() {\n global $conn;\n global $user;\n\n $statement = $conn->prepare(\"SELECT a.id, a.costumer, a.date, a.time, a.status, a.price AS totalPrice,\n b.appointment, b.service, \n c.price\n FROM appointments a, appointment_services b, services c\n WHERE a.costumer = ? AND b.appointment = a.id AND c.name = b.service\n ORDER BY a.id DESC\");\n $statement->execute([$user->id]);\n\n $rows = $statement->fetchAll();\n\n $appointments = [];\n\n foreach($rows as $row) {\n $actual = intval($row[\"id\"]);\n\n $appointments[$actual] = [\n \"id\" => $row[\"id\"],\n \"costumer\" => $row[\"costumer\"],\n \"date\" => $row[\"date\"],\n \"time\" => $row[\"time\"],\n \"status\" => $row[\"status\"],\n \"service\" => $row[\"service\"] . \", \" . (isset($appointments[$actual][\"service\"]) ? $appointments[$actual][\"service\"] : \"\"),\n \"price\" => intval($row[\"price\"]) + (isset($appointments[$actual][\"price\"]) ? intval($appointments[$actual][\"price\"]) : 0),\n \"totalPrice\" => intval($row[\"totalPrice\"])\n ];\n }\n \n foreach($appointments as $appointment) {\n echo '\n <tr>\n <th scope=\"row\">#'.$appointment[\"id\"].'</th>\n <td>'.substr($appointment[\"service\"],0,-2).'</td>\n <td>&euro; '. ($appointment[\"status\"] == \"Booked\" ? $appointment[\"price\"] : $appointment[\"totalPrice\"]).'</td>\n <td>'.$appointment[\"date\"].' - '.$appointment[\"time\"].'</td>\n <td>'.$appointment[\"status\"].'</td>\n </tr>\n ';\n }\n}", "public function actionIndex()\n {\n $searchModel = new TabelAppointmentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $appointmentList = $this->connection->getValue();\n foreach ($appointmentList as $key => $appointment) {\n # code...\n if(array_key_exists('approved', $appointment) && $appointment['approved'] == false){\n unset($appointmentList[$key]);\n }\n }\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'appointmentList' => $appointmentList\n ]);\n }", "public function show(Appointments $appointments)\n {\n //\n }", "public function getEventsByDay( $day ) {\n\n\t\t$rangestart = strtotime($day) * 1000; // zimbra always works with milliseconds in timestamps\n\t\t$rangeend = $rangestart + (24 * 60 * 60 * 1000);\n\n\t\t/**\n\t\t* build full call url\n\t\t*/\n\t\t$calendar = $this->getFromZimbra(\"/calendar?start=\" . $rangestart . \"&end=\" . $rangeend);\n\n\t\t$events = array();\n\t\tif( !property_exists($calendar, \"appt\") ) return $events;\n\n\t\tforeach ($calendar->appt as $meetingSeries) {\n\n\t\t\t/**\n\t\t\t* collect values for the current appointment\n\t\t\t*/\n\t\t\t$finalstartdate = null;\n\t\t\t$finalenddate = null;\n\t\t\t$finalname = null;\n\t\t\t$finallocation = null;\n\n\t\t\t/**\n\t\t\t* iterate over all sub events in order to find the right one\n\t\t\t* single events just have one item = easy, we just take this one\n\t\t\t* series of events contain the original item plus all execptions, more difficult to handle\n\t\t\t*/\n\t\t\tforeach ($meetingSeries->inv as $meeting) {\n\n\t\t\t\t$startdate = isset($meeting->comp[0]->s[0]->u) ? $meeting->comp[0]->s[0]->u : \"\";\n\t\t\t\t$enddate = isset($meeting->comp[0]->e[0]->u) ? $meeting->comp[0]->e[0]->u: \"\";\n\t\t\t\t$name = $meeting->comp[0]->name;\n\t\t\t\t$location = $meeting->comp[0]->loc;\n\n\t\t\t\t/**\n\t\t\t\t* we take the original, if nothing is set yet\n\t\t\t\t* the original events hold the time from the original day only, so we need to recalculate\n\t\t\t\t* since we are only getting the data from one day, we can kill the day information on extract the hours only\n\t\t\t\t*/\n\t\t\t\tif( $finalstartdate == null && !property_exists($meeting->comp[0], \"recurId\")) {\n\t\t\t\t\t$finalstartdate = date(\"Y-m-d\", $rangestart/1000) . \" \" . date(\"H:i\", $startdate / 1000);\n\t\t\t\t\t$finalenddate = date(\"Y-m-d\", $rangestart/1000) . \" \" . date(\"H:i\", $enddate / 1000);\n\t\t\t\t\t$finalname = $name;\n\t\t\t\t\t$finallocation = $location;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t* overwrite if got an exception of the series taking place on the current day\n\t\t\t\t*/\n\t\t\t\tif( property_exists($meeting, \"recurId\") &&\n\t\t\t\t\t($startdate <= $rangeend && $enddate >= $rangestart)) {\n\t\t\t\t\t$finalstartdate = date(\"Y-m-d H:i\", $startdate / 1000);\n\t\t\t\t\t$finalenddate = date(\"Y-m-d H:i\", $enddate / 1000);\n\t\t\t\t\t$finalname = $name;\n\t\t\t\t\t$finallocation = $location; \n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$events[]= array(\n\t\t\t\t\"name\" => $finalname,\n\t\t\t\t\"location\" => $finallocation,\n\t\t\t\t\"startdate\" => $finalstartdate, // timestamp has milli seconds as well\n\t\t\t\t\"enddate\" => $finalenddate\n\t\t\t);\n\t\t}\n\n\t\tusort($events, array(\"self\", \"cmp\"));\n\t\treturn $events;\n\t}", "public function index()\n {\n $patient = Patient::getAppointments(Auth::user()->id);\n return view('patient.appointment.index', compact('patient'));\n }", "public function today(Request $request)\n {\n $reservations = Reservation::query()\n ->whereDate('start_date', '<=', Carbon::now()->endOfDay())\n ->paginate();\n\n return $this->success($reservations);\n }", "public function index(Request $request)\n {\n if ($request->has('technician_id'))\n {\n $appointments = Appointment::where('technician_id',$request->technician_id)->get();\n foreach ($appointments as $ap)\n {\n $ap->user;\n\n }\n unset($ap);\n\n }else\n {\n $appointments = Appointment::where('user_id',$request->user_id)->get();\n }\n\n return response (['appointments' => AppointmentResource::collection($appointments), 'message' => 'Retrieved successfully'], 200);\n }", "function get_patient_queue()\n {\n return Appointments::whereStatus(2)->get();\n }", "public function testGetMessageListAppointments()\r\n\t{\r\n\t\t// Create an event to make sure we have at least one\r\n\t\t$obj = CAntObject::factory($this->dbh, \"calendar_event\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"My Test Event\");\r\n\t\t$obj->setValue(\"ts_start\", date(\"m/d/Y\") . \" 12:00 PM\");\r\n\t\t$obj->setValue(\"ts_end\", date(\"m/d/Y\") . \" 01:00 PM\");\r\n\t\t$eid = $obj->save();\r\n\r\n\t\t// Get events\r\n\t\t$events = $this->backend->GetMessageList(\"calendar_root\", time()); // second param cuts off to today\r\n\t\t$found = false;\r\n\t\tforeach ($events as $evt)\r\n\t\t{\r\n\t\t\tif ($evt[\"id\"] == $eid)\r\n\t\t\t\t$found = true;\r\n\t\t}\r\n\t\t$this->assertTrue($found);\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t}", "public function index()\n {\n $user = auth()->user();\n\n return view('appointments', compact('user'));\n }", "public function schedulingsDay(Request $request)\n {\n $date = $request->input('date_scheduling');\n $schedulings = Scheduling::where('date_scheduling', $date)->get();\n foreach ($schedulings as $value) {\n $value->room->local;\n }\n\n return SchedulingResource::collection($schedulings);\n }", "public function getFollowUpAppointments($notification)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n try {\n $notificationType = $notification->getType()->getValue();\n\n $currentDateTime = \"STR_TO_DATE('\" . DateTimeService::getNowDateTimeInUtc() . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingEnd BETWEEN DATE_SUB({$currentDateTime}, INTERVAL 172800 SECOND) AND {$currentDateTime}\n AND DATE_ADD(a.bookingEnd, INTERVAL {$notification->getTimeAfter()->getValue()} SECOND)\n < {$currentDateTime}\n AND a.notifyParticipants = 1 \n AND cb.status = 'approved' \n AND a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_appointment_follow_up' \n AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "public function today()\n {\n date_default_timezone_set(\"America/Bogota\");\n $date = date(\"Y-m-d\");\n $users = DB::table('reservas')\n ->orderBy(\"hora\",\"ASC\")\n ->join('usuarios', 'reservas.usuario', '=', 'usuarios.usuario')\n ->where('date',\"=\", $date)\n ->get();\n return $users;\n \n \n }", "public function getAgendaAlarmListAction(){\n /** @var Object_Agenda $agenda */\n $this->getDeviceSession()->getUserId();\n $agenda = new Object_Agenda();\n $this->_helper->json($agenda->getClass()->getFieldDefinition('Alarm'));\n }", "public function handleExistAppointments($id){\n\n $appointments = DB::table('medical_appointments')\n ->join('users', 'medical_appointments.user', '=', 'users.id')\n ->where('workplace',$id)->wheredate('when', '>', Carbon::today())\n ->select('medical_appointments.*', 'users.name', 'users.profile_photo')\n ->get();\n\n if(count($appointments) > 0){\n foreach($appointments as $app){\n $app->when;\n }\n return $appointments;\n } \n else{ \n return 'null';\n }\n }", "public function index()\n {\n //add a really old appointment\n $temp[] = \\Calendar::event(\n \"work\",\n false,\n \"1886-01-01T00:00:00\",\n \"1886-01-01T00:00:00\"\n );\n $calendar = \\Calendar::addEvents($temp)->setOptions(['firstDay' => 1])->setCallbacks([]);\n\n\n if(session(\"accountType\") == \"patient\"){\n return redirect(\"/patients/\".session('accountID'));\n }\n else if(session(\"accountType\") == \"doctor\"){\n $appointments = Appointment::where('doctor_id',session('accountID'))->get();\n // return $as;\n foreach($appointments as $appointment){\n $temp[] = \\Calendar::event(\n $appointment->event,\n false,\n $appointment->startTime,\n $appointment->endTime\n );\n $calendar = \\Calendar::addEvents($temp)->setOptions(['firstDay' => 1])->setCallbacks([]);\n }\n \n \n //$calendar = \\Calendar::addEvents($events2)->setOptions(['firstDay' => 1])->setCallbacks([]);\n return view('home', array('calendar'=>$calendar));\n }\n else if(session(\"accountType\") == \"nurse\"){ \n return redirect(\"/patients\");\n }\n // return redirect(\"/hospitals\");\n return view('home', array('calendar'=>$calendar));\n // return session('accountType');\n }", "public function index()\n {\n \n if(Auth::user()->getRoleNames()->first() == 'patient')\n {\n $dp = DB::table('appointments')->where('patient_id', Auth::user()->patient->id)->get();\n }\n else if(Auth::user()->getRoleNames()->first() == 'physician')\n {\n $dp = DB::table('appointments')->where('physician_id', Auth::user()->physician->id)->get();\n }\n else if(Auth::user()->getRoleNames()->first() == 'nurse')\n {\n $dp = DB::table('appointments')->where('nurse_id', Auth::user()->nurse->id)->get();\n }\n else{\n $dp = DB::table('appointments')->get();\n }\n $dp_obj = $dp->map(function ($element){\n $startdatetime = new Carbon($element->start_date_time);\n $enddatetime = new Carbon($element->end_date_time);\n $patient = Patient::find($element->patient_id)->user->name;\n $physician = Physician::find($element->physician_id)->user->name;\n $nurse = Nurse::find($element->nurse_id)->user->name;\n return [\n 'patient' => $patient, \n 'physician' => $physician,\n 'nurse' => $nurse,\n 'url' => url('admin/appointments'),\n 'id' => $element->id,\n 'exaroom' => $element->examinationroom,\n 'startdatetime' => $startdatetime->toDayDateTimeString(),\n 'enddatetime' => $enddatetime->toDayDateTimeString()\n ];\n });\n $physicians = Physician::all();\n $patients = Patient::all();\n $nurses = Nurse::all();\n return view('backend.appointments.index', compact('dp_obj', 'patients', 'physicians', 'nurses'));\n }", "public function indexAction()\n {\n return new ViewModel(array(\n 'title' => 'Appointments list',\n 'appointments' => $this->getAppointmentTable()->fetchAll(),\n ));\n }", "public function index()\n {\n return Calendar::all();\n }", "public function index()\n {\n $appointments = Appointment::with('doctor','patient')->paginate(25);\n\n return view('appointments.index', compact('appointments'));\n }", "public function getAppointmentsListJSON() {\nglobal $_LW;\n$output=[];\nforeach($_LW->dbo->query('select', 'id, title', 'livewhale_appointments', false, 'title ASC')->run() as $res2) { // loop through and add appointments\n\t$output[]=['id'=>$res2['id'], 'title'=>$res2['title']];\n};\nreturn json_encode($output);\n}", "public function todayTodo(): HasMany\n {\n return $this->hasMany(Todo::class)\n ->whereDate('created_at', today());\n }", "public function index()\n {\n \n return response(\n [\n 'error'=> false,\n 'data'=> SubscriptionAppointment::all()\n ]\n ,201);\n }", "public function index()\n {\n // Check and ensure we have run the appointment scraper at least once\n if(! Appointment::first()){\n Appointment::refreshAppointments();\n }\n return view('home');\n }", "public function index()\n {\n $models = Appointment::all();\n return view('appointment.index', compact('models'));\n }", "public static function get_view_all($today) {\n\t\t$today = date_create($today);\n\t\t$year = date_format($today, 'Y');\n\t\t$month = date_format($today, 'm');\n\t\t$date = date_format($today, 'd');\n\t\t// get week\n\t\t$book_view = BooksViewQModel::get_book_view_all($date, $month, $year);\n\t\tif ($book_view == null) {\n\t\t\t$week = null;\n\t\t} else {\n\t\t\t$week = $book_view->week;\n\t\t}\n\t\t// dd($week);\n\t\t$data['day']\t= [];\n\t\t$data['week']\t= [];\n\t\t$data['month']\t= [];\n\t\t$data['season']\t= [];\n\t\t$data['year']\t= [];\n\t\t// get view day all\n\t\tfor ($i = 0; $i < 7; $i++) { \n\t\t\t$data['day'][$i] = BooksViewQModel::get_book_view_day_all($i, $week, $month, $year);\n\t\t\tif ($data['day'][$i] == null)\n\t\t\t\t$data['day'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['day'][$i] = (int)$data['day'][$i]->view;\n\t\t}\n\t\t// get view week all\n\t\tfor ($i = 0; $i < 5; $i++) { \n\t\t\t$data['week'][$i] = BooksViewQModel::get_book_view_week_all($i, $month, $year);\n\t\t\tif ($data['week'][$i] == null)\n\t\t\t\t$data['week'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['week'][$i] = (int)$data['week'][$i]->view;\n\t\t}\n\t\t// get view month all\n\t\tfor ($i = 1; $i <= 12; $i++) { \n\t\t\t$data['month'][$i] = BooksViewQModel::get_book_view_month_all($i, $year);\n\t\t\tif ($data['month'][$i] == null)\n\t\t\t\t$data['month'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['month'][$i] = (int)$data['month'][$i]->view;\n\t\t}\n\t\t// get view season all\n\t\tfor ($i = 1; $i <= 4; $i++) { \n\t\t\t$data['season'][$i] = BooksViewQModel::get_book_view_season_all($i, $year);\n\t\t\tif ($data['season'][$i] == null)\n\t\t\t\t$data['season'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['season'][$i] = (int)$data['season'][$i]->view;\n\t\t}\n\t\t// get view year all\n\t\tfor ($i = 2012; $i <= 2019; $i++) { \n\t\t\t$data['year'][$i] = BooksViewQModel::get_book_view_year_all($i);\n\t\t\tif ($data['year'][$i] == null)\n\t\t\t\t$data['year'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['year'][$i] = (int)$data['year'][$i]->view;\n\t\t}\n\t\treturn $data;\n\t}", "public function all()\n {\n $appointments = Appointment::with('concern')->orderBy('appointment_at', 'asc')->get();\n $patients = Patient::all();\n $list = $patients->pluck('uniquePatient', 'id')->toArray();\n return view('Appointments.All', compact('appointments', 'list'));\n }", "public static function getInvoicesByAppointment(int $appId): array {\n $cols = implode(',', self::getColumns());\n $table = self::getTableName();\n $sql = \"SELECT $cols FROM $table WHERE appointment_id = :id\";\n $invs = array();\n $db = DBEngine::getInstance();\n try {\n $db->open();\n } catch (\\Exception $e) {\n return $invs;\n }\n $rows = $db->fetchAll($sql, array(':id' => $appId));\n $db->close();\n if ($rows) {\n foreach ($rows as $row) {\n $invs[] = self::createInstanceFromRow($row);\n }\n }\n return $invs;\n }", "public function getAppointmentsFromRange(\\DateTime $startDate, \\DateTime $endDate) {\r\n $appointmentsArray = array();\r\n\r\n foreach($this->appointments as $key => $appointment) {\r\n if($appointment->isInRange($startDate, $endDate)) {\r\n $appointmentsArray[] = $appointment;\r\n }\r\n }\r\n\r\n return $appointmentsArray;\r\n }", "function getMyAppointments ($user_id){\n global $db;\n $sql='SELECT firstname, lastname, date, time, location FROM `users`, `appointments` WHERE users.user_id = appointments.user_id AND users.user_id = ? ORDER BY date DESC';\n $statement = $db->prepare($sql);\n $statement->bindValue(1, $user_id); \n $statement->execute();\n $result = $statement->fetchAll();\n $statement->closeCursor();\n return $result; \n}", "function activity_apps(){\n\n // find out the activities of the current ssp year\n $activity_apps = $this->paginate('ActivityApp', array('ActivityApp.year'=>$this->__current_ssp_year()));\n $this->set(compact('activity_apps'));\n\n $departments = $this->Department->find('list', array('fields'=>array('id', 'abbr'), 'order'=>'abbr asc'));\n $this->set(compact('departments'));\n }", "public function get_todays_available_slots()\n {\n return $this->db\n ->select([\n 'availability.*',\n 'appointments.doctor_id',\n 'appointments.patient_id',\n 'appointments.availability_id',\n 'appointments.status',\n 'users.first_name',\n 'users.last_name'\n ])\n ->join('users', 'users.id = availability.user_id', 'left')\n ->join('appointments', 'appointments.availability_id = availability.id', 'left')\n ->get_where('availability', [\n 'date' => date('Y-m-d'),\n 'availability_id' => NULL\n ]);\n }", "public function events()\n {\n if (!Sentry::check()) {\n // User is not logged in, or is not activated\n return Redirect::route('landing');\n } else {\n // Gets all appointments from the school\n $user = Sentry::getUser();\n\n // Check if user is superAdmin\n if ($user->hasAccess('school')) {\n $appointments = Appointment::get()->load('group.school')->toArray();\n // Returns JSON response of the user\n return Response::json($appointments)->setCallback(\n Input::get('callback')\n ); //return View::make('calendar.events');\n\n } else {\n // If user is not superAdmin, show groups based on the school of the logged in user\n $user->load('school.groups.appointments.group.school');\n $appointments = [];\n\n // Loop through groups to get all appointments\n foreach ($user->school->groups as $group) {\n foreach ($group->appointments as $appointment) {\n array_push($appointments, $appointment);\n }\n }\n // Returns JSON response of the user\n return Response::json($appointments)->setCallback(Input::get('callback'));\n }\n }\n }", "public function index(Request $request,$companyID)\n {\n// dd(Carbon::now()->toDateTimeString());\n $appointments = $this->appointmentRepository->with([\n 'user','service',\n 'timing','employee',\n ])->where('company_id',$companyID)->orderBy('date','desc');\n if($request->type == 'past') {\n $appointments->where('date','<',Carbon::now()->toDateTimeString());\n } elseif($request->type == 'all') {\n // dont run query, (will output all the records)\n } else {\n $appointments->where('date','>',Carbon::now()->toDateTimeString())->orderBy('date','asc');\n }\n $appointments = $appointments->get();\n $company = $this->companyRepository->model->find($companyID);\n return view('admin.module.company.appointment.index',compact('appointments','company'));\n }", "public function getAppointments ($id){\n $appointmentRequest = AppointmentRequest::where('id',$id)->first();\n $appointmentRequestId=$id;\n $parentId = $appointmentRequest->parent_id;\n //Retrieve parent and student details corresponding to the appointment request\n $parentDetails = UserDetails::where('user_id',$parentId)->first();\n $parentName = $parentDetails->name;\n $parentContact = $appointmentRequest->parentContact;\n $studentDetails = Student::where('parent_id',$parentId)->first();\n $studentId = $studentDetails->id;\n $studentName = $studentDetails->name;\n $gradeId = $studentDetails->grade_id;\n $gradeDetails = Grade::where('id',$gradeId)->first();\n $gradeName = $gradeDetails->grade_name;\n $reasonOfAppointment = $appointmentRequest->reasonOfAppointment;\n $cancellationReason = $appointmentRequest->cancellationReason;\n $requestType = $appointmentRequest->requestType;\n if($requestType == \"Parent Request\")\n $requestedBy = \"Parent\";\n else\n $requestedBy = \"You\";\n //Retrieve appointment slot corresponding to the appointment request\n $slotId=$appointmentRequest->teacherAppointmentsSlot_id;\n $slot = TeacherAppointmentSlots::where('id',$slotId)->first();\n $booked= $slot->isBooked;\n $awaited = $appointmentRequest->isAwaited;\n $confirmed = $appointmentRequest->isApproved;\n $cancelled = $appointmentRequest->isCancel;\n if ($awaited==1 && $confirmed==0 && $cancelled==0){\n $status = \"Awaited\";\n }\n elseif ($awaited==0 && $confirmed==1 && $cancelled==0){\n $status = \"Confirmed\";\n }\n elseif($awaited==0 && $confirmed==0 && $cancelled==1) {\n $status=\"Cancelled\";\n }\n else{\n $status = \"Invalid Status\";\n }\n //Retrieve appointment event corresponding to the appointment slot\n $eventId = $slot->calendarEventsId;\n $event = CalendarEvent::where('id',$eventId)->first();\n $title=$event->title;\n $start=$event->start;\n $end=$event->end;\n $teacherId = $appointmentRequest->teacher_id;\n $contactNo = $appointmentRequest->contactNo;\n $appointmentDetails= array(\n 'requestId' => $appointmentRequestId,\n 'parentName'=>$parentName,\n 'parentContact'=>$parentContact,\n 'studentId'=>$studentId,\n 'studentName'=>$studentName,\n 'grade'=>$gradeName,\n 'eventId'=>$eventId,\n 'title'=>$title,\n 'reasonOfAppointment'=>$reasonOfAppointment,\n 'cancellationReason'=>$cancellationReason,\n 'start'=>$start,\n 'end'=>$end,\n 'requestedBy'=>$requestedBy,\n 'status'=>$status,\n 'contact'=>$contactNo,\n 'teacherId'=>$teacherId\n );\n return $appointmentDetails;\n }", "public function index()\n {\n $user = Auth::user();\n\n $data = array();\n // Agenda 時間区切り\n $timeDelemiter = $user->clinic->appointmentTableSetting->time_delimiter;\n // デフォルト\n if (empty($timeDelemiter)) {\n $timeDelemiter = 30;\n }\n $data['slotDuration'] = Carbon::createFromTime(0, $timeDelemiter, 0)->toTimeString();\n\n // 昼休み\n $lunchbreaks = $user->clinic->clinicLunchbreak;\n $lunchbreaksTimes = $lunchbreaks->times;\n $data['holidaysForLunchbreak'] = array();\n $data['timesLunchbreak'] = array();\n\n // Business Hours(週)\n $data['businessHours'] = array();\n\n $baseStart = $user->clinic->clinicTime->base['start'];\n $baseEnd = $user->clinic->clinicTime->base['end'];\n\n // デフォルト\n if (empty($baseStart)) {\n $baseStart = '09:00';\n }\n if (empty($baseEnd)) {\n $baseEnd = '19:00';\n }\n\n $minTime = Carbon::createFromTimeString($baseStart);\n $maxTime = Carbon::createFromTimeString($baseEnd);\n\n $times = $user->clinic->clinicTime->times;\n if (!empty($times) && count($times) > 0) {\n $weekNumbers = array('sun' => 0, 'mon' => 1, 'tue' => 2, 'wed' => 3, 'thu' => 4, 'fri' => 5, 'sat' => 6);\n foreach ($weekNumbers as $key => $value) {\n $time = $times[$key];\n if (!empty($time['start']) && !empty($time['end'])) {\n $data['businessHours'][] = array(\n 'dow' => [$value],\n 'start' => $time['start'],\n 'end' => $time['end']\n );\n\n $minTime = $minTime->min(Carbon::createFromTimeString($time['start']));\n $maxTime = $maxTime->max(Carbon::createFromTimeString($time['end']));\n } else {\n $data['businessHours'][] = array(\n 'dow' => [$value],\n 'start' => $baseStart,\n 'end' => $baseEnd\n );\n }\n\n // お昼休み\n $lunchtime = $lunchbreaksTimes[$key];\n if (!empty($lunchtime['start']) && !empty($lunchtime['end'])) {\n $data['timesLunchbreak'][$value]['start'] = $lunchtime['start'];\n $data['timesLunchbreak'][$value]['end'] = $lunchtime['end'];\n } else {\n $data['timesLunchbreak'][$value]['start'] = $lunchbreaks->base['start'];\n $data['timesLunchbreak'][$value]['end'] = $lunchbreaks->base['end'];\n }\n }\n } else {\n $data['businessHours'][] = array(\n 'dow' => [0, 1, 2, 3, 4, 5, 6],\n 'start' => $baseStart,\n 'end' => $baseEnd\n );\n }\n\n // Min Time, Max Time\n $data['minTime'] = $minTime->subHours(2)->format('H:00:00');\n $data['maxTime'] = $maxTime->addHours(2)->format('H:00:00');\n\n // ユニット\n $unitNumber = $user->clinic->unit_number;\n // デフォルト\n if (empty($unitNumber)) {\n $unitNumber = 3;\n }\n\n $displayUnitNumber = $user->clinic->appointmentTableSetting->display_unit_number;\n $unitNames = explode(',', $user->clinic->appointmentTableSetting->unit_names);\n\n // デフォルト\n if (empty($displayUnitNumber)) {\n $displayUnitNumber = $unitNumber;\n }\n if (empty($user->clinic->appointmentTableSetting->unit_names)) {\n $unitNames = array();\n }\n\n $resources = array();\n if (count($unitNames) >= $displayUnitNumber) {\n $resources = array_slice($unitNames, 0, $displayUnitNumber);\n } else {\n $resources = $unitNames;\n for ($i = count($unitNames) + 1; $i <= $displayUnitNumber; $i++) {\n $resources[] = 'ユニット' . $i;\n }\n }\n\n $data['resources'] = array();\n for ($i = 0; $i < count($resources); $i++) {\n $resource = array(\n 'id' => $i,\n 'title' => $resources[$i]\n );\n if ($i >= $unitNumber) {\n $resource['businessHours'] = array(\n 'start' => '00:00',\n 'end' => '00:00',\n );\n }\n $data['resources'][] = $resource;\n }\n\n\n $events = array();\n\n // 休診日\n $holidays = $user->clinic->clinicHolidays;\n foreach ($holidays as $holiday) {\n // Month View\n $monthEvent = array();\n $monthEvent['title'] = config('const.holiday.' . $holiday->type . '.title');\n $monthEvent['start'] = $holiday->start;\n $monthEvent['color'] = config('const.holiday.' . $holiday->type . '.color');\n $monthEvent['editable'] = false;\n $events[] = $monthEvent;\n\n // Agenda View\n $agendaEvent = array();\n $start = new Carbon($holiday->start);\n\n // 午前休、午後休みの終了、開始時間の取得\n $amMax = $lunchbreaks->base['end'];\n $pmMin = $lunchbreaks->base['start'];\n if (count($lunchbreaks->times) > 0) {\n $week = strtolower($start->format('D'));\n if (!empty($lunchbreaks->times[$week]['start']) && !empty($lunchbreaks->times[$week]['end'])) {\n $amMax = $lunchbreaks->times[$week]['end'];\n $pmMin = $lunchbreaks->times[$week]['start'];\n }\n }\n\n switch ($holiday->type) {\n case config('const.holiday.full.key'):\n $agendaEvent['start'] = $start->format('Y-m-d 00:00:00');\n $agendaEvent['end'] = $start->format('Y-m-d 23:59:59');\n break;\n case config('const.holiday.am.key'):\n $agendaEvent['start'] = $start->format('Y-m-d 00:00:00');\n $agendaEvent['end'] = $start->format('Y-m-d ' . $amMax . ':00');\n break;\n case config('const.holiday.pm.key'):\n $agendaEvent['start'] = $start->format('Y-m-d ' . $pmMin . ':00');\n $agendaEvent['end'] = $start->format('Y-m-d 23:59:59');\n break;\n }\n $agendaEvent['backgroundColor'] = config('const.holiday.' . $holiday->type . '.color');\n $agendaEvent['rendering'] = 'background';\n $events[] = $agendaEvent;\n\n $data['holidaysForLunchbreak'][] = $start->format('Y-m-d');\n }\n\n // 予約\n $appointments = DB::table('appointments')\n ->join('patients', 'appointments.patient_id', '=', 'patients.id')\n ->join('treatments', 'appointments.treatment_id', '=', 'treatments.id')\n ->select(\n 'appointments.unit as resourceId',\n 'patients.name as title',\n 'appointments.start',\n 'appointments.end',\n 'treatments.color as backgroundColor',\n DB::raw(\"'#fff' as borderColor\"),\n DB::raw(\"'#212121' as textColor\")\n )\n ->where('appointments.clinic_id', '=', $user->clinic->id)\n ->get()->toArray();\n\n $data['appointments'] = array_merge($events, $appointments);\n\n\n return $data;\n }", "public function run()\n {\n DB::table('appointments')->insert([\n 'nameCustomer' => 'Francisco',\n 'emailCustomer' => '[email protected]',\n 'telephoneCustomer' => '9985043136',\n 'date' => date('Y-m-d', time()), \n 'time' => date('H:i:s', mktime(7,30,0)),\n 'companyId' => 1,\n 'branchOfficeId' => 1,\n 'created_at' => date('Y-m-d H:i:s', time()),\n 'updated_at' => date('Y-m-d H:i:s', time())\n ]);\n DB::table('appointments')->insert([\n 'nameCustomer' => 'Eduardo',\n 'emailCustomer' => '[email protected]',\n 'telephoneCustomer' => '9994994199',\n 'date' => date('Y-m-d', time()), \n 'time' => date('H:i:s', mktime(8,0,0)),\n 'companyId' => 1,\n 'branchOfficeId' => 2,\n 'created_at' => date('Y-m-d H:i:s', time()),\n 'updated_at' => date('Y-m-d H:i:s', time())\n ]);\n DB::table('appointments')->insert([\n 'nameCustomer' => 'Maria',\n 'emailCustomer' => '[email protected]',\n 'telephoneCustomer' => '9987340321',\n 'date' => date('Y-m-d', time()), \n 'time' => date('H:i:s', mktime(7,30,0)),\n 'companyId' => 2,\n 'branchOfficeId' => 3,\n 'created_at' => date('Y-m-d H:i:s', time()),\n 'updated_at' => date('Y-m-d H:i:s', time())\n ]);\n DB::table('appointments')->insert([\n 'nameCustomer' => 'Rosa',\n 'emailCustomer' => '[email protected]',\n 'telephoneCustomer' => '9981228714',\n 'date' => date('Y-m-d', time()), \n 'time' => date('H:i:s', mktime(8,0,0)),\n 'companyId' => 2,\n 'branchOfficeId' => 4,\n 'created_at' => date('Y-m-d H:i:s', time()),\n 'updated_at' => date('Y-m-d H:i:s', time())\n ]);\n }", "public function appointment()\n {\n return $this->hasMany('App\\Models\\Appointment');\n }", "public function showAllTrainingDays(Application $app)\n {\n $queryBuilder = $this->db->createQueryBuilder();\n $queryBuilder->select('*')\n ->from('Training_day');\n\n return $queryBuilder->execute()->fetchAll();\n }", "public function appointments()\n {\n return $this->belongsToMany('App\\Appointment', 'appointment_details', 'patient_id', 'appointment_id');\n }", "public function index()\n {\n $records = Record::all();\n $doctors = Doctor::all();\n $patients = Patient::all();\n return view('appointments.index', compact('records', 'doctors', 'patients'));\n }", "public function todayOn() {\n\t\t// Add all cron timestamp in $t\n\t\t$x = self::getCron();\n\t\t$t = [];\n\t\tforeach ($x['cron'] as $cron) {\n\t\t\tif ($cron['active']) $t[] = self::getNextCron($cron['raw']);\n\t\t}\n\t\t// Add all at events of type A in $t\n\t\t$x = shell_exec('atq');\n\t\tif (count($x) >= 1) {\n\t\t\t$x = explode(\"\\n\",trim($x));\n\t\t\tforeach ($x as $at) {\n\t\t\t\t$at = explode(\"\\t\", $at);\n\t\t\t\t$at[1] = str_replace(' www-data', '', $at[1]);\n\t\t\t\t$d = substr($at[1],0,-1);\n\t\t\t\tif (substr($at[1],-1) == 'A') { // type audio on\n\t\t\t\t\t$t[] = strtotime($d);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// get timestamp that fits in the next 24h\n\t\tif (count($t) >=1) {\n\t\t\t$t = min($t);\n\t\t\t\n\t\t\tif (($t > time()) && ($t <= time()+86400)) { // next cron is within the next 24hours\n\t\t\t\t$str = date(\"H:i\",$t);\n\t\t\t}\n\t\t\telse $str = \"--:--\";\n\t\t}\n\t\telse $str = \"--:--\";\n\t\tFlight::json(array('Time' => $str));\n\t}", "public function actionBookeddays(): array\n {\n $request = Yii::$app->request;\n\n if ($request->isPost) {\n return Appointments::getBookedDays($request->post('service_id'), $request->post('date'));\n }\n \n return [];\n }", "public function Upcoming() {\n return $this->get_all_events( 'start_date', 'ASC', true );\n }", "public function Appointment() {\n return $this->hasMany('App\\TIME');\n }", "public function getAll()\n {\n return\n DB::table('attendances')\n ->select(\n 'id',\n 'code',\n 'name',\n 'description',\n 'permit_code as permitCode'\n )\n ->where([\n ['tenant_id', $this->requester->getTenantId()],\n ['company_id', $this->requester->getCompanyId()]\n ])\n ->get();\n }", "public function index()\n\t{\n\t\t//\n\t\tif (Auth::user()->type==4 || Auth::user()->type==3) {\n\t\t\t# code...\n\t\t\treturn redirect()->back(); \n\t\t}\n\t\t//dd($this->getTodayAppointments());\n\t\t$todays = $this->getTodayAppointments(); \n\t\t$upcomings = $this->getUpcomingAppointments(); \n\t\t$availables = $this->getAvailableBookings(); \n\t\t//dd($availables);\n\t\treturn view('appointments.addAppointment',compact('todays','upcomings','availables'));\n\t}", "public static function getCalendarApplication();", "public function requestappointment() {\n return view('pages.appointment');\n }", "public function getAllEvents(){\n\t\t//$events = EventPage::get()->sort('Date', 'DESC')->limit(5);\n\t\t$limit = 10;\n\n\t\t$items = DataObject::get(\"EventPage\", \"Date > NOW()\", \"Date\", null, $limit);\n\t\treturn $items;\n\n\t}", "function getAppointments($disAccess){\n\t//echo \"<br>Get executed\";\n $db = dbConnect();\n\t\n\t// If disability access required\n\tif ($disAccess == 1){\n \t\t// Find appointments in future based on time and disability access\n \t \t$sql = \"SELECT Appointment.id, Appointment.start_date, Dentist.id AS 'dentist_id', Dentist.rating, Practice.lat, Practice.lng, Practice.city AS 'practice_city'\n\t\t\t \tFROM Appointment \n\t\t\t\t\tINNER JOIN PracticeDentist\n\t\t\t\t\t\tON Appointment.practiceDentist_id = PracticeDentist.id\n\t\t\t\t\tINNER JOIN Practice\n\t\t\t\t\t\tON PracticeDentist.practice_id = Practice.id \n\t\t\t\t\tINNER JOIN Dentist\n\t\t\t\t\t\tON PracticeDentist.dentist_id = Dentist.id\t\n\t\t\t\tWHERE Appointment.dis_access = 1 AND Appointment.start_date > DATE_ADD(NOW(), INTERVAL 45 MINUTE) AND Appointment.timestamp <= NOW() AND Appointment.type = 0 AND (Appointment.status = 0 OR Appointment.status = 1)\";\n\t// if disability access not required\n\t} else { \n\t\t// Find appointments in future based on time and no disability access\n \t \t$sql = \"SELECT Appointment.id, Appointment.start_date, Dentist.id AS 'dentist_id', Dentist.rating, Practice.lat, Practice.lng, Practice.city AS 'practice_city'\n\t\t\t \tFROM Appointment \n\t\t\t\t\tINNER JOIN PracticeDentist\n\t\t\t\t\t\tON Appointment.practiceDentist_id = PracticeDentist.id\n\t\t\t\t\tINNER JOIN Practice\n\t\t\t\t\t\tON PracticeDentist.practice_id = Practice.id \n\t\t\t\t\tINNER JOIN Dentist\n\t\t\t\t\t\tON PracticeDentist.dentist_id = Dentist.id\n\t\t\t\tWHERE (Appointment.status = 0 OR Appointment.status = 1) AND Appointment.start_date > DATE_ADD(NOW(), INTERVAL 45 MINUTE) AND Appointment.timestamp <= NOW() AND Appointment.type = 0\";\n\t}\n // Execute Query\n $result = $db->query($sql);\n // Return Result Array \n return $result;\n}", "public function toArray($request)\n {\n return [\n 'id' => $this->id,\n 'day' => $this->day,\n 'from' => $this->from,\n 'to' => $this->to,\n 'payment_method' => $this->payment_method,\n 'payment_id' => $this->payment_id,\n $this->mergeWhen($request->route()->getName() == 'appointments.index', [\n 'bookings' => BookingResource::collection($this->bookings),\n ]),\n $this->mergeWhen($request->route()->getName() == 'appointments.show', [\n 'doctor' => new DoctorResource($this->doctor),\n 'clinic' => new ClinicResource($this->doctor->clinic),\n 'bookings' => BookingResource::collection($this->bookings),\n ]),\n $this->mergeWhen($request->doctors, [\n 'doctor' => new DoctorResource($this->doctor)\n ]),\n $this->mergeWhen($request->clinics, [\n 'clinic' => new ClinicResource($this->doctor->clinic)\n ])\n ];\n }", "public function All() {\n return $this->get_all_events( 'start_date', 'DESC', false );\n }", "public function getUpcoming() {\r\n \r\n $params = array(\r\n date(\"Y-m-d\"),\r\n date(\"Y-m-d\", strtotime(\"tomorrow\")),\r\n 0\r\n );\r\n \r\n $query = \"SELECT id FROM reminders WHERE reminder >= ? AND reminder < ? AND sent = ?\";\r\n \r\n foreach ($this->db->fetchAll($query, $params) as $row) {\r\n yield new Reminder($row['id']);\r\n }\r\n }", "public function getBookingsByDate(Request $request)\n {\n $booking_obj = new Booking();\n return $booking_obj->getFutureBookingsByServiceAndDate($request->sv_id, $request->start, $request->end);\n }", "public function index(Request $request)\n { \n $s = $request->input('s');\n\n $appointments = Appointment::search($s)->orderByDesc('data')\n ->paginate(10);\n \n return view ('help.appointment.home', compact('appointments', 's'));\n }", "public function today($where = []){\n return $this->where($where);\n }", "public function index()\n {\n $page_title = 'Appointments';\n $patient = PatientManager::getPatientData();\n $patientDetails = PatientManager::getPatientCheckupDetails();\n return view('Patients.appointment',compact('page_title',$page_title))->with('patient',$patient)->with('patientDetails',$patientDetails);\n }", "public function today()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array('categories', 'category_fields', 'custom_fields', 'member_data', 'pagination', 'trackbacks');\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'enable',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'allowed_values' => $disable\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Define parameters specific to this calendar view\n\t\t// -------------------------------------\n\n\t\t$this->P->set('date_range_start', $this->CDT->datetime_array());\n\t\t$this->P->set('date_range_end', $this->CDT->datetime_array());\n\t\t$this->P->set('pad_short_weeks', FALSE);\n\t\t$this->P->set('first_day_of_week', $this->first_day_of_week);\n\n\t\t// -------------------------------------\n\t\t// Define our tagdata\n\t\t// -------------------------------------\n\n\t\t$find = array(\t'EVENTS_PLACEHOLDER',\n\t\t\t\t\t\t'{/',\n\t\t\t\t\t\t'{',\n\t\t\t\t\t\t'}'\n\t\t\t\t\t\t);\n\t\t$replace = array(\tee()->TMPL->tagdata,\n\t\t\t\t\t\t\tLD.T_SLASH,\n\t\t\t\t\t\t\tLD,\n\t\t\t\t\t\t\tRD\n\t\t\t\t\t\t\t);\n\t\tee()->TMPL->tagdata = str_replace($find, $replace, $this->view('day.html', array(), TRUE, $this->sc->addon_theme_path.'templates/day.html'));\n\n\t\t// -------------------------------------\n\t\t// Tell TMPL what we're up to\n\t\t// -------------------------------------\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'events'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['events'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_hour'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_hour'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day'] = TRUE;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If you build it, they will know what's going on.\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}", "private function getUpcomingMeetingList($id) {\n $currentDate = new \\DateTime();\n\n $em = $this->getDoctrine()->getManager();\n\n $q = $em->createQuery(\"SELECT e \"\n . \"FROM \\Acme\\bsceneBundle\\Entity\\Meeting e \"\n . \"WHERE e.account = :id AND e.date >= :date \"\n . \"ORDER BY e.date ASC\")->setParameters(array('date' => $currentDate, 'id' => $id));\n $eventList = $q->getArrayResult();\n\n return $eventList;\n }", "public function show()\n {\n\n\n\n\n $myMeetings = MeetingAttendee::where('phonebook','=',0)\n ->where('attendee','=',\\Auth::user()->id)\n ->select('meeting')\n ->get();\n\n $myMeetingIds = array();\n\n foreach ($myMeetings as $myMeeting) {\n\n $myMeetingIds[] = $myMeeting->meeting;\n\n }\n\n $calendarMeetingsEvents = \\DB::table('calendar_events')\n ->join('calendar_events_type', 'calendar_events.event_type_id', '=', 'calendar_events_type.id')\n ->select(\n \\DB::raw(\"\n calendar_events.id,\n calendar_events.name,\n calendar_events.start_date,\n calendar_events.start_time,\n calendar_events.end_date,\n calendar_events.end_time,\n calendar_events_type.name as event_type\n \"\n\n )\n )\n ->where('calendar_events.event_type_id','=',1)\n ->whereIn('meeting_id',$myMeetingIds)\n ->groupBy('calendar_events.id')\n ->get();\n\n\n\n $calendarEventArray = array();\n $response = array();\n\n foreach ($calendarMeetingsEvents as $calendarMeetingEvent) {\n\n $calendarEventArray['title'] = $calendarMeetingEvent->start_time.'-'.$calendarMeetingEvent->name;\n $calendarEventArray['start'] = $calendarMeetingEvent->start_date.' '.$calendarMeetingEvent->start_time;\n $calendarEventArray['end'] = $calendarMeetingEvent->end_date.' '.$calendarMeetingEvent->end_time;\n $response[] = $calendarEventArray;\n\n\n }\n\n return \\Response::json($response);\n\n }", "public function patientAppointment() {\n $loggedUser = Sentinel::getUser();\n\n # Get the profile of the logged in User\n $profile = new UserProfile;\n $profile = $profile->find($loggedUser->id);\n\n # Some info of the logged in user\n $user = array(\"fullname\" => $profile->fullname, \"profile_type\" => $profile->profile_type);\n\n # Return all Doctors with their complete profile\n $users = new User();\n $users = $users::with('userProfile')\n ->whereHas('userProfile', function ($query) {\n $query->where('profile_type', '=', 'doctor');\n })->get();\n\n # All Appointment\n $userAppointment = Appointment::where('patient_id', '=', $loggedUser->id)->get();\n\n return view('Dashboard.patient.appointments', compact('user', 'users', 'userAppointment'));\n }", "public function getUpcomingEvents()\n {\n return EventQuery::create()->filterByDate(['min' => new DateTime()])->useEventPersonQuery()->useUserRoleQuery()->filterByUser($this)->endUse()->endUse()->distinct()->find();\n }", "public function retrieveAll($token,$counter)\n\t{\n\t\t# Get the cell number\n\t\t$vendor = new Vendor();\n\t\t$cell = $vendor->getCellNumber($token);\n\n\t\t$apointment = new Appointments();\n\t\treturn $apointment->retrieveAll($cell,$counter);;\n\t}", "public function index()\n {\n if(Auth::user()->mecano) {\n $calenderoffers = [];\n $events = [];\n\n $offres = DB::table('offreapplications')->where([['user_id', '=', Auth::user()->id], ['accepted', '=', 1]])->get();\n foreach ($offres as $offre) {\n $calenderoffer = DB::table('offres')->where('id', '=', $offre->offre_id)->first();\n if(!$calenderoffer->completed)\n array_push($calenderoffers, $calenderoffer);\n }\n\n foreach ($calenderoffers as $calenderofferfinal) {\n $event = \\Calendar::event(\n $calenderofferfinal->title, //event title\n false, //full day event?\n $calenderofferfinal->wanteddate, //start time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg)\n $calenderofferfinal->wanteddate, //end time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg),\n 1, //optional event ID\n [\n 'url' => 'http://laravel.dev/home'\n ]\n );\n\n array_push($events, $event);\n }\n\n $eloquentEvent = EventModel::first(); //EventModel implements MaddHatter\\LaravelFullcalendar\\Event\n\n $calendar = \\Calendar::addEvents($events); \n $calendar->setOptions([\n 'buttonText' => [ 'today' => 'Today', 'month' => 'Month', 'week' => 'Week', 'day' => 'Day', 'list' => 'List'],\n ]);\n\n return view('calender', compact('calendar'));\n\n } else {\n $calenderoffers = [];\n $events = [];\n\n $offres = DB::table('offres')->where('user_id', '=', Auth::user()->id)->get();\n foreach ($offres as $offre) {\n if(!$offre->completed) {\n $calenderoffer = DB::table('offreapplications')->where([['offre_id', '=', $offre->id], ['accepted', '=', 1]])->get();\n foreach ($calenderoffer as $calenders) {\n if($calenders->offre_id == $offre->id) {\n array_push($calenderoffers, $offre); \n }\n }\n }\n \n }\n\n foreach ($calenderoffers as $calenderofferfinal) {\n $event = \\Calendar::event(\n $calenderofferfinal->title, //event title\n false, //full day event?\n $calenderofferfinal->wanteddate, //start time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg)\n $calenderofferfinal->wanteddate, //end time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg),\n 1, //optional event ID\n [\n 'url' => 'http://laravel.dev/myoffers'\n ]\n );\n\n array_push($events, $event);\n }\n\n $eloquentEvent = EventModel::first(); //EventModel implements MaddHatter\\LaravelFullcalendar\\Event\n\n $calendar = \\Calendar::addEvents($events);\n $calendar->setOptions([\n 'buttonText' => [ 'today' => 'Today', 'month' => 'Month', 'week' => 'Week', 'day' => 'Day', 'list' => 'List'],\n ]);\n\n return view('calender', compact('calendar'));\n }\n }", "public function index()\n {\n \n $dia = date('d');\n $m = date('M');\n if ($m == 'Jan'){\n $mes='Enero';\n }else if ($m == 'Feb'){\n $mes='Febrero';\n }else if ($m == 'Mar'){\n $mes='Marzo';\n }else if ($m == 'Apr'){\n $mes='Abril';\n }else if ($m == 'May'){\n $mes='Mayo';\n }else if ($m == 'Jun'){\n $mes='Junio';\n }else if ($m == 'Jul'){\n $mes='Julio';\n }else if ($m == 'Aug'){\n $mes='Agosto';\n }else if ($m == 'Sep'){\n $mes='Septiembre';\n }else if ($m == 'Oct'){\n $mes='Octubre';\n }else if ($m == 'Nov'){\n $mes='Noviembre';\n }else if ($m == 'Dec'){\n $mes='Diciembre';\n }\n\n $anio = date('Y');\n $fecha = date('Y-m-d');\n $doctor = Auth::user()->id;\n if(Auth::user()->role == \"secretaria\"){\n $appointmentsB = Appointment::where(array('doctor_id'=>1,'date'=>$fecha))->orderBy('hour', 'asc')->get();\n $appointmentsS = Appointment::where(array('doctor_id'=>2,'date'=>$fecha))->orderBy('hour', 'asc')->get(); \n return view('home', compact('dia','mes','anio','fecha','appointmentsB','appointmentsS'));\n }else{\n $appointments = Appointment::where(array('doctor_id'=>$doctor,'date'=>$fecha))->orderBy('hour', 'asc')->get();\n return view('home', compact('dia','mes','anio','fecha','appointments'));\n }\n \n }" ]
[ "0.74740237", "0.71332127", "0.6835558", "0.6817955", "0.6792229", "0.6659481", "0.6588427", "0.65401274", "0.65291023", "0.6524496", "0.6524496", "0.6524496", "0.65140134", "0.65131205", "0.6485515", "0.6428696", "0.6383067", "0.6329027", "0.6329027", "0.6307852", "0.6284065", "0.62141144", "0.6204455", "0.6122234", "0.611205", "0.61080545", "0.6104663", "0.61029565", "0.60801166", "0.6066507", "0.60569745", "0.6032204", "0.6017653", "0.60083437", "0.59906745", "0.59839743", "0.5976091", "0.59652066", "0.5914823", "0.5903703", "0.58881074", "0.58856034", "0.587899", "0.5873339", "0.5866084", "0.5855243", "0.5849576", "0.58418137", "0.5836364", "0.5831918", "0.5831539", "0.5826016", "0.58164024", "0.5798314", "0.5768953", "0.57523113", "0.57462543", "0.573677", "0.5731106", "0.57111925", "0.5695622", "0.5673769", "0.56588346", "0.56509954", "0.5647229", "0.56415087", "0.563377", "0.5617882", "0.561555", "0.5613244", "0.55988425", "0.5597042", "0.5588937", "0.5587483", "0.55871284", "0.55779606", "0.55778086", "0.5570276", "0.55679667", "0.5560905", "0.55361956", "0.5525524", "0.55244917", "0.55145526", "0.5504509", "0.55029696", "0.54881257", "0.54788077", "0.5476536", "0.5473356", "0.54729176", "0.54670405", "0.54588413", "0.54524124", "0.5438537", "0.54305786", "0.54279447", "0.54193103", "0.54154193", "0.5414973" ]
0.74957526
0
Show all dogs Get a JSON representation of all the dogs
public function index(Request $request) { //kalau nak return all tanpa parameter //return $this->collection(Facility::all(), new FacilityTransformer); //kalau nak return ade filtering parameter if ($request->has('nama')||$request->has('negeri')||$request->has('daerah')||$request->has('type')) { return $this->collection(Facility::where('fac_name','LIKE',"%".$request->get('nama')."%") ->where('fac_state',$request->get('negeri')) ->where('fac_district',$request->get('daerah')) ->where('fac_category',$request->get('type')) ->get(), new FacilityTransformer); //return $this->collection(Facility::where('fac_name','HOSPITAL SULTAN ISMAIL, PANDAN')->get(), new FacilityTransformer); } else { return $this->collection(Facility::all(), new FacilityTransformer); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listDog()\n \t{\n \t\t$dogs = Dog::withoutGlobalScope(PriceScope::class)->whereBetween('price', [100, 2000])->get();\n \t\treturn view('exam.home',compact('dogs'));\t\n \t}", "public function getAllDogs(Request $request)\n {\n\n $request = Request::createFromGlobals();\n $page = $request->query->get('page');\n $limit = $request->query->get('limit');\n $all_info = $request->query;\n\n $sql = new Process($this->conn);\n $in = $sql->createInputs($all_info);\n $output = $sql->getAll($page, $limit, $in);\n\n return new JsonResponse(\n $output,\n 200\n );\n }", "public function dogs()\n {\n return $this->all(static::TYPE_DOG);\n }", "public function api_get_diets()\r\n {\r\n $this->layout = 'ajax';\r\n $this->render(false);\r\n\r\n header('Content-Type: application/json; charset=utf-8');\r\n $diets = $this->Diet->find('all');\r\n echo json_encode(array('diets' => $diets));\r\n\r\n\r\n die();\r\n }", "public function index()\n {\n return view('dog.index', ['dogs' => Dogs::all()]);\n }", "public function index()\n {\n // Display a listing of the resource.\n //$dogs = Dog::All();\n\n $dogs = Dog::orderBy('updated_at', 'des', 'id')->paginate(2);\n return view('courses.tests.dogs.index')->with('dogs', $dogs);\n }", "function getDrugs()\n {\n $request = \"SELECT * FROM DRUG\";\n DBConnexion::getInstance()->prepareAndExecuterQuerySelect($request, null);\n $response = DBConnexion::getInstance()->getResult();\n $drugs = new Drugs();\n foreach ($response as $resp) {\n $drug = new Drug(\n $resp['id'],\n $resp['title'],\n $resp['sub_name'],\n $resp['bar_code'],\n $resp['flash_code'],\n $resp['notice']\n );\n $drugs->addDrug($drug->toJson());\n }\n\n DBConnexion::getInstance()->destroyQueryResults();\n return $drugs->getDrugsToJson();\n }", "public function index(Request $request)\n {\n //to paginate the results\n //$dog = Dog::paginate(9);\n\n Log::info('Controller - dog index endpoint has been called.');\n $response = $this->dogService->index($request->user()->id);\n\n return Response::json([\n 'message' => $response->getMessage(),\n 'data' => $response->getData(),\n 'status_code' => $response->getStatusCode(),\n 'ok' => $response->getOk()\n ], $response->getStatusCode());\n }", "public function index()\n {\n return Breed::all();\n }", "public function index()\n {\n return Animal::all();\n }", "public function animals() {\n $fitting = Cage::fitting();\n $animals = Animal::all();\n return view('shop.animals', compact('animals'), compact('fitting'));\n }", "public function index()\n {\n\n $dados = Animal::all();\n\n return view('animal.list', compact('dados'));\n\n }", "public function index()\n {\n return response()->json(TagResource::collection(Tag::all()->load($this->relations)));\n }", "public function show(Request $request, $dog_id)\n {\n Log::info('Controller - dog show endpoint has been called.');\n $response = $this->dogService->show($request->user()->id, $dog_id);\n\n return Response::json([\n 'message' => $response->getMessage(),\n 'data' => $response->getData(),\n 'status_code' => $response->getStatusCode(),\n 'ok' => $response->getOk()\n ], $response->getStatusCode());\n }", "public function index()\n {\n $catg = new catg;\n return response()->json($catg->get());\n }", "public function index()\n {\n return json_encode(Ingredient::all());\n }", "public function index(){\n foreach($this->animals as $animal){\n echo \"$animal<br>\";\n };\n }", "public function index()\n\t{\n\t\treturn \\Response::json(Category::all());\n\t}", "public function listAction(): JsonResponse\n {\n $categories = $this->getDoctrine()->getRepository(Category::class)->findAll();\n\n $result = [];\n\n foreach ($categories as $category) {\n $result[] = [\n 'name' => $category->getName()\n ];\n }\n\n return new JsonResponse($result, Response::HTTP_OK);\n }", "public function index()\n {\n $dog_breeds = DogBreed::paginate(20);\n \n return view('manage_dog_breeds.index',compact('dog_breeds'))->with('i', (request()->input('page', 1) - 1) * 10);\n }", "public function listmydogsAction()\n {\n $user = $this->identity();\n $dogs = $this->getDogs($user->getUniquename());\n\n $messages = $this->messenger()->getMessages();\n $viewVars = array(\n 'user', \n 'dogs',\n 'messages',\n );\n\n return new \\Zend\\View\\Model\\ViewModel(compact($viewVars));\n }", "public function actionTags()\n {\n $tags = EntityUtil::toArray(TagDao::findAll(), true);\n echo json_encode($tags);\n }", "public function index()\n {\n $this->authorize('view', DishCategory::class);\n\n $dishCategories = DishCategory::all();\n return response()->json([\n 'dishCategories' => $dishCategories\n ], 200);\n }", "public function index()\n {\n $galleries = Gallery::with('images','user','comments')->paginate(10);\n\n return response()->json($galleries);\n }", "public function index()\n {\n $tags = Tag::all();\n return response()->json($tags, 200);\n }", "public function index()\n {\n return Drink::all();\n }", "public function all(): JsonResponse\n {\n $categories = Category::all();\n \n return response()->json(\n [\n 'categories' => $categories\n ],\n 200\n );\n }", "public function index()\n {\n $tags = Tag::withCount(['product', 'post'])->orderBy('title', 'ASC')->paginate(50);\n\n return response()->json([\n 'tags' => $tags,\n ]);\n }", "public function index()\n {\n $dogbreeds = Breed::with('breedgroup')\n ->join('breedgroups', 'breeds.breedgroup_id', '=', 'breedgroups.id')\n ->where('breedgroups.species', 'Dog')\n ->orderBy('breedgroups.displayorder', 'asc')\n ->orderBy('breeds.breedname', 'asc')\n ->get(array('breeds.*', 'breeds.id as breed_id', 'breedgroups.*'));\n \n $catbreeds = Breed::with('breedgroup')\n ->join('breedgroups', 'breeds.breedgroup_id', '=', 'breedgroups.id')\n ->where('breedgroups.species', 'Cat')\n ->orderBy('breedgroups.displayorder', 'asc')\n ->orderBy('breeds.breedname', 'asc')\n ->get(array('breeds.*', 'breeds.id as breed_id', 'breedgroups.*'));\n \n return view('breed.list')->with([\n 'dogbreeds' => $dogbreeds,\n 'catbreeds' => $catbreeds\n ]);\n }", "public function index()\n {\n return response()->json(Tag::all(), 200);\n }", "public function getDogs(Request $request)\n {\n $uri = $request->path();\n $menuItem = Menu::where('route', $uri)->first();\n $category = Category::where('menu_id', $menuItem->id)->first();\n return View::make('pages/animals')->with('category', $category);\n // ->with('orientation', 'right');\n }", "public function index(Dog $dog)\n {\n return view('pages.dogs.activities.index', compact('dog'));\n }", "public function index()\n {\n $category = $this->category->paginate(5);\n return response()->json($category, 200);\n }", "public function index()\n {\n return response()->json(Category::All(), 200);\n }", "public function index()\n {\n $recipes = Recipe::with([\n \"ingredientLists.ingredients\",\n \"ratings\",\n \"steps\",\n \"favorites\",\n \"tags\",\n \"user\",\n ])->get();\n return response()->json($recipes);\n }", "public function listuserdogsAction()\n {\n $user = $this->identity();\n $uniquename = $this->params()->fromRoute('uniquename');\n $dogs = $this->getDogs($uniquename);\n\n $viewVars = array(\n 'user', \n 'dogs',\n );\n\n return new \\Zend\\View\\Model\\ViewModel(compact($viewVars));\n }", "public function listing(){\n $categorias = Categoria::all();\n\n return response()->json(\n $categorias->toArray()\n );\n }", "public function index()\n\t{\n\t\t$budgets = Budget::all();\n\t\tforeach($budgets as $budget)\n\t\t{\n\t\t\t$budget->tag_name = $budget->tag()->name;\n\t\t}\n\t\treturn $this->jsonResponse($budgets);\n\t}", "public function getAllJson()\n {\n $response = new JsonResponse();\n $brands = Brand::orderBy(\"name\")->get();\n $response->setContent(json_encode($brands));\n return $response->send();\n }", "public function all()\n {\n return DogsGallery::where(\"found_by\", null)\n ->get()\n ->map->format();\n }", "public function dog($id)\n {\n return $this->get($id, static::TYPE_DOG);\n }", "function get_kelas1d_json() {\n header('Content-Type: application/json');\n echo $this->bagikelas_model->get_all_kelas1d();\n }", "public function index()\n {\n $allCategories = $this->category->allCategories()->toArray();\n return Response::json($this->categoryTransformer->transformCollection($allCategories));\n // return Response::json($allCategories);\n }", "public function index()\n {\n $category = Category::all();\n return response()->json($category);\n }", "public function index(Request $request)\n {\n //return categories of every drug\n $categories= Drug::select('category')->groupBy('category')->paginate(20);\n//link to get all drugs in it\n //\n foreach($categories as $cat)\n {\n\n $cat->href=$request->getUri().\"/category/\".preg_replace('/ /', \"%20\", $cat->category);\n }\n return response()->json($categories,200);\n\n }", "public function index()\n {\n $nds = Nds::all();\n\n return response()->json([\n 'nds' => $nds->toArray()\n ]);\n }", "public function index()\n {\n $categories = Category::all();\n return response()->json($categories);\n }", "public function index()\n {\n $category = Category::all();\n return response()->json($category, Response::HTTP_OK);\n }", "public function index()\n {\n //\n\n $categories = Categorie::all();\n return CategorieResource::collection($categories)->toJson(JSON_PRETTY_PRINT);\n\n }", "public function index()\n {\n $recipes = Recipe::all();\n return response()->json($recipes);\n }", "public function index()\n {\n $categories = Category::orderBy('id', 'desc')->get();\n return response()->json($categories);\n }", "public function list()\n {\n return response()->json(\n DrawResource::collection(Draw::all())\n );\n }", "public function index()\n {\n $animals = Animal::all();\n return view('animal.index', ['animals' => $animals]);\n }", "public function index()\n {\n $categories = Category::all();\n return response()->json($categories, 200);\n }", "public function index()\n {\n $db = Connection::get();\n $dishManager = new DishManager($db);\n\n if (isset($_GET[\"data\"]) && $_GET[\"data\"] === \"featureddishes\"){\n \n $list = $dishManager->getFeaturedList();\n $return = array();\n foreach ($list as $value) {\n $val = $value->objectToArray();\n $return[] = $val;\n }\n }\n\n echo json_encode($return);\n }", "public function index()\n {\n $categories = Category::all();\n\n return response()->json([\n $categories\n ]);\n }", "public function show(Dog $dog)\n {\n // return Dog::find($dog->id);\n // the better way\n return new DogResource($dog);\n }", "public function index()\n {\n $ingredients = Ingredient::all();\n return response()->json($ingredients);\n }", "public function index()\n {\n $doctors = Doctor::all();\n return response()->json([\"status\" => true, \"data\" => DoctorResource::collection($doctors)] , 200, [] , JSON_NUMERIC_CHECK);\n\n }", "public function getall() {\n\n\t\techo json_encode(array_merge($this->response, Person::getall()));\n\n\t}", "public function index()\n {\n return response()->json(new CategoryCollection(Category::all()), Response::HTTP_OK);\n }", "public function showAllDokter()\n {\n $dokter = Dokter::where('jabatan_id', '=', '4')->get();\n\n return view('dokter::index')\n ->with('dokters', $dokter)\n ->with('dokter', $dokter->first);\n }", "public function index()\n {\n //\n return Cat::all();\n }", "public function data()\n {\n return response()->json(Category::All(), 200);\n }", "public function index()\n {\n $breeds = Breed::all();\n return view ('breeds.index',compact('breeds',));\n }", "public function index()\n {\n foreach ($this->animals as $animal) {\n echo \"Nama Hewan : $animal[name] <br>\";\n }\n }", "public function index()\n {\n $tags = Tags::all()->sortByDesc('updated_at');\n $response = [\n 'status' => '200',\n 'message' => 'Ok',\n 'data' => TagsResource::collection($tags)\n ];\n return response()->json($response, 200);\n }", "public function index()\n\t{\n\t\treturn Response::json(Category::get());\n\t}", "function get_kelas4d_json() {\n header('Content-Type: application/json');\n echo $this->bagikelas_model->get_all_kelas4d();\n}", "public function index()\n\t{\n\t\tdd('Day la trang danh sach');\n\t\t// return Images::all()->toJson();\n\t\t// var_dump($images);\n\t}", "public function index()\n {\n //return Shoe_specific::all();\n $data = Shoe_specific::with(['shoe', 'color', 'size'])->paginate(6);\n return response()->json($data);\n }", "public function index()\n\t{\n\t\t$pokedex = json_decode(DB::table('Pokedex')->get(), true);\n\t\t$return = [\"pokemons\" => []];\n\n\t\tforeach ($pokedex as $respons) {\n\t\t\t$type1 = DB::table('Types')->where('id_pok', $respons['id_pok'])->value('type1');\n\t\t\t$type2 = DB::table('Types')->where('id_pok', $respons['id_pok'])->value('type2');\n\n\t\t\t$pokemon = (object) [\n\t\t\t\t\"id\" => $respons[\"id_pok\"],\n\t\t\t\t\"name\" => $respons[\"nom_pok\"],\n\t\t\t\t\"types\" =>\n\t\t\t\t[\n\t\t\t\t\t\"type1\" => $type1,\n\t\t\t\t\t\"type2\" => $type2\n\t\t\t\t],\n\t\t\t\t\"image\" => $respons[\"id_pok\"] . \".png\"\n\t\t\t];\n\t\t\tarray_push($return[\"pokemons\"], $pokemon);\n\t\t};\n\n\t\treturn response()->json($return, 200);\n\t}", "public function getIndex()\n\t{\n $drawings = Drawing::All();\n return Response::json([\n 'drawings' => $drawings->toArray()\n ]);\n\t}", "public function index()\n {\n $categories = Category::select('id', 'title', 'publish', 'created_at')->orderBy('created_at', 'DESC')->paginate(50);\n\n return response()->json([\n 'categories' => $categories\n ]);\n }", "public function index()\n {\n $categories = Category::all();\n return response()->json(['categories' => $categories],200);\n }", "public function index()\n {\n $categories = Category::all();\n\n return $this->jsonResponse('List categories', $categories);\n }", "public function index()\n {\n $categories = Category::orderBy('id', 'desc')\n ->get();\n\n // return new CategoryCollection($categories);\n return response()->json($categories);\n }", "function get_kelas1g_json() {\n header('Content-Type: application/json');\n echo $this->bagikelas_model->get_all_kelas1g();\n }", "public function index()\n {\n $request = app()->make('request');\n return response()->json([\n 'products' => $this->catProduct->paginate(\n $this->catProduct->where('id', $request->catId)\n ->relTable()\n ->first()\n ->products\n )\n ]);\n }", "public function index()\n {\n $list = Vacancy::with('images')->get();\n $status = '200';\n $data = compact('list', 'status');\n\n return response()->json($data);\n }", "public function show($id)\n {\n $response=Drug::select('active_ingredient','generic_name','price','image','category','form')->where('id',$id)->get();\n return response()->json($response,200);\n }", "public function showAll(): string{\n $json = $this->money->all();\n return json_encode($json);\n }", "public function list()\n {\n $categories = Category::select(['id', 'name'])->get();\n\n return response()->json(['categories' => $categories], 200);\n }", "public function index()\n {\n $adverts = Advert::all();\n $categories = Category::all();\n $products = Product::orderBy('updated_at', 'desc')->take(15)->get();\n return response()->json([\n \"adverts\" => $adverts,\n \"categories\" => $categories,\n \"products\" => $products\n ]);\n }", "public function tags()\n {\n $tags = Tag::all();\n\n return response()->json($tags);\n }", "public function index()\n {\n $data = $this->categoryRepo->all();\n return Response()->json($data);\n\n // return view('category.index')->with('data',$data);\n }", "public function dog()\n {\n return $this->hasMany('App\\Models\\Dog', 'size_id');\n }", "public function show($id)\n {\n return view(\n 'dog.show',\n [\n 'image' => Storage::url('puppy_test.jpeg'),\n 'dog' => Dogs::find($id),\n 'breeds' => Breeds::all(),\n 'genders' => Genders::all()\n ]\n );\n }", "public function showAllHotdrinks() {\n echo json_encode([\"MSG\" => $this->rest->showAllHotdrinks(), \"CODE\" => 200]);\n }", "public function index()\n {\n $categories = $this->categoryRepository->getAll();\n return response()->json([\n 'success' => true,\n 'message' => 'Category List',\n 'data' => $categories\n ]);\n }", "function get_kelas4g_json() {\n header('Content-Type: application/json');\n echo $this->bagikelas_model->get_all_kelas4g();\n}", "public function getMyDrinks(): JsonResponse\n {\n $user_id = Auth::user()->id;\n\n // TODO: Convert to Query Builder\n $my_drinks = DB::select(\"SELECT COUNT(ud.drink_id) AS total_consumed, SUM(d.caffeine_total) AS total_caffeine, d.name, ud.consumed_at FROM laravel.user_drinks ud INNER JOIN laravel.drinks d ON ud.drink_id = d.id INNER JOIN laravel.users u ON ud.user_id = u.id WHERE ud.user_id = ? GROUP BY u.name, d.name, ud.consumed_at ORDER BY ud.consumed_at DESC\", [$user_id]);\n\n return response()->json($my_drinks);\n }", "public function index()\n {\n $category = Category::all();\n\n $response = Response::json($category, 200);\n\n return $response;\n }", "public function index()\n {\n $categorias = Categoria::all();\n\n return response()->json(['categorias' => $categorias], 200);\n }", "public function index()\n {\n $districts= DB::table('districts')\n ->join('cities', 'districts.city_id', '=', 'cities.id')\n ->select('districts.*', 'cities.city')\n ->get();\n $cities=City::all();\n return response()->json(compact('cities','districts'));\n\n }", "function get_kelas5d_json() {\n header('Content-Type: application/json');\n echo $this->bagikelas_model->get_all_kelas5d();\n}", "public function index()\n {\n $personnes = Personne::orderByDesc('id')->get();\n return $personnes->toJson(JSON_PRETTY_PRINT);\n }", "public function listImage()\n {\n $data = Image::all();\n return response()->json($data);\n return $this->showAll($image);\n }", "public function index()\n {\n $items = Film::all();\n return response()->json($items);\n }", "public function index(): JsonResponse\n {\n $blogs = Blog::latest()->get();\n\n return response()->json($blogs);\n }", "public function index()\n {\n //\n $post = Post::query()->with(['categories' => function($CategoryQuery){\n $CategoryQuery;\n }])->paginate(10);\n\n return response()->json($post);\n }" ]
[ "0.7451124", "0.73499125", "0.72616845", "0.69289976", "0.67720056", "0.6748616", "0.6672904", "0.66431487", "0.6636841", "0.65981245", "0.6596574", "0.6482242", "0.644905", "0.6416991", "0.6376585", "0.63718206", "0.6348288", "0.6299913", "0.6276535", "0.62685317", "0.62659067", "0.6249272", "0.624764", "0.62397116", "0.62271", "0.62252533", "0.62065876", "0.61817497", "0.616862", "0.6164304", "0.61605304", "0.61598474", "0.61539704", "0.61435235", "0.6138267", "0.61332166", "0.61318445", "0.61291194", "0.6127648", "0.6114199", "0.6091205", "0.60906947", "0.60794175", "0.6075976", "0.6070751", "0.60692513", "0.6068843", "0.60626155", "0.6058378", "0.60582125", "0.6037999", "0.60371107", "0.6036707", "0.60337985", "0.60315007", "0.6026689", "0.6020201", "0.60168004", "0.6013631", "0.60111004", "0.60095346", "0.6006385", "0.5998296", "0.5996758", "0.59942806", "0.5991026", "0.59844035", "0.5982796", "0.5978028", "0.595663", "0.5950651", "0.5934985", "0.593474", "0.59327954", "0.59318686", "0.5930317", "0.5924166", "0.59213364", "0.5920391", "0.5916729", "0.5915496", "0.59049445", "0.58960545", "0.5892767", "0.58888507", "0.5882224", "0.5880213", "0.5879886", "0.587732", "0.5874204", "0.5872194", "0.58592886", "0.5859092", "0.5851924", "0.5846493", "0.5845332", "0.58424777", "0.58394694", "0.5835229", "0.58349794", "0.58315" ]
0.0
-1
Store a new dog in the database.
public function store(FacilityRequest $request) { return Facility::create($request->only(['fac_code','fac_name','fac_add','fac_postcode','fac_city','fac_district','fac_state','fac_telno','fac_faxNo','fac_hcategory','fac_ministry','fac_category' ])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(Dog $dog, Request $request)\n {\n $this->validate($request,[\n 'activity_id'=>'required',\n 'duration'=>'int|min:1',\n ]);\n $request->merge(['dog_id'=> $dog->id]);\n DogActivity::create($request->all());\n\n return redirect(route('dogs.activities.index', $dog->id));\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'title' => 'required|max:255'\n ]);\n $dog = new Dog();\n $dog->title = $request->title;\n $dog->breed = $request->breed;\n $dog->description = $request->description;\n $dog->dog_name = $request->name;\n if ($dog->save()) {\n // return redirect()->route('dogs.show', $dog->id);\n return redirect()->route('dogs.index');\n } else {\n return redirect()->route('dogs.create');\n }\n }", "public function store(Request $request)\n {\n $request->validate(\n [\n 'name' => 'required',\n 'age' => 'required',\n 'found_date' => 'required',\n 'breed_id' => 'required',\n 'gender_id' => 'required',\n 'nature' => 'required',\n 'health' => 'required',\n 'bio' => 'required'\n ]\n );\n\n $dog = new Dogs(\n [\n 'name' => $request->get('name'),\n 'age' => $request->get('age'),\n 'found_date' => $request->get('found_date'),\n 'breed_id' => $request->get('breed_id'),\n 'gender_id' => $request->get('gender_id'),\n 'nature' => $request->get('nature'),\n 'health' => $request->get('health'),\n 'bio' => $request->get('bio'),\n 'img_path' => $request->get('img_path')\n ]\n );\n\n $dog->save();\n\n return redirect('/dogs')->with('success', $dog->name . ' was added to the kenel!');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n ]);\n\n $tags = $request->input('tags');\n\n $dish = Dish::create($request->all());\n\n // add passed tags\n $dish->tags()->attach($tags);\n\n return redirect()->route('dishes.index')\n ->with('success','Dish created successfully.');\n }", "public function store(Request $request)\n {\n $breed = Breed::create([\n 'name'=>$request->name,\n 'animal_id'=>$request->animal_id,\n\n ]);\n if($breed){\n return redirect('breeds');\n }\n\n }", "public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }", "public function run()\n\t\t{\n\t\t\tDB::table('pets')->insert(array(\n\t\t\t\tarray('name'=>\"Pumpkin\",'age'=>7,'specie_id'=>1),\n\t\t\t\tarray('name'=>\"Fido\",'age'=>3,'specie_id'=>2),\n\t\t\t\tarray('name'=>\"Oliver\",'age'=>12,'specie_id'=>1),\n\t\t\t\tarray('name'=>\"Snowy\",'age'=>8,'specie_id'=>1),\n\t\t\t\tarray('name'=>\"Rover\",'age'=>8,'specie_id'=>2),\n\t\t\t\tarray('name'=>\"Laddie\",'age'=>6,'specie_id'=>2),\n\t\t\t\tarray('name'=>\"Daffney\",'age'=>2,'specie_id'=>3),\n\t\t\t));\n\t\t}", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function run()\n {\n DB::table('dogs')->insert([\n [\n 'name'=>'firulas',\n 'age'=>3\n ],\n [\n 'name'=>'scoob',\n 'age'=>6\n ]\n ,\n [\n 'name'=>'mohe',\n 'age'=>1\n ]\n ]);\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function store(Request $request)\n {\n //validate form data\n $this->validate($request, [\n 'breedname' => 'required|unique:breeds',\n 'breedgroup_id' => 'required|integer',\n 'structure' => 'required',\n 'color' => 'required',\n 'faultsdqs' => 'required',\n 'notes' => 'required'\n ]);\n \n $breed = Breed::create($request->all());\n return redirect()->route('breedlist');\n }", "public function store(Request $request)\n {\n $dog = Dog::create($request->all());\n Event::fire(new DogCreated($dog));\n return response()->json($dog, 201);\n }", "public function run()\n {\n DB::table('pets')->insert([\n 'name' => \"Lolo\", //Cambiar id en caso de error\n 'species' => \"dog\",\n 'race' => \"Labrador\",\n 'owner_id' => \"3\",\n 'sex' => \"masculine\",\n 'age' => \"5\",\n 'commentary' => \"Es muy lindo\",\n 'personality' => \"calm\",\n 'size' => \"tiny\",\n ]); \n }", "public function store(Request $request)\n {\n $dog_breed = new DogBreed([\n 'dog_breed' => $request->dog_breed,\n 'dog_breed_male_count' => $request->dog_breed_male_count,\n 'dog_breed_female_count' => $request->dog_breed_female_count,\n ]);\n $dog_breed->save();\n\n return redirect()->route('manage_dog_breeds.index')->with('success','เพิ่มสายพันธ์สุนัขแล้ว');\n }", "public function postEditDog($dog)\n {\n $rules = array(\n 'name' => 'required|max:32', \n 'kennel_prefix' => 'max:5',\n 'image_url' => 'max:255|image_url:png,gif,jpeg|image_url_size:<=700,<=500', \n 'notes' => 'max:10000',\n );\n\n // Create a new validator instance from our validation rules\n $validator = Validator::make(Input::all(), $rules);\n\n // If validation fails, we'll exit the operation now.\n if ($validator->fails())\n {\n // Ooops.. something went wrong\n return Redirect::route('admin/dogs/dog/edit', $dog->id)->withInput()->with('error', $validator->errors()->first());\n }\n\n try\n {\n $dog->name = Input::get('name');\n $dog->kennel_prefix = Input::get('kennel_prefix');\n $dog->image_url = Input::get('image_url');\n $dog->notes = Input::get('notes');\n $dog->save();\n\n $success = Lang::get('forms/admin.update_dog.success');\n\n return Redirect::route('admin/dogs/dog/edit', $dog->id)->with('success', $success);\n }\n catch(Exception $e)\n {\n $error = Lang::get('forms/admin.update_dog.error');\n }\n\n return Redirect::route('admin/dogs/dog/edit', $dog->id)->withInput()->with('error', $error);\n }", "public function store(Request $request)\n {\n //\n $request->validate([\n 'animal_id' => 'required',\n ]);\n\n $animal = new Animal;\n $cat = new Cat;\n\n\n $animal->name = $request->name;\n $animal->age = $request->age;\n $animal->sexe = $request->sexe;\n $animal->species = 'felina';\n $animal->save();\n \n $cat->animal_id = $animal->id;\n $cat->name = $request->name;\n $cat->age = $request->age;\n $cat->sexe = $request->sexe;\n $cat->species = 'felina';\n $return = $cat->save();\n\n error_log($animal);\n return ($cat);\n\n }", "public function save() {\n if (self::getCategoryById($this->id) == null) {\n // should create\n $sql = \"INSERT INTO category (name) VALUES ('%s') RETURNING id;\";\n $auth_user = User::getUserById(1);\n $sql = sprintf($sql, pg_escape_string($this->name));\n $results = self::$connection->execute($sql);\n $this->id = $results[0][\"id\"];\n } else {\n // should update\n $sql = \"UPDATE category SET name='%s' WHERE id=%d\";\n $sql = sprintf($sql, pg_escape_string($this->name), addslashes($this->id));\n self::$connection->execute($sql);\n }\n }", "public function store(Request $request)\n {\n request()->validate([\n 'tracker_id' => 'required | unique:birds',\n 'name' => 'required',\n 'is-female' => 'required',\n\n ]);\n Tracker::firstOrCreate(['id' => request('tracker_id')]);\n Bird::create(request(['tracker_id', 'name', 'is-female']));\n\n return redirect(route('birds.index'));\n }", "public function persist();", "public function run()\n {\n DB::table('animals')->insert(\n [\n 'name'=>'cachuchin',\n 'gender'=>'F',\n 'arrivalState'=>1,\n 'arrivalDate'=>'01-01-2000',\n 'responsiblePerson'=>'Ana Perez',\n 'responsiblePersonContact'=>'68073431',\n 'responsiblePersonType'=>1,\n 'generalDescription'=>'srkcvgbnmfghjghjbgnhjm',\n 'foundAddress'=>'C. 1 Av. Avenida',\n 'species_id'=>1\n ]\n );\n }", "public function insert() {\r\n\r\n\t\t// Does the Genre object already have an ID?\r\n\t\tif ( !is_null( $this->id ) ) trigger_error ( \"Genre::insert(): Attempt to insert an Genre object that already has its ID property set (to $this->id).\", E_USER_ERROR );\r\n\r\n\t\t// Insert the Genre\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$sql = \"INSERT INTO :table ( id, name ) VALUES ( :id, :name )\";\r\n\t\t$st = $conn->prepare ( $sql );\r\n\t\t$st->bindValue( \":table\", DB_TBL_GENRE, PDO::PARAM_STR );\r\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t$st->bindValue( \":name\", $this->name, PDO::PARAM_STR );\r\n\t\t$st->execute();\r\n\t\t$this->id = $conn->lastInsertId();\r\n\t\t$conn = null;\r\n\t}", "public function persist() {}", "public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }", "public function store(TagStoreRequest $request)\n {\n $medic = medic::create($request->all());\n\n return redirect()->route('medics.edit', $medic->id)\n ->with('info', 'medico guardado con éxito');\n }", "public function store(AdventureRequest $request)\n {\n Adventure::create($request->all());\n\n return redirect('adventures');\n }", "public function run()\n {\n DB::table('cars')->insert($this->getData());\n }", "public function store(Request $request)\n {\n // validate data from post\n $this->validate($request, array(\n 'name' => 'required | max:255'\n ));\n\n // store new tag to the database\n $tag = new Tag();\n $tag->name = $request->name;\n $tag->save();\n\n // set flash message\n Session::flash('success', 'New tag was created succesfully');\n\n // redirect to index page\n return redirect()->route('tags.index');\n }", "public function save()\n {\n $this->persist($this->state);\n }", "public function run()\n {\n DB::table('category')->insert($this->getData());\n }", "public function store(Request $request)\n {\n $validatedData = $request->validate([\n 'size' => 'required|string',\n 'rate_night' => 'required|numeric',\n 'rate_day' => 'required|numeric'\n ]);\n\n $dogSizeObj = new DogSize;\n\n $dogSizeObj->size = $request->size;\n $dogSizeObj->rate_night = $request->rate_night;\n $dogSizeObj->rate_day = $request->rate_day;\n\n $dogSizeObj->save();\n }", "public function store(Request $request)\n {\n $pet = new Pet;\n $pet->nickname = $request->nickname;\n $pet->description = $request->description;\n $pet->category_id = $request->category_id;\n $pet->breed_id = $request->breed_id;\n $pet->founder_id = Auth::user()->id;\n $request->validate([\n 'thumb' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:4048',\n ]);\n $address = new Address;\n $address->zip_code = $request->address_zip_code;\n $address->street = $request->address_street;\n $address->number = $request->address_number;\n $address->district = $request->address_district;\n $address->city = $request->address_city;\n $address->state = $request->address_state;\n $address->country = 'Brasil';\n\n $imageName = $pet->nickname.time().'.'.$request->thumb->extension();\n $pet->thumb = $imageName;\n if($pet->save()){\n $request->thumb->move(public_path('pet_thumbs'), $imageName);\n $address->addressable_id = Pet::latest()->first()->id;\n $address->addressable_type = 'pet';\n if($address->save()){\n Flasher::addSuccess('Pet cadastrado com sucesso!');\n return redirect()->route('pets.index');\n }\n else{\n $pet->destroy($pet->id);\n Flasher::addError('Pet não cadastrado.');\n return back();\n }\n }\n Flasher::addError('Pet não cadastrado.');\n return back();\n }", "public function save()\n {\n try {\n $name = $this->getName();\n $age = $this->getAge();\n if (!$this->getDriverId()) {\n $this->_pdo->query(\"INSERT INTO driver (name, age) VALUES ('$name', '$age')\");\n } else {\n $this->_pdo->query(\n \"UPDATE drive SET name = '$name', age = '$age'\" .\n \" WHERE driver_id = \" . $this->getDriverId()\n );\n }\n } catch (PDOException $e) {\n echo \"Error: \" . $e;\n }\n }", "public function store() {\n\t\t$post = new Post;\n\t\t$post->title = Input::get('title');\n\t\t$post->body = Input::get('body');\n\t\t$post->save();\n\n\t\t$post->category()->sync([\n\t\t\tInput::get('category_id'), $post->post_id\n\t\t]);\n\t}", "public function run()\n {\n DB::table('products') -> insert ([\n\t\t\t'cat_id' => '2',\n\t\t\t'name' => 'Krosachi',\n\t\t\t'description' => 'ochen krutye krossovki',\n\t\t\t'price' => '120$',\n\t\t\t'picture' => 'C:\\OpenServer\\domains\\laravel\\database\\seeds\\1380705314_1.jpg'\n\t\t]);\t\n }", "public function save_new_record() {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$db_data = $this->get_db_data();\r\n\r\n\t\t$table_name = $wpdb->prefix . CTF_POSTS_TABLE;\r\n\t\t$data = array(\r\n\t\t\t'twitter_id' => $db_data['twitter_id'],\r\n\t\t\t'created_on' => $db_data['created_on'],\r\n\t\t\t'last_requested' => $db_data['last_requested'],\r\n\t\t\t'time_stamp' => $db_data['time_stamp'],\r\n\t\t\t'json_data' => $db_data['json_data'],\r\n\t\t\t'media_id' => $db_data['media_id'],\r\n\t\t\t'sizes' => $db_data['sizes'],\r\n\t\t\t'aspect_ratio' => $db_data['aspect_ratio'],\r\n\t\t\t'images_done' => $db_data['images_done']\r\n\t\t);\r\n\t\t$format = array(\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%d',\r\n\t\t\t'%d'\r\n\t\t);\r\n\t\t$error = $wpdb->insert( $table_name, $data, $format );\r\n\r\n\t\tif ( $error !== false ) {\r\n\t\t\t$insert_id = $wpdb->insert_id;\r\n\r\n\t\t\t$this->db_id = $insert_id;\r\n\t\t\t$this->insert_ctf_feeds_posts();\r\n\t\t} else {\r\n\t\t\t// log error\r\n\t\t}\r\n\t}", "public function store(Request $request)\n {\n $validatedData = $request->validate([\n 'name' => 'required|unique:chickens|max:100',\n 'DOB' => 'nullable|date',\n 'DOD' => 'nullable|date',\n 'species' => 'required',\n 'breed' => 'nullable',\n 'sex' => 'nullable',\n 'person' => ' nullable',\n 'people' => 'nullable',\n 'favorites' => 'nullable',\n 'dislikes' => 'nullable',\n 'origin_story' => 'nullable',\n 'locations' => 'nullable',\n 'description' => 'nullable',\n 'pet_photo' => 'nullable|mimes:jpeg,png,jpg,gif|max:2048',\n 'comments' => 'nullable'\n ]);\n \n \n $pet = new Pet();\n\n $pet->name = Request('name');\n $pet->DOB = Request('DOB');\n $pet->DOD = Request('DOD');\n $pet->breed = Request('breed');\n $pet->species = Request('species');\n $pet->sex = Request('sex');\n $pet->person = Request('person');\n $pet->people = Request('people');\n $pet->favorites = Request('favorites');\n $pet->dislikes = Request('dislikes');\n $pet->origin_story = Request('origin_story');\n $pet->locations = Request('locations');\n $pet->description = Request('description');\n $pet->comments = Request('comments');\n\n if ($request->has('pet_photo')) {\n $image = Request('pet_photo');\n $extension = Request('pet_photo')->extension(); \n $name = Request('name').'_'.time().'.'.$extension;\n $path = $image->storePubliclyAs('images/pets', $name);\n $pet->photo_url = $path; \n }\n\n\n $pet->save();\n \n\n return back()->with('success', 'Record Created Successfully.');\n\n // 'name' \n // 'DOB'\n // 'DOD'\n // 'species'\n // 'breed'\n // 'sex'\n // 'favorites'\n // 'dislikes'\n // 'origin_story'\n // 'locations'\n // 'description'\n // 'photo_url'\n // 'comments'\n }", "public function store(Request $request)\n {\n /* $this->validate($request, [\n 'size' => 'required',\n ]); */\n\n $dice = Dice::Create($request->all());\n\n return redirect('/dice/' . $dice->id);\n }", "public function store(StoreDog $request)\n {\n Log::info('Controller - dog store endpoint has been called.');\n $response = $this->dogService->store($request->all(), $request->user()->id);\n\n return Response::json([\n 'message' => $response->getMessage(),\n 'data' => $response->getData(),\n 'status_code' => $response->getStatusCode(),\n 'ok' => $response->getOk()\n ], $response->getStatusCode());\n }", "public function saveAction(){\n //d'you post?\n if ($this->getRequest()->isPost()){\n $knight = $this->getKnight();\n $knight->setName( $this->getRequest()->getPost(\"name\") );\n $knight->setArmor( $this->getRequest()->getPost(\"armor\") );\n //persist the knight\n $this->getDM()->persist($knight);\n $this->getDM()->flush();\n }\n //go back to home (indexAction) to show the grid of knights\n $this->redirect()->toRoute(\"home\");\n }", "public function store(Request $request)\n {\n if (Auth::check()) {\n Dog::create([\n 'regname' => request('regname'),\n 'sire' => request('sire'),\n 'dam' => request('dam')\n ]);\n\n return redirect('/');\n } else {\n return redirect('/login');\n }\n }", "public function store(CreateFoodRequest $request)\n {\n $input = $request->all();\n\n $food = $this->foodRepository->create($input);\n\n toast('Food saved successfully.','success');\n\n return redirect(route('food.index'));\n }", "public function insert_() {\n\n\n\t\t\t$podcast = Model\\Podcast::get_instance();\n\n\t\t}", "public function insert()\n {\n $this->id = insert($this);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'breed_name' => 'required'\n ]);\n\n return Breed::create($request->all());\n }", "public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }", "function storeAndNew() {\n $this->store();\n }", "function store()\n {\n $this->dbInit();\n query( \"INSERT INTO PhoneType set Name='$this->Name'\" );\n }", "public function store()\n\t{\n\t\t$posting = new GearPosting;\n\t\t$posting->gear_title = Input::get('gear_title');\n\t\t$posting->gear_content = Input::get('gear_content');\n\t\t$posting->category = Input::get('category');\n\t\t$posting->save();\n\n\t\treturn Redirect::route('gear.index');\n\t}", "public function persist()\n {\n $uid = $this->getIdentifier() == 0 ? 'NEW' . rand(100000, 999999) : $this->getIdentifier();\n $data = [\n trim(static::$storageTableName) => [\n $uid => $this->getPersistableDataArray()\n ]\n ];\n // New records always must have a pid\n if ($this->getIdentifier() == 0) {\n $data[trim(static::$storageTableName)][$uid]['pid'] = 0;\n }\n /** @var \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $tce */\n $tce = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\DataHandling\\DataHandler::class);\n $tce->start($data, []);\n $tce->process_datamap();\n }", "public function run()\n {\n DB::table('species')->insert([\n 'name' => 'Dog',\n ]);\n\n DB::table('species')->insert([\n 'name' => 'Cat',\n ]);\n\n DB::table('species')->insert([\n 'name' => 'Bird',\n ]);\n\n DB::table('species')->insert([\n 'name' => 'Horse',\n ]);\n\n DB::table('species')->insert([\n 'name' => 'Snake',\n ]);\n }", "public function store(PostRequest $request, TagRequest $tagRequest)\n {\n //Enregistrement en base de données\n //Eloquent\n $post = new Post;\n $post->title = $request->title;\n $post->post = $request->post;\n $post->user_id = CustomAuth::id();\n $post->postable_type = get_class(CustomAuth::user());\n $post->postable_id = CustomAuth::id();\n $post->save();\n //Gestion Tags\n $post->tagsAttach($tagRequest);\n return redirect()->route('posts.index')\n ->with('info', 'Votre post a été ajouté avec succès !');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'Required|max:191'\n ]);\n\n $name = $request->input('name');\n\n $new_tag = new \\App\\Tag();\n $new_tag->name = $name;\n $new_tag->user_id = Auth::user()->id;\n $new_tag->save();\n \n $request->session()->flash(\"success_msg\", \"Successful add a tag.\");\n return redirect(\"/home/tag\");\n }", "public function store(Request $request)\n {\n $request->validate($this->validateRules);\n $data = $request->all();\n\n \n $newPost = new Post;\n $newPost->title = $data['title'];\n $newPost->body = $data['body'];\n $newPost->slug = rand(1, 100) . '-' . Str::slug($newPost->title);\n $newPost->user_id = Auth::id();\n $newPost->published = $data['published'];\n \n if (!empty($data['path_image'])) {\n $path = Storage::disk('public')->put('images', $data['path_image']);\n $newPost->path_image = $path;\n }\n\n $saved = $newPost->save();\n\n\n if (!$saved) {\n return redirect()->back()->with('error', 'Post Store ERROR!');;\n }\n \n if (!empty($data['tags'])){\n $newPost->tags()->attach($data['tags']);\n }\n\n\n return redirect()->route('registred.posts.show', $newPost->slug)->with('message', 'Post Stored!');\n }", "public function run()\n {\n DB::table('tags')->insert([\n \t['name' => 'alpha'],\n \t['name' => 'beta'],\n \t['name' => 'gamma'],\n \t['name' => 'delta'],\n \t['name' => 'omega'],\n \t['name' => 'epsilon']\n ]);\n }", "public function run()\n {\n DB::table('tags_posts')->insert([\n \"id_tag\" => 1,\n \"id_post\" => 1\n ]);\n }", "public function store(Request $request)\n {\n //return \"Save a new cat in the database\";\n $cat = Cat::create($request->all());\n\n return redirect('cats/'.$cat->id)->withSuccess('Cat has been created.');\n }", "public function saveToDb()\n\t{\n\t\t$this->addDocument();\n\t\tparent::saveToDb();\n\t}", "public function store()\n\t{\n\t\t$input['author']=\"Gad Aaron A. Surop\";\n\t\t$input=Request::all();\n\t\tBlogs::create($input);\n\t\treturn redirect('bloggers');\n\n\t}", "public function store(Request $request)\n {\n array_push($this->animals, $request);\n $this->index();\n }", "public function store(CreateDapilRequest $request)\n\t{\n\t\t$input = $request->all();\n\n\t\t$dapil = $this->dapilRepository->create($input);\n\n\t\tFlash::success('Dapil saved successfully.');\n\n\t\treturn redirect(route('dapils.index'));\n\t}", "public function insert(){\n\t\t// $post->title = 'A post from the insert method';\n\t\t// $post->body = 'Some random ghibberrish';\n\t\t// $post->save();\n\n\t\t$data = array(\n\t\t\t'title' => 'A post from the insert method, using the data array',\n\t\t\t'body' => 'Some random ghibberrish, using the data array',\n\t\t\t'user_id' => 1\n\t\t);\n\n\t\tPost::create($data);\n\n\t\tdd('post inserted');\n\t}", "public function persist()\n {\n }", "public function store(Request $request)\n\t{\n\t\t$this->validate($request,[\n\t\t\t'dish_name' => 'required',\n\t\t\t'dish_price' => 'required|numeric'\n\t\t]);\n\n\t\t$food = new Foods();\n\t\t$food->food_name \t = Input::get('dish_name');\n\t\t$food->food_price \t = Input::get('dish_price');\n\t\t$food->food_types_id = Input::get('dish_cate');\n\t\t$food->food_shop = 1;\n\n\t\tif($food->save()) {\n\n\t\t\treturn redirect('admin/dishes');\n\n\t\t} else {\n\n\t\t}\n\n\t}", "public function run()\n {\n $now = Carbon::now()->toDateTimeString();\n Category::insert([\n ['name'=>'Pharmaceutical','slug'=>'pharmaceutical', 'created_at'=>$now,'updated_at'=>$now],\n ['name'=>'Snacks','slug'=>'snacks', 'created_at'=>$now,'updated_at'=>$now],\n \n ]);\n }", "public function store(DrinkCreateRequest $request)\n {\n CoffeeMachine::create($request->all());\n return redirect(route('coffeeMachine.admin'))->with('message','Joogi lisamine õnnestus!');\n }", "public function run()\n {\n //\n\n\n DB::table('bagages')->insert([\n 'ID' => str_random(10),\n 'bagage' => str_random(10),\n \n ]);\n }", "public function store(StorePet $request)\n {\n Pet::create($request->validated());\n\n $request->session()->flash('alert-success', 'Pet was created');\n return redirect(route('pet.index'));\n }", "public function run()\n {\n DB::table('hotels')->insert([\n 'id' => '1',\n 'hotel_name' => 'None'\n ]);\n }", "public function run()\n {\n DB::table('doughs')->insert([\n ['name' => 'Pan'],\n ['name' => 'Delgada'],\n ['name' => 'Hut Cheese'],\n ['name' => 'Hut Cheese Gold'],\n ['name' => 'Pan Gold'],\n ]);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'judul' => 'required',\n 'ringkasan' => 'required',\n 'tahun' => 'required',\n 'genre_id' => 'required',\n 'poster' => 'required|mimes:jpeg,jpg,png|max:2200',\n ]);\n\n $poster = $request->poster;\n $new_poster = time() . ' - ' . $poster->getClientOriginalName();\n\n $query = DB::table('film')->insert([\n 'judul' => $request->judul,\n 'ringkasan' => $request->ringkasan,\n 'tahun' => $request->tahun,\n 'genre_id' => $request->genre_id,\n 'poster' => $new_poster,\n ]);\n $poster->move('uploads/film/', $new_poster);\n return redirect('/film');\n }", "public function store(Request $request)\n {\n\n $filename = $request['img']->getClientOriginalName();\n $path = $request['img']->storeAs('public', $filename );\n\n $animal = new Animal();\n $animal->name = $request['name'];\n $animal->sex = $request['sex'];\n $animal->img = $filename;\n $animal->breed = $request['breed'];\n $animal->species = $request['species'];\n $animal->birth = $request['birth'];\n $animal->user_id = $request['user_id'];\n $animal->castration = $request['castration'];\n $animal->save();\n\n flash('Animal Criado com Sucesso')->success();\n return redirect()->route(\"animais.index\");\n }", "public function store(Request $request)\n { \n \n $pigBreeder = new PigBreeder(); \n $pigBreeder->fill($request->all()); \n $pigBreeder->save(); \n \n $service = new PigService();\n $service->changeStepCycle($request->pig_cycle_id,2);\n\n }", "protected function save(){\n $this->getTags();\n foreach ($this->posts as $post){\n $createdPost = Post::create(['habr_id' => $post['postId'],\n 'post' => $post['full'],\n 'unix_time' => $post['time']]);\n $this->attachPostTags($createdPost,$post['tags']);\n }\n }", "public function store(AdminTagCreate $request)\n {\n $request->validated();\n $post = new Tag();\n $data = $request->all();\n $post->fill($data);\n// $post->title = $request->title;\n// $post->subtitle = $request->subtitle;\n// $post->slug = $request->slug;\n// $post->body = $request->body;\n $post->save();\n\n //TODO redirect to created post\n return redirect(route('tag.index'));\n }", "public function store()\n\t{\n $post = new Post;\n //$post->title='test title';\n //$post->body='test body';\n $data = [\n 'title'=>'title',\n 'body'=>'body',\n 'user_id'=>1\n ];;\n Posts::create($data);\n $post->save();\n\t}", "public function run()\n {\n Category::insert([\n \t['name'=>'Sci-fi','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Suspense','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Religious','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Romance','created_at'=>NULL,'updated_at'=>NULL]]);\n }", "public function store(AnimalRequest $request)\n {\n // dd(\"store\");\n // get all the request data\n // returns an array of all the data the user sent\n $data = $request->all([]);\n\n // create article with data and store in DB\n // and return it as JSON\n // automatically gets 201 status as it's a POST request\n $animal = Animal::create($data)->setTreatments($request->get(\"treatments\"));\n \n // $treatments = Treatment::fromStrings($request->get(\"treatments\"));\n\n return new AnimalResource($animal);\n }", "function saveCat()\n {\n //update stuff\n }", "public function store(Request $request)\n {\n // validate the data (includes CSRF protection)\n $this->validate($request, [\n 'name' => 'required|max:255|unique:tags,name'\n ]);\n \n // store in the database\n $tag = new Tag();\n $tag->name = $request->name;\n $tag->save();\n \n // redirect with flash data to tags.index\n Session::flash('success', 'The tag was created successfully!');\n \n $tags = Tag::orderBy('id')->get();\n return redirect()->route('tags.index')->withTags($tags);\n }", "function persist() ;", "public function save()\n {\n // If deposit is new, will get assigned database ID.\n $this->dbID = $this->db->saveDeposit($this);\n }", "function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required|max:255',\n 'description' => 'max:255',\n 'price' => 'required',\n ]);\n \n $foods = $request->all();\n \\GuestHouse\\food::create($foods);\n return redirect('food');\n }", "public function addPet() {\n $body = $this->objectConverter->convert($_POST, Pet::CLASS);\n $this->petService->addPet($body);\n }", "public function store(CreateFoodRequest $request)\n {\n $input = $request->all();\n $customFields = $this->customFieldRepository->findByField('custom_field_model', $this->foodRepository->model());\n try {\n $food = $this->foodRepository->create($input);\n $food->customFieldsValues()->createMany(getCustomFieldsValues($customFields, $request));\n if (isset($input['image']) && $input['image']) {\n $cacheUpload = $this->uploadRepository->getByUuid($input['image']);\n $mediaItem = $cacheUpload->getMedia('image')->first();\n $mediaItem->copy($food, 'image');\n }\n } catch (ValidatorException $e) {\n Flash::error($e->getMessage());\n }\n\n Flash::success(__('lang.saved_successfully', ['operator' => __('lang.food')]));\n\n return redirect(route('foods.index'));\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required|max:255|unique:tags'\n ]);\n $tag = new Tag();\n $tag->name = $request->name;\n $tag->save();\n session()->flash('success_save_tag','New Tag Added Successfully :)');\n return redirect()->route('tags.index');\n }", "public function store(InsertAdherentRequest $request)\n {\n Adherent::create($request->all());\n return back()->with('info', 'L\\'adhérent a bien été ajouté à la base de données');\n }", "public function store(Request $request)\n {\n if (!$request->show) {\n $request->show = 0;\n }\n\n $save = DB::table('blogs')->insert([\n 'title' => $request->title,\n 'content' => $request->content,\n 'user_id' => $request->writer,\n 'showblog' => $request->show,\n 'product_recommend' => json_encode($request->recommend),\n 'categoryblog_id' => $request->category,\n 'thumbnail' => $this->upload_image($request)\n ]);\n\n if ($save) {\n return redirect(route('admin.blog.manage'));\n }\n }", "public function store(Request $request)\n {\n $horse = new Horse();\n // can be used for seeing the insides of the incoming request\n // dd($request->all()); die();\n $horse->fill($request->all());\n $horse->save();\n\n return redirect()->route('horse.index');\n $this->validate($request, ['name' => 'required']);\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store(CreateTagRequest $request)\n {\n Tag::create($request->all());\n return redirect(route('tags.index'))->with('success', 'A tag has been created');\n }", "public function store(Request $request)\n {\n $tag = new Tag($request->all());\n\n $tag->save();\n\n flash('Tag creado sastifactoriamente')->success()->important();\n\n return redirect()->route('tags.index');\n }", "public function run()\n { \n DB::table('pics')->delete();\n\n DB::table('pics')->insert([\n [\"path\"=>\"default.jpg\"],\n [\"path\"=>\"red.jpg\"],\n [\"path\"=>\"blue.jpg\"],\n [\"path\"=>\"white.jpg\"],\n [\"path\"=>\"arsenal.jpg\"],\n [\"path\"=>\"astonvilla.jpg\"],\n ]);\n\n\n }", "public function saveToDB()\n {\n }", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $drink = new Drink();//instancie une classe drink\n $drink->nom = request('inputName');// attribue le résultat des données saisies dans inputname à l'attribut nom(champ de la table qui devient un attribut grace à laravel)\n $drink->prix = request('inputPrice');\n $drink->save();\n return redirect('drinks');\n }", "public function run()\n {\n $meal = new Meal;\n $meal->type_id = 3;\n $meal->save();\n\n $meal->recipes()->attach(1, ['sidedish' => 1]);\n }", "public function store(Request $request) {\n $adjective = new Adjective;\n $adjective->name_male = $request->name_male;\n $adjective->name_female = $request->name_female;\n $adjective->description_male = $request->description_male;\n $adjective->description_female = $request->description_female;\n $adjective->save();\n\n $request->session()->flash('message', 'Η εγγραφή δημιουργήθηκε με επιτυχία.');\n return redirect()->route('cms.adjectives.index');\n }", "public function save()\n\t{\n\t\t$this->copyAttributesToValues() ;\n\t\tif( $this->factory )\n\t\t{\n\t\t\tswitch( $this->todo )\n\t\t\t{\n\t\t\t\tcase 1: // Insert\n\t\t\t\t\tif( $this->factory->insertObjectIntoDB( $this ) ) $this->state = \"inserted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 2: // update\n\t\t\t\t\tif( $this->factory->updateObjectIntoDB( $this ) ) $this->state = \"updated\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 3: // delete\n\t\t\t\t\tif( $this->factory->deleteObjectIntoDB( $this ) ) $this->state = \"deleted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.6897191", "0.6852598", "0.6572853", "0.61607105", "0.6142625", "0.6099078", "0.60548395", "0.60537565", "0.5957351", "0.59506434", "0.5941333", "0.59043103", "0.58900017", "0.58830315", "0.5870163", "0.5851554", "0.5822885", "0.58077496", "0.5780879", "0.57725793", "0.57517964", "0.5727158", "0.5716931", "0.56895685", "0.56443757", "0.5641396", "0.563629", "0.5619825", "0.55558956", "0.5551153", "0.5550897", "0.5546373", "0.55450374", "0.5530788", "0.55297005", "0.55232143", "0.55165625", "0.5511081", "0.55100185", "0.5507848", "0.5503209", "0.5501571", "0.54896474", "0.54857796", "0.5484406", "0.5477941", "0.5474225", "0.54736215", "0.547174", "0.5464905", "0.5463449", "0.546232", "0.545503", "0.5453675", "0.54400223", "0.5435218", "0.54230636", "0.5420502", "0.54198164", "0.5413305", "0.5398852", "0.5398077", "0.539115", "0.53897965", "0.5387849", "0.53863996", "0.5381366", "0.53706646", "0.5367375", "0.5363258", "0.5362724", "0.53621286", "0.5359802", "0.5356472", "0.5355365", "0.535259", "0.53510106", "0.5350377", "0.53474706", "0.5346805", "0.5341567", "0.53394616", "0.53379864", "0.5337881", "0.5336864", "0.5336287", "0.5333678", "0.5330117", "0.53292125", "0.53275895", "0.5326078", "0.5318003", "0.5317283", "0.53161395", "0.53150374", "0.53150374", "0.53150374", "0.53112113", "0.53023875", "0.530107", "0.53005564" ]
0.0
-1
Display the specified resource.
public function show($id) { return $this->item(Facility::findOrFail($id), new FacilityTransformer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Update the dog in the database.
public function update(FacilityRequest $request, $id) { $facility = Facility::findOrFail($id); $facility->update($request->only(['fac_code','fac_name','fac_add','fac_postcode','fac_city','fac_district','fac_state','fac_telno','fac_faxNo','fac_hcategory','fac_ministry','fac_category' ])); return $facility; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function postEditDog($dog)\n {\n $rules = array(\n 'name' => 'required|max:32', \n 'kennel_prefix' => 'max:5',\n 'image_url' => 'max:255|image_url:png,gif,jpeg|image_url_size:<=700,<=500', \n 'notes' => 'max:10000',\n );\n\n // Create a new validator instance from our validation rules\n $validator = Validator::make(Input::all(), $rules);\n\n // If validation fails, we'll exit the operation now.\n if ($validator->fails())\n {\n // Ooops.. something went wrong\n return Redirect::route('admin/dogs/dog/edit', $dog->id)->withInput()->with('error', $validator->errors()->first());\n }\n\n try\n {\n $dog->name = Input::get('name');\n $dog->kennel_prefix = Input::get('kennel_prefix');\n $dog->image_url = Input::get('image_url');\n $dog->notes = Input::get('notes');\n $dog->save();\n\n $success = Lang::get('forms/admin.update_dog.success');\n\n return Redirect::route('admin/dogs/dog/edit', $dog->id)->with('success', $success);\n }\n catch(Exception $e)\n {\n $error = Lang::get('forms/admin.update_dog.error');\n }\n\n return Redirect::route('admin/dogs/dog/edit', $dog->id)->withInput()->with('error', $error);\n }", "public function db_update() {}", "public function edit(Dog $dog)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $dog = Dogs::find($id);\n\n $request->validate(\n [\n 'name' => 'required',\n 'age' => 'required',\n 'found_date' => 'required',\n 'breed' => 'required',\n 'gender_id' => 'required',\n 'nature' => 'required',\n 'health' => 'required',\n 'bio' => 'required'\n ]\n );\n\n\n $dog->name = $request->get('name');\n $dog->age = $request->get('age');\n $dog->found_date = $request->get('found_date');\n $dog->breed = $request->get('breed');\n $dog->gender_id = $request->get('gender_id');\n $dog->nature = $request->get('nature');\n $dog->health = $request->get('health');\n $dog->bio = $request->get('bio');\n $dog->img_path = $request->get('img_path');\n\n $dog->save();\n\n return redirect('/dogs')->with('success', $dog->name . ' was updated!');\n }", "public function update(Request $request, Dog $dog)\n {\n $dog->update($request->all());\n return response()->json($dog, 200);\n }", "public function update(Request $request, $id)\n {\n $dog_breed = DogBreed::find($id);\n $dog_breed->dog_breed = $request->dog_breed;\n $dog_breed->save();\n\n Dog::where('dog_breed', $request->old_value)\n ->update(['dog_breed' => $request->dog_breed]);\n\n return redirect()->route('manage_dog_breeds.index')->with('success','แก้ไขสายพันธ์สุนัขแล้ว');\n }", "public function update($id)\n {\n if(Auth::check()) {\n\n $dog = Dog::find($id);\n $dog->update(request()->all());\n\n\n return redirect(\"/dog/$id\");\n }\n else {\n return redirect('/login');\n }\n }", "public function update() {\n\t\t\t$query = \"UPDATE $this->table_name SET name=:name, drink=:drink WHERE id=:id\";\n\n\t\t\t// prepare motherfucker\n\t\t\t$stmt = $this->conn->prepare($query);\n\n\t\t\t$stmt->bindParam(':id', $this->id);\n\t\t\t$stmt->bindParam(':name', $this->name);\n\t\t\t$stmt->bindParam(':drink', $this->drink);\n\n\t\t\tif ($stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t}else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function update() {\r\n\r\n\t\t// Does the Genre object have an ID?\r\n\t\tif ( is_null( $this->id ) ) trigger_error ( \"Genre::update(): Attempt to update an Genre object that does not have its ID property set.\", E_USER_ERROR );\r\n\r\n\t\t// Update the Genre\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$sql = \"UPDATE :table SET name=:name WHERE id = :id\";\r\n\t\t$st = $conn->prepare ( $sql );\r\n\t\t$st->bindValue( \":table\", DB_TBL_GENRE, PDO::PARAM_STR );\r\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t$st->bindValue( \":name\", $this->name, PDO::PARAM_STR );\r\n\t\t$st->execute();\r\n\t\t$conn = null;\r\n\t}", "public function updated(Food $food)\n {\n //\n }", "protected function updateAndPersistBlog() {}", "public function update(Request $request, $id)\n {\n $breed = Breed::where(['id'=>$id])->update([\n 'name'=>$request->name,\n 'animal_id'=>$request->animal_id,\n ]);\n return redirect('breeds');\n }", "public function updatePet() {\n $body = $this->objectConverter->convert($_POST, Pet::CLASS);\n $this->petService->updatePet($body);\n }", "public function update(UpdateDog $request, $dog_id)\n {\n\n Log::info('Controller - dog update endpoint has been called.');\n $response = $this->dogService->update($request->all(), $dog_id, $request->user()->id);\n\n return Response::json([\n 'message' => $response->getMessage(),\n 'data' => $response->getData(),\n 'status_code' => $response->getStatusCode(),\n 'ok' => $response->getOk()\n ], $response->getStatusCode());\n\n }", "public function update(Request $request, Pet $pet)\n {\n $validatedData = $request->validate([\n 'name' => 'required|unique:chickens|max:100',\n 'DOB' => 'nullable|date',\n 'DOD' => 'nullable|date',\n 'species' => 'required',\n 'breed' => 'nullable',\n 'sex' => 'nullable',\n 'person' => ' nullable',\n 'people' => 'nullable',\n 'favorites' => 'nullable',\n 'dislikes' => 'nullable',\n 'origin_story' => 'nullable',\n 'locations' => 'nullable',\n 'description' => 'nullable',\n 'pet_photo' => 'nullable|mimes:jpeg,png,jpg,gif|max:2048',\n 'comments' => 'nullable'\n ]);\n \n \n $pet = Pet::where('name', $pet)->firstOrFail();\n\n $pet->name = Request('name');\n if (Request('DOB') !== null) {\n $pet->DOB = Request('DOB');\n }\n if (Request('DOD') !== null) {\n $pet->DOD = Request('DOD');\n }\n $pet->breed = Request('breed');\n $pet->species = Request('species');\n $pet->sex = Request('sex');\n $pet->favorites = Request('favorites');\n $pet->dislikes = Request('dislikes');\n $pet->origin_story = Request('origin_story');\n $pet->locations = Request('locations');\n $pet->description = Request('description');\n $pet->comments = Request('comments');\n\n if ($request->has('pet_photo')) {\n $image = Request('pet_photo');\n $extension = Request('pet_photo')->extension(); \n $name = Request('name').'_'.time().'.'.$extension;\n $path = $image->storePubliclyAs('images/pets', $name);\n }\n $pet->photo_url = $path;\n\n $pet->save();\n \n\n return back()->with('success', 'Record Updated Successfully.');\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",comments=\\\"$this->comments\\\",price=\\\"$this->price\\\",brand=\\\"$this->brand\\\",model=\\\"$this->model\\\",y=\\\"$this->y\\\",link=\\\"$this->link\\\",in_existence=\\\"$this->in_existence\\\",is_public=\\\"$this->is_public\\\",is_featured=\\\"$this->is_featured\\\",category_id=\\\"$this->category_id\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function updateDB()\n {\n\n }", "public function update(Request $request, $id)\n {\n \n// $flight = App\\Flight::find(1);\n\n// $flight->name = 'New Flight Name';\n\n// $flight->save();\n\n\n $data=BountyCategory::find($id);\n \n $data->name=$request->name;\n $data->save();\n\n // BountyCategory::where('id',$category)->update($data);\n session()->flash('success','data successfully updated');\n return redirect(route('bounties.index'));\n }", "public function update(Request $request, $id)\n {\n $drug = Drug::whereId($id)->firstOrFail();\n $drug->product_name = $request->name ;\n $drug->generic_name = $request->brandName ;\n $drug->category = $request->category ;\n $drug->formulation = $request->formulation;\n $drug->allergy_group = $request->allergy;\n $drug->expiry_date = $request->expiry_date;\n $drug->description = $request->description;\n $drug->instructions = $request->instruction;\n $drug->indications = $request->indication;\n $drug->mechanisms = $request->mechanism;\n $drug->contra_indications = $request->contraIndication;\n $drug->precautions = $request->precaution;\n $drug->adverse_effects = $request->sideEffect;\n $drug->drug_interactions = $request->drugInteraction;\n $drug->dose = $request->dose;\n $drug->unit = $request->unit;\n $drug->frequency = $request->frequency;\n $drug->duration = $request->duration;\n $drug->time = $request->time;\n $drug->dosage = $this->getDosage($request->dose, $request->unit, $request->frequency, $request->duration, $request->time);\n $drug->unit_pack = $request->unitPack;\n $drug->quantity= $request->quantity;\n $drug->cost_price = $request->costPrice;\n $drug->retail_price = $request->salePrice;\n $drug->private_price = $request->salePrice;\n $drug->brookstone_price = $request->salePrice;\n if ($request->has('show')) {\n $drug->status = 1;\n } else {\n $drug->status = 0;\n }\n $drug->save();\n return back()->with('success_message', 'Drug updated successfully.');\n }", "public function update(Request $request)\n {\n $pigBreeder = PigBreeder::find($request->id);\n $pigBreeder->fill($request->all()); \n $pigBreeder->save();\n }", "public function updateThisPupil():void\n {\n $cbd = (new Connected())->connectedToDataBase();\n $query = \"UPDATE list_of_classes SET VALUES (?)\";\n \n }", "public function updateBreed($breedname, $breedid)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \"UPDATE pig_breeds \r\n\t\t\t\t\t\t\tset breed_name = '\" .$breedname. \"'\r\n\t\t\t\t\t\tWHERE breed_id = '\" . $breedid. \"'\";\r\n\t\t\t\t$result = mysqli_query($link, $query);\r\n\t\t}", "public function update(Request $request, $id)\n {\n \n $drug = Drug::findOrFail($id);\n//delete image\n if(!is_null($request->pictures_deleted)){\n foreach($request->pictures_deleted as $img){\n Picture::where('title',$img)->delete();\n }\n } \n// Upload image\n if($request->hasfile('pictures'))\n {\n\n foreach($request->file('pictures') as $image)\n {\n $name=time() . '.' .$image->getClientOriginalName();\n $imageUrl = public_path().'/images/drug/'.$name;\n // $image->move(public_path().'/images/', $name); \n Image::make($image)->resize(200, 200)->save($imageUrl); \n // $data[] = $name; \n Picture::create([\n 'title' => $name,\n 'path' => public_path().'/images/drug/' ,\n 'class_name' => 'drug',\n 'object_id' => $id\n ]); \n }\n }\n\n //inpute drug \n\n $input = [\n 'en_name' => $request['en_name'],\n 'ar_name' => $request['ar_name'],\n 'classification_id' => $request['classification_id'],\n 'form_id' => $request['form_id'],\n 'form_unit' => $request['form_unit'],\n 'amount_of_form' => $request['amount_of_form'],\n 'country_id' => $request['country_id'],\n 'company_id' => $request['company_id'],\n 'leaflet_id' => $request['leaflet_id'],\n 'pharma_price' => $request['pharma_price'],\n 'lay_price' => $request['lay_price'],\n 'barcodes' => $request['barcodes'],\n 'status_id' => $request['status_id']\n ];\n //validate impute drug\n $this->validate($request, [\n 'en_name' => 'required | unique:drugs,en_name,'.$id.''\n ]);\n\n Drug::where('id', $id)->update($input);\n//inpute chemical composition\n //delete old chemicalcomposiotion\n //ChemicalComposition::where('drug_id', $id)->delete();\n\n $new_ch_compositions =$request->new_ch_compositions;\n if($request->old_ch_compositions != null)\n {\n $deletes = array_diff($old_ch_compositions, $new_ch_compositions);\n foreach($deletes as $del)\n {\n ChemicalComposition::where('id', $del)->delete();\n }\n }\n \n $compositions = $request->compositions;\n foreach ($request->quantity_id as $quantity_id) {\n if(is_null($quantity_id)){\n break; \n }\n else{\n $first_composition = array_shift($compositions);\n $ch_co = new ChemicalComposition();\n //$ch_co->classification_id = (int) array_shift($classifications);\n $ch_co->drug_id = $id; \n $ch_co->composition_quantity_id = $quantity_id;\n $ch_co->composition_id = $first_composition;\n $ch_co->save();\n }\n }\n\n\n return redirect()->intended('drug-administration/drug');\n\n }", "public function update(Request $request, Drink $drink)\n {\n //\n }", "public function update($data, $id){\n // TODO: Modif bagian ini\n $this->db->where('id', $id);\n $this->db->update('pokemon', $data);\n }", "public function update(Request $request, $id){\n $breed = Breed::find($id);\n $breed->name = $request->json()->get('name');\n $breed->save();\n return response()->json($breed);\n }", "public function update(Request $request, $id)\n {\n $animal = Animal::findOrFail($id);\n $animal->name = $request['name'];\n $animal->sex = $request['sex'];\n $animal->breed = $request['breed'];\n $animal->species = $request['species'];\n $animal->birth = $request['birth'];\n $animal->castration = $request['castration'];\n $animal->save();\n flash('Animal atualizado com Sucesso')->success();\n return redirect()->route(\"animais.index\");\n }", "public function update_dog($id, $params)\n {\n return $this->update($id, $params, static::TYPE_DOG);\n }", "public function update($gunBbl);", "public function update(Request $request, $id)\n {\n $this->animals[$id] = $request;\n $this->index();\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Request $request, $id, Animal $animal)\n {\n $animal = Animal::all();\n $adoption = Adoption::find($id);\n $animalId = $adoption->animalId;\n $this->validate(request(), [\n 'adopted' => 'required',\n ]);\n $adoption->adopted = $request->input('adopted');\n $adoption->save();\n\n if ($adoption->adopted == 'accepted') {\n $other = Adoption::where(\"animalId\", \"=\", $animalId)->where(\"adopted\", \"=\", \"pending\")->get();\n\n foreach ($other as $record) {\n $record->status = 'rejected';\n $record->save();\n }\n }\n\n $animal = Animal::where(\"id\", \"=\", $animalId)->first();\n $animal->availability = 'not available';\n $animal->save();\n\n return redirect('adoptions')->with('success','Adoption has been updated');\n }", "public function update(){\n\t//\tprint_r($this->country);\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",description=\\\"$this->description\\\",tags=\\\"$this->tags\\\",area_id=\".$this->area_id.\",image=\\\"$this->image\\\",created_at=$this->created_at,is_public=$this->is_public,price=$this->price where id=\".$this->id;\n\t\tExecutor::doit($sql);\n\t}", "public function update(Datastore $db)\n {\n $stmt = $db->prepare('\n UPDATE tbl_survey SET\n col_name = :name,\n col_url = :url,\n col_active = :active,\n col_target = :target\n WHERE col_uuid = :surveyUuid\n ');\n $stmt->bindValue(':name', $this->name, PDO::PARAM_STR);\n $stmt->bindValue(':url', $this->url, PDO::PARAM_STR);\n $stmt->bindValue(':active', $this->active, PDO::PARAM_BOOL);\n $stmt->bindValue(':target', $this->target, PDO::PARAM_STR);\n $stmt->bindValue(':surveyUuid', $this->uuid, PDO::PARAM_STR);\n $db->execute($stmt);\n }", "public function update(Request $request, Flavor $flavor)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $post = BlogPost::find($id);\n\n $this->validate($request,[\n\n 'title' => 'required',\n 'category_id' => 'required',\n 'blog_content' => 'required',\n 'tags' => 'required'\n ]);\n\n if($request->hasFile('featured_image')){\n\n $imageName = $request->featured_image;\n $path = 'uploads/posts/';\n $newName = time().$imageName->getClientOriginalName();\n\n $image = move($path, $newName);\n\n $post->featured = $newName;\n }\n\n\n $post->title = $request->title;\n $post->category_id = $request->category_id;\n $post->content = $request->blog_content;\n\n $post->Tags()->sync($request->tags);\n\n\n $post->save();\n\n session()->flash('success', 'The post is updated');\n\n return redirect()->route('post.view');\n\n\n }", "public function update(Request $request, Ibd $ibd)\n {\n //\n }", "public function update() {\n // Get the values that are currently in the database\n $curr_vals = $this->read_single();\n\n // Set the values that will be added to the table\n foreach ($curr_vals as $key => $value) {\n // Convert key from the Database's capitalization to\n // this model's attribute capitalization style (all lowercase)\n $local_key = strtolower($key);\n // If user didn't specify property\n if (($this->attr[$local_key] === \"\") || ($this->attr[$local_key] === null)){\n // Then use the value that's already in the database\n $this->attr[$local_key] = $curr_vals[$key];\n }\n }\n\n // Create query\n $query = \"UPDATE \" . $this->table .\n \" SET = \" .\n \" WHERE MID = :mid AND Spot = :spot \";\n\n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Clean the data (reduce malicious SQL injection, etc.)\n foreach ($this->attr as $key => $value) {\n $this->attr[$key] = htmlspecialchars(strip_tags($value));\n }\n \n // Bind the data to a variable for an SQL attribute\n foreach ($this->attr as $key => $value) {\n $stmt->bindValue((\":\" . $key), $value);\n }\n\n // Execute the prepared statement and check for errors in running it\n return $this->runPrepStmtChkErr($stmt);\n }", "public function update($id)\n {\n $update = $this->model->find($id)->update($this->request->all());\n if ($update) {\n if ($this->request->hasFile('gallary')) {\n //Product Gallary\n $gallary = $this->request->file('gallary');\n foreach ($gallary as $photo) {\n $name = str_random(6) . '_' . $photo->getClientOriginalName();\n $extension = strtolower($photo->getClientOriginalExtension());\n if ($extension == \"jpg\" || $extension == \"jpeg\" || $extension == \"png\" || $extension == \"gif\") {\n $galary = new BlogGalary();\n $galary->photo = $name;\n $galary->blog_id = $insert->id;\n $galary->save();\n $dest = 'admin-assets/images/blogs/';\n $photo->move($dest, $name);\n }\n }\n }\n \n \\Session::flash('flash_message', 'blogs updated successfully'); //<--FLASH MESSAGE\n \n return redirect('admin/blog');\n } else {\n \\Session::flash('flash_message', 'update blogs not complete, Try agin later '); //<--FLASH MESSAGE\n \n return redirect('admin/blog');\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function update(request $request,$id){\n array_splice($this->animals,$id,1,$request->nama);\n $this->index();\n }", "public function update($database, CouchDBObject $object);", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "protected function update() {}", "public function UpdateFood($sku, $foodDesc, $category, $price){\r\n $conn = new ConnectionManager();\r\n $pdo = $conn->getConnection();\r\n \r\n \r\n // YOUR CODE GOES HERE\r\n\r\n\r\n\r\n return $isOk;\r\n }", "public function testUpdate(): void { }", "public function update(Request $request, Dish $dish)\n {\n $request->validate([\n 'name' => 'required',\n ]);\n\n $dish->update($request->all());\n\n $tags = $request->input('tags');\n\n // remove all tags\n $dish->tags()->detach();\n // add passed tags\n $dish->tags()->attach($tags);\n\n return redirect()->route('dishes.index')\n ->with('success','Dish updated successfully');\n }", "public function update() {\n\t\tTournamentDBClient::update($this);\n\t}", "public function update()\n\t{\n\t\t$this->getModel()->update($this);\n\t}", "public function update(Request $request, Pet $pet)\n {\n //\n }", "public function update($id, Request $request)\n {\n $breed = Breed::find($id);\n $breed->update($request->all());\n \n return redirect()->route('showbreed', [$id]);\n }", "public function update(Request $request, $id)\n {\n\n $this->validate($request, array(\n 'title' => 'required|max:255',\n 'editor1' => 'required',\n \"category\" => \"required|max:255\",\n \"author\" => \"required|max:255\",\n ));\n //getting instance of the post\n $post = Post::Find($id);\n //getting image and storing\n if ($request->hasFile('myFile')) {\n $image = $request->file('myFile');\n\n $location = public_path('../../nkeksi-tech.com/img/blogPosts/');\n $filename = time() . '.' . $image->getClientOriginalExtension();\n $image->move($location, $filename);\n $oldfile = $post->featured_file;\n $post->featured_file = $filename;\n\n \\File::delete('../../nkeksi-tech.com/img/blogPosts/'.$oldfile);\n }\n\n\n //grabbing the data into the post object\n $post->title = $request->title;\n $post->body = $request->editor1;\n $post->category_id = $request->category;\n $post->team_id = $request->author;\n\n\n //saving post into the database\n $post->save();\n\n if(isset($request->tags)){\n $post->tags()->sync($request->tags, true);\n }\n else{\n $post->tags()->sync(array());\n }\n\n\n\n Session::flash('success', 'Blog post was updated successfully');\n return redirect()->route('posts.show', $post->id);\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n 'title'=>'required',\n 'featured'=>'image',\n 'content'=>'required',\n 'category_id'=>'required'\n ]);\n\n $post=Post::find($id);\n if($request->hasFile('featured')){\n $featured=$request->featured;\n $featured_new_name=time().$featured->getClientOriginalName();\n $uploaded= $featured->move('uploads/posts', $featured_new_name);\n $post->featured=$uploaded;\n }\n $post->title=$request->input('title');\n $post->content=$request->input('content');\n $post->category_id=$request->input('category_id');\n\n\n\n $post->save();\n $post->tags()->sync($request->tags);\n return redirect('admin/post');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[//validate again the fields\n 'name' => 'required',\n 'slug' => 'required',\n ]);\n\n $lawtags = lawtags::find($id);//find the relevant detail from the database\n $lawtags->name = $request->name;\n $lawtags->slug = $request->slug;\n $lawtags->save();//update the data in the database\n\n return redirect(route('lawtag.index'));//redirect back to the previous page\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name'=>'required',\n 'price'=>'required|digits_between:1,10000',\n 'filepath'=>'required'\n ]);\n $flower = Flower::find($id);\n $flower->name = $request->name;\n $flower->price = $request->price;\n $flower->path = $request->filepath;\n $flower->slider = $request->slider ? 1 : 0;\n $flower->stock = $request->stock ? 1 : 0;\n $flower->description = $request->description;\n $flower->save();\n return redirect('/admin/flower');\n }", "public function update(Request $request, $id)\n {\n\n $biodata = Biodata::find($id);\n\n $data = $request->all();\n\n $biodata->fill($data);\n\n if($request->hasFile('foto')) {\n\n $path = $request->foto->store('public/uploads');\n list($tmp, $filename) = explode('public/', $path);\n $biodata->foto = $filename;\n\n }\n\n\n $sukses = $biodata->save();\n\n if ($sukses) {\n return redirect('admin/biodata');\n }\n }", "public function update(Request $request, $id)\n {\n if (Auth::check()) {\n $data = $request->all();\n\n $vecchio_post = Post::find($id);\n\n $vecchio_post->postToTag()->detach();\n\n $vecchio_post->title = $data['title'];\n $vecchio_post->author = $data['author'];\n $vecchio_post->category_id = $data['category_id'];\n\n $vecchio_post->save();\n\n $vecchio_post->postToInfo->description = $data['description'];\n\n $vecchio_post->postToInfo->save();\n\n $vecchio_post->postToTag()->attach($data['tags']);\n\n return redirect()->route('post.index');\n }\n }", "public function update(Request $request, Dish $dish)\n {\n //\n }", "function update()\n {\n $this->dbInit();\n if ( isset( $this->ID ) )\n {\n query( \"UPDATE Grp set Name='$this->Name', Description='$this->Description',\n\t\tUserAdmin='$this->UserAdmin',\n \t\tUserGroupAdmin='$this->UserGroupAdmin',\n\t\tPersonTypeAdmin='$this->PersonTypeAdmin',\n\t\tCompanyTypeAdmin='$this->CompanyTypeAdmin',\n\t\tPhoneTypeAdmin='$this->PhoneTypeAdmin',\n\t\tAddressTypeAdmin='$this->AddressTypeAdmin' WHERE ID='$this->ID'\" );\n }\n }", "public function update(DiveUpdateRequest $request, Dive $dive)\n {\n $input = $request->except('date');\n $input['time'] = Carbon::createFromTimestamp(strtotime( $request['date'] . $input['time'] . \":00\"));\n\n $dive->update($input);\n\n return response('Update', Response::HTTP_ACCEPTED);\n }", "public function update(Request $request, $id)\n {\n //\n $tag = Tag::Find($request->input('id'));\n $tag->name = $request->input('name');\n $save = $tag->save();\n if($save){\n return redirect()->route('tags.index')->with('success','Tag is added successfully!!!');\n }\n return redirect()->route('tags.index')->with('errors','Tag didnt updated!!!');\n }", "public function update()\n\t{\n\t\t$this->user->db_update();\n\t}", "public function updated(Vision $vision)\n {\n //\n }", "public function update(PDO &$pdo) {\n\n\t\t// create query template\n\t\t$query = \"UPDATE category SET name = :name WHERE categoryId = :categoryId\";\n\t\t$statement = $pdo->prepare($query);\n\n\t\t// bind the member variables\n\t\t$parameters = array(\"name\" => $this->name, \"categoryId\" => $this->categoryId);\n\t\t$statement->execute($parameters);\n\t}", "public function update(Request $request, $id)\n { \n $album = Album::find($id);\n $album->update($request->only('name', 'user_id', 'year', 'genre_id'));\n $album->tags()->attach($request->only('tag'));\n return redirect()->route('album.index')->with('success', ' Album was updated successfully with ID: '.$album->id);\n }", "public function update()\n\t{\n\t\t$input = \\Input::all();\n\n\t\t$category = Category::findOrFail($input.id);\n\n\t\tif($category){\n\t\t\t$category->name = $input.name;\n\t\t\t$result = $category->save();\n\t\t}\n\n\t\tif($result){\n\t\t\treturn \"true\";\n\t\t}\n\t\treturn \"false\";\n\t}", "public function update(Request $request, $id)\n {\n // get data from form\n $data = $request->all();\n\n // validation\n $request->validate($this->ruleValidation());\n\n //get post to update\n $post = Post::find($id);\n\n //generare slug se ne viene creato uno nuovo, stessa coa fatta in store\n $data['slug'] = Str::slug($data['title'], '-');\n\n //se cambia l'img\n if (!empty($data['path_img'])) { //ci chiediamo se abbiamo una nuova img\n if(!empty($post->path_img)) { //ci chiediamo se ce ne fosse una in precedenza\n Storage::disk('public')->delete($post->path_img); //cancella completamente la vecchia se presente\n }\n $data['path_img'] = Storage::disk('public')->put('images', $data['path_img']); //aggiungiamo la nuova img\n }\n\n //aggiornare/update db\n $updated = $post->update($data); //ha bisogno di fillable nel model(già messo)\n\n //verifichiamo se update è andato a buon fine (guardare i return)\n if ($updated) {\n if (!empty($data['tags'])) { \n $post->tags()->sync($data['tags']); //metodi se editando cambiamo le preferenze in checkbox\n }else {\n $post->tags()->detach(); //o le cancelliamo ttt\n }\n\n return redirect()->route('posts.show', $post->slug);\n } else {\n return redirect()->route('home');\n }\n }", "public function update()\n {\n }", "public function update(Request $request, $id)\n {\n $bandArtist = BandArtist::find($id);\n $data = $request->input();\n\n $validator = $this->validator($data);\n if ($validator->fails())\n {\n return redirect('new-band-artist')->withErrors($validator->messages());\n }\n\n $file = $request->file('picture');\n if($file){\n $fileName = time().'_'.$file->getClientOriginalName();\n $file->storeAs('images',$fileName);\n } else {\n $fileName = $data['old_picture'];\n }\n\n $bandArtist->name = $data[\"name\"];\n $bandArtist->genre = $data[\"genre\"];\n $bandArtist->description = $data[\"description\"];\n $bandArtist->img = $fileName;\n $bandArtist->save();\n\n return redirect('band-artist');\n }", "public function update(Request $request, $id)\n {\n //DB::update('UPDATE flowers SET name=?, price=? WHERE id = ?', [$request->name, $request->price, $id]);\n $flower = Flower::find($id);\n\n $flower->name = $request->name;\n $flower->price = $request->price;\n\n $flower->save();\n\n // redirect to flowers list with a message\n return redirect('flowers')->with('success', $request->name . ' was updated successfully');\n }", "public function updaterating($picture)\n {\n $pictureModel = new PictureModel();\n $rating=($pictureModel->rating($picture));\n\n $query = \"UPDATE $this->tableName SET rating=? WHERE id=?\";\n $statement = ConnectionHandler::getConnection()->prepare($query);\n $statement->bind_param('ii', $rating, $picture);\n $statement->execute();\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'category_id' => 'required',\n 'title' => 'required',\n 'description' => 'required',\n\n ]);\n\n if ($validator->fails()) {\n return redirect()->route('blogs.edit',$id)\n ->withErrors($validator)\n ->withInput();\n }\n\n $input = $request->all();\n $bg = Blog::find($id);\n $old_blog_image =$bg->image_url;\n $bg->category_id=$input['category_id'];\n $bg->title=$input['title'];\n $bg->slug_name = strtolower(str_replace(\" \",\"-\",$input['title']));\n\n $bg->description=$input['description'];\n\n if(isset($input['service_image'])){\n\n $blog_image = $this->saveBlogImage($request);\n\n //unlink previous image\n $blog_image_path = $old_blog_image;\n\n if(File::exists(public_path().$blog_image_path)) {\n File::delete(public_path().$blog_image_path);\n }\n\n $bg->image_url=$blog_image;\n }\n\n\n $bg->save();\n\n $request->session()->flash('message', 'Blog has been updated successfully!');\n return redirect()->route('blogs.index');\n }", "public function update(Request $request, $id)\n {\n //\n \n\n $farmer=Farmer::find($id);\n\n $farmer->fname=$request->fname;\n $farmer->lname=$request->lname;\n $farmer->age=$request->age;\n $farmer->address=$request->address;\n $farmer->state=$request->state;\n $farmer->city=$request->city;\n $farmer->pincode=$request->pincode;\n $farmer->vegetable=$request->vegetable;\n \n\n $farmer->save();\n\n Session::flash('success','The tag has been changed successsfully!!!');\n return redirect()->route('home');\n\n }", "public function update(Request $request, $id)\n {\n // 如果路徑不存在,就自動建立\n if (!file_exists('uploads/drugs/drug_introduction')) {\n mkdir('uploads/drugs/drug_introduction', 0755, true);\n }\n \n $drug = DrugIntroduction::find($id);\n\n if ($request->hasFile('image')) {\n // 先刪除原本的圖片\n if ($drug->image != 'default.jpg')\n @unlink('uploads/drugs/drug_introduction/' . $drug->image);\n $file = $request->file('image');\n $path = public_path() . '\\uploads\\drugs\\drug_introduction\\\\';\n $fileName = time() . '.' . $file->getClientOriginalExtension();\n $file->move($path, $fileName);\n\n $drug->image = $fileName;\n }\n\n $drug->name = $request->input('name');\n $drug->generic_name = $request->input('generic_name');\n $drug->uses = $request->input('uses');\n $drug->description = $request->input('description');\n\n $drug->save();\n\n return redirect()->route('admin.drug_introduction.index');\n }", "public function update(Request $request)\n {\n $request->validate([\n 'id'=>'required|integer',\n 'name'=>'required|max:128'\n ]);\n $id = $request->get('id');\n $animalType = AnimalType::find($id);\n $animalType->name = $request->get('name');\n $animalType->save();\n\n return redirect('animalType')->with('success', 'Animal type has been updated successfully');\n }", "public function updateDatabase(){\n $api_response = Http::get(config('urls.api'));\n //Place in database\n $this->postToDatabase($api_response);\n }", "public function update()\n {\n update($this->id, $article);\n }", "public function update(Request $request, $id)\n {\n //\n $animal = Cat::find($id);\n $animal->update($request->all());\n return $animal;\n }", "public function update(Request $request, Bird $bird)\n {\n request()->validate([\n 'tracker_id' => 'required',\n 'name' => 'required',\n 'is-female' => 'required'\n ]);\n\n $bird->update(request(['tracker_id', 'name', 'is-female']));\n return redirect(route('birds.index'));\n }", "protected function update()\n {\n $database = cbSQLConnect::connect('object');\n if (isset($database))\n {\n $fields = self::$db_fields;\n foreach($fields as $key)\n {\n $flag = $database->SQLUpdate(\"place\", $key, $this->{$key}, \"id\", $this->id);\n if ($flag == \"fail\")\n {\n break;\n }\n }\n if ($flag == \"fail\")\n {\n return false;\n }\n else\n return $this->id;\n }\n }", "public function update(Request $request, post $post)\n {\n $data = $request->all(); \n\n // $data['brand_new'] = key_exists('brand_new', $data) ? true: false;\n // $car->update($data); // update = fill + save\n $post->title = $data['title'];\n $post->author = $data['author'];\n $post->cover = $data['cover'];\n $post->data = $data['data'];\n $post->category_id=$data['category_id'];\n $post->save();\n //$this->fillAndSavePost($post, $data);\n\n return redirect()->route('posts.show', compact('post'));\n }", "public function update(Request $request, $id)\n {\n $tag = Tag::findOrFail($id);\n $tag->name = $request->tag_name;\n \n $tag->save();\n }", "public function update(Request $request, $id)\n {\n // Validate the data\n $blog = Blog::find($id);\n\n if ($request->input('slug') == $blog->slug) {\n $this->validate($request, array(\n 'title' => 'required|max:255',\n 'body' => 'required',\n ));\n } else {\n $this->validate($request, array(\n 'title' => 'required|max:255',\n 'body' => 'required',\n 'featured_img' => 'sometimes|image'\n ));\n }\n\n // Save the data to the database\n $blog = Blog::find($id);\n\n $blog->title = $request->input('title');\n $blog->body = $request->input('body');\n $blog->slug = $request->input('slug');\n\n if ($request->hasFile('featured_img')) {\n\n #Add new photo\n $image = $request->file('featured_img');\n $filename = time() . '.' . $image->getClientOriginalExtension();\n $location = public_path('images/blogs/' . $filename);\n Image::make($image)->save($location);\n\n $oldFilename = $blog->image;\n\n\n //here we update the database\n $blog->image = $filename;\n\n # Delete the old photo\n Storage::delete($oldFilename);\n\n $blog->save();\n }\n\n $blog->save();\n\n // set flash data with success message\n Session::flash('success', 'This post was successfully saved.');\n\n // redirect with flash data to $blogs.show\n return redirect()->route('admin.blogs.show', $blog->id);\n }", "public function update(Request $request, $id)\n {\n $validated = $request->validate([\n 'name' => 'required|max:255',\n 'gender' => 'required',\n 'breed' => 'required|max:255',\n 'born_at' => 'required',\n 'medical_condition_id' => 'required',\n 'user_id' => 'required',\n 'pets_type_id' => 'required',\n\n ]);\n\n $pet = Pet::findOrFail($id);\n $pet->fill($validated);\n $pet->save();\n\n return redirect()->route('pets.show', ['pet' => $pet->id]);\n\n\n }", "public function update(Request $request, $id)\n {\n $storeDatabase = \"\";\n $brand = Brands::findOrFail($id);\n $brand->name = $request->name;\n if($request->hasFile('image')){\n $imageName = rand(1, 10000). time() . '.' . $request->image->getClientOriginalExtension();\n $storeDatabase = 'storage/upload/image_brands/'. $imageName;\n Image::make($request->image->getRealPath())->resize(500, 400)->save(public_path('storage/upload/image_brands/') . $imageName); \n $brand->image = $storeDatabase; \n } \n $brand->save();\n\n return redirect()->route('brand.index')->with('status', 'Data Brand Has Been Edited');\n }", "public function update(Request $request, $id)\n {\n //\n\n $garage = Garage::find($id);\n $garage->address = $request->address;\n $garage->city = $request->city;\n $garage->postal = $request->postal;\n $garage->lat = $request->lat;\n $garage->lng = $request->lng;\n\n $garage->title = $request->title;\n $garage->description = $request->description;\n\n $garage->startdate = $request->startdate;\n $garage->enddate = $request->enddate;\n $garage->starthour = $request->starthour;\n $garage->endhour = $request->endhour;\n\n $garage->state_id = $request->state;\n $garage->type_garage_id = $request->type_garage_id;\n $garage->user_id = auth()->user()->id;\n\n $garage->save();\n\n $myArrayTags = $request->tags;\n\n foreach ($garage->tags as $tag) {\n # code...\n $tag->delete();\n }\n\n foreach ($myArrayTags as $myTag) {\n # code...\n $tag = new Tag();\n $tag->name = $myTag;\n $tag->save();\n\n $garage->tags()->sync($tag, false);\n }\n\n return response()->json('Updated', Response::HTTP_ACCEPTED);\n }", "public function update( )\n {\n\n $rules = array(\n 'animalID' => 'required',\n 'progressDescription' => 'required',\n 'progressID' => 'required'\n\n );\n\n $id = Request::get('progressID');\n\n $validator = Validator::make(Request::all(), $rules);\n\n if ($validator->fails()){\n return Redirect::to('mobileapp/progress/'.$id.'create')\n ->withErrors($validator)\n ->withInput(Request::except('password'));\n } else {\n\n\n $progress= Progress::find($id);\n $progress->progressDescription = Request::get('progressDescription');\n $progress->animalID = Request::get('animalID');\n $progress->save();\n\n Session::flash('message','progress point successfully edited');\n return Redirect::to('mobileapp/animals/'. Request::get('animalID').'/edit');\n }\n }", "public function update(Request $request, $id) {\n $adjective = Adjective::findOrFail($id);\n $adjective->name_male = $request->name_male;\n $adjective->name_female = $request->name_female;\n $adjective->description_male = $request->description_male;\n $adjective->description_female = $request->description_female;\n $adjective->save();\n\n $request->session()->flash('message', 'Η εγγραφή με id ' . $id . ' ενημερώθηκε με επιτυχία.');\n return redirect()->route('cms.adjectives.index');\n }", "public function update(Request $request, $id)\n {\n $breed = Breed::find($id);\n\n $breed->update($request->all());\n\n return $breed;\n }", "public function updated(BlogCategory $blogCategory)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $vehicle = Vehicle::whereHas('tags', function ($query) use($id) {\n $query->where('id', $id);\n }); \n\n if ($vehicle->exists()) {\n return redirect()->route('tag.index')->withErrors('Vehicle tag is in use and can not be edited!');\n }\n\n $tag = Tag::find($id);\n $tag->name = $request->tag;\n $tag->save();\n\n return redirect()->route('tag.index')->with('message', 'Tag is updated!');\n }", "public function update()\n\t{\n\t\t$crud = $this->crud->find($_POST['id']);\n\t\t$curd->data([\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t]);\n\t\t$crud->update();\n\t\t$this->redirect('crud');\n\t}", "public function update($id) {\n \n }", "public function update($id) {\n \n }", "public function update(Request $request, $id)\n {\n $hiking = Hiking::find($id);\n if($hiking){\n $input = $request->all();\n $result= $hiking->fill($input)->save(); \n if($result){\n return response($hiking,201);\n }else{\n return response($hiking,500);\n }\n }else{\n return response($hiking,404);\n }\n }", "public function update(Request $request, $id)\n {\n $post = Post::find($id);\n $this->validate($request,[\n \"title\" => \"required\",\n \"content\" => \"required\",\n \"branchs_id\" => \"required\" \n \n ]);\n if ( $request->hasFile('featrued') ) {\n $featured = $request->featrued;\n $featured_new_name = time().$featured->getClientOriginalName();\n $featured->move('uploads/posts/',$featured_new_name);\n $post->featrued = 'uploads/posts/'.$featured_new_name;\n \n }\n$post->title = $request->title;\n$post->content = $request->content;\n$post->branchs_id = $request->Branch_id;\n$post->tags()->sync($request->tags);\n$post->save();\n\n return redirect()->back();\n }", "public function update(InsertAdherentRequest $request, Adherent $adherent)\n {\n /*$adherent->with('equipes')->get();\n $adherent->equipes = $adherent->equipes->toArray();\n if(array_key_exists(0, $adherent->equipes)) {\n $equipesAdherent = array_keys(array_flip($adherent->equipes[0][\"pivot\"]), \"equipe_id\");\n foreach($equipesAdherent as $eq) {\n $adherent->equipes()->detach($eq);\n }\n }\n\n if(!empty($request->input('id'))) {\n foreach($request->input('id') as $check) {\n $adherent->equipes()->attach($check);\n }\n }*/\n \n //$adherent->save();\n\n $adherent->update($request->all());\n return back()->with('info', 'L\\'adhérent a bien été modifié de la base de données');\n }", "public function update(DishValidation $request, Dish $dish)\n {\n\n\n $dish->update([\n 'title' => $request->input('title'),\n 'description' => $request->input('description'),\n 'price' => $request->input('price'),\n 'main_id' => $request->input('main_id'),\n 'image_url' => $request->input('image_url'),\n ]);\n return redirect()->route('admin.dishes')->with('success', 'Dish updated successfully');\n }", "public function update(Request $request, $id)\n {\n $data = Scenery::find($id);\n if($request->hasfile('picture')){\n //创建文件上传对象\n $picture = $request -> file('picture');\n //创建文件名\n $temp_name = str_random(20);\n //获取后缀名\n $ext = $picture -> getClientOriginalExtension(); //后缀名\n //拼接文件名\n $name = $temp_name.'.'.$ext;\n //拼接路径\n $dir = './uploads/'.date('Ymd',time());\n //拼接向数据库存储的路径\n $filename = ltrim($dir.'/'.$name,'.');\n //上传\n $picture -> move($dir,$name);\n $data -> picture = $filename;\n }else{\n $data -> picture = $data['picture'];\n }\n $data -> title = $request -> input('title');\n $data -> content = $request -> input('content');\n $data -> address = $request -> input('address');\n $res = $data -> save();\n if($res){\n return redirect('admin/scenery')->with('success','修改成功');\n }else{\n return back()->with('error','修改失败');\n }\n }", "public function update(Request $request, $id)\n {\n $hdron = new Hdron;\n $hdron->Institucion = $request->input('Institucion');\n $hdron->NombreRobot = $request->input('NombreRobot');\n $hdron->NombreEquipo = $request->input('NombreEquipo');\n $hdron->NombreCapitan = $request->input('NombreCapitan');\n $hdron->Ronda = $request->input('Ronda');\n $hdron->Tiempo = $request->input('Tiempo');\n $hdron->Status = $request->input('Status');\n $hdron->save(); \n\n //$drones->update($request->all());\n\n Drones::find($id)->update($request->all());\n\n return redirect()->route('Drones.index')->with('success',' Updated successfully');\n }" ]
[ "0.6721816", "0.6620883", "0.65648544", "0.6461888", "0.6439406", "0.63850397", "0.63402176", "0.6228897", "0.62143326", "0.61902803", "0.61837274", "0.6161746", "0.61451685", "0.6075297", "0.6046318", "0.6034924", "0.59771085", "0.59630084", "0.5932775", "0.5919881", "0.59099066", "0.588855", "0.5805715", "0.58035976", "0.57913435", "0.5786287", "0.57857454", "0.57814974", "0.5781188", "0.577197", "0.57632303", "0.5750482", "0.5738016", "0.5712361", "0.57097065", "0.569752", "0.5696194", "0.5687647", "0.56731737", "0.5664924", "0.5664924", "0.56586164", "0.56437725", "0.56420445", "0.5634283", "0.5631613", "0.5627087", "0.5623915", "0.56179136", "0.5615351", "0.5610409", "0.56099916", "0.559805", "0.5597231", "0.5590169", "0.5589671", "0.5587394", "0.55796057", "0.55708563", "0.5569266", "0.55668867", "0.5565363", "0.55572623", "0.55543023", "0.55538934", "0.5548175", "0.5541442", "0.5535449", "0.5533353", "0.55319685", "0.5530483", "0.55262154", "0.55255264", "0.55243254", "0.55167216", "0.55153096", "0.55135655", "0.5507291", "0.54997957", "0.5495792", "0.54906607", "0.54899645", "0.54897165", "0.5488917", "0.5486134", "0.548497", "0.54834056", "0.5478215", "0.54768914", "0.5473399", "0.5472377", "0.5465784", "0.5462535", "0.5462454", "0.5462454", "0.54535395", "0.5447638", "0.5440111", "0.54372984", "0.54359925", "0.5430104" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { return Facility::destroy($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Create and get from a mixed $subject
public static function from($subject) { if ($subject instanceof ModelInterface) { $ret = call_user_func_array('static::fromModel', func_get_args()); } elseif ($subject instanceof ResultsetInterface) { $ret = call_user_func_array('static::fromResultset', func_get_args()); } else { throw new \InvalidArgumentException(static::E_INVALID_SUBJECT); } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createSubject( $subject )\n {\n \n $request = new Request( \n 'POST', \n self::ENDPOINT_URL . '/subjects/', \n [ 'content-type' => 'application/json' ], \n json_encode($subject->toArray())\n );\n \n \n $response = $this->request($request);\n \n if (false === $response ) {\n return $response;\n }\n \n $subject->configure($response);\n\n return $subject;\n }", "public static function transform($subject)\n\t{\n\t\treturn new static($subject);\n\t}", "public function subject($subject);", "abstract public function get_subject();", "abstract public function subject($subject);", "public function read($subject);", "abstract protected function getSubject();", "public function set_subject($subject);", "protected function _subject($additional = array()) {\n\t\treturn $this->_crud()->getSubject($additional);\n\t}", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function setSubject($subject);", "public function setSubject($subject);", "public function setSubject($subject);", "public function readResponseObject(array $subject)\n {\n $response = Helper\\SubjectReader::readResponse($subject);\n\n// if (!isset($response['object']) || !is_object($response['object'])) {\n// throw new \\InvalidArgumentException('Response object does not exist');\n// }\n\n return $response['object'];\n }", "public function created(Subject $subject)\n {\n //\n }", "public function testGetSubject()\n {\n $subject = $this->createInstance(['_getSubject']);\n $_subject = $this->reflect($subject);\n $arg = uniqid('subject-');\n\n $subject->expects($this->exactly(1))\n ->method('_getSubject')\n ->will($this->returnValue($arg));\n\n $result = $subject->getSubject();\n $this->assertEquals($arg, $result, 'Subject did not retrieve required exception subject');\n }", "public function __construct($subject)\n {\n $this->subject = $subject;\n }", "public function createSubject($context)\n {\n global $logger;\n //$copyContext = $this->copy($context);\n //$copyContext = $this->_ensureSecurityMgr($copyContext);\n //$copyContext = $this->_resolveSession($copyContext);\n //$copyContext = $this->_resolvePrincipals($copyContext);\n $subject = $this->doCreateSubject($context);\n $this->_save($subject);\n\n return $subject;\n\n }", "function setSubject($subject) {\n\t\treturn $this->setData('subject', $subject);\n\t}", "private function createSubject()\n {\n $input = file_get_contents('subject.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "abstract function getSubject() : string;", "public function setSubject($subject)\n {\n $this->_subject = $subject;\n return $this;\n }", "public function setSubject($subject)\n {\n return $this->getSubject()->setSubject($subject);\n }", "public function subjectOf($subjectOf)\n {\n return $this->setProperty('subjectOf', $subjectOf);\n }", "public function subjectOf($subjectOf)\n {\n return $this->setProperty('subjectOf', $subjectOf);\n }", "function clientCode(Subject $subject)\n{\n // ...\n\n $subject->request();\n\n // ...\n}", "public function setSubject($subject)\n {\n $this->subject = $subject;\n return $this;\n }", "public function setSubject($subject)\n {\n $this->subject = $subject;\n return $this;\n }", "public function setSubject($subject)\n {\n $this->subject = $subject;\n return $this;\n }", "public function setSubject($subject) \n\t{\n\t\t$this->subject = $subject;\n\t\treturn $this;\n\t}", "public function getSubject($additional = array()) {\n\t\tif (empty($this->_model) || empty($this->_modelName)) {\n\t\t\t$this->_setModelProperties();\n\t\t}\n\n\t\t$subject = new CrudSubject();\n\t\t$subject->crud = $this;\n\t\t$subject->controller = $this->_controller;\n\t\t$subject->model = $this->_model;\n\t\t$subject->modelClass = $this->_modelName;\n\t\t$subject->action = $this->_action;\n\t\t$subject->request = $this->_request;\n\t\t$subject->response = $this->_controller->response;\n\t\t$subject->set($additional);\n\n\t\treturn $subject;\n\t}", "private function resolveClassAndCreateObject($type, $subject)\n {\n foreach ($this->classes[$type] as $source => $target) {\n if ($subject instanceof $source) {\n return new $target;\n }\n }\n\n throw new InvalidArgumentException('Unsupported object class.');\n }", "public function show(Subject $subject)\n {\n return new SubjectResource($subject);\n }", "public function subject($subject) {\n\n\t\t$this->subject = $subject;\n\n\t\treturn $this;\n\t}", "public function addSubject($subject)\n\t{\n\t\treturn $this->_subject = $subject;\n\t}", "public function subject($subject)\n {\n $this->subject = $subject;\n\n return $this;\n }", "public function subject($subject)\n {\n $this->subject = $subject;\n\n return $this;\n }", "public function getSubject($type = null)\n {\n if( null === $this->_subject ) {\n throw new Khcn_Model_Exception(\"getSubject was called without first setting a subject. Use hasSubject to check\");\n } else if( is_string($type) && $type !== $this->_subject->getType() ) {\n throw new Khcn_Model_Exception(\"getSubject was given a type other than the set subject\");\n } else if( is_array($type) && !in_array($this->_subject->getType(), $type) ) {\n throw new Khcn_Model_Exception(\"getSubject was given a type other than the set subject\");\n }\n \n return $this->_subject;\n }", "function subject($subject = '')\n\t{\n\t\tif (!$subject)\n\t\t\treturn FALSE;\n\t\t\t\n\t\t$this->subject = $subject;\n\t}", "public function generate( string $subject ) : string\n {\n return $subject;\n }", "public function updateSubject( $subject )\n {\n \n $request = new Request( \n 'PUT', \n self::ENDPOINT_URL . '/subjects/' . $subject->id, \n [ 'content-type' => 'application/json' ], \n json_encode($subject->toArray())\n );\n\n $response = $this->request($request);\n \n $subject->configure($response);\n \n return $subject;\n }", "public static function fromResultset($subject)\n {\n $reflection = new \\ReflectionClass(__CLASS__);\n $instance = $reflection->newInstanceArgs(func_get_args());\n\n return $instance->execute()->get();\n }", "public function get($subject, $workflowName = null)\n {\n return $this->registry->get($subject, $workflowName);\n }", "public function setSubject($subject)\n {\n $this->subject = $subject;\n\n return $this;\n }", "public function setSubject($subject)\n {\n $this->subject = $subject;\n\n return $this;\n }", "public function setSubject($subject)\n {\n $this->subject = $subject;\n\n return $this;\n }", "public function setSubject($subject)\n {\n $this->subject = $subject;\n\n return $this;\n }", "public function setSubject($subject)\n {\n $this->subject = $subject;\n\n return $this;\n }", "public function setSubject($subject)\n {\n $this->subject = $subject;\n\n return $this;\n }", "public function addSubject($subject)\n {\n if ($subject instanceof Subject) {\n $subject = $subject->toArray();\n }\n\n return $this->addToAttribute('subjects', $subject);\n }", "public function getSubject(): mixed\n {\n return $this->subject;\n }", "public function setSubject($subject, $encoding = 'UTF-8') {}", "public function readResponseObject(array $subject)\n {\n $response = SubjectReader::readResponse($subject);\n if (!isset($response['object']) || !is_object($response['object'])) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__('Response object does not exist.'));\n }\n\n return $response['object'];\n }", "public function getSubject(): string;", "function setSubject($subject) {\n $this->fields['subject'] = $subject;\n return $this;\n }", "public function __construct(RealSubject $realSubject)\n {\n $this->realSubject = $realSubject;\n }", "public function __construct(\\SplSubject $subject)\n {\n $this->subject = $subject;\n }", "public function testCreateSubject()\n {\n echo \"\\nTesting Subject creation...\";\n $input = file_get_contents('subject.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"-----Create Response:\".$response;\n \n $result = json_decode($response);\n $this->assertTrue(!$result->success);\n \n \n }", "public function tokenFromSubject(JWTSubject $subject, $meta = []) : string\n {\n return JWT::encode([\n $this->getSubKey() => $subject->getJWTIdentifier(),\n ...$meta\n ], $this->JWTSecret);\n }", "protected function json()\n\t{\n\t\t$this->subject = json_decode($this->subject);\n\n\t\treturn $this;\n\t}", "function clientCode(SubjectInterface $subject)\r\n{\r\n // ...\r\n\r\n $subject->request();\r\n\r\n // ...\r\n}", "public function setSubject($val)\n {\n $this->_propDict[\"subject\"] = $val;\n return $this;\n }", "public function match($subject);", "public function getSubject(): ?SslCertificateEntity {\n $val = $this->getBackingStore()->get('subject');\n if (is_null($val) || $val instanceof SslCertificateEntity) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'subject'\");\n }", "public static function toSubject($data)\n {\n $subj = new ForumSubject();\n $subj->setId(Parse::clean($data->id));\n $subj->setTopic(Parse::clean($data->topic));\n $subj->setSubtitle(Parse::clean($data->subtitle));\n\n return $subj;\n }", "private function transformSubject($subject, $method, $formatBy)\n\t{\n\t\t$transformed = null;\n\n\t\tswitch($formatBy)\n\t\t{\n\t\t\tcase 'property':\n\n\t\t\t\t$result = [];\n\n\t\t\t\t// Loop through property and use values as property on the subject\n\t\t\t\tforeach($this->$method as $key)\n\t\t\t\t{\n\t\t\t\t\t// Cater for alias set in the key names\n\t\t\t\t\t$keyParts = explode('|', $key);\n\t\t\t\t\t$propertyPath = $keyParts[0];\n\t\t\t\t\t$key = isset($keyParts[1]) ? $keyParts[1] : $propertyPath;\n\n\t\t\t\t\t$result[$key] = array_reduce(explode('.', $propertyPath), function($obj, $prop) {\n\t\t\t\t\t\treturn $obj->$prop;\n\t\t\t\t\t}, $subject);\n\t\t\t\t}\n\n\t\t\t\t$transformed = $result;\n\n\t\t\t\tbreak;\n\t\t\tcase 'method':\n\n\t\t\t\t$transformed = $this->$method($subject);\n\n\t\t\t\tbreak;\n\t\t\tcase 'toArray':\n\n\t\t\t\t$transformed = $subject->toArray();\n\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $this->returnType === 'object' ? (object) $transformed : $transformed;\n\t}", "public abstract function subscribe(Subject $subject);", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n ->getMessage();\n\n return $mock->new();\n }", "public function getSubject()\n {\n }", "protected function format($subject)\n\t{\n\t\t$this->subject = $subject;\n\n\t\treturn $this;\n\t}", "protected function first()\n\t{\n\t\tif (is_array($this->subject)) {\n\t\t\t$this->subject = reset($this->subject);\n\t\t} else if ($this->subject instanceof \\stdClass) {\n\t\t\t$this->subject = get_object_vars($this->subject);\n\t\t\t$this->subject = reset($this->subject);\n\t\t}\n\n\t\treturn $this;\n\t}", "function &buildTestSubject($type, $class) {\n\t\tClassRegistry::flush();\n\t\tApp::import($type, $class);\n\t\t$class = $this->getRealClassName($type, $class);\n\t\tif (strtolower($type) == 'model') {\n\t\t\t$instance =& ClassRegistry::init($class);\n\t\t} else {\n\t\t\t$instance =& new $class();\n\t\t}\n\t\treturn $instance;\n\t}", "public function create(Subject $subject)\n {\n $subjects = $subject->all();\n return view('paper.create', compact('subjects'));\n }", "public function store(SubjectRequest $request)\n {\n Subject::create(\n array_merge(\n $request->all(),\n [\n 'school_id' => auth('school')->id()\n ]\n )\n );\n return SubjectResource::collection(Subject::all());\n }", "protected function setSubject($subject)\n {\n $this->subject = $subject;\n\n return $this;\n }", "public function __construct($data, $domain, $type, $subject)\n {\n $this->data = $data;\n $this->domain = $domain;\n $this->type = $type;\n $this->subject = $subject;\n }", "function Subject( $subject )\r\n\t\t{\r\n//echo \"$subject\";\r\n\t\t$this->msubject = \"=?utf-8?B?\"\r\n\t\t\t. base64_encode( strtr( $subject, \"\\r\\n\" , \" \" ) )\r\n\t\t\t. \"?=\";\r\n\t\t}", "public function setSubject($var)\n {\n GPBUtil::checkString($var, True);\n $this->subject = $var;\n\n return $this;\n }", "public function setSubject($var)\n {\n GPBUtil::checkString($var, True);\n $this->subject = $var;\n\n return $this;\n }", "public function store(SubjectStore $request)\n {\n $subject = Subject::create([\n 'code' => $request->code,\n 'name' => $request->name,\n 'shortname' => $request->shortname,\n 'description' => $request->description,\n 'number' => $request->number,\n 'subject_group_id' => $request->subject_group_id,\n 'study_id' => $request->study_id,\n 'course_id' => $request->course_id,\n 'hours' => $request->hours,\n 'week_hours' => $request->week_hours,\n 'start' => $request->start,\n 'end' => $request->end\n ]);\n event(new SubjectStored($subject));\n return $subject->map();\n }", "public function __construct(M $subject)\n\t{\n\t\t$this->subject = $subject;\t\n\t}", "public function subject($value)\n {\n $this->subject = $value;\n\n return $this;\n }", "private function fillSubject($params_array, $subject, string $condition = 'OR')\n {\n if (!is_array($subject)) {\n $subject = [$subject];\n }\n\n //tutor should have at least one of the subjects\n if ($condition === static::COMPARE_CONDITION_OR) {\n //incoming data could contain categories ids, need to convert all categories id and use subject ids related to this categories\n $subject = SubjectOrCategory::convertToSubjectIds($subject);\n array_push($params_array['query']['bool']['must'], [\n 'terms' => [\n 'subjects' => $subject,\n ],\n ]);\n } elseif ($condition === static::COMPARE_CONDITION_AND) {\n //tutor should have all selected subjects\n foreach ($subject as $subjectOrCategoryId) {\n //check is it category or subject\n if (SubjectOrCategory::isIdOfCategory($subjectOrCategoryId)) {\n //if case of category look for all subject from category\n $values = SubjectOrCategory::convertToSubjectIds([$subjectOrCategoryId]);\n } else {\n $values = [$subjectOrCategoryId];\n }\n array_push($params_array['query']['bool']['must'], [\n 'terms' => [\n 'subjects' => $values,\n ],\n ]);\n }\n }\n\n return $params_array;\n }", "public function findNewBySubject(Stock\\StockSubjectInterface $subject): array;", "public function setData($subject)\n {\n }", "public function getSubject() \r\n { \r\n return $this->_subject; \r\n }", "public function setSubject($subject)\n {\n if( null !== $this->_subject ) {\n throw new Khcn_Model_Exception(\"The subject may not be set twice\");\n }\n\n if( !($subject instanceof Khcn_Model_Item_Abstract) ) {\n throw new Khcn_Model_Exception(\"The subject must be an instance of Khcn_Model_Item_Abstract\");\n }\n \n $this->_subject = $subject;\n return $this;\n }", "public function show(Subject $subject)\n {\n $subject->load('course', 'curriculum', 'schedules');\n return $subject;\n }", "public function __construct(&$subject, $params)\n\t{\n\t\tparent::__construct($subject, $params);\n\t}", "public static function buildFromContent( $subject, $htmlContent='', $plaintextContent=NULL, $type = 'transactional', $useWrapper=TRUE )\n\t{\n\t\t$email = static::factory( $type );\n\t\t$email->type = $type;\n\t\t$email->subject = $subject;\n\t\t$email->htmlContent = $htmlContent;\n\t\t$email->plaintextContent = ( $plaintextContent === NULL ) ? static::buildPlaintextBody( $htmlContent ) : $plaintextContent;\n\t\t$email->useWrapper = $useWrapper;\n\t\treturn $email;\n\t}", "public function createObserver(SubjectInterface $subject);", "public function setSubject($value)\n {\n return $this->set('Subject', $value);\n }", "private function parseCommand(string $subject) : Mailcode_Commands_Command_ShowEncoded\n {\n $command = $this->parseCommandStringValid($subject);\n\n $this->assertInstanceOf(Mailcode_Commands_Command_ShowEncoded::class, $command);\n\n return $command;\n }", "public function setSubject($value)\n {\n return $this->set('Subject', $value);\n }" ]
[ "0.68919307", "0.67159295", "0.65651524", "0.65612143", "0.65374964", "0.6387926", "0.63489485", "0.59224516", "0.58480406", "0.58133966", "0.58133966", "0.58133966", "0.58133966", "0.58133966", "0.58133966", "0.58133966", "0.5806838", "0.5806838", "0.5806838", "0.57397157", "0.5735918", "0.5709476", "0.5695622", "0.56944966", "0.5675384", "0.56429756", "0.5620351", "0.5616158", "0.5596637", "0.5578544", "0.5578544", "0.5558556", "0.55366397", "0.55366397", "0.55366397", "0.5518974", "0.55048996", "0.54830915", "0.5478846", "0.5446029", "0.5442942", "0.544232", "0.544232", "0.54355097", "0.5424461", "0.540892", "0.53982097", "0.53948367", "0.5359042", "0.5352453", "0.5352453", "0.5352453", "0.5352453", "0.5352453", "0.5352453", "0.5347866", "0.5344637", "0.5303796", "0.52894694", "0.5284473", "0.528365", "0.52819896", "0.5280522", "0.5269891", "0.5242759", "0.5240076", "0.52383953", "0.52366346", "0.5236593", "0.5234937", "0.52318126", "0.5223128", "0.5201229", "0.5196798", "0.51889336", "0.5179841", "0.51673007", "0.5160549", "0.51487005", "0.51448566", "0.5141674", "0.5131507", "0.5122363", "0.51198685", "0.51198685", "0.5118955", "0.5107477", "0.50966173", "0.5094221", "0.50781584", "0.50652045", "0.50622904", "0.5057188", "0.50525266", "0.50513244", "0.50458115", "0.5045785", "0.5044315", "0.5043363", "0.5042938" ]
0.6729747
1
Create and get from a Model
public static function fromModel(ModelInterface $subject) { $reflection = new \ReflectionClass(__CLASS__); $instance = $reflection->newInstanceArgs(func_get_args()); return $instance->execute()->get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->modelManager->instance($this->model);\n }", "public function create(): Model;", "public function create(Model $model);", "static function Create() \n\t{\n if (NULL == self::$userModel) {\n self::$userModel = new UserModel();\n }\n return self::$userModel;\n }", "public function getModel()\n {\n $model = new $this->versionable_type();\n $model->unguard();\n $model->fill(unserialize($this->model_data));\n $model->exists = true;\n $model->reguard();\n return $model;\n }", "public function create()\n {\n return $this->get();\n }", "protected function make(): Model\n {\n $model = new $this->model;\n $this->modelPk = $model->getKeyName();\n\n return $model;\n }", "public function createModel()\n {\n }", "public function createModel()\n\t{\n\t\treturn $this->getModelConfiguration()->createModel();\n\t}", "protected function makeModel()\n {\n return factory(Employee::class)->create();\n }", "private function makeModel()\n {\n\n $this->model = $this->app->make($this->model());\n\n if (!$this->model instanceof Model)\n throw new Exception(\"Class \".$this->model.\" must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\n\n\n return $this->model;\n }", "private function createModel()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "public function createModel() {\n return null;\n }", "public function model($model) {\r\n require_once \"../app/models/$model.php\";\r\n return new $model; //return class\r\n }", "protected abstract function model();", "public function model()\n {\n $model = $this->_model;\n return new $model;\n\n }", "public function createModel()\n\t{\n\t\t$class = '\\\\'.ltrim($this->model, '\\\\');\n\t\treturn new $class;\n\t}", "protected static function getModel()\n {\n $modelName = get_called_class();\n $model = new $modelName();\n $model->setFetchMode(\\Phalcon\\Db::FETCH_OBJ);\n return $model;\n }", "abstract protected function modelFactory();", "public abstract function model();", "public static function model()\n {\n return new self;\n }", "function getModel($model)\n{\n $models = [];\n /* $models['Address'] = new Address;\n $models['Agency'] = new Agency;\n $models['AgencyBranch'] = new AgencyBranch;\n $models['AgencySolicitorPartnership'] = new AgencySolicitorPartnership;\n $models['Cache'] = new Cache;\n $models['ConveyancingCase'] = new ConveyancingCase;\n $models['User'] = new User;\n $models['UserAddress'] = new UserAddress;\n $models['UserPermission'] = new UserPermission;\n $models['UserRole'] = new UserRole;*/\n $models['TargetsAgencyBranch'] = new TargetsAgencyBranch;\n return $models[$model];\n}", "public function getModel()\n {\n return new $this->model;\n }", "protected function newModel($data)\n{\n\t$className = Model::className($this->query['from']);\n\t$model = new $className($this->query['from']);\n\n\tif (!$this->cachedTemplate) {\n\t\t$this->cachedTemplate = $model->getTemplate();\n\t}\n\n\t$model->setTemplate($this->cachedTemplate);\n\n\tif ($data) {\n\t\t$model->setValues($data);\n\t\t$model->isInDb(true);\n\t}\n\n\treturn $model;\n}", "function create($model)\n {\n }", "public function query()\n {\n if ($model = $this->model) {\n return new $model();\n }\n }", "protected function getModelInstance()\n {\n return new $this->model();\n }", "abstract protected function model();", "abstract protected function model();", "public function buildModel() {}", "public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }", "public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }", "public function makeModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n $modelData = is_resource($this->model_data)\n ? stream_get_contents($this->model_data,-1,0)\n : $this->model_data;\n\n $className = self::getActualClassNameForMorph($this->versionable_type);\n $model = new $className();\n $model->unguard();\n $model->fill(unserialize($modelData));\n $model->exists = true;\n $model->reguard();\n return $model;\n }", "public function create($modelData);", "public function model($model) {\n // Require model file\n require_once \"../app/models/{$model}.php\";\n\n // Instantiate model\n return new $model();\n }", "static public function getModel($model_name) {\n return new $model_name();\n }", "abstract function getModel();", "public function create(Request $request): Model;", "abstract function model();", "abstract function model();", "abstract function model();", "abstract function model();", "public static function newModel()\n {\n $model = static::$model;\n\n return new $model;\n }", "public function create($data)\n\t{\n\t\t$model = $this->model->create($data);\n\n\t\treturn $model;\n\t}", "abstract public function model();", "abstract public function model();", "abstract public function model();", "abstract public function model();", "public function make($modelClass);", "function getUser($model)\n\t{\n\t\t$user = $this->users->find($model->idUser);\n\t\t$model->nameUser = $user->name;\n\t\t$model->scoreUser = $user->score;\n\t\t$model->emailUser = $user->email;\n\t\treturn $model;\n\t}", "protected function get_model_obj(){ return new Session_Model(); }", "public function create($data=null) {\n\t\t\treturn $this->_create_model_instance(parent::create($data));\n\t}", "function M($model)\n{\n\n $modelFile = APP.'/Model/'.$model.'Model.class.php';\n $modelClass = '\\\\'.MODULE.'\\Model\\\\'.$model.'Model';\n if (is_file($modelFile)) {\n \t$model = new $modelClass();\n \treturn $model;\n } else {\n \tthrow new \\Exception('找不到模型', $modelClass);\n }\n}", "abstract protected function getModel();", "protected function newModel(): Model\n {\n return (new $this->model)->fresh();\n }", "public function _instanciar_model() {\n $Model = ClassRegistry::init('Autenticacao.' . $this->config['model_usuario']);\n return $Model;\n }", "abstract public function instanceModel(): Model;", "public function getModel()\n {\n return $this->model->newInstance();\n }", "abstract protected function newModel(): Model;", "protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}", "private function createModel()\n\t{\n\t\treturn new Image();\t\t\n\t}", "protected function createModel()\n {\n $class = $this->getModelClass();\n\n $attributes = $this->getModelAttributes();\n\n return new $class($attributes);\n }", "abstract public function getModel();", "protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }", "public function model();", "public function model();", "public function model($model)\n\t{\n\t\trequire_once '../app/models/'.$model.'.php';\n\t\treturn new $model();\n\t}", "public function getObject()\n {\n $object = Doctrine::getTable($this->getModel())->findOneById($this->getModelId());\n\n return $object;\n }", "public function model($model){\n\n if(file_exists('../src/models/' . $model . '.php')){\n require_once '../src/models/' . $model . '.php';\n return new $model();\n } else {\n die('<strong>Fatal Error:</strong> Model <em>' . $model .'</em> does not exist');\n }\n }", "public function model($model)\n\t{\n\t\trequire_once INC_ROOT .'/app/models/'. $model .'.php';\n\t\treturn new $model();\n\t}", "public function getModel(): Model;", "public function getModel(): Model;", "protected function newModelInstance()\n {\n return resolve(Arr::get(self::DOCUMENT_TYPES, $this->type));\n }", "public function createModel()\n {\n return \\Model::factory(Group::class)->create();\n }", "public static function createFromModel(\\MemberModel $model)\n {\n return self::create($model->row());\n }", "public static function factory($model, $id = NULL)\n\t{\t\n\t\t$class = Jelly_Meta::class_name($model);\n\t\t\n\t\treturn new $class($id);\n\t}", "public static function Create() {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$record = new Dbi_Record($model, array());\r\n\t\treturn $record;\r\n\t}", "public function Model($model){\r\n $fullpath=cf(\"BASE/MVCPATH\").\"models\".DS.ucwords($model).EXT;\r\n if($this->Load($fullpath)){\r\n return new $model();\r\n }\r\n else {\r\n return null;\r\n } \r\n }", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function newEntryModel();", "public function creating($model)\n\t{\n\t}", "function getModel($name);", "final public static function getModel($model){\n $fileClass = self::getConfig()->path->path_modules.'/'. self::getPathModule().'/model/'.ucfirst($model).self::getConfig()->path->ext_file;\n if(file_exists($fileClass)){\n\n $model = str_replace('/', '\\\\', self::getPathModule().'/model/'.ucfirst($model));\n $obj = new $model();\n return $obj;\n\n }\n\n }", "public function get_model() {\r\n\t\t$model = null;\r\n\t\t\r\n\t\t//Includes the shared model, if exists.\r\n\t\t$path_shared = 'models/shared.php';\r\n\t\tif (file_exists($path_shared)) include($path_shared);\r\n\t\t\r\n\t\t//Checks if the models' file for the current controller exists.\r\n\t\t$path_current_model = 'models/'.$this->controller.'.php';\r\n\t\t\r\n\t\tif (file_exists($path_current_model)) {\r\n\t\t\t//If the file exists, checks if the class for the current action exists.\r\n\t\t\tinclude($path_current_model);\r\n\t\t\t$class_name = ucwords($this->controller).ucwords($this->action).\"Model\";\r\n\t\t\t\r\n\t\t\tif (class_exists($class_name)) {\r\n\t\t\t\t//Creates the class and populates its properties.\r\n\t\t\t\t$model = new $class_name();\r\n\t\t\t\t\r\n\t\t\t\t//Iterates through all request values and check for properties with the same name.\r\n\t\t\t\tforeach ($_REQUEST as $key => $value) {\r\n\t\t\t\t\tif (property_exists($model, $key)) {\r\n\t\t\t\t\t\t$model->$key = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $model;\r\n\t}", "public function create(array $data): ?Model;", "private function _getModel()\n {\n if (NULL === $this->_model) {\n $this->_model = new Model();\n }\n\n return $this->_model;\n }", "public function model()\n {\n //use model\n }", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}", "protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }", "private function loadModel() {\n // name as requested resource.\n $name = $this->name.'Model';\n $path = str_replace(kPlaceholder, $this->version, kModelsFolder);\n $path = $path . $name . \".php\";\n // If it does not exist, go with\n // the default Model class.\n if (!file_exists($path)) {\n return new Model();\n } else {\n if (!class_exists($name)) {\n include $path;\n }\n\n return new $name();\n }\n }", "abstract public function get(Model $from);", "abstract function load(Model $model);", "protected function get_model()\n {\n if( ! isset(self::$models[$this->_model]))\n {\n $model = $this->_model;\n self::$models[$this->_model] = new $model;\n }\n return self::$models[$this->_model];\n }", "public function create(): object\n {\n if (!Bouncer::can('create', $this->model)) {\n abort(403);\n }\n $form = $this->form($this->form, [\n 'method' => 'POST',\n 'route' => [$this->routeWithModulePrefix . '.' . 'store']\n ]);\n\n $item = new $this->model;\n return $this->view($this->baseView . '.create', ['form' => $form, 'item' => $item]);\n }", "protected function model($model)\r\n {\r\n if (file_exists(ROOT_DIR . '/app/models/' . $model . '.php'))\r\n {\r\n require_once ROOT_DIR . '/app/models/' . $model . '.php';\r\n return new $model(self::$db);\r\n }\r\n return NULL;\r\n }", "public function model($name){\n\t\treturn new $name();\n\t}", "public function readFromModel($entity);", "public function createModelObject($modelName){\n //$this->modelObject = new SignupModel;\n\n }", "public function getModel(){ }", "public function createModel(PayModel $model);" ]
[ "0.69898605", "0.68235415", "0.67063034", "0.6677367", "0.6629197", "0.6618596", "0.6614139", "0.65641963", "0.6557883", "0.6552055", "0.65394986", "0.6492876", "0.64752495", "0.6467825", "0.6452971", "0.64065707", "0.6391991", "0.63608754", "0.6353148", "0.6323329", "0.6315236", "0.62931055", "0.627514", "0.6269071", "0.6266179", "0.6260808", "0.6248624", "0.62484837", "0.62484837", "0.6234963", "0.6228546", "0.6228546", "0.6227398", "0.6201062", "0.6198052", "0.619218", "0.6189463", "0.61893255", "0.61869454", "0.6174391", "0.6174391", "0.6174391", "0.6174391", "0.6171472", "0.61682135", "0.6158714", "0.6158714", "0.6158714", "0.6158714", "0.6157368", "0.6110519", "0.61088127", "0.61057866", "0.6105419", "0.6105074", "0.61015534", "0.60923976", "0.60769546", "0.60646063", "0.6063117", "0.60603833", "0.6056493", "0.6056272", "0.60498714", "0.604514", "0.6043427", "0.6043427", "0.60344356", "0.6016036", "0.6013517", "0.6013045", "0.6010341", "0.6010341", "0.60102236", "0.5997732", "0.5995957", "0.5995761", "0.5989268", "0.59832895", "0.5982395", "0.5974771", "0.5967262", "0.5965948", "0.59580845", "0.59542626", "0.5952205", "0.594237", "0.59395814", "0.5933367", "0.5930927", "0.5930116", "0.5917476", "0.5915572", "0.5910187", "0.59088844", "0.58968985", "0.5895979", "0.5886185", "0.5885682", "0.5879589", "0.58765024" ]
0.0
-1
Create and get from a Resultset
public static function fromResultset($subject) { $reflection = new \ReflectionClass(__CLASS__); $instance = $reflection->newInstanceArgs(func_get_args()); return $instance->execute()->get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function factory_set( $resultset, $self = False )\n {\n $set = array();\n\n foreach ($resultset as $row) {\n $obj = $this->factory_item($row, $self);\n $obj->loaded = True;\n $set[] = $obj;\n }\n\n return $set;\n }", "private function _createResultset($select, $resultResource){\n\t\tif($select['return']=='1'){\n\t\t\tif($this->_db->numRows($resultResource)==0){\n\t\t\t\t$this->_count = 0;\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t$this->_db->setFetchMode(DbBase::DB_ASSOC);\n\t\t\t\t$uniqueRow = $this->_db->fetchArray($resultResource);\n\t\t\t\t$this->_db->setFetchMode(DbBase::DB_BOTH);\n\t\t\t\t$this->dumpResultSelf($uniqueRow);\n\t\t\t\t$this->_count = 1;\n\t\t\t\treturn $this->dumpResult($uniqueRow);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->_count = $this->_db->numRows($resultResource);\n\t\t\tif($this->_count>0){\n\t\t\t\treturn new ActiveRecordResultset($this, $resultResource, $select['sql']);\n\t\t\t} else {\n\t\t\t\treturn new ActiveRecordResultset($this, false, $select['sql']);\n\t\t\t}\n\t\t}\n\t}", "public abstract function fetchRow($result_set);", "public abstract function fetch($result_set, $class_name = null);", "protected function createResultObject() {\n\t\t$result = new Result();\n\t\treturn $result;\n\t}", "public function fetchResultAsObject(\\mysqli_result $result): MysqlResultCollection;", "public function resultSet(){\n\t\t$this->execute();\n\t\treturn $this->stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function resultSet(){\n $this->executeQuery($this->statement);\n return $this->fetchAll($this->statement);\n }", "public function resultSet(){\n $this->execute();\n return $this->statement->fetchAll(PDO::FETCH_OBJ);\n }", "function getIterator()\n {\n return new MySQL_Result( $this );\n }", "public static function fromResultSet( $res ) {\n //We get all the values form the query\n $id = $res[ ApplicationADO::$colNameId];\n $idUser = $res[ ApplicationADO::$colNameIdUser ];\n $position = $res[ ApplicationADO::$colNamePosition ];\n $startDate = $res[ ApplicationADO::$colNameStartDate ];\n $web = $res[ ApplicationADO::$colNameWeb ];\n $salary = $res[ ApplicationADO::$colNameSalary ];\n $hobbies = $res[ ApplicationADO::$colNameHobbies ];\n $relocate = $res[ ApplicationADO::$colNameRelocate ];\n $reasons = $res[ ApplicationADO::$colNameReasons ];\n\n //Object construction\n $entity = new Application();\n $entity->setId($id);\n $entity->setIdUser($idUser);\n $entity->setPosition($position);\n $entity->setStartDate($startDate);\n $entity->setWeb($web);\n $entity->setSalary($salary);\n $entity->setRelocate($hobbies);\n $entity->setReasons($reasons);\n\n return $entity;\n }", "public function fetch()\n {\n return mysql_fetch_object($this->res);\n }", "public function resultSet()\n\t{\n\t\t$this->execute();\n\t\treturn $this->stm->fetchAll(PDO::FETCH_OBJ);\n\t}", "function _fetch_object()\n\t{\n\t\treturn sqlsrv_fetch_object($this->result_id);\n\t}", "public function fetch() {\r\n $this->resource_fetched=true;\r\n return new dbconnect_rowset($this, $this->result);\r\n }", "public function getObject()\n {\n return mysqli_fetch_object($this->resulset);\n }", "private function getObjByResult($result){ \n //verifica tamanho do array\n if(count($result)>1){ \n $objects=array(); \n foreach ($result as $k => $v){ \n $objects[$k]=$this->getObjByRow($result[$k]);\n }\n return $objects;\n }\n else{ \n return array($this->getObjByRow($result[0]));\n }\n }", "abstract function res_row($res);", "public function getResultSet($stmt)\n\t{\n\t\tif($stmt instanceof PDOStatement) {\n\t\t\t$results = array();\n\t\t\t$resultsIdentities = array();\n\t\t\t\n\t\t\t// Set object to fetch results into\n\t\t\t$stmt->setFetchMode(PDO::FETCH_CLASS, $this->rowClass, array());\n\t\t\t\n\t\t\t// Fetch all results into new DataMapper_Result class\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_CLASS)) {\n\t\t\t\t\n\t\t\t\t// Load relations for this row\n\t\t\t\t$relations = $this->getRelationsFor($row);\n\t\t\t\tif($relations && is_array($relations) && count($relations) > 0) {\n\t\t\t\t\tforeach($relations as $relationCol => $relationObj) {\n\t\t\t\t\t\t$row->$relationCol = $relationObj;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Store in array for ResultSet\n\t\t\t\t$results[] = $row;\n\t\t\t\t\n\t\t\t\t// Store primary key of each unique record in set\n\t\t\t\t$pk = $this->getPrimaryKey($row);\n\t\t\t\tif(!in_array($pk, $resultsIdentities) && !empty($pk)) {\n\t\t\t\t\t$resultsIdentities[] = $pk;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Mark row as loaded\n\t\t\t\t$row->loaded(true);\n\t\t\t}\n\t\t\t// Ensure set is closed\n\t\t\t$stmt->closeCursor();\n\t\t\t\n\t\t\treturn new $this->resultSetClass($results, $resultsIdentities);\n\t\t\t\n\t\t} else {\n\t\t\treturn array();\n\t\t\t//throw new $this->exceptionClass(__METHOD__ . \" expected PDOStatement object\");\n\t\t}\n\t}", "function get_values ($resultset) {\n\t\t$data = array();\n\t\tfor ($i=0; $i<mysqli_num_rows($resultset); $i++) {\n\t\t\t$row = mysqli_fetch_assoc($resultset);\n\t\t\tarray_push($data,$row);\n\t\t}\n\t\treturn $data;\n\t}", "public function fetchRow($result_set)\n\t{\n\t\treturn $result_set->fetch_row();\n\t}", "public function custom_result_object($class_name)\n\t{\n\t\tif (array_key_exists($class_name, $this->custom_result_object))\n\t\t{\n\t\t\treturn $this->custom_result_object[$class_name];\n\t\t}\n\n\t\tif ( ! class_exists($class_name) OR $this->result_id === FALSE OR $this->num_rows() === 0)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t// add the data to the object\n\t\t$result_object = array();\n\t\t$data = NULL;\n\n\t\t/* First check if we don't already have the data.\n\t\t * If so - pass by reference, as we don't know how\n\t\t * large it might be and we don't want 1000 row\n\t\t * sets being copied.\n\t\t */\n\t\tif (count($this->result_array) > 0)\n\t\t{\n\t\t\t$data = &$this->result_array;\n\t\t}\n\t\telseif (count($this->result_object) > 0)\n\t\t{\n\t\t\t$data = &$this->result_object;\n\t\t}\n\n\t\tif ( ! is_null($data))\n\t\t{\n\t\t\tfor ($i = 0, $c = count($data); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$result_object[$i] = new $class_name();\n\t\t\t\tforeach ($data[$i] as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$result_object[$i]->$key = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// No prefetched result set\n\t\t\tif (is_array($this->row_data))\n\t\t\t{\n\t\t\t\t$row_index = count($this->row_data);\n\t\t\t\tif ($row_index === 0)\n\t\t\t\t{\n\t\t\t\t\treturn array();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfor ($i = 0; $i < $row_index; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result_object[$i] = new $class_name();\n\t\t\t\t\t\tforeach ($this->row_data[$i] as $key => $value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$result_object[$i]->$key = $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\telse\n\t\t\t{\n\t\t\t\t$row_index = 0;\n\t\t\t\t$this->row_data = array();\n\t\t\t}\n\n\t\t\twhile ($row = $this->_fetch_assoc())\n\t\t\t{\n\t\t\t\t$data = new $class_name();\n\t\t\t\tforeach ($row as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$data->$key = $value;\n\t\t\t\t}\n\n\t\t\t\t$this->row_data[$row_index] = $row;\n\t\t\t\t$result_object[$row_index++] = $data;\n\t\t\t}\n\t\t\t// Un-comment the following line, in case it becomes needed\n\t\t\t// $this->_data_seek();\n\t\t}\n\n\t\t/* As described for the num_rows() method - there's no easy\n\t\t * way to get the number of rows selected. Our work-around\n\t\t * solution (as in here as well) first checks if result_array\n\t\t * or result_object exist and returns their count. It doesn't\n\t\t * however check for a custom_object_result, so - do it here.\n\t\t */\n\t\tif ( ! is_int($this->num_rows))\n\t\t{\n\t\t\t$this->num_rows = count($result_object);\n\t\t}\n\n\t\t// Cache and return the array\n\t\treturn $this->custom_result_object[$class_name] = $result_object;\n }", "public function fetch($result_set, $class_name = null)\n\t{\n\t\t$object = $result_set->fetch_object(Builder::className($class_name));\n\t\tif ($object instanceof Abstract_Class) {\n\t\t\t$this->prepareFetch($object->class);\n\t\t\t$object = $this->read($this->getObjectIdentifier($object), $object->class);\n\t\t}\n\t\t// execute actions stored into $prepared_fetch\n\t\tforeach ($this->prepared_fetch as $property_name => $actions) {\n\t\t\tforeach ($actions as $action) {\n\t\t\t\tif ($action === self::GZINFLATE) {\n\t\t\t\t\t/** @noinspection PhpUsageOfSilenceOperatorInspection if not deflated */\n\t\t\t\t\t$value = @gzinflate($object->$property_name);\n\t\t\t\t\tif ($value !== false) {\n\t\t\t\t\t\t$object->$property_name = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($action instanceof Data_Link) {\n\t\t\t\t\t$value = $action->readProperty($object, $property_name);\n\t\t\t\t\tif (isset($value)) {\n\t\t\t\t\t\t$object->$property_name = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $object;\n\t}", "private function resultToDataset(object $result): Dataset {\n $dataset = new Dataset();\n\n $dataset->setId($result->id);\n $dataset->setOwnerOrg($result->owner_org);\n $dataset->setIdentifier($result->identifier);\n $dataset->setLanguage($result->language);\n $dataset->setAuthority($result->authority);\n $dataset->setPublisher($result->publisher);\n $dataset->setContactPointName($result->contact_point_name);\n $dataset->setName($result->name);\n $dataset->setTitle($result->title);\n $dataset->setNotes($result->notes);\n $dataset->setMetadataLanguage($result->metadata_language);\n $dataset->setMetadataModified($result->metadata_modified);\n $dataset->setTheme($result->theme);\n $dataset->setModified($result->modified);\n $dataset->setLicenseId($result->license_id);\n $dataset->setPrivate((bool) $result->private);\n $dataset->setHighValue(isset($result->high_value) && strtolower($result->high_value) === 'true');\n $dataset->setBaseRegister(isset($result->basis_register) && strtolower($result->basis_register) === 'true');\n $dataset->setReferenceData(isset($result->referentie_data) && strtolower($result->referentie_data) === 'true');\n $dataset->setNationalCoverage(isset($result->national_coverage) && strtolower($result->national_coverage) === 'true');\n\n $resources = [];\n if (!empty($result->resources)) {\n foreach ($result->resources as $v) {\n $resources[] = $this->resultToResource($v);\n }\n }\n $dataset->setResources($resources);\n\n $tags = [];\n if (!empty($result->tags)) {\n foreach ($result->tags as $v) {\n $tag = new Tag();\n $tag->setId($v->id);\n $tag->setName($v->name);\n $tags[] = $tag;\n }\n }\n $dataset->setTags($tags);\n\n $dataset->setAlternateIdentifier($result->alternate_identifier ?? []);\n $dataset->setSourceCatalog($result->source_catalog ?? NULL);\n $dataset->setContactPointAddress($result->contact_point_address ?? NULL);\n $dataset->setContactPointEmail($result->contact_point_email ?? NULL);\n $dataset->setContactPointPhone($result->contact_point_phone ?? NULL);\n $dataset->setContactPointWebsite($result->contact_point_website ?? NULL);\n $dataset->setContactPointTitle($result->contact_point_title ?? NULL);\n $dataset->setAccessRights($result->access_rights ?? NULL);\n $dataset->setUrl($result->url ?? NULL);\n $dataset->setConformsTo($result->conforms_to ?? []);\n $dataset->setRelatedResource($result->related_resource ?? []);\n $dataset->setSource($result->source ?? []);\n $dataset->setVersion($result->version ?? NULL);\n $dataset->setHasVersion($result->has_verison ?? []);\n $dataset->setIsVersionOf($result->is_version_of ?? []);\n $dataset->setLegalFoundationRef($result->legal_foundation_ref ?? NULL);\n $dataset->setLegalFoundationUri($result->legal_foundation_uri ?? NULL);\n $dataset->setLegalFoundationLabel($result->legal_foundation_label ?? NULL);\n $dataset->setFrequency($result->frequency ?? NULL);\n $dataset->setProvenance($result->provenance ?? []);\n $dataset->setSample($result->sample ?? []);\n $dataset->setSpatialScheme($result->spatial_scheme ?? []);\n $dataset->setSpatialValue($result->spatial_value ?? []);\n $dataset->setTemporalLabel($result->temporal_label ?? NULL);\n $dataset->setTemporalStart($result->temporal_start ?? NULL);\n $dataset->setTemporalEnd($result->temporal_end ?? NULL);\n $dataset->setDatasetStatus($result->dataset_status ?? NULL);\n $dataset->setDatePlanned($result->date_planned ?? NULL);\n $dataset->setVersionNotes($result->version_notes ?? []);\n $dataset->setIssued($result->issued ?? NULL);\n $dataset->setDocumentation($result->documentation ?? []);\n $dataset->setCommunities($result->communities ?? []);\n $dataset->setDatasetQuality($result->dataset_quality ?? NULL);\n $dataset->setCreatorUserId($result->creator_user_id ?? NULL);\n\n return $dataset;\n }", "public function result_object()\n\t{\n\t\tif (count($this->result_object) > 0)\n\t\t{\n\t\t\treturn $this->result_object;\n\t\t}\n\t\telseif (count($this->result_array) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->result_array); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$this->result_object[] = (object) $this->result_array[$i];\n\t\t\t}\n\n\t\t\treturn $this->result_object;\n\t\t}\n\t\telseif (is_array($this->row_data))\n\t\t{\n\t\t\tif (count($this->row_data) === 0)\n\t\t\t{\n\t\t\t\treturn $this->result_object;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row_index = count($this->row_data);\n\t\t\t\tfor ($i = 0; $i < $row_index; $i++)\n\t\t\t\t{\n\t\t\t\t\t$this->result_object[$i] = (object) $this->row_data[$i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row_index = 0;\n\t\t\t$this->row_data = array();\n\t\t}\n\n\t\t$row = NULL;\n\t\twhile ($row = $this->_fetch_object())\n\t\t{\n\t\t\t$this->row_data[$row_index] = (array) $row;\n\t\t\t$this->result_object[$row_index++] = $row;\n\t\t}\n\n\t\t// Un-comment the following line, in case it becomes needed\n\t\t// $this->_data_seek();\n\t\treturn $this->result_object;\n\t}", "public function createResponse() {\n\t\t\t$query = \"SELECT * FROM $this->table_name WHERE name=:name AND drink=:drink\";\n\n\t\t\t// prepare \n\t\t\t$stmt = $this->conn->prepare($query);\n\n\t\t\t// bind values\n\t\t\t$stmt->bindParam(':name', $this->name);\n\t\t\t$stmt->bindParam(':drink', $this->drink);\n\n\t\t\t$stmt->execute();\n\n\t\t\t// get retrieved row\n\t\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t\t// set values to object properties\n\t\t\t$this->id = $row['id'];\n\t\t\t$this->name = $row['name'];\n\t\t\t$this->drink = $row['drink'];\n\t\t}", "public function fetchResult();", "public function fetchObject()\n {\n return sasql_fetch_object($this->result);\n }", "private static function fromResultSetList( $res ) {\n\t\t$entityList = array();\n\t\t$i=0;\n\t\t//print_r($res);\n\t\twhile ( ($row = $res->fetch_array(MYSQLI_BOTH)) != NULL ) {\n\t\t\t//We get all the values an add into the array\n\t\t\t$entity = CakeDesignClass::fromResultSet( $row );\n\t\t\t\n\t\t\t$entityList[$i]= $entity;\n\t\t\t$i++;\n\t\t}\n\t\treturn $entityList;\n }", "public function resultset(){\n\t\t$this->execute() ;\n\t\treturn $this->statement->fetchAll(PDO::FETCH_ASSOC) ;\n\t}", "public function fetch_object()\n\t{\n\t\t$object = null;\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$object->$key = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$object = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $object;\n\t}", "public static function fromResultSetList( $res ) {\n $entityList = array();\n $i=0;\n //while ( ($row = $res->fetch_array(MYSQLI_BOTH)) != NULL ) {\n foreach ( $res as $row)\n {\n //We get all the values an add into the array\n $entity = ApplicationADO::fromResultSet( $row );\n\n $entityList[$i]= $entity;\n $i++;\n }\n return $entityList;\n }", "protected function get_result_from_query(){\n\t\t$this ->open_connection();\n\t\t$result = $this -> conn -> query($this -> query);\n\t\twhile($this -> rows[] = $result ->fetch_assoc());\n\t\t$result -> close();\n\t\t$this -> close_connection();\n\t\tarray_pop($this -> rows); // Extraé y devuelve el último valor\n\t}", "function resultSet($results) {\n $this->map = array();\n $numFields = $results->columnCount();\n $index = 0;\n $j = 0;\n\n while ($j < $numFields) {\n $column = $results->getColumnMeta($index);\n if (!empty($column['table'])) {\n $this->map[$index++] = array($column['table'], $column['name']);\n } else {\n if (strpos($column['name'], '__')) {\n $parts = explode('__', $column['name']);\n $this->map[$index++] = array($parts[0], $parts[1]);\n } else {\n $this->map[$index++] = array(0, $column['name']);\n }\n }\n $j++;\n }\n\n }", "public function results()\n\t{\n\t\t// using any existing $resource, process the results into a stdClass object:\n\t\t$out = array();\n\n\t\t// if the resource exists, proceed:\n\t\tif (isset(self::$resource))\n\t\t{\n\t\t\t// loop through the results and add them to the object:\n\t\t\twhile ($row = mysql_fetch_assoc(self::$resource))\n\t\t\t{\n\t\t\t\t$out[] = (object)$row;\n\t\t\t}\n\t\t}\n\n\t\t// return $out as an object:\n\t\treturn (object)$out;\n\t}", "public function fetch_array($result_set){\n return mysql_fetch_array($result_set);\n \n }", "public function getResults(): ?ResultSetContract;", "private static function mappingFromDBResult(&$result){\n $bindResult= [];\n $result->bind_result($bindResult['id'],$bindResult['descripcion'],$bindResult['estatus']);\n\n $results = [];\n while($result->fetch()){\n $estadoActual = new EstadoActual($bindResult['id'],$bindResult['descripcion']);\n $estadoActual->estatus = new Estatus($bindResult['estatus']);\n $results[] = $estadoActual;\n }\n return $results;\n }", "function sql_fetch_object($res)\n {\n $results = NULL;\n if ( $res && is_object( $res ) )\n $results = $res->fetchObject(); \n return $results;\n }", "private function prepared_to_object($prepared) {\r\n\t\t$parameters = array();\r\n\t\t$metadata = $prepared->result_metadata();\r\n\t\t\r\n\t\twhile($field = $metadata->fetch_field())\r\n\t\t\t$parameters[] = &$row[$field->name];\r\n\t\tcall_user_func_array(array($prepared, 'bind_result'), $parameters);\r\n\t\t\r\n\t\t$nrs = 0;\r\n\t\twhile($prepared->fetch()) {\r\n\t\t\t$cls = new stdClass;\r\n\t\t\tforeach($row as $key => $val)\r\n\t\t\t\t$cls->$key = $val;\r\n\t\t\t$results[] = $cls;\r\n\t\t\t$nrs++;\r\n\t\t}\r\n\t\t\r\n\t\treturn ($nrs == 0) ? 0 : $results;\r\n\t}", "public function setDataFromStatement(array $result)\n {\n $myBook = parent::setDataFromStatement($result);\n\n if (!empty($result['serie_id'])) {\n $myBook->getSerie()->setData(array(\n 'id' => $result['serie_id'],\n 'name' => $result['serie_name'],\n 'sort' => $result['serie_sort'],\n ));\n }\n\n return $myBook;\n }", "public function getResult(){\n\t\t\treturn $this->resultSet;\n\t\t}", "public static function prepareQueryResult($res) {\r\n $keys = call_user_func(array(get_called_class(), 'getKeys'));\r\n //identify all parameters with \"colname\" set\r\n $column_keys = array();\r\n foreach ($keys as $key => $val) {\r\n if (isset($val['colname']) && $val['colname'] != null)\r\n $column_keys[$key] = $val['colname'];\r\n }\r\n\r\n //for all items\r\n $ret = array();\r\n foreach ($res as $row) {\r\n $ret_row = array();\r\n //for the identified parameters\r\n foreach ($column_keys as $key => $val)\r\n //execute $row->get<ParameterColname>\r\n $ret_row[$key] = call_user_func(array($row, \"get\" . $val));\r\n $ret[] = $ret_row;\r\n }\r\n return $ret;\r\n }", "protected static final function objectsFromResult($name, $result, $chain)\n {\n $chain_result = new OrmChainResult(&$chain);\n\n foreach (SSql::getResultsFor($result) as $row) { # by row\n $row_class_vars = array();\n $row_rship_vars = array();\n\n foreach ($row as $key => $val) { # by col\n switch (sizeof($parts = explode('__', $key))) {\n case 3: # result_of, iterable, property -- i.e. populate a relationship\n list($r_alias, $i, $r_property) = $parts;\n $r_alias = self::dbToClassName($r_alias);\n $r_property = self::dbToPropertyName($r_property);\n\n $key = sprintf('%s__%s', Orm::dbToClassName($r_alias), $i);\n if (!isset($row_rship_vars[$key]))\n $row_rship_vars[$key] = array();\n\n $row_rship_vars[$key][$r_property] = $val;\n break;\n\n case 4: # result_of, iterable, class, property -- i.e. populate a class\n list($r_alias, $i, $r_class, $r_property) = $parts;\n $r_class = self::dbToClassName($r_class);\n $r_alias = self::dbToClassName($r_alias);\n $r_property = self::dbToPropertyName($r_property);\n\n $key = sprintf('%s__%s__%s', Orm::dbToClassName($r_alias), $i, Orm::dbToClassName($r_class));\n if (!isset($row_class_vars[$key]))\n $row_class_vars[$key] = array();\n\n $row_class_vars[$key][$r_property] = $val;\n break;\n\n case 6: # child_result_of, iterable, child, \"inherits\", class, property -- i.e. populate the rest of a class\n list($r_child_alias, $i, $r_child, $inherits_e_inherits, $r_class, $r_property) = $parts;\n $r_class = self::dbToClassName($r_class);\n $inherits_e_inherits = self::dbToClassName($inherits_e_inherits);\n $r_child = self::dbToClassName($r_child);\n $r_child_alias = self::dbToClassName($r_child_alias);\n $r_property = self::dbToPropertyName($r_property);\n\n if ($inherits_e_inherits != self::RELATIONSHIP_INHERITS)\n throw new OrmException('Not expecting key of form %s', $key);\n\n $key = sprintf('%s__%s__%s', Orm::dbToClassName($r_child_alias), $i, Orm::dbToClassName($r_child));\n if (!isset($row_class_vars[$key]))\n $row_class_vars[$key] = array();\n\n if ($r_property == self::AUTO_PROPERTY_ID)\n $row_class_vars[$key][sprintf('__%s__%s', $r_class, self::AUTO_PROPERTY_ID)] = $val;\n else\n $row_class_vars[$key][$r_property] = $val;\n break;\n\n default:\n throw new OrmException('Unexpected key encountered: %s', print_r($parts, true));\n }\n }\n\n $row_class_objs = array();\n $row_rship_objs = array();\n\n foreach ($row_class_vars as $alias__class => $vars) {\n list($alias, $i, $class) = explode('__', $alias__class);\n if (!self::isRegisteredClass($name, $class))\n throw new OrmException('Class %s is not registered for Schema %s', $class, $name);\n\n $obj = new $class(OrmClass::CONSTR_CMD_POPULATE_SYNCED_ARRAY, $name, $vars);\n\n $row_class_objs[sprintf('%s__%s', $alias, $i)] = $obj;\n }\n foreach ($row_rship_vars as $relationship => $vars) {\n list($class, $i) = explode('__', $relationship);\n if (!self::isRegisteredIRelationship($name, $class))\n throw new OrmException('Relationship %s is not registered or is not instanciable for Schema %s', $class, $name);\n\n $obj = new $class($vars, $name);\n /*$obj->setLoadedFromDb();*/\n # TODO: WORKING_ON -- this should set each class it's loading\n\n $row_rship_objs[$relationship] = $obj;\n }\n $chain_result->add(new OrmChainRow(&$chain, $row_class_objs, $row_rship_objs));\n }\n\n return $chain_result->finalize();\n }", "function fetch() {\n\t\t$this->i++;\n\t\treturn $this->result->fetch_object($this->class_name);\n\t}", "private function prepared_to_sobject($prepared) {\r\n\t\t$parameters = array();\r\n\t\t$metadata = $prepared->result_metadata();\r\n\t\t\r\n\t\twhile($field = $metadata->fetch_field())\r\n\t\t\t$parameters[] = &$row[$field->name];\r\n\t\tcall_user_func_array(array($prepared, 'bind_result'), $parameters);\r\n\t\t\r\n\t\t$nrs = 0;\r\n\t\twhile($prepared->fetch()) {\r\n\t\t\t$cls = new stdClass;\r\n\t\t\tforeach($row as $key => $val)\r\n\t\t\t\t$cls->$key = $val;\r\n\t\t\t$nrs++;\r\n\t\t}\r\n\t\t\r\n\t\treturn ($nrs == 0) ? 0 : $cls;\r\n\t}", "public function GetData() {\r\n\t\twhile ($val = mysqli_fetch_assoc($this->result)) {\r\n\t\t\tarray_push($this->returnSet, $val);\r\n\t\t}\r\n\t\treturn $this->returnSet;\r\n\t}", "public function fetch_array($result_set) {\n\n if (get_class($result_set) != 'mysqli_result') {\n $msg = \"DBO_ERROR: fetch_array requires on parameter of type: mysqli_result.\\n\"\n . \"Actual type submitted was: '\" .get_class($result_set) .\"'.\";\n throw new \\Exception($msg);\n } \n $rec = mysqli_fetch_assoc($result_set);\n $metas = mysqli_fetch_fields($result_set);\n $rec = $this->_castFields($rec, $metas);\n return $rec;\n }", "public function fetch($queryResult);", "public function getResultById($result_id);", "public function resultaSet(){\n $this->execute();\n return $this->statemet->fetchAll(PDO::FETCH_OBJ);\n }", "function result()\r\n {\r\n $result = array();\r\n if(!$this->res_id)\r\n {\r\n $this->error_msg = \"Could not execute query to $this->db_name database, wrong result id\";\r\n return 0;\r\n }\r\n $row = mysql_fetch_object($this->res_id);\r\n return $row;\r\n }", "function _get_result($sql) {\n\t\t// Get from local cache\n\t\tif (isset($this->_cache_get_result[$sql])) {\n\t\t\treturn $this->_cache_get_result[$sql];\n\t\t}\n\t\t$result = false;\n\t\t$Q = db()->query($sql);\n\t\twhile ($A = db()->fetch_assoc($Q)) {\n\t\t\t$result[$A[\"id\"]] = $A;\n\t\t}\n\t\t// Put into local cache\n\t\t$this->_cache_get_result[$sql] = $result;\n\n\t\treturn $result;\n\t}", "private function setResult(\n $result\n )\n {\n //$GLOBALS['log']->info('call to DBManager::setResult() is deprecated');\n if (PEAR::isError($result) === true) {\n //$GLOBALS['log']->error($msg);\n $result = FALSE;\n } \n elseif ($result != DB_OK) {\n // must be a result\n //$GLOBALS['log']->fatal(\"setResult:\".print_r($result,true));\n $row = array();\n $rows = array();\n while (ocifetchinto($result, $row, OCI_ASSOC|OCI_RETURN_NULLS|OCI_RETURN_LOBS)){\n $err = ocierror($result);\n if ($err == false) $rows[] = $row;\n else print_r($err);\n }\n $result = $rows;\n }\n //$GLOBALS['log']->fatal(\"setResult: returning rows from setResult\");\n return $result;\n }", "public function getCustomResultObject(string $className)\n {\n if (isset($this->customResultObject[$className])) {\n return $this->customResultObject[$className];\n }\n\n if (! $this->isValidResultId()) {\n return [];\n }\n\n // Don't fetch the result set again if we already have it\n $_data = null;\n if (($c = count($this->resultArray)) > 0) {\n $_data = 'resultArray';\n } elseif (($c = count($this->resultObject)) > 0) {\n $_data = 'resultObject';\n }\n\n if ($_data !== null) {\n for ($i = 0; $i < $c; $i++) {\n $this->customResultObject[$className][$i] = new $className();\n\n foreach ($this->{$_data}[$i] as $key => $value) {\n $this->customResultObject[$className][$i]->{$key} = $value;\n }\n }\n\n return $this->customResultObject[$className];\n }\n\n if ($this->rowData !== null) {\n $this->dataSeek();\n }\n $this->customResultObject[$className] = [];\n\n while ($row = $this->fetchObject($className)) {\n if (! is_subclass_of($row, Entity::class) && method_exists($row, 'syncOriginal')) {\n $row->syncOriginal();\n }\n\n $this->customResultObject[$className][] = $row;\n }\n\n return $this->customResultObject[$className];\n }", "public function resultSet(){\r\n $this->execute();\r\n return $this->stmt->fetchAll(PDO::FETCH_OBJ);\r\n /*PDO::FETCH_OBJ\r\n assim podemos imprimir como objeto exemplo\r\n foreach($users as user){\r\n echo $user->name . '<br>';\r\n ao invés de echo $user['name];\r\n */\r\n }", "public function fetchObject($result)\n\t{\n\t\treturn mysqli_fetch_object($result);\n\t}", "private function mapSqlToObject($rs) {\n $instructions = new instructions();\n $instructions->_id = $rs[\"id\"];\n $instructions->_instruction = $rs[\"instruction\"];;\n return $instructions;\n }", "public function getFromCache_queryRow() {}", "public function fetch() {\n\t\t$this->checkResultSet();\n\t\treturn $this->fetchRowAssoc();\n\t}", "public function __construct($result) {\n $this->settable = false; // disables change in pseudo-class members \n // populates the fields of the class based on the results\t\t \n $this->data = array(\n 'num_rows' => sqlsrv_num_rows($result),\n 'num_fields' => sqlsrv_num_fields($result),\n 'has_rows' => sqlsrv_has_rows($result)\n );\n\n $this->fetch($result); // fills the array of results\n }", "function getRows() {\n if ($this->_recordset === null) {\n // begin processing result into recordset\n $this->_entries = ldap_get_entries($this->dbh->connection, $this->result);\n $this->row_counter = $this->_entries['count'];\n $i = 1;\n $rs_template = array();\n if (count($this->dbh->attributes) > 0) {\n reset($this->dbh->attributes);\n while (list($a_index, $a_name) = each($this->dbh->attributes)) $rs_template[$a_name] = '';\n }\n while (list($entry_idx, $entry) = each($this->_entries)) {\n // begin first loop, iterate through entries\n if (!empty($this->dbh->limit_from) && ($i < $this->dbh->limit_from)) continue;\n if (!empty($this->dbh->limit_count) && ($i > $this->dbh->limit_count)) break;\n $rs = $rs_template;\n if (!is_array($entry)) continue;\n while (list($attr, $attr_values) = each($entry)) {\n // begin second loop, iterate through attributes\n if (is_int($attr) || $attr == 'count') continue;\n if (is_string($attr_values)) $rs[$attr] = $attr_values;\n else {\n $value = '';\n while (list($value_idx, $attr_value) = each($attr_values)) {\n // begin third loop, iterate through attribute values\n if (!is_int($value_idx)) continue;\n if (empty($value)) $value = $attr_value;\n else {\n if (is_array($value)) $value[] = $attr_value;\n else $value = array($value, $attr_value);\n }\n// else $value .= \"\\n$attr_value\";\n // end third loop\n }\n $rs[$attr] = $value;\n }\n // end second loop\n }\n reset($rs);\n $this->_recordset[$entry_idx] = $rs;\n $i++;\n // end first loop\n }\n $this->_entries = null;\n if (!is_array($this->_recordset))\n $this->_recordset = array();\n if (!empty($this->dbh->sorting)) {\n $sorting_method = (!empty($this->dbh->sorting_method) ? $this->dbh->sorting_method : 'cmp');\n uksort($this->_recordset, array(&$this, $sorting_method));\n }\n reset($this->_recordset);\n // end processing result into recordset\n }\n return DB_OK;\n }", "abstract public function freeResult($rs);", "private function mapSqlToObject($rs) {\n if(!$rs){\n return \"false\";\n }\n $sous_prix = new souscategory_prix();\n $sous_prix->_id = $rs[\"id\"];\n $sous_prix->_id_modelmetier_category = $rs[\"id_modelmetier_category\"];\n $sous_prix->_id_coeff_prix = $rs[\"id_coeff_prix\"];\n $sous_prix->_id_support = $rs[\"id_support\"];\n return $sous_prix;\n }", "private function mapSqlToObject($rs) {\n $cata_category = new cata_category();\n $cata_category->_id = $rs[\"id\"];\n $cata_category->_libelle = $rs[\"libelle\"];;\n $cata_category->_active = $rs[\"active\"];;\n return $cata_category;\n }", "function getResRow($tsql,$method=PDO::FETCH_ASSOC){ \n $rs=$this->DBH->prepare($tsql);\n $rs->execute();\n $row=$rs->fetch($method);\n \n return $row;\n }", "public function GetResults() {\n return $this->rs; \n }", "public function process(ResultSet $resultSet);", "function fetchResult() {\n\t\tif ($row = mysql_fetch_row($this->results)) {\n\t\t\t$resultRow = array();\n\t\t\t$i = 0;\n\t\t\tforeach ($row as $index => $field) {\n\t\t\t\tlist($table, $column) = $this->map[$index];\n\t\t\t\t$resultRow[$table][$column] = $row[$index];\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $resultRow;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function _to_object($result, $model)\r\n\t{\r\n\t\t$items = array();\r\n\r\n\t\tforeach ($result as $row)\r\n\t\t{\r\n\t\t\t$item = new $model();\r\n\r\n\t\t\tforeach ($this->fields as $field)\r\n\t\t\t{\r\n\t\t\t\tif (isset($row->{$field}))\r\n\t\t\t\t{\r\n\t\t\t\t\t$item->{$field} = $row->{$field};\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$item->{$field} = NULL;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$item->_refresh_stored_values();\r\n\r\n\t\t\t$items[$item->id] = $item;\r\n\t\t}\r\n\r\n\t\treturn $items;\r\n\t}", "function results()\r\n {\r\n $result = array();\r\n if(!$this->res_id)\r\n {\r\n $this->error_msg = \"Could not execute query to $this->db_name database, wrong result id\";\r\n return 0;\r\n }\r\n while($row = mysql_fetch_object($this->res_id))\r\n {\r\n array_push($result, $row);\r\n }\r\n return $result;\r\n }", "function _fetch_object()\n\t{\n\t\treturn mysqli_fetch_object($this->result_id);\n\t}", "function msql_fetch_object($result)\n{\n}", "public function result_set() {\n $this -> execute();\n return $this -> stmt -> fetchAll();\n }", "public function fetch_array_set($result_set) {\n if (get_class($result_set) != 'mysqli_result') {\n print \"<pre>\\n\";\n// print_r($result_set);\n// print \"</pre>\\n\";\n $msg = \"DBO_ERROR: fetch_array_set requires on parameter of type: mysqli_result.\\n\"\n . \"Actual type submitted was: '\" .get_class($result_set) .\"'.\";\n throw new \\Exception($msg);\n }\n \n $array_set = array();\n $numRows = $result_set->num_rows;\n for($i=0; $i<$numRows; $i++) {\n $row = $this->fetch_array($result_set);\n $array_set[$i] = $row;\n }\n return (array) $array_set;\n }", "function loadResult() {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$ret = null;\n\t\tif ($row = mysql_fetch_row( $cur )) {\n\t\t\t$ret = $row[0];\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $ret;\n\t}", "function resultSet2array($myrst) {\n $resultset = null;\n $row = 0;\n while ($myrow = mysql_fetch_array($myrst)) {\n $col = 0;\n foreach ($myrow as $column) {\n $resultset[$row][$col]=$myrow[$col++];\n }\n $row++;\n }\n return $resultset;\n}", "public function fetch($resultset = \"NONEE\"){\n\t\tif($resultset === \"NONEE\")\n\t\t\t$resultset = $this->resultset;\n\t\treturn $resultset = $this->showErrors ? mysqli_fetch_array($resultset) : @mysqli_fetch_array($resultset); \n\t}", "public function return_results_objects($result){\n\n $objectsArr = [];\n foreach($result as $result){\n $obj = new $this->model();\n $obj->populate_object_data($result);\n $objectsArr[] = $obj;\n }\n\n return $objectsArr;\n\n }", "protected function _execute()\n {\n $this->triggerBeforeFind();\n if ($this->_results) {\n $decorator = $this->_decoratorClass();\n\n return new $decorator($this->_results);\n }\n\n $statement = $this->getEagerLoader()->loadExternal($this, $this->execute());\n\n return new ResultSet($this, $statement);\n }", "function getTblResVal($result, $tablename, $pk, $id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from $tablename where $pk='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs[$result];\n\t}\n\n\t$crud->disconnect();\n}", "private function set_response_rows($result) { \n $rows = [];\n foreach ($result as $r) {\n $cell = [];\n foreach ($r as $column => $value) {\n $cell[] = call_user_func($this->format, $column, $value, $r);\n }\n\n $rows[] = [\n 'id' => $r->id,\n 'cell' => $cell\n ];\n }\n return $rows;\n }", "public function testFetchReturnsSingleRowFromResultSet() {\n $fixture = array(\n \"col1\" => \"value1\",\n \"col2\" => \"value2\"\n );\n \n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"hasResultSet\", \"_fetch\"))\n ->getMock();\n \n $stub->expects($this->once())\n ->method(\"hasResultSet\")\n ->will($this->returnValue(false));\n \n $rs = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOResultSet\")\n ->disableOriginalConstructor()\n ->getMock();\n \n $rs->expects($this->once())\n ->method(\"isEmpty\")\n ->will($this->returnValue(false));\n \n $rs->expects($this->once())\n ->method(\"getRow\")\n ->will($this->returnValue($fixture));\n \n $stub->expects($this->once())\n ->method(\"_fetch\")\n ->will($this->returnValue($rs));\n \n $result = $stub->fetch();\n $this->assertEquals(count($fixture), count($result));\n $this->assertInternalType('array', $result);\n $this->assertSame($fixture, $result);\n }", "public function testFetchReturnsMultipleRowsFromResultSet() {\n $fixtures = array(\n array(\n \"r1c1\" => \"v1\",\n \"r1c2\" => \"v2\"\n ),\n array(\n \"r2c1\" => \"v1\",\n \"r2c2\" => \"v2\"\n ) \n );\n \n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"getResultSet\", \"hasResultSet\", \"_fetch\"))\n ->getMock();\n \n $rs = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOResultSet\")\n ->disableOriginalConstructor()\n ->setMethods(array())\n ->getMock();\n \n $rs->expects($this->exactly(2))\n ->method(\"getRow\")\n ->will($this->onConsecutiveCalls($fixtures[0], $fixtures[1]));\n \n $stub->expects($this->exactly(3))\n ->method(\"hasResultSet\")\n ->will($this->onConsecutiveCalls(false, true, true));\n \n $stub->expects($this->exactly(2))\n ->method(\"_fetch\")\n ->will($this->returnValue($rs));\n \n $rs->expects($this->exactly(5))\n ->method(\"isEmpty\")\n ->will($this->onConsecutiveCalls(false, false, false, false, true));\n \n $rs->expects($this->exactly(2))\n ->method(\"key\")\n ->will($this->onConsecutiveCalls(1, null));\n \n $stub->expects($this->exactly(2))\n ->method(\"getResultSet\")\n ->will($this->returnValue($rs));\n \n \n $result = array();\n while($row = $stub->fetch()) {\n array_push($result, $row);\n }\n \n $this->assertEquals(count($fixtures), count($result));\n $this->assertInternalType('array', $result);\n $this->assertSame($fixtures, $result);\n }", "public function resultSet()\n {\n $this->execute();\n return $this->stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getResultObject(): array\n {\n if (! empty($this->resultObject)) {\n return $this->resultObject;\n }\n\n // In the event that query caching is on, the result_id variable\n // will not be a valid resource so we'll simply return an empty\n // array.\n if (! $this->isValidResultId()) {\n return [];\n }\n\n if ($this->resultArray) {\n foreach ($this->resultArray as $row) {\n $this->resultObject[] = (object) $row;\n }\n\n return $this->resultObject;\n }\n\n if ($this->rowData !== null) {\n $this->dataSeek();\n }\n\n while ($row = $this->fetchObject()) {\n if (! is_subclass_of($row, Entity::class) && method_exists($row, 'syncOriginal')) {\n $row->syncOriginal();\n }\n\n $this->resultObject[] = $row;\n }\n\n return $this->resultObject;\n }", "abstract protected function setresults();", "function resultado(){\n\t\t\treturn $this->result=mysql_fetch_object($this->query);\n\t\t\t}", "function get_results($query=null) {\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query ) {\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Send back array of objects. Each row is an object\n\t\t\treturn $this->last_result;\n\t\t}", "function resultToArray($result,$fields,$encoding='')\r\n\t{\r\n\t\t$result_array = array();\r\n\t\twhile ($one_row=mysql_fetch_assoc($result))\r\n\t\t\t\t$result_array[]=$one_row;\r\n\t\treturn $result_array;\r\n\t}", "public function resultArray($recordset)\n {\n \n// $result = array();\n// while ($row = mysql_fetch_assoc($recordset))\n// {\n// $result[] = $row; // Inside while loop\n// }\n// return $result;\n $result = $this->sqlAssoc;\n return $result;\n }", "public function fetchObject($result = false){\n $this->resCalc($result); \n return mysql_fetch_object($result);\n }", "public function fetch_array($result_set) {\n\t\treturn mysqli_fetch_array($result_set);\n\t}", "public function get() {\n\t\t\n\t\t/**\n\t\t * @get() Almacena los resultados de la query en un array\n\t\t * en este caso $this->rows[]\n\t\t */\n\t\t\n\t\ttry {\n\n\t\t\tif (!$this->result) {\n\t\t\t\tthrow new Exception(_QUERY_ERROR);\n\t\t\t}\n\t\t\t\t\n\t\t\t/**\n\t\t\t * Almacenamos los resultados MySQLi en un array ($this->rows[])\n\t\t\t * Para poder exportarlo a la vista.\n\t\t\t */\n\t\t\t\n\t\t\twhile($row = $this->result->fetch_array()) {\n\t\t\t\t$this->rows[] = $row;\n\t\t\t}\n\n//\t\t\t\trecorrer datos almacenados en $rows[]\n//\t\t\t\tlo hacemos desde la vista:\t\t\t\n \t\t\t//foreach ($this->rows as $row) {\n \t\t\t\t//echo $row['id'] . $row['title'];\n \t\t\t//}\n\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t$e->getMessage();\n\t\t}\n\t\t\n\t}", "public function withHttpResponse(ResponseInterface $response) : ResultSet\n {\n $data = Json::decodeObject((string) $response->getBody());\n\n return $this->withJsonObject($data);\n }", "abstract protected function handleResult();", "public function fromDbResults($results)\n {\n foreach ($results as $key => $value)\n {\n $this->set($key, $value);\n }\n\n return $this;\n }", "function _fetch_object()\r\n\t{\r\n\t\tif ( is_array($this->pdo_results) ) {\r\n\t\t\t$i = $this->pdo_index;\r\n\t\t\t$this->pdo_index++;\r\n\t\t\tif ( isset($this->pdo_results[$i])) {\r\n\t\t\t\t$back = '';\r\n\t\t\t\tforeach ( $this->pdo_results[$i] as $key => $val ) {\r\n\t\t\t\t\t$back->$key = $val;\r\n\t\t\t\t}\r\n\t\t\t\treturn $back;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn $this->result_id->fetch(PDO::FETCH_OBJ);\r\n\t}", "private function mapSqlToObject($rs) {\n $langue = new langue();\n $langue->_id = $rs[\"id\"];\n $langue->_key_identifier = $rs[\"key_identifier\"];\n $langue->_english = $rs[\"english\"];\n $langue->_french = $rs[\"french\"];\n $langue->_spanish = $rs[\"spanish\"];\n $langue->_german = $rs[\"german\"];\n $langue->_italien = $rs[\"italien\"];\n return $langue;\n }", "private function createEntryFromResult(array $result)\n {\n // check if the first element in the given array is an array\n // => if so, we have to return an array of instances\n // => if not, we can create a single instace from the array\n if (count($result) === 1) {\n // we have to construct only one array\n return $this->createSingleInstance($result[0]);\n } else {\n // create empty array to later store created instances\n $entires = [];\n // Iteate over all given entry data\n foreach ($result as $entryData) {\n // create a new entry instance and push to array\n array_push($entires, $this->createSingleInstance($entryData));\n }\n\n return $entires;\n }\n }" ]
[ "0.6689762", "0.63832927", "0.6276974", "0.62755764", "0.62457997", "0.6131868", "0.6101183", "0.6039166", "0.6028268", "0.6018519", "0.60160494", "0.6001742", "0.5969818", "0.59491426", "0.5940522", "0.5894371", "0.58851403", "0.5873768", "0.5859929", "0.5816725", "0.58148175", "0.58019704", "0.5778976", "0.57730895", "0.57701904", "0.5753479", "0.5737067", "0.57351255", "0.5728306", "0.57256037", "0.57241887", "0.5710181", "0.57074904", "0.5698277", "0.5690769", "0.568233", "0.56735086", "0.5642946", "0.56337154", "0.5614342", "0.5612165", "0.5597689", "0.55901766", "0.558446", "0.55751693", "0.55739194", "0.5573548", "0.55587727", "0.5545312", "0.55226374", "0.55214983", "0.5517891", "0.5505002", "0.5504699", "0.54985386", "0.5490492", "0.54873717", "0.5479878", "0.54798096", "0.54769135", "0.5469032", "0.5453502", "0.5429897", "0.5425944", "0.541359", "0.54111874", "0.5408529", "0.53876054", "0.5385963", "0.5377523", "0.5371763", "0.5369347", "0.53688926", "0.53663146", "0.53657156", "0.5364703", "0.5364349", "0.53345096", "0.5323089", "0.5319575", "0.5318193", "0.53147393", "0.53022105", "0.53009075", "0.52916294", "0.5291081", "0.52909315", "0.52722275", "0.52689964", "0.5265049", "0.52587557", "0.52583593", "0.52523005", "0.52399784", "0.5238657", "0.52357703", "0.5235612", "0.52350664", "0.5228602", "0.5225683" ]
0.6216743
5
Parses the arguments that will be resolved to Relation instances
public static function parseArguments(array $arguments) { if (empty($arguments)) { throw new \InvalidArgumentException('Arguments can not be empty'); } $relations = []; foreach ($arguments as $relationAlias => $queryConstraints) { if (is_string($relationAlias)) { $relations[$relationAlias] = is_callable($queryConstraints) ? $queryConstraints : null; } else { if (is_string($queryConstraints)) { $relations[$queryConstraints] = null; } } } if (empty($relations)) { return []; } return $relations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function relations();", "public function testParseArgumentsCanParseRuleArguments()\n {\n $this->assertEquals(['min' => 10, 'max' => 100], $this->ruleParse->parseArguments('min=10,max=100'));\n $this->assertEquals([0 => 10, 1 => 100], $this->ruleParse->parseArguments('10,100'));\n }", "public function prepareArguments() {}", "public function args(): array\n {\n $relation = $this->relation->getRelationName();\n\n if ($this->getPivotModelSchema()) {\n $typename = Str::studly($relation).'PivotInput';\n $type = $this->registry->type($typename)->list();\n } else {\n $type = $this->registry->ID()->list();\n }\n\n return $this->modelSchema->getLookupFields()->map(function (Field $field) {\n return $field->getType();\n })->merge(['input' => $type])->toArray();\n }", "function __call($name, $arguments)\n\t{\n\t\t$numberOfArguments = count($arguments);\n\n\t\tif (isset(static::$relationTypes[$name]))\n\t\t{\n\t\t\tif ($numberOfArguments == 1)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 2)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 3)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1], $arguments[2]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 4)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1], $arguments[2], $arguments[3]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 5)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1], $arguments[2], $arguments[3], $arguments[4]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 6)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1], $arguments[2], $arguments[3], $arguments[4], $arguments[5]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments >= 7)\n\t\t\t{\n\t\t\t\treturn $this->addRelation($arguments[0], $name, $arguments[1], $arguments[2], $arguments[3], $arguments[4], $arguments[5], $arguments[6]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException(\"You can not create an unnamed '$name' relation\");\n\t\t\t}\n\t\t}\n\t\telseif (substr($name, 0, 3) == 'get')\n\t\t{\n\t\t\t$relationName = substr($name, 3);\n\t\t\t$relationName = strtolower($relationName[0]) . substr($relationName, 1);\n\n\t\t\tif ($numberOfArguments == 0)\n\t\t\t{\n\t\t\t\treturn $this->getData($relationName);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 1)\n\t\t\t{\n\t\t\t\treturn $this->getData($relationName, $arguments[0]);\n\t\t\t}\n\t\t\telseif ($numberOfArguments == 2)\n\t\t\t{\n\t\t\t\treturn $this->getData($relationName, $arguments[0], $arguments[1]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException(\"Invalid number of arguments getting data for the '$relationName' relation\");\n\t\t\t}\n\t\t}\n\n\t\t// Throw an exception otherwise\n\t\tthrow new DataModel\\Relation\\Exception\\RelationTypeNotFound(\"Relation type '$name' not known to relation manager\");\n\t}", "protected function makeRelationInstruction()\n {\n $parts = $this->keyRelationParts();\n\n $this->parsedKey = $relation = $parts['relation'];\n \n $relationType = $this->setRelationType($relation);\n\n $values = array_filter($this->getValueAsArray());\n \n if(empty($values) || !$values){\n return null;\n }\n \n $parts['relation_type'] = $relationType;\n $parts['data'] = $values;\n \n return $parts;\n \n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "protected function parseEntitiesArguments()\n {\n $args = array();\n while ($arg = $this->matchFuncs(array('parseEntitiesAssignment', 'parseExpression'))) {\n $args[] = $arg;\n if (!$this->matchChar(',')) {\n break;\n }\n }\n\n return $args;\n }", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "private function processArguments(array $arguments)\n {\n foreach ($arguments as $k => $argument) {\n if (is_array($argument)) {\n $arguments[$k] = $this->processArguments($argument);\n } elseif ($argument instanceof Reference) {\n $defId = $this->getDefinitionId($id = (string) $argument);\n\n if ($defId !== $id) {\n $arguments[$k] = new Reference($defId, $argument->getInvalidBehavior());\n }\n }\n }\n\n return $arguments;\n }", "abstract protected function arguments(): array;", "abstract protected function get_args();", "public function initializeArguments() {}", "public function initializeArguments() {}", "public function initializeArguments() {}", "public function initializeArguments() {}", "private function parseRelations()\n {\n if ($this->parentRelations === null) {\n $this->parentRelations = [];\n $this->parentEntities = [];\n $this->childEntities = [];\n $this->childRelations = [];\n $this->siblingEntities = [];\n $this->siblingRelations = [];\n foreach ($this->getModule()->getRelations() as $relation) {\n if ($relation->getEntityOneInstance() === $this) {\n if ($relation->getType() === Relation::TYPE_ONE_TO_MANY) {\n $this->childRelations[] = $relation;\n $childEntity = $relation->getRelatedEntity($this);\n $this->childEntities[$childEntity->getNameSingular()] = $childEntity;\n } elseif ($relation->getType() === Relation::TYPE_MANY_TO_MANY) {\n $siblingEntity = $relation->getRelatedEntity($this);\n $this->siblingRelations[] = $relation;\n $this->siblingEntities[$siblingEntity->getNameSingular()] = $siblingEntity;\n }\n }\n if ($relation->getEntityTwoInstance() === $this) {\n if ($relation->getType() === Relation::TYPE_ONE_TO_MANY) {\n $this->parentRelations[] = $relation;\n $parentEntity = $relation->getRelatedEntity($this);\n $this->parentEntities[$parentEntity->getNameSingular()] = $parentEntity;\n } elseif ($relation->getType() === Relation::TYPE_MANY_TO_MANY) {\n $siblingEntity = $relation->getRelatedEntity($this);\n $this->siblingRelations[] = $relation;\n $this->siblingEntities[$siblingEntity->getNameSingular()] = $siblingEntity;\n }\n }\n }\n }\n }", "public function getRelationParams($attributeName);", "abstract public static function relations() : ? array;", "public function argList(){\n try {\n // Sparql11query.g:243:3: ( OPEN_BRACE ( WS )* CLOSE_BRACE | OPEN_BRACE expression ( COMMA expression )* CLOSE_BRACE ) \n $alt31=2;\n $LA31_0 = $this->input->LA(1);\n\n if ( ($LA31_0==$this->getToken('OPEN_BRACE')) ) {\n $LA31_1 = $this->input->LA(2);\n\n if ( ($LA31_1==$this->getToken('COALESCE')||$LA31_1==$this->getToken('IF')||($LA31_1>=$this->getToken('STR') && $LA31_1<=$this->getToken('FALSE'))||$LA31_1==$this->getToken('IRI_REF')||$LA31_1==$this->getToken('PNAME_NS')||$LA31_1==$this->getToken('PNAME_LN')||($LA31_1>=$this->getToken('VAR1') && $LA31_1<=$this->getToken('MINUS'))||$LA31_1==$this->getToken('INTEGER')||$LA31_1==$this->getToken('DECIMAL')||($LA31_1>=$this->getToken('DOUBLE') && $LA31_1<=$this->getToken('DOUBLE_NEGATIVE'))||($LA31_1>=$this->getToken('STRING_LITERAL1') && $LA31_1<=$this->getToken('STRING_LITERAL_LONG2'))||$LA31_1==$this->getToken('NOT_SIGN')||$LA31_1==$this->getToken('OPEN_BRACE')) ) {\n $alt31=2;\n }\n else if ( ($LA31_1==$this->getToken('WS')||$LA31_1==$this->getToken('CLOSE_BRACE')) ) {\n $alt31=1;\n }\n else {\n $nvae = new NoViableAltException(\"\", 31, 1, $this->input);\n\n throw $nvae;\n }\n }\n else {\n $nvae = new NoViableAltException(\"\", 31, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt31) {\n case 1 :\n // Sparql11query.g:244:3: OPEN_BRACE ( WS )* CLOSE_BRACE \n {\n $this->match($this->input,$this->getToken('OPEN_BRACE'),self::$FOLLOW_OPEN_BRACE_in_argList830); \n // Sparql11query.g:244:14: ( WS )* \n //loop29:\n do {\n $alt29=2;\n $LA29_0 = $this->input->LA(1);\n\n if ( ($LA29_0==$this->getToken('WS')) ) {\n $alt29=1;\n }\n\n\n switch ($alt29) {\n \tcase 1 :\n \t // Sparql11query.g:244:14: WS \n \t {\n \t $this->match($this->input,$this->getToken('WS'),self::$FOLLOW_WS_in_argList832); \n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop29;\n }\n } while (true);\n\n $this->match($this->input,$this->getToken('CLOSE_BRACE'),self::$FOLLOW_CLOSE_BRACE_in_argList835); \n\n }\n break;\n case 2 :\n // Sparql11query.g:245:5: OPEN_BRACE expression ( COMMA expression )* CLOSE_BRACE \n {\n $this->match($this->input,$this->getToken('OPEN_BRACE'),self::$FOLLOW_OPEN_BRACE_in_argList841); \n $this->pushFollow(self::$FOLLOW_expression_in_argList843);\n $this->expression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:245:27: ( COMMA expression )* \n //loop30:\n do {\n $alt30=2;\n $LA30_0 = $this->input->LA(1);\n\n if ( ($LA30_0==$this->getToken('COMMA')) ) {\n $alt30=1;\n }\n\n\n switch ($alt30) {\n \tcase 1 :\n \t // Sparql11query.g:245:28: COMMA expression \n \t {\n \t $this->match($this->input,$this->getToken('COMMA'),self::$FOLLOW_COMMA_in_argList846); \n \t $this->pushFollow(self::$FOLLOW_expression_in_argList848);\n \t $this->expression();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop30;\n }\n } while (true);\n\n $this->match($this->input,$this->getToken('CLOSE_BRACE'),self::$FOLLOW_CLOSE_BRACE_in_argList852); \n\n }\n break;\n\n }\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "abstract public static function args();", "protected function parse()\n {\n if($this->isRelationalKey()){\n $this->parsedValue = $this->makeRelationInstruction();\n } \n else {\n $this->parsedValue = $this->parseFlatValue($this->value);\n } \n }", "public function validateArguments() {}", "protected function prepareArguments()\n {\n if ($this->type != 'enum') {\n return $this->arguments;\n }\n\n $arguments = array_map(function ($arg) {\n return '\\'' . $arg . '\\'';\n }, $this->arguments);\n\n return [\n '[' . join(',', $arguments) . ']'\n ];\n }", "protected function _getRelation(array $params, array $args = null)\n {\n $array = array();\n\n $column = $params['column'];\n $object = $params['foreignClass'];\n $foreignColumn = $params['foreignColumn'];\n\n $object = 'model\\\\' . strtolower($object) . '\\\\' . $object;\n\n if($params['type'] == self::MANY_TO_MANY)\n {\n $relationClass = $params['relationClass'];\n $relationClass = 'model\\\\' . strtolower($relationClass) . '\\\\' . $relationClass;\n\n $left_col = static::_getTableName() . '_' . $column;\n $right_col = strtolower($object) . '_' . $foreignColumn;\n\n $relationObjects = $relationClass::find(array($left_col => $this->$column));\n\n foreach($relationObjects as $obj)\n {\n array_push($array, $object::find(array($foreignColumn => $obj->$right_col)));\n }\n }\n else\n {\n $array = $object::find(array($foreignColumn => $this->$column));\n }\n\n $params['objs'] = $array;\n array_merge($this->_dataRelations, $params);\n\n return isset($this->_dataRelations[0]['objs'][0]) ? $this->_dataRelations[0]['objs'][0] : array();\n }", "protected static function _relations() {\n\n\t}", "abstract protected function requiredArguments(): array;", "protected function maybeConvertQueryArgs() {\n\n // Process the grouped posts parameter\n if ($this->getContext('queryArgs.posts')) {\n\n foreach ($this->getContext('queryArgs.posts') as $key => $value) {\n $this->addContext('queryArgs.' . $key, $value);\n }\n\n $this->removeContext('queryArgs.posts');\n\n }\n\n // Process the grouped author parameters\n if ($this->getContext('queryArgs.authors')) {\n foreach ($this->getContext('queryArgs.authors') as $key => $value) {\n $this->addContext('queryArgs.' . $key, $value);\n }\n\n $this->removeContext('queryArgs.authors');\n }\n\n // Process the grouped orders parameters\n if ($this->getContext('queryArgs.orders')) {\n foreach ($this->getContext('queryArgs.orders') as $key => $value) {\n $this->addContext('queryArgs.' . $key, $value);\n }\n\n $this->removeContext('queryArgs.orders');\n }\n\n // Process the grouped pagination parameters\n if ($this->getContext('queryArgs.pagination')) {\n foreach ($this->getContext('queryArgs.pagination') as $key => $value) {\n $this->addContext('queryArgs.' . $key, $value);\n }\n\n $this->removeContext('queryArgs.pagination');\n }\n\n\n // Process the grouped taxonomy parameters\n if ($this->getContext('queryArgs.taxonomy')) {\n foreach ($this->getContext('queryArgs.taxonomy') as $key => $data) {\n\n if (is_numeric($key)) {\n if (!empty($value['terms'])\n && !empty($value['taxonomy'])) {\n\n $this->addContext('tax_query.' . $key, $data);\n }\n }\n else {\n $this->addContext('tax_query.' . $key, $data);\n }\n }\n\n $this->removeContext('queryArgs.taxonomy');\n }\n\n // Process the grouped metas parameter\n if ($this->getContext('queryArgs.meta')) {\n foreach ($this->getContext('queryArgs.meta') as $key => $data) {\n\n if (is_numeric($key)) {\n if (!empty($value['key'])\n && !empty($value['value'])) {\n\n $this->addContext('meta_query.' . $key, $data);\n }\n }\n else {\n $this->addContext('meta_query.' . $key, $data);\n }\n }\n\n $this->removeContext('queryArgs.meta');\n }\n\n return $this;\n }", "protected function getArguments()\n {\n return [\n ['entityName', InputArgument::REQUIRED, 'The fully-qualified class name of the Entity.'],\n ['startEntityId', InputArgument::REQUIRED, 'The first Entity ID.'],\n ['endEntityId', InputArgument::REQUIRED, 'The last Entity ID.'],\n ['depth', InputArgument::OPTIONAL, 'Number of levels to iterate through to retrieve associations.', 0]\n ];\n }", "public abstract function get_query_args();", "private function extractArguments(array $arguments)\n {\n $this->namespace = Arr::get($arguments, 0);\n $this->entity = Arr::get($arguments, 1);\n $this->view = Arr::get($arguments, 2);\n $this->name = Arr::get($arguments, 3);\n }", "public function getArguments();", "public function getArguments();", "public function getArguments();", "public function getArguments();", "public function parse($args){\n $param_double=[] ; // --param=value or --param value or --param\n $param_extra=null;\n $cont=0; \n foreach($args as $argument){\n $cont++;\n if(preg_match('/^--(\\w+)=(.*)$/', $argument, $match)){\n $parameter=$match[1];\n $value=$match[2];\n $param_double[$parameter]=$value ;\n }elseif(preg_match('/^--(\\w+)$/', $argument, $match)){\n $parameter=$match[1];\n $param_double[$parameter]=null;\n }elseif(preg_match('/^-(help|h)$/', $argument, $match)){\n //$parameter=$match[1];\n $param_extra='help';\n }elseif(preg_match('/^\\w+$/',$argument,$match) && $cont==1){\n //echo \"aca: \".print_r($match,1);\n $param_extra=$match[0] ;\n }\n }\n return [ $param_double , $param_extra ];\n }", "private function prepareArgs(){\n\t\t$nro_arguments \t = $this->webPathNumber + 3;\n\t\t$this->argsArray = array_slice(explode('/',$this->uri), $nro_arguments);\n\t}", "abstract public function getArguments(): array;", "private function askRelations()\n {\n foreach ($this->generator->relations as $relation) {\n //Ask\n $choice = $this->ask(\"Is the relation between `\".$relation['table'].\"(\".$relation['local_id'].\")`\"\n .\"and `\".$relation['foreign_table'].\"(\".$relation['foreign_id'].\")`\"\n .\"1:One to Many? or 2:One to One? or 3:None\", '1');\n\n if ($choice != '3') {\n $choice == '2' ? $this->generator->oneToOne[] = $relation : $this->generator->oneToMany[] = $relation;\n }\n }\n }", "private function _subparse($relCriteria)\n {\n // Merge in default criteria params\n $relCriteria = array_merge([\n 'field' => null,\n 'sourceSite' => null,\n ], $relCriteria);\n\n // Check for now-deprecated sourceLocale param\n if (isset($relCriteria['sourceLocale'])) {\n Craft::$app->getDeprecator()->log('relatedTo:sourceLocale', 'The sourceLocale criteria in relatedTo element query params has been deprecated. Use sourceSite instead.');\n $relCriteria['sourceSite'] = $relCriteria['sourceLocale'];\n unset($relCriteria['sourceLocale']);\n }\n\n // Normalize the sourceSite param (should be an ID)\n if ($relCriteria['sourceSite'] && !is_numeric($relCriteria['sourceSite'])) {\n if ($relCriteria['sourceSite'] instanceof Site) {\n $relCriteria['sourceSite'] = $relCriteria['sourceSite']->id;\n } else {\n $site = Craft::$app->getSites()->getSiteByHandle($relCriteria['sourceSite']);\n if (!$site) {\n // Invalid handle\n return false;\n }\n $relCriteria['sourceSite'] = $site->id;\n }\n }\n\n if (!is_array($relCriteria)) {\n $relCriteria = ['element' => $relCriteria];\n }\n\n // Get the element IDs, wherever they are\n $relElementIds = [];\n $relSourceElementIds = [];\n $glue = 'or';\n\n $elementParams = ['element', 'sourceElement', 'targetElement'];\n $elementParam = null;\n\n foreach ($elementParams as $elementParam) {\n if (isset($relCriteria[$elementParam])) {\n $elements = $relCriteria[$elementParam];\n if (!is_array($elements)) {\n $elements = is_string($elements) ? StringHelper::split($elements) : [$elements];\n }\n\n if (isset($elements[0]) && ($elements[0] === 'and' || $elements[0] === 'or')) {\n $glue = array_shift($elements);\n }\n\n foreach ($elements as $element) {\n if (is_numeric($element)) {\n $relElementIds[] = $element;\n if ($elementParam === 'element') {\n $relSourceElementIds[] = $element;\n }\n } else if ($element instanceof ElementInterface) {\n if ($elementParam === 'targetElement') {\n $relElementIds[] = $element->getSourceId();\n } else {\n $relElementIds[] = $element->id;\n if ($elementParam === 'element') {\n $relSourceElementIds[] = $element->getSourceId();\n }\n }\n } else if ($element instanceof ElementQueryInterface) {\n $ids = $element->ids();\n ArrayHelper::append($relElementIds, ...$ids);\n if ($elementParam === 'element') {\n ArrayHelper::append($relSourceElementIds, ...$ids);\n }\n }\n }\n\n break;\n }\n }\n\n if (empty($relElementIds)) {\n return false;\n }\n\n // Going both ways?\n if ($elementParam === 'element') {\n array_unshift($relElementIds, $glue);\n\n return $this->parse([\n 'or',\n [\n 'sourceElement' => $relElementIds,\n 'field' => $relCriteria['field']\n ],\n [\n 'targetElement' => $relSourceElementIds,\n 'field' => $relCriteria['field']\n ]\n ]);\n }\n\n // Figure out which direction we’re going\n if ($elementParam === 'sourceElement') {\n $dir = self::DIR_FORWARD;\n } else {\n $dir = self::DIR_REVERSE;\n }\n\n // Do we need to check for *all* of the element IDs?\n if ($glue === 'and') {\n // Spread it across multiple relation sub-params\n $newRelatedToParam = ['and'];\n\n foreach ($relElementIds as $elementId) {\n $newRelatedToParam[] = [$elementParam => [$elementId]];\n }\n\n return $this->parse($newRelatedToParam);\n }\n\n $conditions = [];\n $relationFieldIds = [];\n\n if ($relCriteria['field']) {\n // Loop through all of the fields in this rel criteria, create the Matrix-specific conditions right away\n // and save the normal field IDs for later\n $fields = $relCriteria['field'];\n if (!is_array($fields)) {\n $fields = is_string($fields) ? StringHelper::split($fields) : [$fields];\n }\n\n foreach ($fields as $field) {\n if (($fieldModel = $this->_getField($field, $fieldHandleParts)) === null) {\n Craft::warning('Attempting to load relations for an invalid field: ' . $field);\n\n return false;\n }\n\n /** @var Field $fieldModel */\n if ($fieldModel instanceof BaseRelationField) {\n // We'll deal with normal relation fields all together\n $relationFieldIds[] = $fieldModel->id;\n } else if ($fieldModel instanceof Matrix) {\n $blockTypeFieldIds = [];\n\n // Searching by a specific block type field?\n if (isset($fieldHandleParts[1])) {\n // There could be more than one block type field with this handle, so we must loop through all\n // of the block types on this Matrix field\n $blockTypes = Craft::$app->getMatrix()->getBlockTypesByFieldId($fieldModel->id);\n\n foreach ($blockTypes as $blockType) {\n foreach ($blockType->getFields() as $blockTypeField) {\n /** @var Field $blockTypeField */\n if ($blockTypeField->handle == $fieldHandleParts[1]) {\n $blockTypeFieldIds[] = $blockTypeField->id;\n break;\n }\n }\n }\n\n if (empty($blockTypeFieldIds)) {\n continue;\n }\n }\n\n if ($dir === self::DIR_FORWARD) {\n self::$_relateSourcesCount++;\n self::$_relateTargetMatrixBlocksCount++;\n\n $sourcesAlias = 'sources' . self::$_relateSourcesCount;\n $targetMatrixBlocksAlias = 'target_matrixblocks' . self::$_relateTargetMatrixBlocksCount;\n $targetMatrixElementsAlias = 'target_matrixelements' . self::$_relateTargetMatrixBlocksCount;\n\n $subQuery = (new Query())\n ->select([\"$sourcesAlias.targetId\"])\n ->from([$sourcesAlias => Table::RELATIONS])\n ->innerJoin(Table::MATRIXBLOCKS . ' ' . $targetMatrixBlocksAlias, \"[[{$targetMatrixBlocksAlias}.id]] = [[{$sourcesAlias}.sourceId]]\")\n ->innerJoin(Table::ELEMENTS . ' ' . $targetMatrixElementsAlias, \"[[{$targetMatrixElementsAlias}.id]] = [[{$targetMatrixBlocksAlias}.id]]\")\n ->where([\n \"$targetMatrixBlocksAlias.ownerId\" => $relElementIds,\n \"$targetMatrixBlocksAlias.fieldId\" => $fieldModel->id,\n \"$targetMatrixElementsAlias.enabled\" => true,\n \"$targetMatrixElementsAlias.dateDeleted\" => null,\n ]);\n\n if ($relCriteria['sourceSite']) {\n $subQuery->andWhere([\n 'or',\n [\"$sourcesAlias.sourceSiteId\" => null],\n [\"$sourcesAlias.sourceSiteId\" => $relCriteria['sourceSite']]\n ]);\n }\n\n if (!empty($blockTypeFieldIds)) {\n $subQuery->andWhere([\"$sourcesAlias.fieldId\" => $blockTypeFieldIds]);\n }\n } else {\n self::$_relateSourceMatrixBlocksCount++;\n $sourceMatrixBlocksAlias = 'source_matrixblocks' . self::$_relateSourceMatrixBlocksCount;\n $sourceMatrixElementsAlias = 'source_matrixelements' . self::$_relateSourceMatrixBlocksCount;\n $matrixBlockTargetsAlias = 'matrixblock_targets' . self::$_relateSourceMatrixBlocksCount;\n\n $subQuery = (new Query())\n ->select([\"$sourceMatrixBlocksAlias.ownerId\"])\n ->from([$sourceMatrixBlocksAlias => Table::MATRIXBLOCKS])\n ->innerJoin(Table::ELEMENTS . ' ' . $sourceMatrixElementsAlias, \"[[{$sourceMatrixElementsAlias}.id]] = [[{$sourceMatrixBlocksAlias}.id]]\")\n ->innerJoin(Table::RELATIONS . ' ' . $matrixBlockTargetsAlias, \"[[{$matrixBlockTargetsAlias}.sourceId]] = [[{$sourceMatrixBlocksAlias}.id]]\")\n ->where([\n \"$sourceMatrixElementsAlias.enabled\" => true,\n \"$sourceMatrixElementsAlias.dateDeleted\" => null,\n \"$matrixBlockTargetsAlias.targetId\" => $relElementIds,\n \"$sourceMatrixBlocksAlias.fieldId\" => $fieldModel->id\n ]);\n\n if ($relCriteria['sourceSite']) {\n $subQuery->andWhere([\n 'or',\n [\"$matrixBlockTargetsAlias.sourceSiteId\" => null],\n [\"$matrixBlockTargetsAlias.sourceSiteId\" => $relCriteria['sourceSite']]\n ]);\n }\n\n if (!empty($blockTypeFieldIds)) {\n $subQuery->andWhere([\"$matrixBlockTargetsAlias.fieldId\" => $blockTypeFieldIds]);\n }\n }\n\n $conditions[] = ['elements.id' => $subQuery];\n unset($subQuery);\n } else {\n Craft::warning('Attempting to load relations for a non-relational field: ' . $fieldModel->handle);\n\n return false;\n }\n }\n }\n\n // If there were no fields, or there are some non-Matrix fields, add the normal relation condition. (Basically,\n // run this code if the rel criteria wasn't exclusively for Matrix.)\n if (empty($relCriteria['field']) || !empty($relationFieldIds)) {\n if ($dir === self::DIR_FORWARD) {\n self::$_relateSourcesCount++;\n $relTableAlias = 'sources' . self::$_relateSourcesCount;\n $relConditionColumn = 'sourceId';\n $relElementColumn = 'targetId';\n } else {\n self::$_relateTargetsCount++;\n $relTableAlias = 'targets' . self::$_relateTargetsCount;\n $relConditionColumn = 'targetId';\n $relElementColumn = 'sourceId';\n }\n\n $subQuery = (new Query())\n ->select([\"$relTableAlias.$relElementColumn\"])\n ->from([$relTableAlias => Table::RELATIONS])\n ->where([\"$relTableAlias.$relConditionColumn\" => $relElementIds]);\n\n if ($relCriteria['sourceSite']) {\n $subQuery->andWhere([\n 'or',\n [\"$relTableAlias.sourceSiteId\" => null],\n [\"$relTableAlias.sourceSiteId\" => $relCriteria['sourceSite']]\n ]);\n }\n\n if (!empty($relationFieldIds)) {\n $subQuery->andWhere([\"$relTableAlias.fieldId\" => $relationFieldIds]);\n }\n\n $conditions[] = ['elements.id' => $subQuery];\n }\n\n if (empty($conditions)) {\n return false;\n }\n\n if (count($conditions) == 1) {\n return $conditions[0];\n }\n\n array_unshift($conditions, 'or');\n\n return $conditions;\n }", "private static function processArgs( $arguments )\n\t {\n\t\t$args = array();\n\t\tforeach ( $arguments as $arg ) {\n\t\t\tif ( is_array( $arg ) ) {\n\t\t\t\t$args = array_merge( $args, $arg );\n\t\t\t} else {\n\t\t\t\t$exp = explode( '=', $arg, 2 );\n\t\t\t\t$args[$exp[0]] = $exp[1];\n\t\t\t}\n\t\t}\n\t\treturn $args;\n\t }", "protected function initializeCommandMethodArguments() {}", "private function handleParseQuery(array $arguments, array $argumentIndexes = null): array\n {\n if ($argumentIndexes === null) {\n foreach ($arguments as $index => $argument) {\n $arguments[$index] = $this->parseArgumentQuery($argument);\n }\n\n return $arguments;\n }\n\n foreach ($argumentIndexes as $index) {\n if (array_key_exists($index, $arguments)) {\n $arguments[$index] = $this->parseArgumentQuery($arguments[$index]);\n }\n }\n\n return $arguments;\n }", "protected function getArguments()\n {\n return [\n ['to-type', InputArgument::REQUIRED, 'The mapping type to be converted.'],\n ['dest-path', InputArgument::REQUIRED, 'The path to generate your entities classes.'],\n ];\n }", "private function setArguments()\n {\n $args = $this->data;\n $match = explode(\"/\", $this->routeMatch);\n\n // remove the domain part.\n foreach ($this->domains as $value) {\n // search for domain on url array.\n // array_search(needle, haystack)\n $index = array_search($value, $args);\n unset($args[$index]);\n\n // search for domain on matched route.\n $index = array_search($value, $match);\n unset($match[$index]);\n }\n\n // find the action part in url data and the matched route string.\n // preg_grep(pattern, input)\n $this->action = preg_grep(\"/^{$this->wildcards[':action']}$/\", $args);\n $matchAction = preg_grep(\"/^{$this->wildcards[':action']}$/\", $match);\n if ( !empty($this->action) )\n {\n // convert action from array to string.\n // find action in url data.\n // remove from url data.\n $this->action = array_shift($this->action);\n $index = array_search($this->action, $args);\n unset($args[$index]);\n\n $matchAction = array_shift($matchAction);\n $index = array_search($matchAction, $match);\n unset($match[$index]);\n }\n\n // get the arguments from url data\n // get the key from the wildcard. :id, :yyyy, :dd, etc.\n foreach ($args as $arg) {\n $key = $this->matchWildcard($match, $arg);\n $this->arguments[$key] = $arg;\n }\n }", "static function add_rels($content,$args = []){\n\n\n }", "private function reference(array $arguments): array {\n $references = [];\n foreach ($arguments as $id) {\n $references[] = new Reference($id);\n }\n return $references;\n }", "public function args(): array{\n\t\treturn [\n\t\t\t'name' => [\n\t\t\t\t'type' => Type::string(),\n\t\t\t],\n\t\t\t'from' => [\n\t\t\t\t'type' => Type::string(),\n\t\t\t],\n\t\t\t'to' => [\n\t\t\t\t'type' => Type::string(),\n\t\t\t],\n\t\t\t'store' => [\n\t\t\t\t'type' => Type::int(),\n\t\t\t],\n\t\t\t'terminal' => [\n\t\t\t\t'type' => Type::int(),\n\t\t\t],\n\t\t\t'user' => [\n\t\t\t\t'type' => Type::int(),\n\t\t\t],\n\t\t\t'limit' => [\n\t\t\t\t'type' => Type::int(),\n\t\t\t],\n\t\t\t'page' => [\n\t\t\t\t'type' => Type::int(),\n\t\t\t],\n\t\t\t'sort' => [\n\t\t\t\t'type' => Type::string(),\n\t\t\t],\n\t\t\t'desc' => [\n\t\t\t\t'type' => Type::string(),\n\t\t\t],\n\n\t\t];\n\t}", "public function testArgs() {\n // test the constructor\n $args = array(1 => 'one');\n $node = new Route\\RouteNodeArguments(null, $args);\n $this->assertEquals($args, $node->GetArguments());\n\n // test the SetArguments / GetArguments pair\n $otherArgs = array(2 => 'two');\n $node->SetArguments($otherArgs);\n $this->assertEquals($otherArgs, $node->GetArguments());\n }", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\tarray('class', InputArgument::REQUIRED, 'The name of the class you want to have scraped.'),\n\t\t);\n\t}", "public function arguments(): array;", "protected function getArguments()\n\t{\n\t\treturn [\n//\t\t\t['query', InputArgument::REQUIRED, 'Query word you want to search for.'],\n\t\t];\n\t}", "private function readEngineArguments() {\n // TODO: Clean this up and move it into LandEngines.\n\n $onto = $this->getEngineOnto();\n $remote = $this->getEngineRemote();\n\n // This just overwrites work we did earlier, but it has to be up in this\n // class for now because other parts of the workflow still depend on it.\n $this->onto = $onto;\n $this->remote = $remote;\n $this->ontoRemoteBranch = $this->remote.'/'.$onto;\n }", "protected function parseArgs($query, &$args) {\n\t\t\t\tforeach($args as $id => $arg) {\n\t\t\t\t\tif(is_array($arg)) {\n\t\t\t\t\t\t$n = 0;\n\t\t\t\t\t\t$ids = array();\n\t\t\t\t\t\tforeach($arg as $value) {\n\t\t\t\t\t\t\tif($value instanceof DatabaseObject) {\n\t\t\t\t\t\t\t\t$value = $value->Id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$args[$id.$n] = $value;\n\t\t\t\t\t\t\t$ids[] = $id.$n;\n\t\t\t\t\t\t\t$n++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($args[$id]);\n\t\t\t\t\t\t$query = str_replace($id, implode(', ', $ids), $query);\n\t\t\t\t\t} elseif($arg instanceof Collection) {\n\t\t\t\t\t\t$n = 0;\n\t\t\t\t\t\t$ids = array();\n\t\t\t\t\t\tforeach($arg as $value) {\n\t\t\t\t\t\t\t$args[$id.$n] = $value->Id;\n\t\t\t\t\t\t\t$ids[] = $id.$n;\n\t\t\t\t\t\t\t$n++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($args[$id]);\n\t\t\t\t\t\t$query = str_replace($id, implode(', ', $ids), $query);\n\t\t\t\t\t} elseif($arg instanceof DateTime) {\n\t\t\t\t\t\t$args[$id] = $arg->format('Y-m-d H:i:s');\n\t\t\t\t\t} elseif($arg instanceof DatabaseObject) {\n\t\t\t\t\t\t$args[$id] = $arg->Id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $query;\n\t\t\t}", "public function parse_args($argv)\n {\n $this->stats = new Stats();\n $argc = count($argv);\n\n if($argc == 1)\n {\n return;\n }\n else if($argc == 2)\n {\n if($argv[1] == \"--help\" or $argv[1] == \"-h\")\n {\n print \"IPPcode19 parser\\n\";\n print \"Written by Tomáš Sasák for BUT FIT 2019.\\n\\n\";\n print \"Parser parses IPPcode19 language and translates it into XML representation.\\n\";\n print \"Checks syntactic analysis and lexical analysis.\\n\";\n print \"IPPcode19 is taken from STDIN.\\n\";\n exit(0);\n }\n }\n else if(preg_grep(\"/^--stats=.+$/\", $argv))\n {\n $this->stats->parse_stats($argv);\n return;\n }\n fwrite(STDERR, \"Error, unknown parameters!\\n\");\n exit(10);\n }", "private function analyzeRelations() {\n\t\tforeach(self::$relations as $key1 => $table) {\n\t\t\tforeach ($table as $key => &$relation) {\n\t\t\t\t$table1 = new table($key1);\n\t\t\t\t$table2 = new table($key);\n\t\t\t\tif ($relation->type==NOT_ANALYZED) {\n\t\t\t\t\tif (isset($relation->connector)) {\t\n\t\t\t\t\t\t$relation->type = MANY;\n\t\t\t\t\t}\n\t\t\t\t\t$tK = $relation->targetKey;\n\t\t\t\t\t$oK = $relation->origKey;\n\t\t\t\t\tif (isset($table2->$tK) && isset($table1->$oK)) {\n\t\t\t\t\t\t$relation->type = ONE_TO_MANY;\n\t\t\t\t\t}\n\t\t\t\t\t//@TODO single relations\n\t\t\t\t\telseif ($relation->type == NOT_ANALYZED) {\n\t\t\t\t\t\t$info->relationType = NOT_RECOGNIZED;\n\t\t\t\t\t\tthrow new Exception(\"Error! Relation between tables not recognized: $key1 and $key\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "public function testParsingMultipleArgument()\n {\n $request = $this->parser->parse('foo bar baz blah');\n $this->assertEquals('foo', $request->getCommandName());\n $this->assertEquals(['bar', 'baz', 'blah'], $request->getArgumentValues());\n $this->assertEquals([], $request->getOptionValues());\n }", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "private static function relations()\n {\n $files = ['OneToOne', 'OneToMany', 'ManyToMany', 'BelongsTo'];\n $folder = static::$root.'MVC/Relations'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyRelationException', 'ModelNotFindedException'];\n $folder = static::$root.'MVC/Relations/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function havingArguments();", "public function __construct( $args = array() )\n {\n $this->attributeTypes = array(\n \"owner_id\" => Datatypes::INT_NUMBER,\n \"ref_id\" => Datatypes::INT_NUMBER,\n \"type\" => Datatypes::INT_NUMBER,\n \"ord\" => Datatypes::INT_NUMBER\n );\n\n // Aca se pueden cargar valores por defecto!\n $this->attributeValues = array(\n \"owner_id\" => NULL,\n \"ref_id\" => NULL,\n \"type\" => NULL,\n \"ord\" => NULL\n );\n\n $this->constraints = array(\n \"owner_id\" => array( Constraint::nullable(false) ),\n \"ref_id\" => array( Constraint::nullable(false) ),\n \"ord\" => array( Constraint::nullable(true) ) // Si el atributo hasMany no es LIST, aca se guarda NULL.\n );\n\n parent::__construct( $args );\n }", "public function parseFrom(&$arguments)\n {\n /* Grab the table name */\n $arguments['table'] = $this->getNextWord();\n\n /* Filter out the table and database name if the database name exists */\n if (strpos($arguments['table'], '.')) {\n list($arguments['db'], $arguments['table']) = explode('.', $arguments['table']);\n }\n\n return true;\n }", "protected function createRelationHandlerInstance() {}", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "function parseCommLineArgs($argc, $argv){\n\t\t$args = array(\n\t\t\t\"help\" => false,\n\t\t\t\"input\" => null,\n\t\t\t\"output\" => null,\n\t\t\t\"query\" => null,\n\t\t\t\"n\" => false,\n\t\t\t\"root\" => null,\n\t\t);\n\n\t\t// Query file variable\n\t\t$qf = null;\n\n\t\t// No arguments passed\n\t\tif($argc == 1){\n\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\tprintHelp();\n\t\t\texit(EWARGS);\n\t\t}\n\n\t\t// Cycle, in which arguments are parsed\n\t\tfor($i = 1; $i < $argc; $i++){\n\t\t\tif($args[\"help\"] !== false){\n\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\texit(EWARGS);\n\t\t\t} \n\t\t\telseif($argv[$i] == \"--help\"){\n\t\t\t\tif($i > 1){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\n\t\t\t\t$args[\"help\"] = true;\n\t\t\t} \n\t\t\telseif($argv[$i] == \"-n\"){\n\t\t\t\tif($args[\"n\"]){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\n\t\t\t\t$args[\"n\"] = true;\n\t\t\t} \n\t\t\telseif(substr($argv[$i], 0, 8) == \"--input=\"){\n\t\t\t\tif($args[\"input\"] != null){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\t\t\t\telse if(strlen($argv[$i]) == 8)\n\t\t\t\t\t$args[\"input\"] = 'php://stdin';\n\t\t\t\telse\n\t\t\t\t\t$args[\"input\"] = substr($argv[$i],8);\n\t\t\t} \n\t\t\telseif(substr($argv[$i], 0, 9) == \"--output=\"){\n\t\t\t\tif($args[\"output\"] != null){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\t\t\t\telse if(strlen($argv[$i]) == 9)\n\t\t\t\t\t$args[\"output\"] = 'STDOUT';\n\t\t\t\telse\n\t\t\t\t\t$args[\"output\"] = substr($argv[$i],9);\n\t\t\t} \n\t\t\telseif(substr($argv[$i], 0, 8) == \"--query=\"){\n\t\t\t\tif($args[\"query\"] != null){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\t\t\t\telse if(strlen($argv[$i]) == 8)\n\t\t\t\t\t$args[\"query\"] = '';\n\t\t\t\telse\n\t\t\t\t\t$args[\"query\"] = substr($argv[$i],8);\n\t\t\t} \n\t\t\telseif(substr($argv[$i], 0, 5) == \"--qf=\"){\n\t\t\t\tif($qf != null){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\t\t\t\telse if(strlen($argv[$i]) == 5)\n\t\t\t\t\t$args[\"query\"] = '';\n\t\t\t\telse\n\t\t\t\t\t$qf = substr($argv[$i],5);\n\t\t\t} \n\t\t\telseif(substr($argv[$i], 0, 7) == \"--root=\"){\n\t\t\t\tif($args[\"root\"] != null || strlen($argv[$i]) == 7){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\n\t\t\t\t$args[\"root\"] = substr($argv[$i],7);\n\t\t\t} \n\t\t\telse{\n\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\texit(EWARGS);\n\t\t\t}\n\t\t}\n\n\t\tif($args[\"help\"] !== false)\n\t\t\treturn $args;\n\n\n\n\t\t// Checks for a collision of --qf and --query arguments\n\t\tif($args[\"query\"] != null and $qf != null){\n\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\texit(EWARGS);\n\t\t}\n\t\telse if($args[\"query\"] == null and $qf == null){\n\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\texit(EWQUERY);\n\t\t}\n\n\t\t// Loads query from file\n\t\tif($qf != null){\n\t\t\tif($qf == \"\"){\n\t\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\t\texit(EWQUERY);\n\t\t\t}\n\t\t\telseif(!file_exists($qf) || !is_readable($qf)){\n\t\t\t\tfprintf(STDERR, \"ERROR! File with query could not be open!\\n\");\n\t\t\t\texit(EWQUERY);\n\t\t\t}\n\t\t\t$args[\"query\"] = file_get_contents($qf);\n\t\t}\n\t\t\n\t\tif($args[\"query\"] == null || $args[\"query\"] == \"\"){\n\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\texit(EWQUERY);\n\t\t}\n\n\t\treturn $args;\n\t}", "public abstract function getCustomizedRelationList();", "private function executeRelationshipQueries(QueryEventArgs $eventArgs) {\n $targetClass = $eventArgs->getTargetEntity();\n $entityManager = $eventArgs->getEntityManager();\n $results = $eventArgs->getResults();\n\n /** @var ManyToOne[] $manyToOnes */\n $manyToOnes = $this->hydrator->extractSpecAnnotations($targetClass, ManyToOne::class);\n /** @var JoinColumns[] $joinsColumns */\n $joinsColumns = $this->hydrator->extractSpecAnnotations($targetClass, JoinColumns::class);\n\n foreach ($manyToOnes as $propName => $mto) {\n if (!isset($joinsColumns[$propName])) {\n continue;\n }\n\n foreach ($joinsColumns as $joinsColumn) {\n /** @var JoinColumn[] $joinColumns */\n $joinColumns = $joinsColumn->value;\n foreach ($joinColumns as $joinColumn) {\n $colunmName = AnnotationEntityHydrator::camelizeString($joinColumn->referencedColumnName);\n foreach ($results as $key => $result) {\n if (property_exists(get_class($result), $colunmName)) {\n $value = $this->hydrator->extract($result, $colunmName);\n $relObject = $entityManager->getRepository($mto->targetEntity)\n ->findOneBy([$colunmName => $value]);\n $this->hydrator->hydrate($results[$key], [$colunmName => $relObject]);\n }\n }\n }\n }\n }\n\n $eventArgs->setResults($results);\n }", "public function buildRelations()\n {\n $this->addRelation('Denomination', 'Denomination\\\\Denomination', RelationMap::MANY_TO_ONE, array('denomination_id' => 'id', ), null, null);\n $this->addRelation('ProfessionalCategory', 'ProfessionalCategory\\\\ProfessionalCategory', RelationMap::MANY_TO_ONE, array('professional_category_id' => 'id', ), null, null);\n $this->addRelation('Country', 'Country\\\\Country', RelationMap::MANY_TO_ONE, array('country_of_birth_id' => 'id', ), null, null);\n $this->addRelation('Migration', 'Migration\\\\Migration', RelationMap::ONE_TO_MANY, array('id' => 'person_id', ), null, null, 'Migrations');\n }", "private function parse_params($params)\n {\n }", "public static function parseArgs($args) {\n if (preg_match_all ( \"/([^\\\\[^\\\\]]+)/\", $args, $matches )) {\n $params = explode ( ',', $matches [1] [0] );\n $toReturn = array ( );\n foreach ( $params as $p ) {\n @list ( $key, $value ) = explode ( '=>', $p );\n $toReturn [preg_replace ( \"/[\\\\' ]+/\", \"\", $key )] = preg_replace ( \"/[\\\\' ]+/\", \"\", $value );\n }\n return $toReturn;\n }\n return $args;\n }", "abstract public function getConnectionArguments();", "public function __construct()\n {\n $this->arguments = func_get_args();\n }", "protected function getArguments()\n {\n return array(\n // array('model', InputArgument::OPTIONAL, 'The model for which you would like to generate rules.'),\n );\n }", "function parseParameters(array $conditions): array;", "function userelation($relation) { atkuse(\"relation\" , $relation); }", "public static function workflowRelations();", "private function create_args( array $assoc_args ) {\n\t\t$this->publication = $assoc_args['publication'];\n\n\t\tif ( ! $this->does_publication_exist() ) {\n\t\t\tWP_CLI::error( \"Publication with ID {$this->publication} does not exist.\" );\n\t\t\tdie;\n\t\t}\n\n\t\tif ( isset( $assoc_args['taxonomies'] ) ) {\n\t\t\t$this->taxonomies = explode( ',', $assoc_args['taxonomies'] );\n\t\t}\n\t}", "public function getRelationList();", "abstract public function processParameters ($params);" ]
[ "0.5558806", "0.5533093", "0.54748654", "0.54435164", "0.5401782", "0.51215535", "0.5103562", "0.5103562", "0.5103562", "0.5103562", "0.5103562", "0.5103562", "0.5103562", "0.5103562", "0.5103562", "0.51034975", "0.5095997", "0.5095997", "0.5095997", "0.5095997", "0.5095997", "0.5095997", "0.5095997", "0.5095997", "0.50865847", "0.5048386", "0.5043384", "0.5021972", "0.5021972", "0.5021972", "0.5021777", "0.50080913", "0.49640247", "0.49460942", "0.49178514", "0.49128318", "0.48984385", "0.4886309", "0.4883825", "0.48633063", "0.48504394", "0.48321676", "0.48315522", "0.48277682", "0.48165923", "0.48099226", "0.48047647", "0.48047647", "0.48047647", "0.48047647", "0.48044482", "0.48003963", "0.47997138", "0.47635993", "0.47424528", "0.47415665", "0.47163504", "0.47157788", "0.47060892", "0.46739122", "0.46652967", "0.4662901", "0.4661213", "0.46566778", "0.46560237", "0.46440336", "0.46233776", "0.4617389", "0.46168023", "0.46030423", "0.4602763", "0.4595402", "0.45866883", "0.45866883", "0.45866883", "0.45866883", "0.45819235", "0.4576115", "0.45703897", "0.45695144", "0.45627233", "0.4549626", "0.4549626", "0.4549626", "0.4549626", "0.45405927", "0.45328632", "0.45323497", "0.45270383", "0.4523418", "0.45197135", "0.45180902", "0.45137247", "0.45127034", "0.45113084", "0.45103744", "0.45008186", "0.449996", "0.44948485", "0.44948" ]
0.6385314
0
Returns always the same instance of this plugin.
public static function get_instance() { if ( ! self::$instance ) { self::$instance = new self(); } return self::$instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_instance() {\n\t\t\t// Store the instance locally to avoid private static replication\n\t\t\tstatic $instance = null;\n\n\t\t\tif ( null === $instance ) {\n\t\t\t\t$instance = new self();\n\t\t\t\tself::_setup_plugin();\n\t\t\t}\n\n\t\t\treturn $instance;\n\t\t}", "public function getInstance()\n {\n return $this;\n }", "public static function instance() {\n return self::$instance;\n }", "public static function instance() {\r\n return self::$instance;\r\n }", "public static function getInstance()\n {\n return self::$instance ?? self::getNewInstance();\n }", "public static function instance() {\n\t\treturn static::$instance;\n\t}", "public function get_instance()\n\t{\n\t\treturn $this;\n\t}", "public function get_instance()\n\t{\n\t\treturn $this;\n\t}", "public function instance() {\n\t\n\t\treturn $this;\n\t\n\t}", "public function getInstance() {\n\t\treturn $this->instance;\n\t}", "public function getInstance(): self\n {\n return $this;\n }", "public static function get_instance() {\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\t\treturn self::$instance;\n\t}", "public static function instance(): self\n {\n return self::$instance ??= new self();\n }", "public function get_instance() {\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public static function get_instance() {\n\n if ( ! self::$instance instanceof self ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n\n }", "public static function instance() {\n if ( empty( self::$instance ) ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }", "public static function instance(){\n if (!self::$instance){\n self::$instance = new Plugins();\n }\n return self::$instance;\n }", "public static function instance() {\n\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\n\t\t}", "public static function get_instance() {\n\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n\n }", "public static function get_instance() {\n\n\t\treturn null === self::$instance ? new self() : self::$instance;\n\n\t}", "public static function instance()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tif ( ! self::$instance instanceof self )\r\n\t\t\t{\r\n\t\t\t\tself::$instance = new self;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn self::$instance;\r\n\t\t}", "public static function plugin_instance()\r\n\t{\r\n\t\tif ( ! static::$instance)\r\n\t\t{\r\n\t\t\tstatic::$instance = static::forge(array(PLUGINPATH));\r\n\t\t}\r\n\t\treturn static::$instance;\r\n\t}", "private static function instance() {\n\t\tif (!isset(self::$instance)) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public function getInstance()\n {\n return self::$instance;\n }", "public static function instance()\n {\n\n // If the single instance hasn't been set, set it now.\n if (null == self::$instance) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }", "public static function instance() {\n\t\tif ( ! self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( ! self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\r\n // # If the single instance hasn't been set, set it now.\r\n if ( null == self::$instance ) {\r\n self::$instance = new self;\r\n }\r\n\r\n return self::$instance;\r\n }", "public static function get_instance() {\n\t\tif ( ! ( self::$instance instanceof Plugin ) ) {\n\t\t\tself::$instance = new Plugin();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\t\t\tif( ! self::$instance )\n\t\t\t\tself::$instance = new self;\n\t\t\treturn self::$instance;\n\t\t}", "public static function shared()\n {\n if (null === self::$instance) {\n self::$instance = new self();\n }\n\n return self::$instance;\n }", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t\t\n\t}", "function get() {\n\t\tif (!self::$instance) self::$instance = new self;\n\t\treturn self::$instance;\n\t}", "public static function instance()\n {\n if ( !isset(self::$instance) ) {\n self::$instance = new self();\n }\n return self::$instance;\n }", "public static function get_instance() {\n\n\t\t\t// Check if instance is already exists.\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function get_instance() {\n\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( null == self::$instance ) {\n\t\t\t\tself::$instance = new self;\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function get_instance(){\n\t\t\tif( is_null( self::$instance ) ){\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function get_instance()\n {\n\n // If the single instance hasn't been set, set it now.\n if (null == self::$instance) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }", "public static function instance() {\n\n\t\tif (!self::$instance) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( empty( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif (empty(self::$instance)) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\treturn new self;\n\t}", "public static function instance() {\n\t\t\tif ( ! self::$_instance ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self;\n\t\t\tself::$instance->do_hooks();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\t\t\tif ( !self::$instance ) self::$instance = new self;\n\t\t\treturn self::$instance;\n\t\t}", "public static function getInstance() {\n return self::$instance;\n }", "public static function instance()\n {\n if ( !isset(self::$instance) ) {\n self::$instance = new self();\n }\n return self::$instance;\n }", "public static function instance()\n {\n if ( !isset(self::$instance) ) {\n self::$instance = new self();\n }\n return self::$instance;\n }", "public static function get_instance() {\n // If the single instance hasn't been set, set it now.\n if (null == self::$instance) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }", "public static function get_instance() {\n // If the single instance hasn't been set, set it now.\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }", "static public function instance()\n\t{\n\t\tif (is_null(self::$instance))\n\t\t{\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( null == self::$instance ) {\n\t\t\t\tself::$instance = new self;\n\t\t\t}\n\t\t\t\n\t\t\treturn self::$instance;\n\t\t}", "public static function get_instance() {\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( null == self::$instance ) {\n\t\t\t\tself::$instance = new self;\n\t\t\t}\n\t\t\t\n\t\t\treturn self::$instance;\n\t\t}", "public static function instance() {\n\t\tif ( ! ( self::$instance instanceof self ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function get_instance() {\n // If the single instance hasn't been set, set it now.\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function get_instance() {\n // If the single instance hasn't been set, set it now.\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) )\n\t\t\t\tself::$_instance = new self();\n\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( null === self::$_instance ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function get_instance() {\n\t\t\t// Check if instance is already exists.\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function get_instance() {\n\t\t\t// Check if instance is already exists.\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function instance(): self\n {\n return static::$instance ??= new static();\n }", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\n\t\tif ( null === self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "static public function getInstance()\n\t{\n\t\treturn parent::getInstance();\n\t}", "public static function get_instance() {\n\t\tif ( null === self::$single_instance ) {\n\t\t\tself::$single_instance = new self();\n\t\t}\n\n\t\treturn self::$single_instance;\n\t}", "public static function get_instance() {\n\t\tif ( null === self::$single_instance ) {\n\t\t\tself::$single_instance = new self();\n\t\t}\n\n\t\treturn self::$single_instance;\n\t}", "public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__);\n\t}", "public static function instance()\n\t{\n\t\tif ( !isset(self::$instance) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance()\n\t{\n\t\tif ( !isset(self::$instance) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance()\n\t{\n\t\tif ( !isset(self::$instance) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance()\n\t{\n\t\tif ( !isset(self::$instance) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance()\n\t{\n\t\tif ( !isset(self::$instance) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\n\t\tif ( null === self::$instance ) {\n\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance()\n {\n // If the single instance hasn't been set, set it now.\n if(null == self::$instance) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\r\n\t\tif ( null === self::$single_instance ) {\r\n\t\t\tself::$single_instance = new self();\r\n\t\t}\r\n\r\n\t\treturn self::$single_instance;\r\n\t}", "public static function get_instance() {\n\t\tif ( !is_a( self::$instance, __CLASS__ ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}" ]
[ "0.7822202", "0.780008", "0.77917904", "0.7741688", "0.7716762", "0.77058506", "0.7694209", "0.7694209", "0.76834464", "0.76693386", "0.76642394", "0.76513267", "0.76513267", "0.76305", "0.76230353", "0.76115733", "0.76115733", "0.76115733", "0.76115733", "0.7590571", "0.7586711", "0.7573765", "0.75576025", "0.7546276", "0.7542942", "0.75313324", "0.7530735", "0.7527041", "0.75261855", "0.75261855", "0.7516413", "0.7515208", "0.75117284", "0.75117284", "0.75091237", "0.7503911", "0.7499222", "0.74965674", "0.7494824", "0.7485691", "0.748515", "0.7479905", "0.7473878", "0.7472652", "0.7471357", "0.7466384", "0.74659014", "0.7463933", "0.746106", "0.7460517", "0.7454635", "0.74542755", "0.7450728", "0.7449971", "0.74477243", "0.74477243", "0.7446513", "0.7445284", "0.744361", "0.74417216", "0.74417216", "0.74402285", "0.7438344", "0.7438344", "0.7438344", "0.7438344", "0.74333215", "0.74333215", "0.74284273", "0.7426768", "0.74264926", "0.74264926", "0.7423045", "0.7422913", "0.7422913", "0.7422913", "0.7422913", "0.7422913", "0.7422913", "0.74200475", "0.74199086", "0.7411615", "0.7411615", "0.741096", "0.7410333", "0.7410333", "0.7410333", "0.7410333", "0.7410333", "0.74098545", "0.74093074", "0.7408691", "0.74086815", "0.74086815", "0.74086815", "0.74086815", "0.74086815", "0.74086815", "0.74086815", "0.7408027", "0.74066746" ]
0.0
-1
Indicates whether it is permitted to notify about a post or not.
public function is_post_notifiable( $post, $action ) { if ( ! $post || ! is_a( $post, 'WP_Post' ) ) { return false; } // All actions can notify about handbooks. $notifiable_post_types = array( 'handbook' ); // There's a large number of custom handbooks, and more will be created in the future. if ( str_contains( $post->post_type, '-handbook' ) ) { $notifiable_post_types[] = $post->post_type; } if ( 'publish' === $action || 'comment' === $action ) { $notifiable_post_types = array_merge( $notifiable_post_types, array( 'post', 'handbook', 'wporg_workshop', 'lesson-plan', 'course' ) ); } // Some post types are imported programmatically and aren't directly attributable to a wordpress.org // account. $is_markdown_post = false; $post_meta = get_post_custom( $post->ID ); foreach ( $post_meta as $key => $value ) { if ( str_contains( $key, '_markdown_source' ) ) { $is_markdown_post = true; } } if ( is_plugin_active( 'subscribers-only.php' ) ) { $notifiable = false; } elseif ( ! in_array( $post->post_type, $notifiable_post_types, true ) ) { $notifiable = false; } elseif ( 'publish' != $post->post_status ) { $notifiable = false; } elseif ( ! empty( $post->post_password ) ) { $notifiable = false; } elseif ( $is_markdown_post || ! $post->post_author ) { // Some Handbook posts are automatically created and don't have an author. $notifiable = false; } elseif ( $post->_xpost_original_permalink || str_starts_with( $post->post_name, 'xpost-' ) ) { $notifiable = false; } else { $notifiable = true; } return apply_filters( 'wporg_profiles_wp_activity-is_post_notifiable', $notifiable, $post ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canPost()\n {\n $role = $this->role;\n if($role == 'author' || $role == 'admin')\n {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'DELETE':\n {\n return true;\n }\n case 'POST':\n {\n return true;\n }\n case 'PUT':\n {\n if (Auth::user()->hasPermissionTo('post_update', 'blog')) {\n return true;\n } else {\n return true;\n }\n }\n default:\n break;\n }\n return true;\n }", "public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function authorize()\n {\n if ($this->isMethod('POST')) {\n return true;\n }\n\n $thePost = Post::find($this->route('id'));\n return Auth::user()->can('update', $thePost) && Auth::user()->can('delete', $thePost);\n }", "function canCreatePost() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }", "public function get_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function canSend()\n {\n $flag = intval(setting(\"mail_notify_{$this->getTemplateTag()}\"));\n\n return !!$flag;\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }", "public function authorizePost()\n {\n return $this->user()->can('acme.create');\n }", "public function isPost(): bool {}", "protected function AllowSendAuthorReviewCommentNotification()\n {\n $bAllowSendAuthorCommentNotification = false;\n if ($this->fieldSendCommentNotification) {\n if (!empty($this->fieldAuthorEmail) || !empty($this->fieldDataExtranetUserId)) {\n $bAllowSendAuthorCommentNotification = true;\n }\n }\n\n return $bAllowSendAuthorCommentNotification;\n }", "public function only_post_user_can_answered_his_post()\n {\n $comment = factory(\\App\\Comment::class)->create();\n\n $policy = new CommentPolicy();\n\n $policy->accept($comment->post->user,$comment);\n\n $this->assertTrue($policy->accept($comment->post->user,$comment));\n }", "function is_approved() {\n\t\treturn $this->get_data( 'comment_approved' );\n\t}", "function eman_post_reviewable( $post )\n{\n\t// Get current post status\n\t$status = emanager_post::status($post, 'slug');\n\tif ( $status && ! in_array($status, array('void','approved','approve','draft','revise','executed')) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function notificationCanSend( $metaData )\n\t{\n\t\treturn true;\n\t}", "public function isApproved()\n {\n\n return false;\n }", "public function authorize()\n {\n return Gate::allows('add_to_dos') ? true : false;\n }", "public function authorize()\n {\n if ( ! $this->getRelease()->belongsToYou()) {\n return false;\n }\n return true;\n }", "public function isApproved(): bool;", "public function isPublished()\n {\n if(!strcmp($this->getStatus(), 'approved')) {\n return true;\n }\n\n return false;\n }", "public function isPost();", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsProfileNotification::manage_process');\n }", "public function authorize()\n {\n return $this->user()->hasPermission('update-title');\n }", "public function authorize()\n {\n return !Cache::has('announcement');\n }", "protected function canReply(){\n return $this->canUserModify() &&\n $this->socialQuestion &&\n $this->isActive() &&\n $this->socialQuestion->SocialPermissions->canComment() &&\n !$this->connectObj->Parent->ID;\n }", "protected function check_update_permission($post)\n {\n }", "protected function check_update_permission($post)\n {\n }", "public function authorize(): bool\n {\n return $this->user()->can('update_contact');\n }", "function _sf_send_user_publish_note($new_status, $old_status, $post) {\n\t\tif($post->post_type == 'spot') {\n\t\t\t\n\t\t\t$user = get_user_by('id', $post->post_author);\n\t\t\t\n\t\t\t//// IF THIS POST IS BEING PUBLISHED AND THE AUTHOR IS A SUBMITTER\n\t\t\tif($old_status != 'publish' && $new_status == 'publish' && isset($user->caps['submitter'])) {\n\t\t\t\t\n\t\t\t\t//// SENDS AN EMAIL SAYING HIS POST HAS BEEN SUBMITTED\n\t\t\t\t$message = sprintf2(__(\"Dear %user,\n\t\t\t\t\nThis is to inform you that your submission %title at %site_name has been approved and it is now published.\n\nYou can view it here at %link\n\nKind regards,\nthe %site_name team.\", 'btoa'), array(\n\t\t\t\n\t\t\t\t\t'user' => $user->display_name,\n\t\t\t\t\t'title' => $post->post_title,\n\t\t\t\t\t'site_name' => get_bloginfo('name'),\n\t\t\t\t\t'link' => get_permalink($post->ID),\n\t\t\t\t\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\t$subject = sprintf2(__('Submission approved at %site_name', 'btoa'), array('site_name' => get_bloginfo('name')));\n\t\t\t\t\n\t\t\t\t$headers = \"From: \".get_bloginfo('name').\" <\".get_option('admin_email').\">\";\n\t\t\t\t\n\t\t\t\twp_mail($user->user_email, $subject, $message, $headers);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t///// IF ITS A SPOT\n\t\t\tif($post->post_type == 'spot') {\n\t\t\t\t\n\t\t\t\tif(ddp('future_notification') == 'on' && $old_status != 'publish' && $new_status == 'publish') {\n\t\t\t\t\t\n\t\t\t\t\t//// ALSO CHECKS FOR USER NOTIFICATIONS FOR MATCHING CRITERIA\n\t\t\t\t\tif(function_exists('_sf_check_for_user_notifications_matching_spot')) { _sf_check_for_user_notifications_matching_spot($post->ID); }\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('submission_days') != '' && ddp('submission_days') != '0') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO PENDING IN X AMOUNT OF DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET FOR OUR FEATURED SUBMISSION - AND ITS INDEED FEATURED\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('price_featured_days') != '' && ddp('price_featured_days') != '0' && get_post_meta($post->ID, 'featured', true) == 'on') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO NORMAL SUBMISSION AFTER X DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date_featured($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }", "public function authorize()\n {\n return Gate::allows('notifications_create');\n }", "protected function check_create_permission($post)\n {\n }", "public function authorize()\n {\n return Gate::allows('update', $this->route('topic'));\n }", "public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }", "public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }", "public function authorize()\n {\n // パラメータのIDからで削除対象のリプライを取得\n $post = Post::find($this->route(\"id\"));\n // if ($reply == null) return false;\n\n return $post && $this->user()->id == $post->user_id ? true : false;\n }", "public function isPublished()\n {\n return $this->postID > 0;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Pronko_TaskManagement::TaskManagement_save');\n }", "public function authorize()\n {\n\n $this->note = Note::find($this->route('note'));\n\n return Gate::allows('update', $this->note);\n }", "public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }", "protected function has_permission( $post_id ) {\n // autosave -> do nothing\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return false;\n }\n\n // Ajax -> do nothing\n if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {\n return false;\n }\n\n // no post found -> do nothing\n $post = get_post( $post_id );\n if ( $post === null ) {\n return false;\n }\n\n // current post type is not enabled for LaterPay -> do nothing\n if ( ! in_array( $post->post_type, $this->config->get( 'content.enabled_post_types' ), true ) ) {\n return false;\n }\n\n return true;\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }", "public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }", "function sh_can_user_post_in_forum($id) {\n\treturn true;\n}", "public function canWrite() {\n\t\tif (empty($_SESSION['tokens']['fb'])) return false;\n\t\tif (empty($_SESSION['user']['fb']['permissions'])) return false;\n\t\treturn in_array('publish_actions', $_SESSION['user']['fb']['permissions']);\n\t}", "public function authorize()\n {\n// $comment = Comment::find($this->route('comment')); // Get 'comment' route's params.\n// return $comment && $this->user()->can('update', $comment);\n\n return false;\n }", "protected function authorizePublishPost($caps, $obj) {\n $id = (is_a($obj, 'WP_Post') ? $obj->ID : $obj);\n $object = AAM::getUser()->getObject('post', $id);\n $area = AAM_Core_Api_Area::get();\n \n if (!$object->allowed($area . '.publish')) {\n $caps[] = 'do_not_allow';\n }\n\n return $caps;\n }", "public function authorize()\n {\n \t// var_dump(Auth::check());\n \t// $postId = $this->route('create');\n \t// var_dump($postId);\n \tif(session('statut') == 'admin')\n \t\treturn true;\n \telse\n \t\treturn false;\n\n \t// return Gate::allows('update', Post::findOrFail($postId));\n }", "public function isAuthorized($user) {\n if ($this->action === 'add') {\n return true;\n }\n\n // The owner of a post can edit and delete it\n if (in_array($this->action, array('edit', 'delete'))) {\n $presupuestoId = $this->request->params['pass'][0];\n if ($this->Post->isOwnedBy($presupuestoId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}", "function canEditPost(Post $post) {\n return ($this->isAdmin() || ($this->id == $post->getCreatorId()));\n }", "function isPost() {\r\n\t\treturn $this->isPost;\r\n\t}", "public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }", "public function canPublish($member = null)\n {\n return $this->owner->isEditable();\n }", "public function canPublish($member = false)\n {\n return Permission::check(get_class($this->owner) . '_publish');\n }", "public function publishedStatus()\n {\n if ( !$this->owner->getScheduledStatus() && !$this->owner->getExpiredStatus() ) {\n return true;\n }\n\n return false;\n }", "public function check_read_permission($post)\n {\n }", "public function check_read_permission($post)\n {\n }", "public function restore_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function authorize()\n {\n return $this->user()->can('update_users');\n }", "function can_manage(){\r\n\t\treturn ( $this->get_booking()->can_manage() );\r\n\t}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('system/config/newsletter');\n }", "public function isPost() {\n return $this->post;\n }", "public function authorize()\n {\n return $this->user()->can('create mindoro transaction');\n }", "function notify_reviewer( $post_ID, $post, $dowhat='publish' ) {\n\t\t\tglobal $wpdb, $current_user;\n\t\t\t$last_revision = $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_parent=%d AND post_type=%s ORDER BY post_date DESC LIMIT 1\", $post_ID, 'revision' ) );\n\t\t\t$post_content = 'draft' == $dowhat ? get_post( $last_revision ) : get_post( $post_ID );\n\t\t\t$last_mod = $post_content->post_date;\n\t\t\t$post_content = $post_content->post_content;\n\t\t\t$revision_compare_link = admin_url( 'revision.php?action=diff&post_type=' . $post->post_type . '&right=' . $post->ID . '&left=' . $last_revision );\n\t\t\t$body = sprintf( __( \"New changes have been made to \\\"%s\\\" at <%s>. \", $this->text_domain ), $post->post_title, get_permalink( $post->ID ) );\n\t\t\tif( 'draft' == $dowhat ) {\n\t\t\t\t$body .= __( \"The author has requested that you review the new changes and determine whether to remove or approve them. These changes will not appear on the public website until you approve them.\\n\\n\", $this->text_domain );\n\t\t\t} else {\n\t\t\t\t$body .= __( \"The modifications have been published, but the author of the page has requested you be notified of them.\\n\\n\", $this->text_domain );\n\t\t\t}\n\t\t\t$body .= sprintf( __( \"The new content of the page is shown below if you would like to review it. You can also review %s the changes at %s. Thank you. \\n\\n======================================================= \\nRevisions made at %s \\n======================================================= \\n\\n%s\", $this->text_domain ), ( 'draft' == $dowhat ? __( \" and approve/reject \", $this->text_domain ) : '' ), $revision_compare_link, $last_mod, $post_content );\n\t\t\t\n\t\t\t$headers = \"From: {$current_user->display_name} <{$current_user->user_email}>\\r\\n\";\n\t\t\t\n\t\t\twp_mail( $this->reviewers, sprintf( __( '[%s] New modifications to %s' ), get_bloginfo('name'), $post->post_title ), $body, $headers );\n\t\t}", "public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }", "protected function check_read_permission($post)\n {\n }", "public function no_post_author_cannot_accept_a_comment_as_post_answer()\n {\n $comment = factory(\\App\\Comment::class)->create();\n\n $this->actingAs(factory(\\App\\User::class)->create());\n\n $this->visit($comment->post->url);\n\n $this->post(route('comment.accept',$comment));\n $this->seeInDatabase('posts',[\n 'id' => $comment->post_id,\n 'pending' => true\n ]);\n\n\n }", "public function canFlag()\n {\n return in_array('flag', $this->actions);\n }", "function is_post_status_viewable($post_status)\n {\n }", "public function authorize()\n {\n if ($this->route()->getName() === 'home.update') {\n $post = Post::findOrFail($this->id);\n return Auth::check() && Auth::user()->isAdminOrOwner($post->user_id);\n }\n return Auth::check();\n }", "public function can_post($forum, &$whynot, $userid=0) {\n return true;\n }", "public function isInAuthorPost()\n {\n return $this->object->isInAuthorPost();\n }", "public static function add_notice_if_flagged_or_unflagged() {\n\t\t$screen = get_current_screen();\n\n\t\t// Only add notice when editing single photo.\n\t\t$post_type = Registrations::get_post_type();\n\t\tif ( ! $screen || $post_type !== $screen->id || $post_type !== $screen->post_type ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$notice = $user = $user_id = '';\n\t\t$notice_type = 'warning';\n\n\t\t$post = get_post();\n\t\tif ( ! $post ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Don't need to report flagging/unflagging for published posts.\n\t\tif ( 'published' === $post->post_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Note: Not reporting who flagged a post once it has been unflagged.\n\t\tif ( $user_id = Flagged::get_unflagger( $post ) ) {\n\t\t\t/* translators: 1: URL to the profile of the user who unflagged the photo, 2: The name of the user who unflagged the photo. */\n\t\t\t$notice = __( '<strong>This photo was unflagged by <a href=\"%1$s\">%2$s</a> and is safe to moderate.', 'wporg-photos' );\n\t\t\t$notice_type = 'success';\n\t\t}\n\t\telseif ( $user_id = Flagged::get_flagger( $post ) ) {\n\t\t\t// A user can't actually flag their own submission. This results from auto-flagging.\n\t\t\tif ( $user_id === $post->post_author ) {\n\t\t\t\t$notice = __( '<strong>This photo was automatically flagged due to potential concerns after image analysis.', 'wporg-photos' );\n\t\t\t} else {\n\t\t\t\t/* translators: 1: URL to the profile of the user who flagged the photo, 2: The name of the user who flagged the photo. */\n\t\t\t\t$notice = __( '<strong>This photo was flagged by <a href=\"%1$s\">%2$s</a>.', 'wporg-photos' );\n\t\t\t}\n\t\t}\n\n\t\tif ( $user_id ) {\n\t\t\t$user = new \\WP_User( $user_id );\n\t\t}\n\n\t\tif ( ! $user || ! $notice ) {\n\t\t\treturn;\n\t\t}\n\n\t\tprintf(\n\t\t\t'<div id=\"message\" class=\"notice notice-%s\"><p>%s</p></div>' . \"\\n\",\n\t\t\tesc_attr( $notice_type ),\n\t\t\tsprintf(\n\t\t\t\t$notice,\n\t\t\t\t'https://profiles.wordpress.org/' . $user->user_nicename . '/',\n\t\t\t\tsanitize_text_field( $user->display_name )\n\t\t\t)\n\t\t);\n\t}", "public function authorize()\n {\n// $this->authorize('create', Reply::class);\n// Вместо authorize используем Gate:\n return Gate::allows('create', Reply::class); //проверка на спам сообщениями\n// return true;\n }", "function notify_post($post_id) {\n\n if( ( $_POST['post_status'] == 'publish' ) && ( $_POST['original_post_status'] != 'publish' ) && ( $_POST['post_type'] == 'events' ) ) {\n\n send_event_email($post_id);\n\n }\n\n}", "function user_can_save( $post_id ) {\n\n\t\t$is_autosave = wp_is_post_autosave( $post_id );\n\t\t$is_revision = wp_is_post_revision( $post_id );\n\n\t\t// Return true if the user is able to save; otherwise, false.\n\t\treturn ! ( $is_autosave || $is_revision );\n\n\t}", "public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }", "public function isApproved()\n {\n if ($this->approved == 'YES') {\n return true;\n }\n \n return false;\n }", "public function isApproved()\n {\n return $this->approved;\n }", "public function authorize()\n {\n return true; //true - todos\n }", "public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }", "public function iN_CheckNotificationInsertedBeforePostLike($userID, $postID) {\n\t\t$userID = mysqli_real_escape_string($this->db, $userID);\n\t\t$postID = mysqli_real_escape_string($this->db, $postID);\n\t\t$check = mysqli_query($this->db, \"SELECT not_iuid, not_post_id FROM i_user_notifications WHERE not_iuid = '$userID' AND not_post_id = '$postID' AND not_not_type = 'postLike'\") or die(mysqli_error($this->db));\n\t\tif (mysqli_num_rows($check) == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function canBeReviewed(): bool\n {\n if (!$this->isOnline()) {\n return false;\n }\n\n if (new \\DateTimeImmutable('now') > $this->getReviewDeadline()) {\n return false;\n }\n\n return true;\n }", "function _admin_notice_post_locked()\n {\n }", "public function authorize()\n {\n\n if (Gate::allows('change-order-status', $this->route('order'))) {\n return true;\n }\n\n return false;\n }", "public static function isAllowed() {\r\n\t\treturn TodoyuAuth::isAdmin();\r\n\t}", "public function flagAction()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$user = Application_Model_User::getAuth();\r\n\r\n\t\t\tif ($user == null)\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('You are not authorized to access this action');\r\n\t\t\t}\r\n\r\n\t\t\t$id = $this->_request->getPost('id');\r\n\r\n\t\t\tif (!v::intVal()->validate($id))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post ID value: ' .\r\n\t\t\t\t\tvar_export($id, true));\r\n\t\t\t}\r\n\r\n\t\t\tif (!Application_Model_News::checkId($id, $post, ['join'=>false]))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post ID: ' .\r\n\t\t\t\t\tvar_export($id, true));\r\n\t\t\t}\r\n\r\n\t\t\t$settings = Application_Model_Setting::getInstance();\r\n\r\n\t\t\tMy_Email::send(\r\n\t\t\t\t$settings['email_fromAddress'],\r\n\t\t\t\t'Report Abuse',\r\n\t\t\t\t[\r\n\t\t\t\t\t'template' => 'flag-post',\r\n\t\t\t\t\t'assign' => ['post' => $post],\r\n\t\t\t\t\t'settings' => $settings\r\n\t\t\t\t]\r\n\t\t\t);\r\n\r\n\t\t\t$response = ['status' => 1];\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\t$response = [\r\n\t\t\t\t'status' => 0,\r\n\t\t\t\t'message' => $e instanceof RuntimeException ?\r\n\t\t\t\t\t$e->getMessage() : 'Internal Server Error'\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\t$this->_helper->json($response);\r\n\t}", "public function isNotice()\n {\n return $this->getName() === 'notice';\n }", "public function isNotify($obj)\n {\n return $this->validate($obj, 'notify');\n }", "protected function isTalkAllowed() {\n\t\t$title = $this->getTitle();\n\t\treturn $this->isAllowedPageAction( 'talk' ) &&\n\t\t\t!$title->isTalkPage() &&\n\t\t\t$title->canTalk() &&\n\t\t\t$this->getUser()->isLoggedIn();\n\t}", "function check_and_publish_future_post($post)\n {\n }", "public function is_privacy_policy()\n {\n }", "protected function check_read_post_permission($post, $request)\n {\n }", "public function is_show_ask_for_review_notice() {\n return (\n nk_theme()->theme_dashboard()->theme_id &&\n nk_theme()->theme_dashboard()->theme_uri &&\n nk_theme()->theme_dashboard()->ask_for_review &&\n 'show' === nk_theme()->get_option( 'ask_for_review_status', 'first' )\n );\n }", "protected function hasAccessOnPublished()\n\t{\n\t\treturn $this->User->hasAccess($GLOBALS['TL_DCA'][$this->strTable]['config']['ptable'] . '::published', 'alexf');\t\t\n\t}", "public function authorize(): bool\n {\n if (Auth::user()->hasPermissionTo('delete thread')) {\n return true;\n }\n\n $thread = $this->run(GetThreadJob::class, [\n 'thread_id' => $this->request->all()['thread_id']\n ]);\n\n if ($thread != null && $thread->user_id === Auth::user()->id && Auth::user()->hasPermissionTo('delete own thread')) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "public function shouldBePublished()\n {\n return $this->publish;\n }", "public function isPost(): bool \r\n {\r\n return $this -> method() === 'POST' ? true : false;\r\n }" ]
[ "0.6946952", "0.6498154", "0.64958954", "0.649266", "0.64653337", "0.63537335", "0.6348838", "0.63475245", "0.6334246", "0.62739605", "0.627186", "0.6266791", "0.62631756", "0.6263084", "0.62560534", "0.62535495", "0.6237207", "0.62103105", "0.61896163", "0.61710155", "0.6153991", "0.6145905", "0.6115226", "0.6114894", "0.61042416", "0.6103053", "0.6099821", "0.6099821", "0.6096252", "0.6080044", "0.60792035", "0.6069297", "0.60674286", "0.6062932", "0.6060456", "0.60522944", "0.60478365", "0.60426784", "0.6010322", "0.59974515", "0.59653467", "0.59629375", "0.5956518", "0.5948292", "0.59426534", "0.59262097", "0.59237593", "0.5917144", "0.5906994", "0.5898834", "0.58741087", "0.58732265", "0.5860927", "0.5859918", "0.5855127", "0.58461505", "0.5836457", "0.5836457", "0.58319014", "0.58294636", "0.58278877", "0.582557", "0.58122987", "0.57967925", "0.5779814", "0.5777219", "0.5776331", "0.57739943", "0.5767327", "0.57658935", "0.576509", "0.57475924", "0.5747326", "0.5746079", "0.5739474", "0.5737675", "0.57346725", "0.57325304", "0.57285994", "0.57266545", "0.5725554", "0.57202387", "0.57188225", "0.5716515", "0.5708396", "0.57082164", "0.57054955", "0.5702484", "0.5699904", "0.56885874", "0.5686018", "0.5685468", "0.56815624", "0.5678891", "0.56775725", "0.5676168", "0.5668955", "0.56686693", "0.5664999", "0.56648576" ]
0.6300419
9
Only send notification for post getting published.
public function maybe_notify_new_published_post( $new_status, $old_status, $post ) { if ( 'publish' != $new_status ) { return; } if ( $old_status == $new_status ) { return; } if ( ! $this->is_post_notifiable( $post, 'publish' ) ) { return; } $this->notify_blog_post( $post, 'new' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _sf_send_user_publish_note($new_status, $old_status, $post) {\n\t\tif($post->post_type == 'spot') {\n\t\t\t\n\t\t\t$user = get_user_by('id', $post->post_author);\n\t\t\t\n\t\t\t//// IF THIS POST IS BEING PUBLISHED AND THE AUTHOR IS A SUBMITTER\n\t\t\tif($old_status != 'publish' && $new_status == 'publish' && isset($user->caps['submitter'])) {\n\t\t\t\t\n\t\t\t\t//// SENDS AN EMAIL SAYING HIS POST HAS BEEN SUBMITTED\n\t\t\t\t$message = sprintf2(__(\"Dear %user,\n\t\t\t\t\nThis is to inform you that your submission %title at %site_name has been approved and it is now published.\n\nYou can view it here at %link\n\nKind regards,\nthe %site_name team.\", 'btoa'), array(\n\t\t\t\n\t\t\t\t\t'user' => $user->display_name,\n\t\t\t\t\t'title' => $post->post_title,\n\t\t\t\t\t'site_name' => get_bloginfo('name'),\n\t\t\t\t\t'link' => get_permalink($post->ID),\n\t\t\t\t\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\t$subject = sprintf2(__('Submission approved at %site_name', 'btoa'), array('site_name' => get_bloginfo('name')));\n\t\t\t\t\n\t\t\t\t$headers = \"From: \".get_bloginfo('name').\" <\".get_option('admin_email').\">\";\n\t\t\t\t\n\t\t\t\twp_mail($user->user_email, $subject, $message, $headers);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t///// IF ITS A SPOT\n\t\t\tif($post->post_type == 'spot') {\n\t\t\t\t\n\t\t\t\tif(ddp('future_notification') == 'on' && $old_status != 'publish' && $new_status == 'publish') {\n\t\t\t\t\t\n\t\t\t\t\t//// ALSO CHECKS FOR USER NOTIFICATIONS FOR MATCHING CRITERIA\n\t\t\t\t\tif(function_exists('_sf_check_for_user_notifications_matching_spot')) { _sf_check_for_user_notifications_matching_spot($post->ID); }\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('submission_days') != '' && ddp('submission_days') != '0') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO PENDING IN X AMOUNT OF DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET FOR OUR FEATURED SUBMISSION - AND ITS INDEED FEATURED\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('price_featured_days') != '' && ddp('price_featured_days') != '0' && get_post_meta($post->ID, 'featured', true) == 'on') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO NORMAL SUBMISSION AFTER X DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date_featured($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function post_publish()\n\t{\n\t\t$this->get_publish();\n\t}", "function post_publish_notification($ID , $post){\n\t$email = get_the_author_meta('user_email',$post->post_author);\n\t$subject = 'Published '.$post->post_title;\n\t$message = 'We just Published your post '.$post->post_title.\n\t ' take a look at : '. get_permalink($ID);\n\twp_mail($email,$subject,$message);\n}", "function notify_post($post_id) {\n\n if( ( $_POST['post_status'] == 'publish' ) && ( $_POST['original_post_status'] != 'publish' ) && ( $_POST['post_type'] == 'events' ) ) {\n\n send_event_email($post_id);\n\n }\n\n}", "function check_and_publish_future_post($post)\n {\n }", "public function future_to_published($post) {\n\t\t\n\t\tdefine(\"WPU_JUST_POSTED_{$postID}\", TRUE);\n\t\t$this->handle_new_post($post->ID, $post, true);\n\t}", "public function handleFutureToPublish($post) {\n if (\"publish\" == $post->post_status) {\n $this->indexPost($post->ID);\n }\n }", "public function sendPostNotification() {\n\t\t$getNotificatin = \\DB::table('notification')\n\t\t\t->where('type', 'post_added')\n\t\t\t->where('push_status', '0')\n\t\t\t->where('receiver', '0')\n\t\t\t->orderBy('id', 'ASC')\n\t\t\t->get();\n\t\tif (count($getNotificatin) > 0) {\n\t\t\tforeach ($getNotificatin as $nKey => $rows) {\n\t\t\t\t$notification_id = $rows->id;\n\t\t\t\t$senderId = $rows->sender;\n\t\t\t\t$senderInfo = \\DB::table('users')->where('id', $rows->sender)->first();\n\t\t\t\t$user_details[] = array(\n\t\t\t\t\t'ID' => $senderInfo->id,\n\t\t\t\t\t'user_image' => '',\n\t\t\t\t\t'Name' => $senderInfo->username,\n\t\t\t\t);\n\t\t\t\t$my_user = \\DB::table('user_connection')\n\t\t\t\t\t->where('user_connection.friend_id', $senderId)\n\t\t\t\t\t->where('user_connection.follow', '1')\n\t\t\t\t\t->where('user_connection.status', '1')\n\t\t\t\t\t->pluck('user_connection.user_id');\n\t\t\t\t$userRow = \\DB::table('users')\n\t\t\t\t\t->where('player_id', '!=', '')\n\t\t\t\t\t->WhereIn('id', $my_user)\n\t\t\t\t\t->pluck('player_id');\n\t\t\t\tif (!empty($userRow)) {\n\t\t\t\t\tif ($userRow) {\n\t\t\t\t\t\t$title = 'New Post';\n\t\t\t\t\t\t$message = $senderInfo->username . ' added new post';\n\t\t\t\t\t\t$msg = array(\n\t\t\t\t\t\t\t'title' => $title,\n\t\t\t\t\t\t\t'message' => $message,\n\t\t\t\t\t\t\t'push_notification_id' => $notification_id,\n\t\t\t\t\t\t\t'type' => $rows->type,\n\t\t\t\t\t\t\t'ID' => $rows->receiver,\n\t\t\t\t\t\t\t'sender_user_id' => $rows->sender,\n\t\t\t\t\t\t\t'sender_user_name' => $senderInfo->username,\n\t\t\t\t\t\t\t'object_id' => $rows->object_id ? $rows->object_id : 0,\n\t\t\t\t\t\t\t'user_details' => $user_details,\n\t\t\t\t\t\t\t'batch_count' => 0,\n\t\t\t\t\t\t\t'vibrate' => 1,\n\t\t\t\t\t\t\t'sound' => 1,\n\t\t\t\t\t\t\t'largeIcon' => 'large_icon',\n\t\t\t\t\t\t\t'smallIcon' => 'small_icon',\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$response = \\OneSignalServiceHelpers::sendPushNotification($userRow, $msg);\n\t\t\t\t\t\t$this->info($response);\n\t\t\t\t\t}\n\t\t\t\t\t$this->info(json_encode($userRow));\n\t\t\t\t}\n\t\t\t\t$this->updateNotificationStatus($notification_id);\n\t\t\t}\n\t\t}\n\t}", "public function publish(Post $post){\n $this->posts()->save($post);\n }", "public function publish()\n {\n $message = new MailMessage;\n $message->greeting(\"Hi {$this->post->reporting->name}!\");\n $message->line(\"The post {$this->post->titile} has been published successfully.\"); \n foreach ($this->workflow as $key => $value) {\n if ($key == 0) {\n $message->action($value->action, url('workflows/workflow/' . $value->id));\n continue;\n }\n $message->line('<a href=\"'.url('workflows/workflow/' . $value->id).'\">'.$value->action.'</a>');\n }\n\n return $message;\n }", "public function publish(Post $post)\n {\n $post->updated_at = null;\n\n $post->published = true;\n\n $query = DB::table('threads')\n ->where('id', $post->thread_id)\n ->update(['lastpost_uid' => $post->user_id, 'lastpost_date' => $post->created_at]);\n\n $post->save();\n\n return back();\n }", "function block_core_calendar_update_has_published_posts()\n {\n }", "public function publish(Post $post)\n\t{\n\t\t$q = \"UPDATE in_posts \";\n\t\t$q .= \"SET publish_flag=1, read_length=:read_length, publish_time=Now() WHERE id=:post_id\";\n\t\t$vars = array(\n\t\t\t':read_length'=>$post->read_length,\n\t\t\t':post_id'=>$post->id\n\t\t);\n\t\t//$this->logger->logInfo($q);\n\t\t$ps = $this->execute($q, $vars);\n\t}", "public function send_expiry_notification() {\n $expired_posts = $this->get_expired_posts();\n\n $subject = 'Posts that need your attention';\n $recipient = \\get_bloginfo('admin_email');\n $content = $this->_generate_expiry_notification_content( $expired_posts );\n\n // Set post to draft\n // bb_log( $content, 'Sending an email to ' . $recipient );\n // Helper\\Email::send_email( $recipient, $subject, $content );\n }", "public function isPublished()\n {\n return $this->postID > 0;\n }", "public function postPublish(Post $post)\n {\n $this->postRepository->postPublished($post);\n return redirect(config('blog.prefix', 'admin/blog') . '/' . 'post');\n }", "public function publishPost($POST) {\r\n\t\t$sql = 'UPDATE `posts` SET `post_status` = :post_status\r\n\t\t\t\tWHERE `ID` = :ID AND `post_author` = :post_author LIMIT 1';\r\n\t\t$sth = $this->db->prepare($sql);\r\n\r\n\t\t$ret = $sth->execute(array('ID' => $POST['id'],\r\n\t\t\t\t\t\t\t\t 'post_author' => $GLOBALS['user']['id'],\r\n\t\t\t\t\t\t\t\t 'post_status' => 'publish'));\r\n\r\n\t\tif ($ret) {\r\n\t\t\t$this->putMsg('Successfully published');\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "function _publish_post_hook($post_id)\n {\n }", "public function onPostShowing(Post $post)\n {\n $user = auth()->user();\n if (!isAdmin($user)) {\n $post->increment('view_count');\n }\n if (auth()->check()) {\n $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Model\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }\n }\n }", "function publish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\t/* This method formerly updated the published_date, but that was removed in \n\t\t * favor of giving manual control of the published_date to the author\n\t\t * $this->saveField('published_date', date('Y-m-d', time()).' 00:00:00') */\n\t\treturn $this->saveField('is_published', 1);\n\t}", "function wp_publish_post($post)\n {\n }", "function block_core_calendar_update_has_published_post_on_delete( $post_id ) {\n\t\t$post = get_post( $post_id );\n\n\t\tif ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {\n\t\t\treturn;\n\t\t}\n\n\t\tblock_core_calendar_update_has_published_posts();\n\t}", "public function onPostShowing(Post $post)\n {\n $is_viewed_already=(bool) View::where('user_id', \\Auth::id())\n ->where('post_id', $this->id)\n ->first();\n\n $user = auth()->user();\n if($is_viewed_already == false){\n \\Auth::user()->views()->attach($post->id);\n }\n \n /* $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }*/\n }", "public function onPostShowing(Post $post)\n {\n $user = auth()->user();\n if (!isAdmin($user)) {\n $post->increment('view_count');\n }\n\n if (auth()->check()) {\n $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }\n }\n }", "public function onNewPost(PostEvent $event): bool\n {\n $user = $event->user;\n $badges = Badge::where('type', 'onNewPost')->get();\n\n $collection = $badges->filter(function ($badge) use ($user) {\n return $badge->rule <= $user->discuss_post_count;\n });\n\n $result = $user->badges()->syncWithoutDetaching($collection);\n\n return $this->sendNotifications($result, $badges, $user);\n }", "public function publish();", "public function publish();", "function block_core_calendar_has_published_posts()\n {\n }", "public function getPublish();", "public function publish() {\n if($this->exists) {\n $post = Post::create($this->getDraftData());\n $this->delete();\n return $post;\n }\n }", "public function notify_blog_post( $post, $type ) {\n\t\tif ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$user_id = 'new' === $type ? $post->post_author : get_current_user_id();\n\t\t$user = get_user_by( 'id', $user_id );\n\n\t\t$content = wp_trim_words(\n\t\t\tstrip_shortcodes( has_excerpt( $post ) ? $post->post_excerpt : $post->post_content ),\n\t\t\t55\n\t\t);\n\n\t\t$args = array(\n\t\t\t'action' => 'wporg_handle_activity',\n\t\t\t'type' => $type,\n\t\t\t'source' => 'wordpress',\n\t\t\t'user' => $user->user_login,\n\t\t\t'post_id' => $post->ID,\n\t\t\t'blog' => get_bloginfo( 'name' ),\n\t\t\t'blog_url' => site_url(),\n\t\t\t'post_type' => $post->post_type,\n\t\t\t'title' => get_the_title( $post ),\n\t\t\t'content' => $content,\n\t\t\t'url' => get_permalink( $post->ID ),\n\t\t);\n\n\t\tProfiles\\api( $args );\n\t}", "function send_webhook( $post_id, $post, $update ) {\n \t\t\t// Return if build hook isnt set\n \t\t\tif (!is_string($this->BUILD_HOOK_URL) && strlen($this->BUILD_HOOK_URL) === 0) { return; }\n\n\t\t // Don't fire on blank posts\n\t\t\tif (isset($post->post_status) && $post->post_status == 'published') { return; }\n\n\t\t\t// Only run in production\n\t\t\tif (defined('WP_ENV') && WP_ENV !== 'production') { return; }\n\n\t\t\t$client = new \\GuzzleHttp\\Client();\n\t\t\t$response = $client->post($this->BUILD_HOOK_URL);\n\t\t}", "function wpgnv_mail_on_post( $post_id ) {\n\tif ( 'pending' == get_post_status( $post_id ) ) {\n\t\t$post_title = get_the_title( $post_id );\n\t\t$subject = 'A new Idea has been submitted on wpgnv.com!';\n\t\t$message = \"Please moderate this Idea as soon as possible.\\n\\n\";\n\t\t$message .= \"TITLE: $post_title \\n\\n\";\t\n\t\t$message .= \"Link: http://wpgnv.com/wp-admin\";\n\t\t//$message = get_post_status( $post_id );\n\t\twp_mail( '[email protected]', $subject, $message );\n\t\twp_mail( '[email protected]', $subject, $message );\n\t\twp_mail( '[email protected]', $subject, $message );\n\t}\n}", "public function getPendingPost();", "public function mail_sending_mechanism() {\n add_action( 'publish_post', [ $this, 'mail_handler' ], 10, 2 );\n }", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "function proitdev_publish_send_mail(){\n\tglobal $post;\n\t$author = $post->post_author; /* Post author ID */\n\t$name = get_the_author_meta('display_name',$author);\n\t$mail = get_the_author_meta('user_email',author);\n\t$title = $post->post_title;\n\t$permalink = get_permalink( $ID );\n\t$edit = get_edit_post_link($ID, '');\n\t$to[] = $sprintf('%s <%s>' , $name, $email);\n\t$subject = sprintf('Published: %s', $title);\n\t$message = sprintf('Congratulations, %s! Your article \"%s\" has been published.'. \"\\n\\n\", $name, $title);\n\t$message .= sprintf('View %s', $permalink);\n\t$header[] = '';\n\twp_mail($to, $subject, $messagge, $header);\n}", "public function send_subscriptions(){\r\n //send email to all those who have subscribed to posts from this author\r\n\r\n }", "public function publish($id)\n\t{\n\t\t$data = array(\n\t\t\t\t\t\t'status' => 1\n\t\t\t\t\t );\n\n\t\t$result = $this->common_model->UpdateDB('blog_post',array('id' => $id),$data);\n\n\t\tif ($result) \n\t\t{\n\t\t\tset_flashdata('success','Post Status Changed to Publish');\n\t\t\tredirect('blog/posts/manage_posts','refresh');\n\t\t} \n\t}", "function block_core_calendar_update_has_published_post_on_delete($post_id)\n {\n }", "function save_post( $post_ID, $post ) {\n\t\t\tif( $this->done )\n\t\t\t\treturn $post_ID;\n\t\t\t\n\t\t\tif( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n\t\t\t\treturn $post_ID;\n\t\t\tif( 'auto-draft' == $post->post_status || 'inherit' == $post->post_status )\n\t\t\t\treturn $post_ID;\n\t\t\t\n\t\t\t$this->done = true;\n\t\t\t\n\t\t\tif( ! isset( $_REQUEST['_dpn_nonce'] ) || !wp_verify_nonce( $_REQUEST['_dpn_nonce'], 'dpn-nonce' ) )\n\t\t\t\treturn $post_ID;\n\t\t\tif( !isset( $_REQUEST['dpn_notify'] ) || 0 == $_REQUEST['dpn_notify'] )\n\t\t\t\treturn $post_ID;\n\t\t\t\n\t\t\tif( 1 == $_REQUEST['dpn_notify'] || 3 == $_REQUEST['dpn_notify'] )\n\t\t\t\t$dowhat = 'draft';\n\t\t\telse\n\t\t\t\t$dowhat = 'publish';\n\t\t\t\n\t\t\tif( 1 == $_REQUEST['dpn_notify'] || 2 == $_REQUEST['dpn_notify'] )\n\t\t\t\t$notify = true;\n\t\t\telse\n\t\t\t\t$notify = false;\n\t\t\t\n\t\t\tif( isset( $_REQUEST['dpn_notify_address'] ) && strstr( $_REQUEST['dpn_notify_address'], ',' ) )\n\t\t\t\t$_REQUEST['dpn_notify_address'] = explode( ',', str_replace( ' ', '', $_REQUEST['dpn_notify_address'] ) );\n\t\t\t\n\t\t\t$revs = isset( $_REQUEST['dpn_notify_address'] ) && !empty( $_REQUEST['dpn_notify_address'] ) ? $_REQUEST['dpn_notify_address'] : array();\n\t\t\tif( !is_array( $revs ) )\n\t\t\t\t$revs = array_map( 'trim', explode( ',', $revs ) );\n\t\t\t$revs = array_filter( $revs, 'is_email' );\n\t\t\t\n\t\t\t$this->reviewers = !empty( $revs ) ? $revs : $this->get_reviewers();\n\t\t\t\n\t\t\tglobal $wpdb;\n\t\t\tif( 'draft' == $dowhat ) {\n\t\t\t\t$last_revision = array_pop( wp_get_post_revisions( $post_ID, array( 'posts_per_page' => 1 ) ) );\n\t\t\t\tif( empty( $last_revision ) || empty( $last_revision->post_content ) )\n\t\t\t\t\treturn $post_ID;\n\t\t\t\t$last_revision = $last_revision->ID;\n\t\t\t\t\n\t\t\t\twp_restore_post_revision( $last_revision );\n\t\t\t}\n\t\t\t\n\t\t\tif( $notify )\n\t\t\t\t$this->notify_reviewer( $post_ID, $post, $dowhat );\n\t\t\t\n\t\t\treturn $post_ID;\n\t\t}", "public function isPublished()\n {\n if(!strcmp($this->getStatus(), 'approved')) {\n return true;\n }\n\n return false;\n }", "public function getPublish()\n {\n return $this->shouldBePublished();\n }", "public function isPublishedField()\n {\n return $this->get('check_publish') == 1;\n }", "public function actionPublish()\n {\n //Mixpanel track new published story\n //MyMixpanel::TrackNewStories(MyMixpanel::PROPERTY_CMS_TYPE_PUBLISHED);\n $this->publishUnpublishSchedule(Story::STATUS_PUBLISHED, date('Y-m-d H:i:s'));\n\n if(Yii::$app->request->post(\"selection\") && !empty($_POST[\"selection\"]))\n {\n //send email about story when story is published\n $selection=Yii::$app->request->post(\"selection\"); //it is checkbox array and value is \"id\" in Story\n foreach ($selection as $key=>$IDstory)\n {\n $story=Story::findOne($IDstory);\n //send email to specific peopel about that this story was created\n $this->sendEmailAboutCreatedStory($story);\n }\n }\n }", "function authorNotification2( $post_id ) {\n\tglobal $wpdb;\n\t$post = get_post( $post_id );\n\t$author = get_userdata( $post->post_author );\n\t$message = \"\";\n\twp_mail( $author->user_email, \"\", $message );\n}", "public function isPublished()\n {\n return $this->publish_status == Status::PUBLISHED;\n }", "function isPublished() {\n\t\tif ($this->status == 'published') {\n\t\t\t$now = time();\n\t\t\tif ($this->datePublish <= $now) {\n\t\t\t\tif ($this->dateUnpublish > $now || $this->dateUnpublish == null) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function is_post_notifiable( $post, $action ) {\n\t\tif ( ! $post || ! is_a( $post, 'WP_Post' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// All actions can notify about handbooks.\n\t\t$notifiable_post_types = array( 'handbook' );\n\n\t\t// There's a large number of custom handbooks, and more will be created in the future.\n\t\tif ( str_contains( $post->post_type, '-handbook' ) ) {\n\t\t\t$notifiable_post_types[] = $post->post_type;\n\t\t}\n\n\t\tif ( 'publish' === $action || 'comment' === $action ) {\n\t\t\t$notifiable_post_types = array_merge(\n\t\t\t\t$notifiable_post_types,\n\t\t\t\tarray( 'post', 'handbook', 'wporg_workshop', 'lesson-plan', 'course' )\n\t\t\t);\n\t\t}\n\n\t\t// Some post types are imported programmatically and aren't directly attributable to a wordpress.org\n\t\t// account.\n\t\t$is_markdown_post = false;\n\t\t$post_meta = get_post_custom( $post->ID );\n\n\t\tforeach ( $post_meta as $key => $value ) {\n\t\t\tif ( str_contains( $key, '_markdown_source' ) ) {\n\t\t\t\t$is_markdown_post = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( is_plugin_active( 'subscribers-only.php' ) ) {\n\t\t\t$notifiable = false;\n\t\t} elseif ( ! in_array( $post->post_type, $notifiable_post_types, true ) ) {\n\t\t\t$notifiable = false;\n\t\t} elseif ( 'publish' != $post->post_status ) {\n\t\t\t$notifiable = false;\n\t\t} elseif ( ! empty( $post->post_password ) ) {\n\t\t\t$notifiable = false;\n\t\t} elseif ( $is_markdown_post || ! $post->post_author ) {\n\t\t\t// Some Handbook posts are automatically created and don't have an author.\n\t\t\t$notifiable = false;\n\t\t} elseif ( $post->_xpost_original_permalink || str_starts_with( $post->post_name, 'xpost-' ) ) {\n\t\t\t$notifiable = false;\n\t\t} else {\n\t\t\t$notifiable = true;\n\t\t}\n\n\t\treturn apply_filters( 'wporg_profiles_wp_activity-is_post_notifiable', $notifiable, $post );\n\t}", "public function action_publish_post( $post, $form )\n\t{\n\t\t$this->action_form_publish($form, $post);\n\t\t\n\t\tif( $form->notes->value != NULL ) {\n\t\t\t$note = new Note( $form->note_key->value );\n\t\t\t$note->content = $form->notes->value;\n\n\t\t\t$note->update();\n\t\t\t\n\t\t\t// Utils::debug( $note, $note->update(), $this->get_notes() );\n\n\t\t\t$post->info->note_key = $note->key;\n\t\t}\n\t\t\n\t\t\n\t\t// exit;\n\t\t\n\t}", "function block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post ) {\n\t\tif ( $new_status === $old_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'post' !== get_post_type( $post ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'publish' !== $new_status && 'publish' !== $old_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tblock_core_calendar_update_has_published_posts();\n\t}", "public function actionSchedulePublish()\n {\n $this->publishUnpublishSchedule(Story::STATUS_PUBLISHED, Story::STATUS_SCHEDULE);\n }", "public function shouldBePublished()\n {\n return $this->publish;\n }", "public function toggle_published() {\n $will_be_published = !$this->post->is_published();\n $this->post->toggle_published();\n redirect(\n '/backend/posts/edit',\n ['notice' => $will_be_published ? 'Published' : 'Unpublished'],\n ['id' => $this->post->id]\n );\n }", "public function postReadAllNotification () {\n $owner_id = Auth::user()->id;\n\n $readAll = PosteNotification::where('owner_id', $owner_id)->update(['status' => 1]);\n if ($readAll) {\n return 1;\n }\n return 0;\n }", "public function getPublish() {\n return $this->changeFilter('publish');\n }", "public function publish()\n {\n // Initialize variables\n $cid = JRequest::getVar('cid', array(), 'post', 'array');\n $task = JRequest::getCmd('task');\n $publish = ($task == 'publish');\n\n if(empty($cid))\n {\n $this->setRedirect($this->_ambit->getRedirectUrl(), JText::_('COM_JOOMGALLERY_COMMAN_MSG_NO_COMMENTS_SELECTED'));\n $this->redirect();\n }\n\n $model = $this->getModel('comments');\n if($count = $model->publish($cid, $publish))\n {\n if($count != 1){\n $msg = JText::sprintf($publish ? 'COM_JOOMGALLERY_COMMAN_MSG_COMMENTS_PUBLISHED' : 'COM_JOOMGALLERY_COMMAN_MSG_COMMENTS_UNPUBLISHED', $count);\n } else {\n $msg = JText::_($publish ? 'COM_JOOMGALLERY_COMMAN_MSG_COMMENT_PUBLISHED' : 'COM_JOOMGALLERY_COMMAN_MSG_COMMENT_UNPUBLISHED');\n }\n $this->setRedirect($this->_ambit->getRedirectUrl(), $msg);\n }\n else\n {\n $msg = JText::_('COM_JOOMGALLERY_COMMON_MSG_ERROR_PUBLISHING_UNPUBLISHING');\n $this->setRedirect($this->_ambit->getRedirectUrl(), $msg, 'error');\n }\n }", "public function publish(Post $p)\n {\n if ($p->status === 'draft') {\n $p->status = 'published';\n $p->save();\n }\n\n return $p;\n }", "function block_core_calendar_update_has_published_posts() {\n\tglobal $wpdb;\n\t$has_published_posts = (bool) $wpdb->get_var( \"SELECT 1 as test FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1\" );\n\tupdate_option( 'wp_calendar_block_has_published_posts', $has_published_posts );\n\treturn $has_published_posts;\n}", "public function sendNotification($post = null, $attachmentList = null) {\n\t\t$sql = \"SELECT\t\tuser.*\n\t\t\tFROM\t\twbb\".WBB_N.\"_board_subscription subscription\n\t\t\tLEFT JOIN\twcf\".WCF_N.\"_user user\n\t\t\tON\t\t(user.userID = subscription.userID)\n\t\t\tWHERE\t\tsubscription.boardID = \".$this->boardID.\"\n\t\t\t\t\tAND subscription.enableNotification = 1\n\t\t\t\t\tAND subscription.emails = 0\n\t\t\t\t\tAND subscription.userID <> \".$this->userID.\"\n\t\t\t\t\tAND user.userID IS NOT NULL\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\tif (WCF::getDB()->countRows($result)) {\n\t\t\t// get first post\n\t\t\tif ($post === null) {\n\t\t\t\trequire_once(WBB_DIR.'lib/data/post/Post.class.php');\n\t\t\t\t$post = new Post($this->firstPostID);\n\t\t\t}\n\t\t\t\n\t\t\t// get attachments\n\t\t\tif ($attachmentList === null) {\n\t\t\t\trequire_once(WCF_DIR.'lib/data/attachment/MessageAttachmentList.class.php');\n\t\t\t\t$attachmentList = new MessageAttachmentList($this->firstPostID);\n\t\t\t\t$attachmentList->readObjects();\n\t\t\t}\n\t\t\t\n\t\t\t// set attachments\n\t\t\trequire_once(WCF_DIR.'lib/data/message/bbcode/AttachmentBBCode.class.php');\n\t\t\tAttachmentBBCode::setAttachments($attachmentList->getSortedAttachments());\n\t\t\t\n\t\t\t// parse text\n\t\t\trequire_once(WCF_DIR.'lib/data/message/bbcode/MessageParser.class.php');\n\t\t\t$parser = MessageParser::getInstance();\n\t\t\t$parser->setOutputType('text/plain');\n\t\t\t$parsedText = $parser->parse($post->message, $post->enableSmilies, $post->enableHtml, $post->enableBBCodes, false);\n\t\t\t// truncate message\n\t\t\tif (!POST_NOTIFICATION_SEND_FULL_MESSAGE && StringUtil::length($parsedText) > 500) $parsedText = StringUtil::substring($parsedText, 0, 500) . '...';\n\t\t\t\n\t\t\t// send notifications\n\t\t\t$languages = array();\n\t\t\t$languages[WCF::getLanguage()->getLanguageID()] = WCF::getLanguage();\n\t\t\t$languages[0] = WCF::getLanguage();\n\t\t\trequire_once(WCF_DIR.'lib/data/mail/Mail.class.php');\n\t\t\trequire_once(WCF_DIR.'lib/data/user/User.class.php');\n\t\t\trequire_once(WBB_DIR.'lib/data/board/Board.class.php');\n\t\t\t$board = Board::getBoard($this->boardID);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\t$recipient = new User(null, $row);\n\t\t\t\t\n\t\t\t\t// get language\n\t\t\t\tif (!isset($languages[$recipient->languageID])) {\n\t\t\t\t\t$languages[$recipient->languageID] = new Language($recipient->languageID);\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// enable language\n\t\t\t\t$languages[$recipient->languageID]->setLocale();\n\t\t\t\t\n\t\t\t\t// send mail\n\t\t\t\t$data = array(\n\t\t\t\t\t'PAGE_TITLE' => $languages[$recipient->languageID]->get(PAGE_TITLE),\n\t\t\t\t\t'PAGE_URL' => PAGE_URL,\n\t\t\t\t\t'$recipient' => $recipient->username,\n\t\t\t\t\t'$author' => $this->username,\n\t\t\t\t\t'$boardTitle' => $languages[$recipient->languageID]->get($board->title),\n\t\t\t\t\t'$topic' => $this->topic,\n\t\t\t\t\t'$threadID' => $this->threadID,\n\t\t\t\t\t'$text' => $parsedText);\n\t\t\t\t$mail = new Mail(\tarray($recipient->username => $recipient->email),\n\t\t\t\t\t\t\t$languages[$recipient->languageID]->get('wbb.threadAdd.notification.subject', array('$title' => $languages[$recipient->languageID]->get($board->title))),\n\t\t\t\t\t\t\t$languages[$recipient->languageID]->get('wbb.threadAdd.notification.mail', $data));\n\t\t\t\t$mail->send();\n\t\t\t}\n\t\t\t\n\t\t\t// enable user language\n\t\t\tWCF::getLanguage()->setLocale();\n\t\t\t\n\t\t\t// update notification count\n\t\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_board_subscription\n\t\t\t\tSET \temails = emails + 1\n\t\t\t\tWHERE\tboardID = \".$this->boardID.\"\n\t\t\t\t\tAND enableNotification = 1\n\t\t\t\t\tAND emails = 0\";\n\t\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t\t}\n\t}", "function tp_publish_automatic($id, $post) {\r\n\tif ($post->post_status !== 'publish') return;\r\n\r\n\t// check options to see if we need to send to FB at all\r\n\t$options = tp_options();\r\n\tif (!$options['autotweet_flag'] || !$options['autotweet_token'] || !$options['autotweet_secret'] || !$options['publish_text'])\r\n\t\treturn;\r\n\r\n\t// args to send to twitter\r\n\t$args=array();\r\n\r\n\t$args['status'] = tp_get_default_tweet($id);\r\n\r\n\t$args['acc_token'] = $options['autotweet_token'];\r\n\t$args['acc_secret'] = $options['autotweet_secret'];\r\n\r\n\t$resp = tp_do_request('statuses/update',$args, 'post');\r\n\r\n return $resp;\r\n}", "function send_mail_to_subscribers($post_ID) {\n global $wpdb;\n \n if( ( $_POST['post_status'] == 'publish' ) && ( $_POST['original_post_status'] != 'publish' ) ) {\n $mailqueue = $wpdb->prefix . 'mailqueue';\n $wpdb->query($wpdb->prepare(\"INSERT INTO $mailqueue SET post_id = %d\", $post_ID));\n }\n \n return $post_ID;\n}", "public function publishedStatus()\n {\n if ( !$this->owner->getScheduledStatus() && !$this->owner->getExpiredStatus() ) {\n return true;\n }\n\n return false;\n }", "protected function checkSendImmediately($post)\n {\n if (isset($_GET['sendImmediately'])) {\n /** @var CronHandler $cronHandler */\n $cronHandler = new CronHandler();\n $cronHandler->executeCron('hourly');\n // And redirect back to the page\n header('Location: /wp-admin/post.php?post=' .$post->ID . '&action=edit');\n exit;\n }\n }", "public function publishadmin(){\n $post = Products::where('id', \\request(\"id\"))->first();\n $post->published = $post->published==\"unpublished\"?\"Publish\":\"unpublished\";\n $post->save();\n return redirect(route('voyager.h-products.index'));\n }", "public function getIsPublishScheduled()\n {\n /** @var DBDatetime $publishTime */\n $publishTime = $this->owner->dbObject('PublishOnDate');\n\n if ($publishTime->InFuture()) {\n return true;\n }\n\n if ((int) $this->owner->PublishJobID !== 0) {\n return true;\n }\n\n return false;\n }", "public function isPublished(): bool\n {\n $publishedStatus = ['publish'];\n\n return in_array($this->status, $publishedStatus);\n }", "public function handle()\n {\n foreach ($this->posts as $post) {\n PublishPost::dispatch($post)->delay(Carbon::now());\n }\n }", "function rfi_should_stop_post_publishing( $post ) {\n $is_watched_post_type = rfi_is_supported_post_type( $post );\n $is_after_enforcement_time = rfi_is_in_enforcement_window( $post );\n $large_enough_image_attached = rfi_post_has_large_enough_image_attached( $post );\n\n if ( $is_after_enforcement_time && $is_watched_post_type ) {\n return !$large_enough_image_attached;\n }\n return false;\n}", "function dispatch_wiki_post_notification($post_id, $type)\n{\n require_lang('wiki');\n\n $page_id = $GLOBALS['SITE_DB']->query_select_value('wiki_posts', 'page_id', array('id' => $post_id));\n $the_message = $GLOBALS['SITE_DB']->query_select_value('wiki_posts', 'the_message', array('id' => $post_id));\n $page_name = get_translated_text($GLOBALS['SITE_DB']->query_select_value('wiki_pages', 'title', array('id' => $page_id)));\n $_the_message = get_translated_text($the_message);\n\n $_view_url = build_url(array('page' => 'wiki', 'type' => 'browse', 'id' => $page_id), get_page_zone('wiki'), null, false, false, true);\n $view_url = $_view_url->evaluate();\n $their_displayname = $GLOBALS['FORUM_DRIVER']->get_username(get_member(), true);\n $their_username = $GLOBALS['FORUM_DRIVER']->get_username(get_member());\n\n require_code('notifications');\n\n $subject = do_lang($type . '_WIKI_POST_SUBJECT', $page_name, $their_displayname, $their_username, get_site_default_lang());\n $message_raw = do_notification_lang($type . '_WIKI_POST_BODY', comcode_escape($their_displayname), comcode_escape($page_name), array(comcode_escape($view_url), $_the_message, strval(get_member()), comcode_escape($their_username)), get_site_default_lang());\n\n dispatch_notification('wiki', strval($page_id), $subject, $message_raw);\n}", "public function sendPost(){\n\t\t\t// record the post in the database\n\t\t\t\n\t\t}", "public function unpublish()\n {\n $message = new MailMessage;;\n $message->greeting(\"Hi {$this->post->reporting->name}!\");\n $message->line(\"The post {$this->post->titile} has been unpublished successfully.\"); \n foreach ($this->workflow as $key => $value) {\n if ($key == 0) {\n $message->action($value->action, url('workflows/workflow/' . $value->id));\n continue;\n }\n $message->line('<a href=\"'.url('workflows/workflow/' . $value->id).'\">'.$value->action.'</a>');\n }\n\n return $message;\n }", "function isPublished(){\n\t\tif($this->isPublished == 1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function notify_reviewer( $post_ID, $post, $dowhat='publish' ) {\n\t\t\tglobal $wpdb, $current_user;\n\t\t\t$last_revision = $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_parent=%d AND post_type=%s ORDER BY post_date DESC LIMIT 1\", $post_ID, 'revision' ) );\n\t\t\t$post_content = 'draft' == $dowhat ? get_post( $last_revision ) : get_post( $post_ID );\n\t\t\t$last_mod = $post_content->post_date;\n\t\t\t$post_content = $post_content->post_content;\n\t\t\t$revision_compare_link = admin_url( 'revision.php?action=diff&post_type=' . $post->post_type . '&right=' . $post->ID . '&left=' . $last_revision );\n\t\t\t$body = sprintf( __( \"New changes have been made to \\\"%s\\\" at <%s>. \", $this->text_domain ), $post->post_title, get_permalink( $post->ID ) );\n\t\t\tif( 'draft' == $dowhat ) {\n\t\t\t\t$body .= __( \"The author has requested that you review the new changes and determine whether to remove or approve them. These changes will not appear on the public website until you approve them.\\n\\n\", $this->text_domain );\n\t\t\t} else {\n\t\t\t\t$body .= __( \"The modifications have been published, but the author of the page has requested you be notified of them.\\n\\n\", $this->text_domain );\n\t\t\t}\n\t\t\t$body .= sprintf( __( \"The new content of the page is shown below if you would like to review it. You can also review %s the changes at %s. Thank you. \\n\\n======================================================= \\nRevisions made at %s \\n======================================================= \\n\\n%s\", $this->text_domain ), ( 'draft' == $dowhat ? __( \" and approve/reject \", $this->text_domain ) : '' ), $revision_compare_link, $last_mod, $post_content );\n\t\t\t\n\t\t\t$headers = \"From: {$current_user->display_name} <{$current_user->user_email}>\\r\\n\";\n\t\t\t\n\t\t\twp_mail( $this->reviewers, sprintf( __( '[%s] New modifications to %s' ), get_bloginfo('name'), $post->post_title ), $body, $headers );\n\t\t}", "public function unPublish($post_id)\n\t{\n\t\t$q = \"UPDATE in_posts \";\n\t\t$q .= \"SET publish_flag=0 WHERE id=:post_id\";\n\t\t$vars = array(\n\t\t\t':post_id'=>$post_id\n\t\t);\n\t\t//$this->logger->logInfo($q);\n\t\t$ps = $this->execute($q, $vars);\n\t}", "public function isPublished()\n {\n return $this->status == static::PUBLISHED;\n }", "function xgb_check_post_count($post_id) {\n\tglobal $wpdb;\n\t\n\t$post = get_post($post_id);\n\t$author_id = $post->post_author;\n\t$user_info = get_userdata(get_current_user_id());\n\t\n\t\t$published_post_count = $wpdb->get_var(\"SELECT COUNT(ID) FROM wp_posts WHERE post_status='publish' AND post_type='post' AND post_author=$author_id\");\n\t\tif($published_post_count > $GLOBALS['live_article_limit'] ) {\n\t\t\t$wpdb->query(\"UPDATE wp_posts SET post_status='pending' WHERE ID=$post_id\");\n\t\t\t// Set the transient for admin notice\n\t\t\tset_transient( get_current_user_id().'publisherror', $GLOBALS['live_article_limit'] ); \n\t\t}\n}", "public function isPublished()\n {\n return $this->published_at->lte(Carbon::now());\n }", "function _update_blog_date_on_post_publish( $new_status, $old_status, $post ) {\n\t$post_type_obj = get_post_type_object( $post->post_type );\n\tif ( ! $post_type_obj || ! $post_type_obj->public ) {\n\t\treturn;\n\t}\n\n\tif ( 'publish' != $new_status && 'publish' != $old_status ) {\n\t\treturn;\n\t}\n\n\t// Post was freshly published, published post was saved, or published post was unpublished.\n\n\twpmu_update_blogs_date();\n}", "public function onAfterPublish()\n {\n\t\t$context = [\n PublishingEngine::CONTEXT_ACTION => PublishingEngine::CONTEXT_ACTION_PUBLISH\n\t\t];\n\t\t$this->collectChanges($context);\n\t\t$this->flushChanges();\n\t}", "function post_publish_handling( $eZ_object, $force_exit = false )\r\n\t{\r\n\t\t// in case it is necessary\r\n\t\t//echo \"no post-handling today\\n\\n\";\r\n\t\treturn true;\r\n\t}", "public function onPublishPage($data) {\n return $this->worker()->onPublishPage($data);\n }", "public function isPublished()\n {\n if (\n $this->getStatus() === PageStatus::PUBLISHED ||\n ($this->getStatus() === PageStatus::SCHEDULED &&\n $this->getPublishedAt() < new \\DateTime())\n ) {\n return true;\n } else {\n return false;\n }\n }", "public function created(Post $post)\n {\n $post->recordActivity('created');\n }", "public function isPublished()\n {\n if ($this->getStatus() === self::PUBLISHED) {\n return true;\n }\n\n if ($this->getStatus() === self::SCHEDULED) {\n return $this->getPublishedAt() <= new \\DateTime();\n }\n\n return false;\n }", "function gotb_listing_expired_notify( $post_id ) {\n\t\tif ( 'job_listing' !== get_post_type( $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$post = get_post( $post_id );\n\t\t$author = get_userdata( $post->post_author );\n\t\t$headers = array('Content-Type: text/html; charset=UTF-8');\n\n\t\t$subject = __( sprintf( \"Listing expired - %s\", esc_html( $post->post_title ) ), 'gotb' );\n\n\t\t$message = __( sprintf( \"Hi %s, <br><br>\", $author->display_name ), 'gotb' );\n\n\t\t$message .= __( \"Please note your job listing has now expired. \n<br><br> \nIf you would like to repost this position, please sign onto our website and use your dashboard to manage your posting. \n<br><br>\n<a href='http://www.careercentre.org/postajob/'>http://www.careercentre.org/postajob/</a> \n<br><br> \nIf you require further assistance with your hiring needs, please feel free to contact me or check out our many <a href='http://www.careercentre.org/other-employer-resources/'>resources for employers </a> \n<br><br>\nThank you for posting with us, <br> <br>\nEmployer Services Coordinator <br> \n250.248.3205 Ext. 236\" , 'gotb' );\n\n\t\twp_mail( $author->user_email, $subject, $message, $headers );\n\n\t}", "public function onBeforeWrite()\n {\n // a 'future' publish... While the same could be said for the unpublish, the 'publish' state is the one that\n // must be avoided so we allow setting the 'unpublish' date for as-yet-not-published content.\n if (Versioned::get_stage() === Versioned::LIVE) {\n return;\n }\n\n // Jobs can only be queued for records that already exist\n if (!$this->owner->ID) {\n return;\n }\n\n $this->owner->ensurePublishJob();\n $this->owner->ensureUnPublishJob();\n }", "public function update_post_publication_date( LaterPay_Core_Event $event ) {\n list( $status_after_update, $status_before_update, $post ) = $event->get_arguments() + array( '', '', '' );\n\n // skip on insufficient permission\n if ( ! $this->has_permission( $post->ID ) ) {\n return;\n }\n\n // only update publication date of posts with dynamic pricing\n if ( LaterPay_Helper_Pricing::get_post_price_type( $post->ID ) !== LaterPay_Helper_Pricing::TYPE_INDIVIDUAL_DYNAMIC_PRICE ) {\n return;\n }\n\n // don't update publication date of already published posts\n if ( $status_before_update === LaterPay_Helper_Pricing::STATUS_POST_PUBLISHED ) {\n return;\n }\n\n // don't update publication date of unpublished posts\n if ( $status_after_update !== LaterPay_Helper_Pricing::STATUS_POST_PUBLISHED ) {\n return;\n }\n\n LaterPay_Helper_Pricing::reset_post_publication_date( $post );\n }" ]
[ "0.7212498", "0.71627766", "0.7153691", "0.70109665", "0.70063597", "0.69323134", "0.6919806", "0.67551273", "0.67494625", "0.673192", "0.66867995", "0.6670828", "0.65812236", "0.6457386", "0.6454994", "0.64511937", "0.6448927", "0.6427889", "0.63557726", "0.63551277", "0.6351825", "0.6349027", "0.6317574", "0.630438", "0.63025486", "0.62950397", "0.62950397", "0.6285611", "0.626295", "0.62366045", "0.6222822", "0.6192353", "0.61900985", "0.6181088", "0.61683", "0.6137003", "0.6137003", "0.6137003", "0.6137003", "0.6137003", "0.6137003", "0.6137003", "0.6137003", "0.6137003", "0.6137003", "0.6137003", "0.6137003", "0.6137003", "0.61278236", "0.6111563", "0.61059564", "0.6080895", "0.6041934", "0.60348547", "0.60268396", "0.6016263", "0.60106575", "0.60004216", "0.59849346", "0.59774196", "0.59754276", "0.5974313", "0.5974112", "0.597217", "0.5960446", "0.59563226", "0.59314376", "0.59306127", "0.5914742", "0.59074354", "0.58876914", "0.5884575", "0.58837503", "0.5881154", "0.5878764", "0.5871204", "0.586557", "0.5863948", "0.58631396", "0.58631307", "0.58547616", "0.58465034", "0.5835747", "0.581896", "0.5817705", "0.5814558", "0.5798028", "0.5790848", "0.578335", "0.5782787", "0.57816726", "0.57759815", "0.5757849", "0.5754066", "0.5746205", "0.5745315", "0.5740566", "0.57230264", "0.57202107", "0.5711933" ]
0.6428538
17
Sends activity notification for new blog post.
public function notify_blog_post( $post, $type ) { if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { return; } $user_id = 'new' === $type ? $post->post_author : get_current_user_id(); $user = get_user_by( 'id', $user_id ); $content = wp_trim_words( strip_shortcodes( has_excerpt( $post ) ? $post->post_excerpt : $post->post_content ), 55 ); $args = array( 'action' => 'wporg_handle_activity', 'type' => $type, 'source' => 'wordpress', 'user' => $user->user_login, 'post_id' => $post->ID, 'blog' => get_bloginfo( 'name' ), 'blog_url' => site_url(), 'post_type' => $post->post_type, 'title' => get_the_title( $post ), 'content' => $content, 'url' => get_permalink( $post->ID ), ); Profiles\api( $args ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function attachPostToBlogAtTheEnd() {}", "function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password)\n {\n }", "public function post()\n\t{\n\t\t$crud = $this->generate_crud('blog_posts');\n\t\t$crud->columns('author_id', 'category_id', 'title', 'image_url', 'tags', 'publish_time', 'status');\n\t\t$crud->set_field_upload('image_url', UPLOAD_BLOG_POST);\n\t\t$crud->set_relation('category_id', 'blog_categories', 'title');\n\t\t$crud->set_relation_n_n('tags', 'blog_posts_tags', 'blog_tags', 'post_id', 'tag_id', 'title');\n\t\t\n\t\t$state = $crud->getState();\n\t\tif ($state==='add')\n\t\t{\n\t\t\t$crud->field_type('author_id', 'hidden', $this->mUser->id);\n\t\t\t$this->unset_crud_fields('status');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$crud->set_relation('author_id', 'admin_users', '{first_name} {last_name}');\n\t\t}\n\n\t\t$this->mPageTitle = 'Blog Posts';\n\t\t$this->render_crud();\n\t}", "public function created(Post $post)\n {\n $post->recordActivity('created');\n }", "public function add_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'title', 'channel_id', 'link', 'start_time', 'end_time','hits', 'status'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$result = Gou_Service_Notice::addNotice($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "protected function run()\n {\n $slug = $this->get('slug');\n\n $category = $this->categories->findBySlug($slug);\n\n $creator = User::current();\n $now = Carbon::now();\n\n $conversation = (object) [\n 'poster' => $creator->username,\n 'title' => $this->get('subject'),\n 'posted' => $now,\n 'last_post' => $now,\n 'last_poster' => $creator->username,\n 'category_slug' => $category->slug,\n ];\n\n $post = (new Post([\n 'poster'\t=> $creator->username,\n 'poster_id'\t=> $creator->id,\n 'message'\t=> $this->get('message'),\n 'posted'\t=> $now,\n ]));\n\n $this->categories->addNewTopic($category, $conversation, $post->toArray());\n\n $this->raise(new UserHasPosted($creator, $post));\n }", "public function handle(PostWasCreated $event)\n {\n $event->post->thread->markAsUnread();\n }", "function new_post($post){\n $this->newPost($post);\n }", "public function blogNewAction()\n {\n // Check if the blog was posted\n if ($this->request->isPost() && $this->security->checkToken()) {\n $post = new Blog();\n $post->url = $this->request->getPost('title');\n $post->title = $this->request->getPost('title');\n $post->text = $this->request->getPost('message');\n $post->author = $this->session->get('user')->name;\n $post->date = $this->request->getPost('date');\n\n // The form was sent\n $this->view->setVar(\"form_sent\", true);\n\n // Validation\n if ($post->validation()) {\n if ($post->save()) {\n $this->view->setVar(\"form_success\", true);\n $this->view->setVar(\"form_message\", \"Blog post successvol bijgewerkt / geplaatst.\");\n } else {\n $this->view->setVar(\"form_success\", false);\n $this->view->setVar(\"form_message\", \"Niet alle velden zijn correct ingevuld.\");\n error_log(\"\\nFailed to add blog message: \".print_r($post->getMessages(), true));\n }\n } else {\n $this->view->setVar(\"form_success\", false);\n $this->view->setVar(\"form_message\", \"Niet alle velden zijn correct ingevuld.\");\n error_log(\"\\nFailed to add blog message: \".print_r($post->getMessages(), true));\n }\n } else {\n $this->view->setVar(\"form_sent\", false);\n }\n\n // Render the view\n $this->assets->addJs('share/plugins/jquery/jquery.selection.js');\n $this->assets->addJs('assets/js/editor.js');\n $this->view->setVar('form_action', 'new');\n $this->view->setVar('action', 'new');\n $this->view->pick('pages/admin/blog/form');\n }", "public function store(Request $request)\n {\n //\n\n $this->post = new Post();\n $this->post->title = $request->input('blog_title');\n $this->post->slug = str_slug($request->input('blog_title'));\n $this->post->user_id = Auth::user()->id;\n $this->post->content = $request->input('blog_description');\n $this->post->abstract = $request->input('blog_abstract');\n $this->post->published_date = Carbon::now();\n\n //check for the images for not\n if($request->has('_featured_image')){\n //need to save the image first\n $blog_image = $request->file('_featured_image');\n $name = time() . '.'.$blog_image->getClientOriginalExtension();\n $blog_image->move($this->destination_path,$name);\n $this->post->image_path = $name;\n }\n\n $this->post->save();\n\n //after saving send the notification to the currently logged in career advisor followers\n $blog_details = Post::findOrFail($this->post->id);\n $followers = Auth::user()->followers;\n\n foreach($followers as $follower){\n $notifiy_career_advisor = User::findOrFail($follower->pivot->follower_id);\n $notifiy_career_advisor->notify(new NewBlogCreatedNotification($blog_details));\n }\n\n\n\n return redirect()->route('profile.blog.index');\n }", "public function AddBlogPostAction(Request $request)\n {\n $Blogposts=new Blogposts();\n $D=new \\DateTime();\n $manager = $this->get('mgilet.notification');\n //form\n $form=$this->createForm(BlogpostsType::class,$Blogposts);\n $form=$form->handleRequest($request);\n if($form->isValid())\n { $manager = $this->get('mgilet.notification');\n $notif = $manager->createNotification('Hello world!');\n $notif->setMessage('This a notification.');\n $notif->setLink('https://symfony.com/');\n $manager->addNotification(array($this->getUser()), $notif, true);\n $em=$this->getDoctrine()->getManager();\n $user = $this->container->get('security.token_storage')->getToken()->getUser();\n $em->persist($Blogposts);\n\n $Blogposts->setAuthor($user);\n $Blogposts->setPostDate($D);\n $em->flush();\n return $this->redirectToRoute('blog_homepage');\n\n }\n //envoi form\n return $this->render('@Blog/BlogViews/AddBlogPost.html.twig',array('form'=>$form->createView()));\n\n\n\n }", "public function onNewPost(PostEvent $event): bool\n {\n $user = $event->user;\n $badges = Badge::where('type', 'onNewPost')->get();\n\n $collection = $badges->filter(function ($badge) use ($user) {\n return $badge->rule <= $user->discuss_post_count;\n });\n\n $result = $user->badges()->syncWithoutDetaching($collection);\n\n return $this->sendNotifications($result, $badges, $user);\n }", "public function run()\n {\n $posts = [\n [ \n 'content' => 'Looking for someone to mow my lawn.',\n 'user_id' => 1\n ],\n [\n 'content' => 'Can someone buy my weekly shopping?',\n 'user_id' => 2\n ],\n [\n 'content' => 'Looking for someone to set up my Wi-Fi network with WPA2 encrpytion -- 7 devices.',\n 'user_id' => 3\n ],\n [\n 'content' => 'I would like a back massage.',\n 'user_id' => 4\n ]\n ];\n\n foreach ($posts as $post) {\n Post::create($post);\n }\n }", "public function publishBlog(Request $request){\n $email = \\Auth::user()->email;\n $user_id = User::all()->where('email', $email)->first();\n \n Blog::create([\n 'user_id' => $user_id[\"id\"],\n 'title' => $request->title,\n 'content' => trim($request->content)\n ]);\n\n return redirect()->route('blogs');\n }", "public function createPost()\n {\n $this->validate(['body' => 'required|min:15']);\n $post = auth()->user()->posts()->create(['body' => $this->body]);\n\n $this->emit('postAdded', $post->id); //emit de l'event\n\n $this->body = \"\"; //vidage du body\n\n }", "public function run()\n\t{\n\t\tPost::create([\n\t\t\t'title'=>'Fourth post',\n\t\t\t'slug'=>'Fourth -post',\n\t\t\t'excerpt'=>'<strong>Fourth post body</strong>',\n\t\t\t'content'=>'<strong>Content Fourth post body</strong>',\n\t\t\t'published'=>false ,\n\t\t\t'published_at'=>DB::raw('CURRENT_TIMESTAMP')]);\n}", "public function sendPost(){\n\t\t\t// record the post in the database\n\t\t\t\n\t\t}", "public function create()\n\t{\n\n\t\t$post = $this->store('create', '/thread/new');\n\n\t\tredirect('/threads?id=' . $post->id);\n\t}", "public function create_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['to'] = $this->input->get('to');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\n\t\t$this->Messages_model->create($data);\n\t}", "function owa_newBlogActionTracker($blog_id, $user_id, $domain, $path, $site_id) {\r\n\r\n\t$owa = owa_getInstance();\r\n\t$owa->trackAction('wordpress', 'Blog Created', $domain);\r\n}", "public function createPost()\n {\n if ($this->issetPostSperglobal('title') &&\n $this->issetPostSperglobal('description') &&\n $this->issetPostSperglobal('content') &&\n $this->issetPostSperglobal('categorie') &&\n $this->issetPostSperglobal('publish'))\n {\n $empty_field = 0;\n foreach ($_POST as $key => $post) {\n if ($key !== 'publish' && empty(trim($post))) {\n $empty_field++;\n }\n }\n if ($empty_field === 0) {\n $User = $this->session->read('User');\n $this->posts_manager->create($_POST, $User->getIdUser());\n $this->session->writeFlash('success', \"L'article a été créé avec succès.\");\n $this->redirect('dashboard');\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont vides.\");\n }\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont manquants.\");\n }\n $_post = $this->getSpecificPost($_POST);\n $categories = $this->categories_manager->listAll();\n $this->render('admin_post', ['head'=>['title'=>'Création d\\'un article', 'meta_description'=>''], 'categories'=>$categories, '_post'=>isset($_post) ? $_post : ''], 'admin');\n }", "public function postAction()\n {\n // $this->view->blog = $Blog->fetchAll();\n \n }", "public function sendPostNotification() {\n\t\t$getNotificatin = \\DB::table('notification')\n\t\t\t->where('type', 'post_added')\n\t\t\t->where('push_status', '0')\n\t\t\t->where('receiver', '0')\n\t\t\t->orderBy('id', 'ASC')\n\t\t\t->get();\n\t\tif (count($getNotificatin) > 0) {\n\t\t\tforeach ($getNotificatin as $nKey => $rows) {\n\t\t\t\t$notification_id = $rows->id;\n\t\t\t\t$senderId = $rows->sender;\n\t\t\t\t$senderInfo = \\DB::table('users')->where('id', $rows->sender)->first();\n\t\t\t\t$user_details[] = array(\n\t\t\t\t\t'ID' => $senderInfo->id,\n\t\t\t\t\t'user_image' => '',\n\t\t\t\t\t'Name' => $senderInfo->username,\n\t\t\t\t);\n\t\t\t\t$my_user = \\DB::table('user_connection')\n\t\t\t\t\t->where('user_connection.friend_id', $senderId)\n\t\t\t\t\t->where('user_connection.follow', '1')\n\t\t\t\t\t->where('user_connection.status', '1')\n\t\t\t\t\t->pluck('user_connection.user_id');\n\t\t\t\t$userRow = \\DB::table('users')\n\t\t\t\t\t->where('player_id', '!=', '')\n\t\t\t\t\t->WhereIn('id', $my_user)\n\t\t\t\t\t->pluck('player_id');\n\t\t\t\tif (!empty($userRow)) {\n\t\t\t\t\tif ($userRow) {\n\t\t\t\t\t\t$title = 'New Post';\n\t\t\t\t\t\t$message = $senderInfo->username . ' added new post';\n\t\t\t\t\t\t$msg = array(\n\t\t\t\t\t\t\t'title' => $title,\n\t\t\t\t\t\t\t'message' => $message,\n\t\t\t\t\t\t\t'push_notification_id' => $notification_id,\n\t\t\t\t\t\t\t'type' => $rows->type,\n\t\t\t\t\t\t\t'ID' => $rows->receiver,\n\t\t\t\t\t\t\t'sender_user_id' => $rows->sender,\n\t\t\t\t\t\t\t'sender_user_name' => $senderInfo->username,\n\t\t\t\t\t\t\t'object_id' => $rows->object_id ? $rows->object_id : 0,\n\t\t\t\t\t\t\t'user_details' => $user_details,\n\t\t\t\t\t\t\t'batch_count' => 0,\n\t\t\t\t\t\t\t'vibrate' => 1,\n\t\t\t\t\t\t\t'sound' => 1,\n\t\t\t\t\t\t\t'largeIcon' => 'large_icon',\n\t\t\t\t\t\t\t'smallIcon' => 'small_icon',\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$response = \\OneSignalServiceHelpers::sendPushNotification($userRow, $msg);\n\t\t\t\t\t\t$this->info($response);\n\t\t\t\t\t}\n\t\t\t\t\t$this->info(json_encode($userRow));\n\t\t\t\t}\n\t\t\t\t$this->updateNotificationStatus($notification_id);\n\t\t\t}\n\t\t}\n\t}", "public function post_create()\n\t{\n\t\tAcl::can('post_comments_create');\n\n\t\t$validation = Validator::make(Input::all(), array(\n\t\t\t'user_id' => array('required', 'integer'),\n\t\t\t'blog_post_id' => array('required', 'integer'),\n\t\t\t'content' => array('required'),\n\t\t));\n\n\t\tif($validation->valid())\n\t\t{\n\t\t\t$comment = new Blog_Comment;\n\n\t\t\t$comment->user_id = Input::get('user_id');\n\t\t\t$comment->blog_post_id = Input::get('blog_post_id');\n\t\t\t$comment->content = Input::get('content');\n\n\t\t\t$comment->save();\n\n\t\t\tCache::forget(Config::get('cache.key').'comments');\n\n\t\t\tSession::flash('message', 'Added comment #'.$comment->id);\n\n\t\t\treturn Redirect::to('blog/comments');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('blog/comments/create')\n\t\t\t\t\t->with_errors($validation->errors)\n\t\t\t\t\t->with_input();\n\t\t}\n\t}", "public function new_post( $post_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_post', 'new_group_forum_post' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_post', $post_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_post',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_post']['creds'],\n\t\t\t\t$this->prefs['new_post']['log'],\n\t\t\t\t$post_id,\n\t\t\t\t'bp_fpost',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}", "public function handle()\n {\n foreach ($this->posts as $post) {\n PublishPost::dispatch($post)->delay(Carbon::now());\n }\n }", "public function actionCreate()\n\t{\t\t\n\t\t// Check Access\n\t\tcheckAccessThrowException('op_blog_addposts');\n\t\t\n\t\t$model = new BlogPost;\n\t\t\n\t\tif( isset( $_POST['BlogPost'] ) ) {\n\t\t\t$model->attributes = $_POST['BlogPost'];\n\t\t\tif( isset( $_POST['submit'] ) ) {\n\t\t\t\tif( $model->save() ) {\n\t\t\t\t\tfok(at('Page Created.'));\n\t\t\t\t\talog(at(\"Created Blog Post '{name}'.\", array('{name}' => $model->title)));\n\t\t\t\t\t$this->redirect(array('blog/index'));\n\t\t\t\t}\n\t\t\t} else if( isset( $_POST['preview'] ) ) {\n\t\t\t\t$model->attributes = $_POST['BlogPost'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$roles = AuthItem::model()->findAll(array('order'=>'type DESC, name ASC'));\n\t\t$_roles = array();\n\t\tif( count($roles) ) {\n\t\t\tforeach($roles as $role) {\n\t\t\t\t$_roles[ AuthItem::model()->types[ $role->type ] ][ $role->name ] = $role->name;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Add Breadcrumb\n\t\t$this->addBreadCrumb(at('Creating New Post'));\n\t\t$this->title[] = at('Creating New Post');\n\t\t\n\t\t// Display form\n\t\t$this->render('form', array( 'roles' => $_roles, 'model' => $model ));\n\t}", "public function run()\n\t{\n\t\tPost::create(array(\n\t\t\t'post_title' => \"Have a Happy Day\",\n\t\t\t'post_body' => 'Welcome family! I wish you all the \n\t\t\tbest day :)',\n\t\t\t'post_author' => '3'\n\t\t\t));\n\t\tPost::create(array(\n\t\t\t'post_title' => \"Up To Two Posts\",\n\t\t\t'post_body' => 'Hey everybody! We need more posts! :)',\n\t\t\t'post_author' => '3'\n\t\t\t));\n\t}", "public function create() {\n\t\t// Setup some variables\n\t\t$this->data['validation'] = '';\n\t\t$this->data['entry'] = array('title' => '', 'url_title' => '', 'content' => '', 'status' => '', 'category_id' => '');\n\t\t$this->data['statuses'] = array('' => '---', 'published' => 'Published', 'draft' => 'Draft', 'review' => 'Review');\n\t\t$this->data['categories'] = $this->mojo->blog_model->categories_dropdown();\n\t\t\n\t\t// Handle entry submission\n\t\tif ($this->mojo->input->post('entry')) {\n\t\t\t// Get the entry data and set some stuff\n\t\t\t$this->data['entry']\t\t \t\t= $this->mojo->input->post('entry');\n\t\t\t$this->data['entry']['author_id'] \t= $this->mojo->session->userdata('id');\n\t\t\t$this->data['entry']['date']\t\t= date('Y-m-d H:i:s');\n\t\t\t$this->data['entry']['status']\t\t= ($this->data['entry']['status']) ? $this->data['entry']['status'] : 'published';\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert($this->data['entry'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/index');\n\t\t\t\t$response['message'] = 'Successfully created new entry';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Load that bitchin' view\n\t\t$this->_view('create');\n\t}", "public function run()\n {\n $post = new Post;\n $post->user_id = 2;\n $post->content = \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book\";\n $post->save();\n }", "public function publish(Post $post){\n $this->posts()->save($post);\n }", "function wp_newPost( $args ) {\n\n global $wp_xmlrpc_server;\n $wp_xmlrpc_server->escape($args);\n\n $blog_ID = (int) $args[0]; // for future use\n $username = $args[1];\n $password = $args[2];\n $content_struct = $args[3];\n $publish = isset( $args[4] ) ? $args[4] : false;\n\n if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) )\n return $wp_xmlrpc_server->error;\n \n $post_type = get_post_type_object( $content_struct['post_type'] );\n if( ! ( (bool)$post_type ) )\n return new IXR_Error( 403, __( 'Invalid post type' ) );\n\n if( ! current_user_can( $post_type->cap->edit_posts ) )\n return new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts in this post type' ));\n\n // this holds all the post data needed\n $post_data = array();\n $post_data['post_type'] = $content_struct['post_type'];\n\n $post_data['post_status'] = $publish ? 'publish' : 'draft';\n\n if( isset ( $content_struct[\"{$content_struct['post_type']}_status\"] ) )\n $post_data['post_status'] = $content_struct[\"{$post_data['post_type']}_status\"];\n\n\n switch ( $post_data['post_status'] ) {\n\n case 'draft':\n break;\n case 'pending':\n break;\n case 'private':\n if( ! current_user_can( $post_type->cap->publish_posts ) )\n return new IXR_Error( 401, __( 'Sorry, you are not allowed to create private posts in this post type' ));\n break;\n case 'publish':\n if( ! current_user_can( $post_type->cap->publish_posts ) )\n return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts in this post type' ));\n break;\n default:\n return new IXR_Error( 401, __( 'Invalid post status' ) );\n break;\n \n }\n\n // Only use a password if one was given.\n if ( isset( $content_struct['wp_password'] ) ) {\n\n if( ! current_user_can( $post_type->cap->publish_posts ) )\n return new IXR_Error( 401, __( 'Sorry, you are not allowed to create password protected posts in this post type' ) );\n $post_data['post_password'] = $content_struct['wp_password'];\n \n }\n\n // Let WordPress generate the post_name (slug) unless one has been provided.\n $post_data['post_name'] = \"\";\n if ( isset( $content_struct['wp_slug'] ) )\n $post_data['post_name'] = $content_struct['wp_slug'];\n\n if ( isset( $content_struct['wp_page_order'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'] , 'page-attributes' ) )\n return new IXR_Error( 401, __( 'This post type does not support page attributes.' ) );\n\n $post_data['menu_order'] = (int)$content_struct['wp_page_order'];\n \n }\n\n if ( isset( $content_struct['wp_page_parent_id'] ) ) {\n\n if( ! $post_type->hierarchical )\n return new IXR_Error( 401, __( 'This post type does not support post hierarchy.' ) );\n\n // validating parent ID\n $parent_ID = (int)$content_struct['wp_page_parent_id'];\n if( $parent_ID != 0 ) {\n\n $parent_post = (array)wp_get_single_post( $parent_ID );\n if ( empty( $parent_post['ID'] ) )\n return new IXR_Error( 401, __( 'Invalid parent ID.' ) );\n\n if ( $parent_post['post_type'] != $content_struct['post_type'] )\n return new IXR_Error( 401, __( 'The parent post is of different post type.' ) );\n\n }\n\n $post_data['post_parent'] = $content_struct['wp_page_parent_id'];\n\n }\n\n // page template is only supported only by pages\n if ( isset( $content_struct['wp_page_template'] ) ) {\n\n if( $content_struct['post_type'] != 'page' )\n return new IXR_Error( 401, __( 'Page templates are only supported by pages.' ) );\n\n // validating page template\n $page_templates = get_page_templates( );\n $page_templates['Default'] = 'default';\n \n if( ! array_key_exists( $content_struct['wp_page_template'], $page_templates ) )\n return new IXR_Error( 403, __( 'Invalid page template.' ) );\n\n $post_data['page_template'] = $content_struct['wp_page_template'];\n\n }\n\n $post_data['post_author '] = $user->ID;\n\n // If an author id was provided then use it instead.\n if( isset( $content_struct['wp_author_id'] ) && ( $user->ID != (int)$content_struct['wp_author_id'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'] , 'author' ) )\n return new IXR_Error( 401, __( 'This post type does not support to set author.' ) );\n\n if( ! current_user_can( $post_type->cap->edit_others_posts ) )\n return new IXR_Error( 401, __( 'You are not allowed to create posts as this user.' ) );\n \n $author_ID = (int)$content_struct['wp_author_id'];\n\n $author = get_userdata( $author_ID );\n if( ! $author )\n return new IXR_Error( 404, __( 'Invalid author ID.' ) );\n \n $post_data['post_author '] = $author_ID;\n \n }\n\n if( isset ( $content_struct['title'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'] , 'title' ) )\n return new IXR_Error( 401, __('This post type does not support title attribute.') );\n $post_data['post_title'] = $content_struct['title'];\n \n }\n\n if( isset ( $content_struct['description'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'] , 'editor' ) )\n return new IXR_Error( 401, __( 'This post type does not support post content.' ) );\n $post_data['post_content'] = $content_struct['description'];\n \n }\n\n if( isset ( $content_struct['mt_excerpt'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'] , 'excerpt' ) )\n return new IXR_Error( 401, __( 'This post type does not support post excerpt.' ) );\n $post_data['post_excerpt'] = $content_struct['mt_excerpt'];\n \n }\n\n if( post_type_supports( $content_struct['post_type'], 'comments' ) ) {\n\n $post_data['comment_status'] = get_option('default_comment_status');\n\n if( isset( $content_struct['mt_allow_comments'] ) ) {\n\n if( ! is_numeric( $content_struct['mt_allow_comments'] ) ) {\n\n switch ( $content_struct['mt_allow_comments'] ) {\n case 'closed':\n $post_data['comment_status']= 'closed';\n break;\n case 'open':\n $post_data['comment_status'] = 'open';\n break;\n default:\n return new IXR_Error( 401, __( 'Invalid comment option.' ) );\n }\n\n } else {\n\n switch ( (int) $content_struct['mt_allow_comments'] ) {\n case 0: // for backward compatiblity\n case 2:\n $post_data['comment_status'] = 'closed';\n break;\n case 1:\n $post_data['comment_status'] = 'open';\n break;\n default:\n return new IXR_Error( 401, __( 'Invalid comment option.' ) );\n }\n\n }\n \n }\n\n } else {\n\n if( isset( $content_struct['mt_allow_comments'] ) )\n return new IXR_Error( 401, __( 'This post type does not support comments.' ) );\n\n }\n\n\n if( post_type_supports( $content_struct['post_type'], 'trackbacks' ) ) {\n\n $post_data['ping_status'] = get_option('default_ping_status');\n\n if( isset( $content_struct['mt_allow_pings'] ) ) {\n\n if ( ! is_numeric( $content_struct['mt_allow_pings'] ) ) {\n\n switch ( $content_struct['mt_allow_pings'] ) {\n case 'closed':\n $post_data['ping_status']= 'closed';\n break;\n case 'open':\n $post_data['ping_status'] = 'open';\n break;\n default:\n return new IXR_Error( 401, __( 'Invalid ping option.' ) );\n }\n\n } else {\n\n switch ( (int) $content_struct['mt_allow_pings'] ) {\n case 0:\n case 2:\n $post_data['ping_status'] = 'closed';\n break;\n case 1:\n $post_data['ping_status'] = 'open';\n break;\n default:\n return new IXR_Error( 401, __( 'Invalid ping option.' ) );\n }\n\n }\n\n }\n\n } else {\n\n if( isset( $content_struct['mt_allow_pings'] ) )\n return new IXR_Error( 401, __( 'This post type does not support trackbacks.' ) );\n\n }\n\n $post_data['post_more'] = null;\n if( isset( $content_struct['mt_text_more'] ) ) {\n\n $post_data['post_more'] = $content_struct['mt_text_more'];\n $post_data['post_content'] = $post_data['post_content'] . '<!--more-->' . $post_data['post_more'];\n \n }\n\n $post_data['to_ping'] = null;\n if ( isset( $content_struct['mt_tb_ping_urls'] ) ) {\n\n $post_data['to_ping'] = $content_struct['mt_tb_ping_urls'];\n if ( is_array( $to_ping ) )\n $post_data['to_ping'] = implode(' ', $to_ping);\n \n }\n\n // Do some timestamp voodoo\n if ( ! empty( $content_struct['date_created_gmt'] ) )\n $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force\n elseif ( !empty( $content_struct['dateCreated']) )\n $dateCreated = $content_struct['dateCreated']->getIso();\n\n if ( ! empty( $dateCreated ) ) {\n $post_data['post_date'] = get_date_from_gmt( iso8601_to_datetime( $dateCreated ) );\n $post_data['post_date_gmt'] = iso8601_to_datetime( $dateCreated, 'GMT' );\n } else {\n $post_data['post_date'] = current_time('mysql');\n $post_data['post_date_gmt'] = current_time('mysql', 1);\n }\n\n // we got everything we need\n $post_ID = wp_insert_post( $post_data, true );\n\n if ( is_wp_error( $post_ID ) )\n return new IXR_Error( 500, $post_ID->get_error_message() );\n\n if ( ! $post_ID )\n return new IXR_Error( 401, __( 'Sorry, your entry could not be posted. Something wrong happened.' ) );\n\n // the default is to unstick\n if( $content_struct['post_type'] == 'post' ) {\n\n $sticky = $content_struct['sticky'] ? true : false;\n if( $sticky ) {\n\n if( $post_data['post_status'] != 'publish' )\n return new IXR_Error( 401, __( 'Only published posts can be made sticky.' ));\n\n if( ! current_user_can( $post_type->cap->edit_others_posts ) )\n return new IXR_Error( 401, __( 'Sorry, you are not allowed to stick this post.' ) );\n\n stick_post( $post_ID );\n\n\n } else {\n\n unstick_post( $post_ID );\n\n }\n\n } else {\n\n if( isset ( $content_struct['sticky'] ) )\n return new IXR_Error( 401, __( 'Sorry, only posts can be sticky.' ) );\n \n }\n\n if( isset ( $content_struct['custom_fields'] ) ) {\n\n if( ! post_type_supports( $content_struct['post_type'], 'custom-fields' ) )\n return new IXR_Error( 401, __( 'This post type does not support custom fields.' ) );\n $wp_xmlrpc_server->set_custom_fields( $post_ID, $content_struct['custom_fields'] );\n \n } \n\n $post_type_taxonomies = get_object_taxonomies( $content_struct['post_type'] );\n\n if( isset( $content_struct['terms'] ) ) {\n\n $terms = $content_struct['terms'];\n $taxonomies = array_keys( $terms );\n\n // validating term ids\n foreach( $taxonomies as $taxonomy ) {\n\n if( ! in_array( $taxonomy , $post_type_taxonomies ) )\n return new IXR_Error( 401, __( 'Sorry, one of the given taxonomy is not supported by the post type.' ));\n\n $term_ids = $terms[ $taxonomy ];\n foreach ( $term_ids as $term_id) {\n\n $term = get_term( $term_id, $taxonomy );\n\n if ( is_wp_error( $term ) )\n return new IXR_Error( 500, $term->get_error_message() );\n\n if ( ! $term )\n return new IXR_Error( 401, __( 'Invalid term ID' ) );\n\n }\n\n }\n\n foreach( $taxonomies as $taxonomy ) {\n\n $term_ids = $terms[ $taxonomy ];\n $term_ids = array_map( 'intval', $term_ids );\n $term_ids = array_unique( $term_ids );\n wp_set_object_terms( $post_ID , $term_ids, $taxonomy , $append);\n\n }\n\n return true;\n\n }\n\n // backward compatiblity\n\t\tif ( isset( $content_struct['categories'] ) ) {\n\n if( ! in_array( 'category', $post_type_taxonomies ) )\n return new IXR_Error( 401, __( 'Sorry, Categories are not supported by the post type' ));\n \n\t\t\t$category_names = $content_struct['categories'];\n\n foreach( $category_names as $category_name ) {\n $category_ID = get_cat_ID( $category_name );\n if( ! $category_ID )\n return new IXR_Error( 401, __( 'Sorry, one of the given categories does not exist!' ));\n $post_categories[] = $category_ID;\n }\n\n wp_set_post_categories ($post_ID, $post_categories );\n\n\t\t}\n\n if( isset( $content_struct['mt_keywords'] ) ) {\n\n if( ! in_array( 'post_tag' , $post_type_taxonomies ) )\n return new IXR_Error( 401, __( 'Sorry, post tags are not supported by the post type' ));\n\n wp_set_post_terms( $post_id, $tags, 'post_tag', false); // append is set false here\n\n }\n\n if( isset( $content_struct['wp_post_format'] ) ) {\n\n if( ! in_array( 'post_format' , $post_type_taxonomies ) )\n return new IXR_Error( 401, __( 'Sorry, post formats are not supported by the post type' ));\n \n wp_set_post_terms( $post_ID, array( 'post-format-' . $content_struct['wp_post_format'] ), 'post_format' );\n\n }\n\n // Handle enclosures\n $thisEnclosure = isset($content_struct['enclosure']) ? $content_struct['enclosure'] : null;\n $wp_xmlrpc_server->add_enclosure_if_new($post_ID, $thisEnclosure);\n $wp_xmlrpc_server->attach_uploads( $post_ID, $post_data['post_content'] );\n\n return strval( $post_ID );\n\n}", "function owa_newAttachmentActionTracker($post_id) {\r\n\r\n\t$owa = owa_getInstance();\r\n\t$post = get_post($post_id);\r\n\t$label = $post->post_title;\r\n\t$owa->trackAction('wordpress', 'Attachment Created', $label);\r\n}", "public function actionCreate()\n {\n $model = new BlogComments();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function post($post_id)\n\t{\n\t\t$check = DB::select(\"SELECT COUNT(*) as count FROM blog WHERE id = '\".explode('-',$post_id)[0].\"'\")[0];\n\t\tif ($check->count == 0){\n\t\t\tabort(404);\n\t\t}\n\t\t$post = DB::select(\"SELECT * FROM blog WHERE id = '\".explode('-',$post_id)[0].\"'\")[0];\n\t\tDB::update(\"UPDATE blog SET visits = visits+1 WHERE id = '\".$post->id.\"'\");\n\t\t$title = $post->title;\n\t\t$desc = mb_substr($post->content,0,75);\n\t\t$header = $this->header(translate($post->title),$desc,false,true,url('/assets/blog/'.$post->images));\n\t\t// Get blocs of the page builder\n\t\t$blocs = DB::select(\"SELECT * FROM blocs WHERE area = 'post' ORDER BY o ASC\");\n\t\t$footer = $this->footer();\n\t\treturn view('post')->with(compact('header','post','blocs','footer'));\n\t}", "public function publish()\n {\n $message = new MailMessage;\n $message->greeting(\"Hi {$this->post->reporting->name}!\");\n $message->line(\"The post {$this->post->titile} has been published successfully.\"); \n foreach ($this->workflow as $key => $value) {\n if ($key == 0) {\n $message->action($value->action, url('workflows/workflow/' . $value->id));\n continue;\n }\n $message->line('<a href=\"'.url('workflows/workflow/' . $value->id).'\">'.$value->action.'</a>');\n }\n\n return $message;\n }", "public function create(Request $request)\n {\n $this->validate($request, [\n 'content' => 'required',\n ]); \n\n $post = new Post();\n $post->content = $request->input('content');\n $post->user_id = Auth::id();\n $post->save();\n\n $post = Post::with('user')->find($post->id);\n $pusher = \\Illuminate\\Support\\Facades\\App::make('pusher');\n $channels = [];\n $friends = Friend::getFriends();\n foreach ($friends as $f) {\n $channels[] = 'private-larawall'.$f;\n }\n if(!empty($channels)){\n $pusher->trigger($channels,'newpost',$post);\n }\n\n\n return $post;\n }", "public function blogAction()\n {\n\n \t$blogId = $this->_request->getParam(2);\n $page = $this->_request->getParam(3);\n\n $blog = Data::factory($blogId, Blog::ITEM_TYPE);\n\t\tif(empty($blog)){\n throw new Lib_Exception_NotFound(\"Blog '$blogId' not found\");\n }\n\n Zend_Registry::set('Category', $blog->getCategory());\n Zend_Registry::set('SubCategory', $blog->getSubCategory());\n\n $table = new Blog_Post();\n $select = $table->select();\n $select->where(\"blogId = $blog->id\");\n\n // Regular users only see valid posts\n if(!$blog->isEditableBy($this->_user, $this->_acl)){\n \t$select->where(\"status = '\".Data::VALID.\"'\");\n }\n $select->order(\"date DESC\");\n\n $posts = $this->_helper->dataPaginator($select, $page, 'commonviews/pagination.phtml', BLOGPOSTS_PER_PAGE);\n\n $this->view->blog = $blog;\n $this->view->dataType = 'Blog_Post';\n $this->view->posts = $posts;\n \n if($this->_user->getId() == $blog->getSubmitter()->getId()){\n \t$this->_useAdditionalContent = false;\n \t$this->_helper->layout->setLayout('one-column');\n } else {\n \t$this->_useAdditionalContent = true;\n \t$this->_helper->layout->setLayout('two-columns');\n \t$this->view->wrapperIsCard = true;\n }\n \n \n }", "public function blogCommentPost() {\n\n $data = $this->request->all();\n $this->comment->create($data);\n return json_encode(array('status' => 200, 'message' => 'Saved successfuly'));\n }", "public function postsAction() {\n\n $params = $this->_request->getParams();\n $this->view->ajax_post = isset($params['ajax_post']) ? TRUE : FALSE;\n\n //Добавим путь к действию\n $this->_breadcrumbs->addStep($this->Translate('Список сообщений в блогах'));\n }", "public function run()\n {\n Post::create([\n \t'user_id' => 2,\n \t'title' => 'First Post',\n \t'body' => 'Lorem ipsum dolar sit amet.'\n ]);\n }", "public function addPostToBlogInTheMiddle() {}", "public function create_new()\n\t{\n\t\trequire_once(MODELS . '/Post.php');\n\t\t$model = new Post();\n\t\t$result = $model->create_new();\n\t\tif ($result){\n\t\t\theader('Location:/home');\n\t\t\tuser_msg('Post created successfully'); // <-- this doesn't work, why?\n\t\t}\n\t}", "function index_post() {\n $data = array(\n 'NewsID' => $this->post('NewsID'),\n 'CategoryID' => $this->post('CategoryID'),\n 'NewsTitle' => $this->post('NewsTitle'),\n 'PostDate' => $this->post('PostDate'),\n 'NewsHTML' => $this->post('NewsHTML'),\n 'ViewCount' => $this->post('ViewCount'),\n 'Visible' => $this->post('Visible')\n );\n $insert = $this->db->insert('CMS_News', $data);\n if ($insert) {\n $this->response($data, 200);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function publish(Post $post)\n {\n $post->updated_at = null;\n\n $post->published = true;\n\n $query = DB::table('threads')\n ->where('id', $post->thread_id)\n ->update(['lastpost_uid' => $post->user_id, 'lastpost_date' => $post->created_at]);\n\n $post->save();\n\n return back();\n }", "public function run()\n {\n Post::truncate();\n\n $categories = Category::all();\n\n foreach ($categories as $key => $category) {\n for ($i=1; $i < 21; $i++) {\n Post::create([\n 'title' => 'Titulo '.$i,\n 'url_clean' => strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', 'Titulo '.$i))),\n 'content' => 'Lorem ipsum dolor, sit amet consectetur adipisicing elit. Blanditiis similique fugiat consequatur deserunt eos sed numquam amet. Aliquam, et. Totam quae temporibus, nulla unde consequuntur quam aliquid neque. Iste, placeat.',\n 'posted' => 'yes',\n 'category_id' => $category->id\n ]);\n }\n }\n }", "public function run()\n {\n //\n for($i = 0; $i < 5; $i++) {\n $new_post = new Post();\n\n $new_post->title = 'Post #' . ($i + 1);\n $new_post->slug = Str::slug($new_post->title, '-');\n $new_post->content = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Atque officiis error ab eligendi cumque consequatur, maiores unde officia eum delectus laboriosam similique blanditiis ea, quod architecto vitae corporis! Optio, ut!';\n\n $new_post->save();\n }\n }", "public function run()\n {\n $posts = [\n ['id' => 1, 'title' => 'post one', 'description' => 'description one', 'status' => '1'],\n ['id' => 2, 'title' => 'post two', 'description' => 'description two', 'status' => '0'],\n ['id' => 3, 'title' => 'post three', 'description' => 'description three', 'status' => '6'],\n ['id' => 4, 'title' => 'post four', 'description' => 'description four', 'status' => '3'],\n ['id' => 5, 'title' => 'post five', 'description' => 'description five', 'status' => '4'],\n ];\n Post::insert($posts);\n }", "function post_publish_notification($ID , $post){\n\t$email = get_the_author_meta('user_email',$post->post_author);\n\t$subject = 'Published '.$post->post_title;\n\t$message = 'We just Published your post '.$post->post_title.\n\t ' take a look at : '. get_permalink($ID);\n\twp_mail($email,$subject,$message);\n}", "public function create()\n {\n $obj['method'] = \"post\";\n return view('create_blog',$obj);\n }", "public function actionCreate()\n {\n $model = new Post();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->alias = Inflector::slug($model->title);\n $model->created_date = time();\n $model->publish_date = time();\n if($model->save()) {\n \\Yii::$app->session->setFlash('success', Module::t('general', 'Create post successfull'));\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function postPublish(Post $post)\n {\n $this->postRepository->postPublished($post);\n return redirect(config('blog.prefix', 'admin/blog') . '/' . 'post');\n }", "public function post_publish()\n\t{\n\t\t$this->get_publish();\n\t}", "public function generatePost($forum_id, $thread_id, $user, $message, $parent_pos, $notify, $subject = '', $alias = '', $date = '', $status = 1, $send_activation_mail = 0)\n\t{\n\t\tglobal $ilUser, $ilDB;\n\t\n\t\t$objNewPost = new ilForumPost();\n\t\t$objNewPost->setForumId($forum_id);\n\t\t$objNewPost->setThreadId($thread_id);\n\t\t$objNewPost->setSubject($subject);\n\t\t$objNewPost->setMessage($message);\n\t\t$objNewPost->setUserId($user);\n\t\t$objNewPost->setUserAlias($alias);\n\t\tif ($date == \"\")\n\t\t{\n\t\t\t$objNewPost->setCreateDate(date(\"Y-m-d H:i:s\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (strpos($date, \"-\") > 0)\t\t// in mysql format\n\t\t\t{\n\t\t\t\t$objNewPost->setCreateDate($date);\n\t\t\t}\n\t\t\telse\t\t\t\t\t\t\t\t// a timestamp\n\t\t\t{\n\t\t\t\t$objNewPost->setCreateDate(date(\"Y-m-d H:i:s\", $date));\n\t\t\t}\n\t\t}\n\n\t\t$objNewPost->setImportName($this->getImportName());\n\t\t$objNewPost->setNotification($notify);\n\t\t$objNewPost->setStatus($status);\n\t\t$objNewPost->insert();\n\t\t\n\t\t// entry in tree-table\n\t\tif ($parent_pos == 0)\n\t\t{\n\t\t\t$this->addPostTree($objNewPost->getThreadId(), $objNewPost->getId(), $objNewPost->getCreateDate());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->insertPostNode($objNewPost->getId(), $parent_pos, $objNewPost->getThreadId(), $objNewPost->getCreateDate());\n\t\t}\n//echo \"<br>->\".$objNewPost->getId().\"-\".$parent_pos.\"-\".$objNewPost->getThreadId().\"-\".\n//\t$objNewPost->getCreateDate().\"-\".$forum_id.\"-\".$message.\"-\".$user.\"-\";\n\t\t// string last post\n\t\t$lastPost = $objNewPost->getForumId().\"#\".$objNewPost->getThreadId().\"#\".$objNewPost->getId();\n\t\t\t\n\t\t// update thread\n\t\t$result = $ilDB->manipulateF('\n\t\t\tUPDATE frm_threads \n\t\t\tSET thr_num_posts = thr_num_posts + 1,\n\t\t\t\tthr_last_post = %s\n\t\t\tWHERE thr_pk = %s',\n\t\t\tarray('text', 'integer'),\n\t\t\tarray($lastPost, $objNewPost->getThreadId()));\n\t\t\n\t\t// update forum\n\t\t$result = $ilDB->manipulateF('\n\t\t\tUPDATE frm_data \n\t\t\tSET top_num_posts = top_num_posts + 1,\n\t\t\t \ttop_last_post = %s\n\t\t\tWHERE top_pk = %s',\n\t\t\tarray('text', 'integer'),\n\t\t\tarray($lastPost, $objNewPost->getForumId()));\n\t\t\n\t\t// MARK READ\n\t\t$forum_obj = ilObjectFactory::getInstanceByRefId($this->getForumRefId());\n\t\t$forum_obj->markPostRead($objNewPost->getUserId(), $objNewPost->getThreadId(), $objNewPost->getId());\n\t\t\n\t\t$pos_data = $objNewPost->getDataAsArray();\n\t\t$pos_data[\"ref_id\"] = $this->getForumRefId();\n\n\t\t// FINALLY SEND MESSAGE\n\n\t\tif ($this->ilias->getSetting(\"forum_notification\") == 1 && (int)$status )\n\t\t{\n\t\t\t$GLOBALS[\"frm_notifications_sent\"] = array();\n\t\t\t$this->__sendMessage($parent_pos, $pos_data);\n\n\t\t\t$pos_data[\"top_name\"] = $forum_obj->getTitle();\t\t\t\n\t\t\t$this->sendForumNotifications($pos_data);\n\t\t\t$this->sendThreadNotifications($pos_data);\n\t\t\tunset($GLOBALS[\"frm_notifications_sent\"]);\n\t\t}\n\t\t\n\t\t// Send notification to moderators if they have to enable a post\n\t\t\n\t\tif (!$status && $send_activation_mail)\n\t\t{\n\t\t\t$pos_data[\"top_name\"] = $forum_obj->getTitle();\t\t\t\n\t\t\t$this->sendPostActivationNotification($pos_data);\n\t\t}\n\t\t\n\t\t// Add Notification to news\n\t\tif ($status)\n\t\t{\n\t\t\trequire_once 'Services/RTE/classes/class.ilRTE.php';\n\t\t\tinclude_once(\"./Services/News/classes/class.ilNewsItem.php\");\n\t\t\t$news_item = new ilNewsItem();\n\t\t\t$news_item->setContext($forum_obj->getId(), 'frm', $objNewPost->getId(), 'pos');\n\t\t\t$news_item->setPriority(NEWS_NOTICE);\n\t\t\t$news_item->setTitle($objNewPost->getSubject());\n\t\t\t$news_item->setContent(ilRTE::_replaceMediaObjectImageSrc($this->prepareText($objNewPost->getMessage(), 0), 1));\n\t\t\t$news_item->setUserId($user);\n\t\t\t$news_item->setVisibility(NEWS_USERS);\n\t\t\t$news_item->create();\n\t\t}\n\t\t\n\t\treturn $objNewPost->getId();\n\t}", "public function publish($id)\n\t{\n\t\t$data = array(\n\t\t\t\t\t\t'status' => 1\n\t\t\t\t\t );\n\n\t\t$result = $this->common_model->UpdateDB('blog_post',array('id' => $id),$data);\n\n\t\tif ($result) \n\t\t{\n\t\t\tset_flashdata('success','Post Status Changed to Publish');\n\t\t\tredirect('blog/posts/manage_posts','refresh');\n\t\t} \n\t}", "static function comment_post($id_comment){\n if(!(($id_user = PDOQueries::get_post_publisher_id_by_comment($id_comment)) > 0) || !(($id_post = PDOQueries::get_post_id_by_comment($id_comment)) > 0) || !(($id_publisher = PDOQueries::get_publisher_id($id_post)) > 0))\n throw new \\PersonalizeException(2001);\n $marker = '{comment_post}{id_publisher/'.$id_user.'}';\n $link = 'index.php?'.Navigation::$navigation_marker.'='.Timeline::$post_id_page.'#'.$id_post.$id_comment;\n return PDOQueries::add_notification($id_publisher,$marker,$link);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Post;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// ** Do not remove this line due to some weird Yii bugs\n\t\t// ** Without this line the post will double-saved in chrome.\n\t\t// ** commented by [email protected]\n\t\t$this->performAjaxValidation($model);\n\t\t\n\t\tif(isset($_POST['Post']) and isset($_POST['Tag']))\n\t\t{\n\t\t\t$tag_ids = array();\n\t\t\tforeach(explode(\", \", $_POST['Tag']['name']) as $tag_name)\n\t\t\t{\n\t\t\t\t$tag_model = Tag::model()->findAll(\n\t\t\t\t\t\t\"name=:name\", array(\"name\"=>$tag_name));\n\t\t\t\t//$tag_model = Tag::model()->findbyPk(6);\n\t\t\t\tif (empty($tag_model))\n\t\t\t\t\tbreak;\n\t\t\t\tarray_push($tag_ids, $tag_model[0]->id);\n\t\t\t}\n\t\t\t$model->tag = $tag_ids;\n\t\t\n\t\t\t$_POST['Post']['user_id'] = Yii::app()->user->getId();\n\t\t\t$_POST['Post']['post_type'] = Post::POST_TYPE_NEWS;\n\t\t\t$model->attributes=$_POST['Post'];\n\t\t\t\n\t\t\tif ($model->save())\n\t\t\t\t$this->redirect(array('postDetail','id'=>$model->id));\n\t\t\telse\n\t\t\t\tYii::trace(\"Could not save the user. SQL\");\t\n\t\t}\n\t}", "public function actionCreate()\n {\n\t$this->layout='wide';\n $post=new Post;\n if(isset($_POST['Post']))\n {\n $post->attributes=$_POST['Post'];\n if(isset($_POST['previewPost']))\n $post->validate();\n else if(isset($_POST['submitPost']) && $post->save())\n {\n if(Yii::app()->user->status==User::STATUS_VISITOR)\n {\n Yii::app()->user->setFlash('message','Thank you for your post. Your post will be posted once it is approved.');\n $this->redirect(Yii::app()->homeUrl);\n }\n $this->redirect(array('show','slug'=>$post->slug));\n }\n }\n $this->pageTitle=Yii::t('lan','New Post');\n $this->render('create',array('post'=>$post));\n }", "public function __construct($new_postNotification)\n {\n //\n $this->postNotification = $new_postNotification;\n\n }", "public function created($model)\n {\n $model->forum->update([\n 'latest_post_id' => $model->id,\n ]);\n }", "public function ajaxNewCommentAction() {\n if ($this->request->hasArgument('blogid')) {\n $blogid = $this->request->getArgument('blogid');\n }\n if ($this->request->hasArgument('postid')) {\n $postid = $this->request->getArgument('postid');\n }\n if ($this->request->hasArgument('name')) {\n $name = $this->request->getArgument('name');\n }\n if ($this->request->hasArgument('email')) {\n $email = $this->request->getArgument('email');\n }\n if ($this->request->hasArgument('text')) {\n $text = $this->request->getArgument('text');\n }\n \n $commentRepository = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Repository\\\\CommentRepository');\n \n $newComment = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Model\\\\Comment'); \n $newComment->setBlogid($blogid);\n $newComment->setPostid($postid);\n $newComment->setCommentname($name);\n $newComment->setCommentmail($email);\n $newComment->setCommenttext($text);\n $newComment->setCommentdate(time());\n \n $commentRepository->add($newComment);\n $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\PersistenceManager')->persistAll();\n \n exit;\n }", "function getActivity()\n\t\t{\n\t\t\t$userID = $_POST[\"userID\"];\n\t\t\t$title = \"userPost\";\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t\n\t\t\techo $this->postActivity($userID, $title, $description, $link);\n\t\t}", "public function run()\n\t{\n\t\t$content = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. ';\n\n\t\tfor($i = 1; $i <= 20; $i++ )\n\t\t{\n\t\t\t$post = new Post;\n\t\t\t$post->title = \"Post no $i\";\n\t\t\t$post->read_more = substr($content, 0, 120);\n\t\t\t$post->content = $content;\n\t\t\t$post->save();\n\n\t\t\t$maxComments = mt_rand(3,15);\n\t\t\tfor($j = 1; $j <= $maxComments; $j++)\n\t\t\t{\n\t\t\t\t$comment = new Comment;\n\t\t\t\t$comment->commenter = 'xyz';\n\t\t\t\t$comment->comment = substr($content, 0, 120);\n\t\t\t\t$comment->email = '[email protected]';\n\t\t\t\t$comment->approved = 1;\n\t\t\t\t$post->comments()->save($comment);\n\t\t\t\t$post->increment('comment_count');\n\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n DB::table('posts')->insert([\n \t'subject' => str_random(30),\n \t'content' => str_random(1000),\n 'user_id' => 1,\n \t'category' => 'blog',\n\n ]);\n }", "public function post($id){\n\t\t$this->load->model('blog_model');\n\t\t$data = $this->blog_model->getPost($id);\n\t\t$data['comment'] = $this->blog_model->getComments($id);\n\t\t$data['userLogin'] = $this->checkLogin();\n\t\tif($data['userLogin']){\n\t\t\t$data['user'] = $this->getUser();\n\t\t}\n\n\t\t$data['sidebar'] = $this->sidebar();\n\t\t\n\t\tif($data['postcount'] < 1){\n\t\t\tredirect('Blog/404');\n\t\t}\n\t\t$this->load->helper('url');\n\t\t$this->load->view('frontend/templates/header');\n\t\t$this->load->view('frontend/templates/navigation');\n\t\t$this->load->view('frontend/single-post', $data);\n\t\t$this->load->view('frontend/templates/sidebar');\n\t\t$this->load->view('frontend/templates/footer');\n\t}", "public function run()\n {\n //\n Post::create([\n 'title' => 'Sample Post Title',\n 'slug' => 'sample-post-title',\n 'content' => 'Sample post content. Sample post content.',\n 'category_id' => 1,\n ]);\n }", "public function run()\n {\n DB::table('blogs')->delete();\n\t\tDB::table('blogs')->insert([\n\t\t'title' => 'นี่คือหัวข้อแรกของบล็อค',\n\t\t'content' => 'นี่คือเนื้อหาแรกของบล็อค',\n\t\t'created_at' => date('Y-m-d H:i:s')\n\t\t]);\n }", "public function add_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'title', 'ad_type', 'ad_ptype', \r\n\t\t\t\t'link', 'activity', 'clientver', 'img', 'start_time', 'end_time', 'status', 'hits',\r\n\t\t\t\t'channel_id', 'module_id', 'cid', 'channel_code', 'ptype_id', 'is_recommend', 'action'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$result = Gou_Service_Ad::addAd($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function create()\n {\n return view('frontend.blog.post.create');\n }", "public function add(): void\n {\n\n $this->checkAccess(); // redirect to login page if not connected\n\n $pageTitle = 'Ajouter un post';\n $message = '';\n $style = 'success';\n $template = 'new-post';\n $post = $this->model;\n\n $postArray = $post->collectInput('POST'); // collect global $_POST data\n \n if (!empty($postArray))\n {\n if (isset($postArray['save']))\n {\n $message = 'Le post a bien été enregistré en base';\n $post->status = self::STATUS_SUBMITTED;\n }\n if (isset($postArray['saveAsDraft']))\n {\n $message = 'Le brouillon a bien été enregistré en base';\n $post->status = self::STATUS_DRAFT;\n }\n\n $post->author = filter_var($_SESSION['user_id'], FILTER_VALIDATE_INT); // author = connected user\n $this->dataTransform($post, $postArray);\n \n $post->id = $post->insert();\n\n if($post->id == 0)\n {\n $message = 'Une erreur est survenue, le post n\\'a pas pu être inséré dans la base de données.';\n $style = 'danger';\n } \n if($post->id !== 0)\n {\n array_push($_SESSION['user_posts'], $post->id);\n $message .= ' sous l\\'identifiant #'.$post->id.'.';\n $pageTitle = 'Modifier le post #'.$post->id;\n $template = 'edit-post';\n\n if((!$this->isAdmin()) AND (NOTIFY['new_post'] == 1)) // if current user is not admin and new post notification is enabled\n {\n // Try to notify the site owner of the new post submission\n try\n {\n $serverArray = $this->collectInput('SERVER');\n $baseUrl = 'http://'.$serverArray['HTTP_HOST'].$serverArray['PHP_SELF'];\n $body = \"Un nouveau post vient d'être soumis par {$post->getAuthor()} : {$baseUrl}?controller=post&task=edit&id={$post->id}\";\n if (!$this->sendEmail(SITE_NAME,'[email protected]','Nouveau post soumis',$body))\n {\n throw new Throwable();\n }\n }\n catch (Throwable $e)\n {\n // Uncomment in dev context:\n $error = sprintf('Erreur : %1$s<br>Fichier : %2$s<br>Ligne : %3$d', $e->getMessage(), $e->getFile(), $e->getLine());\n echo filter_var($error, FILTER_SANITIZE_STRING);\n }\n }\n }\n\n }\n \n $this->display('admin', $template, $pageTitle, compact('message','style','post'));\n\n }", "public function postCreate(Request $request)\n\t{\n\t\t$date = jDate::forge('now')->format('%d %B ، %Y');\n\t\t$b=new tbl_blogs;\t\n\t\t$b->title=$request->title;\n\t\t$b->content=$request->messageArea;\n\t\t$b->categorizes=$request->item_id;\n\t\t$b->tag=$request->item_id;\n\t\t$b->date=$date;\n\t\t$b->save();\n\t\treturn redirect('home/blog');\n\t}", "public function createComment(Request $request)\n {\n\n $validator = Validator::make($request->all(), [\n 'comment' => 'required',\n ]);\n\n if ($validator->fails()) {\n return back()\n ->withErrors($validator)\n ->withInput();\n }\n\n $comment = new BlogComment();\n $comment->user_id = Auth::id();\n $comment->blog_id = $request->bid;\n $comment->comment = $request->comment;\n $comment->save();\n\n $comment = BlogComment::with('user')->find($comment->id);\n\n //send email here\n $comment->notify(new BlogCommentNotification($comment));\n\n return redirect()->back();\n }", "public function p_add() {\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this post was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n\n # Insert\n # Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n DB::instance(DB_NAME)->insert('activities', $_POST);\n\n # Send them back to home page\n Router::redirect('/activities/index');\n\n }", "public function postAction() {\n\t\t$this->sendMessage();\n\t}", "public function created(Post $post)\n {\n //\n }", "public function create()\n {\n return view('admin_panel.blog.create');\n }", "public function run()\n {\n \t$titles = ['Post 1', 'Post 2', 'Post 3'];\n\n \tforeach ($titles as $i => $t) {\n $i++;\n \t\tPost::create([\n \t\t\t'user_id' => 1,\n 'category_id' => $i,\n \t\t\t'title' => $t,\n \t\t\t'seo_title' => Str::slug($t, '-'),\n \t\t\t'description' => \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\",\n \t\t\t'image' => '/images/sample.jpg',\n \t\t]);\n \t}\n\n }", "public function create()\n\t{\n\t\treturn view('backend.blog.create');\n\t}", "function wiki_add_post($page_id, $message, $validated = 1, $member = null, $send_notification = true, $add_time = null, $views = 0, $edit_date = null)\n{\n if (is_null($member)) {\n $member = get_member();\n }\n if (is_null($add_time)) {\n $add_time = time();\n }\n\n require_lang('wiki');\n\n ignore_user_abort(true);\n\n require_code('comcode_check');\n check_comcode($message, null, false, null, true);\n\n if (!addon_installed('unvalidated')) {\n $validated = 1;\n }\n $map = array(\n 'validated' => $validated,\n 'member_id' => $member,\n 'date_and_time' => $add_time,\n 'page_id' => $page_id,\n 'wiki_views' => $views,\n 'edit_date' => $edit_date\n );\n if (multi_lang_content()) {\n $map['the_message'] = 0;\n } else {\n $map['the_message'] = '';\n $map['the_message__text_parsed'] = '';\n $map['the_message__source_user'] = get_member();\n }\n $post_id = $GLOBALS['SITE_DB']->query_insert('wiki_posts', $map, true);\n\n require_code('attachments2');\n $GLOBALS['SITE_DB']->query_update('wiki_posts', insert_lang_comcode_attachments('the_message', 2, $message, 'wiki_post', strval($post_id)), array('id' => $post_id), '', 1);\n\n // Log\n log_it('WIKI_MAKE_POST', strval($post_id), strval($page_id));\n\n // Update post count\n if ((addon_installed('points')) && (cms_mb_strlen($message) > 1024)) {\n require_code('points');\n $_count = point_info($member);\n $count = array_key_exists('points_gained_wiki', $_count) ? $_count['points_gained_wiki'] : 0;\n $GLOBALS['FORUM_DRIVER']->set_custom_field($member, 'points_gained_wiki', $count + 1);\n }\n\n // Stat\n update_stat('num_wiki_posts', 1);\n\n if ($send_notification) {\n if (post_param_integer('send_notification', null) !== 0) {\n dispatch_wiki_post_notification($post_id, 'ADD');\n }\n }\n\n if (get_option('show_post_validation') == '1') {\n decache('main_staff_checklist');\n }\n\n if ((addon_installed('commandr')) && (!running_script('install')) && (!get_mass_import_mode())) {\n require_code('resource_fs');\n generate_resource_fs_moniker('wiki_post', strval($post_id), null, null, true);\n }\n\n @ignore_user_abort(false);\n\n return $post_id;\n}", "private function runPost()\n {\n $numDraftPost = (int) $this->ask('How many records do you want to create for the draft posts table?');\n $numPublicPost = (int) $this->ask('How many records do you want to create for the public posts table?');\n\n $sum = (int) ($numDraftPost + $numPublicPost);\n\n for ($i = 0; $i < $sum; $i++) {\n factory(Post::class)->create(\n [\n 'publication_status' => ($i < $numDraftPost) ? 'draft' : 'public',\n ]\n );\n }\n }", "public function handle()\n {\n Blog::each(function ($blog) {\n $this->line('Parsing feed: ' . $blog->name);\n $feed = FeedsFacade::make($blog->feed_url);\n foreach ($feed->get_items() as $item) {\n if ($blog->posts()->where('guid', $item->get_id())->count()) {\n continue;\n }\n\n $postDate = Carbon::parse($item->get_date());\n\n $post = $blog->posts()->create([\n 'guid' => $item->get_id(),\n 'created_at' => $postDate,\n ]);\n\n if ($postDate->diffInDays(Carbon::now()) > 1) {\n continue;\n }\n\n $post->blog->users->each(function ($user) use ($post, $item) {\n Twilio::sendMessage(\n $user->pivot->notify_location,\n \"New blog post:\\n\" . $post->blog->name . \"\\n\" . $item->get_title() . \"\\n\" . $post->guid\n );\n });\n }\n });\n }", "public function createNewPost(NodeInterface $forum, NodeTemplate $newPost) {\n\t\t$newPostNodeName = \\TYPO3\\TYPO3CR\\Utility::renderValidNodeName($newPost->getProperty('title'));\n\t\t$forum->createNodeFromTemplate($newPost, $newPostNodeName);\n\t\t$forum->setProperty('numberOfReplies', (intval($forum->getProperty('numberOfReplies')) +\t1));\n\t\t$lastMessageDate = new \\DateTime();\n\t\t$forum->setProperty('lastMessageDate', $lastMessageDate);\n\t}", "public function addPost() {\n\n if ($this->request->is('post')) {\n\n $this->Post->create();\n\n $data = $this->getPreparedPostData($this->request);\n\n if ($this->Post->save($data)) {\n $this->Session->setFlash('Your post has been saved.');\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash('Unable to add your post.');\n }\n }\n }", "public function run()\n {\n $blog_one = new Blog();\n $blog_one->title='Title 1';\n $blog_one->slug='title-1';\n $blog_one->meta_title='this is the meta title';\n $blog_one->meta_description='metadescription';\n $blog_one->body='Lorem ipsum dolor';\n $blog_one->save();\n\n $blog_two = new Blog();\n $blog_two->title='Title 2';\n $blog_two->slug='title-2';\n $blog_two->meta_title='this is the metatitle of blog entry 2';\n $blog_two->meta_description='Meta description';\n $blog_two->body='Tis is the body of my second blog. Add more text if you want.';\n $blog_two->save();\n }", "function qa_wall_add_post($userid, $handle, $cookieid, $touserid, $tohandle, $content, $format)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\trequire_once QA_INCLUDE_DIR . 'app/format.php';\n\trequire_once QA_INCLUDE_DIR . 'db/messages.php';\n\n\t$messageid = qa_db_message_create($userid, $touserid, $content, $format, true);\n\tqa_db_user_recount_posts($touserid);\n\n\tqa_report_event('u_wall_post', $userid, $handle, $cookieid, array(\n\t\t'userid' => $touserid,\n\t\t'handle' => $tohandle,\n\t\t'messageid' => $messageid,\n\t\t'content' => $content,\n\t\t'format' => $format,\n\t\t'text' => qa_viewer_text($content, $format),\n\t));\n\n\treturn $messageid;\n}", "public function future_to_published($post) {\n\t\t\n\t\tdefine(\"WPU_JUST_POSTED_{$postID}\", TRUE);\n\t\t$this->handle_new_post($post->ID, $post, true);\n\t}", "function create_post()\n {\n //Create the post with information submitted\n if(isset($_POST['note-text']) && !($_POST['note-text'] == \"\"))\n {\n $query = $this->pdo->prepare('INSERT INTO note (title, description, created_at, updated_at) VALUES(:title,:description, NOW(), NOW())');\n $query->execute(array(\n ':title' => $_POST['note-title'],\n ':description' => $_POST['note-text']\n ));\n }\n }", "public function handle_new_post($postID, $post, $future=false) {\n\t\tglobal $phpbbForum;\n\t\t\n\t\tif( (!$future) && (defined(\"WPU_JUST_POSTED_{$postID}\")) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$did_xPost = false;\n\n\t\tif (($post->post_status == 'publish' ) || $future) { \n\t\t\tif (!defined('suppress_newpost_action')) { //This should only happen ONCE, when the post is initially created.\n\t\t\t\tupdate_user_meta($post->post_author, 'wpu_last_post', $postID); \n\t\t\t} \n\n\t\t\tif ( $this->get_setting('integrateLogin') ) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Update blog link column\n\t\t\t\t/**\n\t\t\t\t * @todo this doesn't need to happen every time\n\t\t\t\t */\t\t\t\n\t\t\t\tif(!$phpbbForum->update_blog_link($post->post_author)) {\n\t\t\t\t\twp_die(__('Error accessing the phpBB database when updating Blog ID', 'wp-united'));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( (($phpbbForum->user_logged_in()) || $future) && ($this->get_setting('xposting')) ) {\n\t\t\t\t\t$did_xPost = $this->xPoster->do_crosspost($postID, $post, $future);\n\t\t\t\t} \n\n\t\t\t\tdefine('suppress_newpost_action', TRUE);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public function run()\n\t{\n $admin = User::whereUsername('admin')->firstOrFail();\n $user1 = User::whereUsername('user1')->firstOrFail();\n\n $post = BlogPost::create([\n 'title' => 'Hello world',\n 'slug' => Str::slug('Hello world'),\n 'content' => 'Welcome to tso-nf.com my friend, enjoy your stay',\n 'user_id' => $admin->id\n ]);\n\n BlogComment::create([\n 'post_id' => $post->id,\n 'content' => 'I will!',\n 'user_id' => $user1->id\n ]);\n\t}", "public function blogPosts()\n\t{\n\t\t$auth = $this->ensureAuthed();\n\t\t$output = Output::getInstance();\n\t\t$feeds = Feeds::getInstance();\n\n\t\t$urls = $feeds->getValidURLs();\n\n\t\t$posts = array();\n\t\tforeach ($urls as $url => $user)\n\t\t{\n\t\t\t$teams = $auth->getTeams($user);\n\t\t\tif (count($teams) > 0)\n\t\t\t{\n\t\t\t\t$author = $auth->displayNameForTeam($teams[0]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$author = $user;\n\t\t\t}\n\t\t\t$msgs = Feeds::getRecentPosts($url, 3, $author);\n\t\t\t$posts = array_merge($posts, $msgs);\n\t\t}\n\t\t$output->setOutput('posts', $posts);\n\t\treturn true;\n\t}", "function _publish_post_hook($post_id)\n {\n }", "public function run()\n {\n for($i=0; $i<10; $i++){\n $new_post= new Post();\n $new_post->title = \"Post numero: \" .($i + 1);\n $new_post->slug = Str::slug($new_post->title, '-');\n $new_post->content= ($i + 1). \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Praesentium exercitationem veritatis, cumque eligendi similique, \n itaque sint eaque alias illo consequuntur nesciunt repellat laudantium eveniet quae voluptate reprehenderit error odit necessitatibus?\";\n $new_post->save();\n }\n }", "public function run()\n {\n for ($i=0; $i < 10; $i++) { \n \n $new_post = new Post();\n $new_post->title = \"Titolo post \".($i + 1); \n $new_post->slug = Str::slug($new_post->title, '-');\n $new_post->content = ($i + 1) . \" Lorem ipsum dolor sit amet consectetur adipisicing elit. Dignissimos assumenda eos dolore minus cumque vel quaerat omnis sapiente? Repellendus similique mollitia ad quod cupiditate praesentium a quas unde adipisci ut.\"; \n $new_post->save(); \n }\n }", "public function NewCommentEpisode(){\r\n $this->comment();\r\n $this->pseudoPost();\r\n $this->contentPost();\r\n $this->_commentManager->AddComment($this->_pseudoPostSecure, $this->_contentPostSecure, $_GET['id'],false,true); \r\n header('location: Episode&id='.$_GET[\"id\"]); \r\n }", "function bp_activity_action_post_update() {\n\n\t// Do not proceed if user is not logged in, not viewing activity, or not posting\n\tif ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'post' ) )\n\t\treturn false;\n\n\t// Check the nonce\n\tcheck_admin_referer( 'post_update', '_wpnonce_post_update' );\n\n\t// Get activity info\n\t$content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new'] );\n\n\tif ( ! empty( $_POST['whats-new-post-object'] ) ) {\n\t\t$object = apply_filters( 'bp_activity_post_update_object', $_POST['whats-new-post-object'] );\n\t}\n\n\tif ( ! empty( $_POST['whats-new-post-in'] ) ) {\n\t\t$item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );\n\t}\n\n\t// No activity content so provide feedback and redirect\n\tif ( empty( $content ) ) {\n\t\tbp_core_add_message( __( 'Please enter some content to post.', 'buddypress' ), 'error' );\n\t\tbp_core_redirect( wp_get_referer() );\n\t}\n\n\t// No existing item_id\n\tif ( empty( $item_id ) ) {\n\t\t$activity_id = bp_activity_post_update( array( 'content' => $content ) );\n\n\t// Post to groups object\n\t} else if ( 'groups' == $object && bp_is_active( 'groups' ) ) {\n\t\tif ( (int) $item_id ) {\n\t\t\t$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );\n\t\t}\n\n\t// Special circumstance so let filters handle it\n\t} else {\n\t\t$activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );\n\t}\n\n\t// Provide user feedback\n\tif ( !empty( $activity_id ) )\n\t\tbp_core_add_message( __( 'Update Posted!', 'buddypress' ) );\n\telse\n\t\tbp_core_add_message( __( 'There was an error when posting your update, please try again.', 'buddypress' ), 'error' );\n\n\t// Redirect\n\tbp_core_redirect( wp_get_referer() );\n}", "public function create()\n {\n return view('dash.blog.create');\n }", "public function publish() {\n if($this->exists) {\n $post = Post::create($this->getDraftData());\n $this->delete();\n return $post;\n }\n }", "public function actionCreate() {\n $model = new Blog;\n if (!Yii::app()->params['blog_user_auto'])\n $model->scenario = 'bloguser';\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n $model->publish_date = date(\"m/d/Y H:i:s\");\n if (isset($_POST['Blog'])) {\n $model->attributes = $_POST['Blog'];\n $model->createdon = new CDbExpression('NOW()');\n $model->page_address_identifier = CommonFunctions::getUrlFriendlyString($model->title, $model->tableName(), 0, 'blog_id');\n $model->publish_date = (trim($_POST['Blog']['publish_date']) != '' ? date(Yii::app()->params['mysqlDateTimeFormat'], strtotime($_POST['Blog']['publish_date'])) : '');\n //Start a transaction in case something goes wrong\n if (Yii::app()->params['ajaxFileUpload'])\n $model->image = Yii::app()->user->getState(Yii::app()->params['blogajaxImageVar']);\n $transaction = $model->dbConnection->beginTransaction();\n try {\n //Save the model to the database\n if ($model->save()) {\n /* $fileurl = $model->blogImgBehavior->FileUrl;\n $filename = substr($fileurl,strrpos($fileurl, \"/\")+1);\n CommonFunctions::updateFileField($filename,$model->blog_id,'blog_id','image',$model->tableName()); */\n $file_name = CUploadedFile::getInstance($model, 'image');\n if ($file_name !== null) {\n $fileurl = $model->blogImgBehavior->FileUrl;\n $filemask = substr($fileurl, strrpos($fileurl, \"/\") + 1);\n CommonFunctions::updateFileField($filemask, $model->blog_id, 'blog_id', 'image', $model->tableName(), 'image_name_date', $file_name);\n }\n //update page identifier\n if (substr($model->page_address_identifier, -2) == '-0') {\n CommonFunctions::updatePageAddressField($model->tableName(), \"page_address_identifier\", substr($model->page_address_identifier, 0, strlen($model->page_address_identifier) - 1) . $model->blog_id, 'blog_id', $model->blog_id);\n }\n\n $transaction->commit();\n EUserFlash::setSuccessMessage(CommonFunctions::getText(MSG_RECORD_INSERT_SUCCESS));\n $this->redirect(array('admin'));\n }\n } catch (Exception $e) {\n $transaction->rollback();\n Yii::app()->handleException($e);\n $message = $e->getMessage();\n EUserFlash::setErrorMessage($message);\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "function tp_publish_automatic($id, $post) {\r\n\tif ($post->post_status !== 'publish') return;\r\n\r\n\t// check options to see if we need to send to FB at all\r\n\t$options = tp_options();\r\n\tif (!$options['autotweet_flag'] || !$options['autotweet_token'] || !$options['autotweet_secret'] || !$options['publish_text'])\r\n\t\treturn;\r\n\r\n\t// args to send to twitter\r\n\t$args=array();\r\n\r\n\t$args['status'] = tp_get_default_tweet($id);\r\n\r\n\t$args['acc_token'] = $options['autotweet_token'];\r\n\t$args['acc_secret'] = $options['autotweet_secret'];\r\n\r\n\t$resp = tp_do_request('statuses/update',$args, 'post');\r\n\r\n return $resp;\r\n}", "public function new_blogpost($data = false) {\n $this->check_auth();\n $post_data = array(\n 'title' => $data ? $data['title'] : $this->input->post('title'),\n 'short_description' => $data ? $data['short_description'] : $this->input->post('short_description'),\n 'description' => $data ? $data['description'] : $this->input->post('description'),\n 'user_id' => $data ? $data['user_id'] : $this->user_id\n );\n if (is_array($data)) {\n $post_data['publisher_id'] = $data['publisher_id'];\n }\n if (!$post_data['title']) {\n return $this->send_error('NO_TITLE');\n } elseif (!$post_data['short_description']) {\n return $this->send_error('NO_SHORT_DESCRIPTION');\n } elseif (!$post_data['description']) {\n return $this->send_error('NO_DESCRIPTION');\n } elseif (!$_FILES['image']) {\n return $this->send_error('NO_IMAGE');\n }\n foreach ($post_data as $key => $value) {\n $post_data[$key] = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $value);\n }\n $this->load->helper('image_upload');\n if ($img = do_image_upload(config_item('src_path_blog_images'), 10000, 250, 'image')) {\n if (isset($img['error'])) {\n return $this->send_error('ERROR');\n }\n $post_data['image'] = reset($img);\n }\n $this->load->model('blog_posts_model');\n if (!$id = $this->blog_posts_model->insert($post_data)) {\n return $this->error('INSERT_FAIL');\n }\n $this->timeline_model->insert(array('item_id' => $id, 'type' => 'blog_post'));\n $this->event_log();\n return $this->send_success();\n }" ]
[ "0.68137056", "0.64132994", "0.63637364", "0.6353758", "0.62696505", "0.6222222", "0.61442786", "0.59877443", "0.5967703", "0.5925621", "0.5914046", "0.5909623", "0.5892857", "0.5856362", "0.5838192", "0.58232075", "0.58009815", "0.5796611", "0.5778905", "0.5729601", "0.5706916", "0.56978977", "0.56828374", "0.5677552", "0.5659672", "0.56382644", "0.5635459", "0.56292826", "0.56278276", "0.5622431", "0.5599093", "0.5592113", "0.5589948", "0.5588597", "0.55691725", "0.5564492", "0.5562994", "0.5547924", "0.5537099", "0.55328065", "0.5531191", "0.55220795", "0.5509954", "0.5501268", "0.54995525", "0.5496229", "0.5484622", "0.5479182", "0.54733634", "0.54719263", "0.5471529", "0.5467357", "0.5459643", "0.54568744", "0.5450726", "0.54472876", "0.5439702", "0.5439674", "0.5433257", "0.5431956", "0.5427722", "0.541751", "0.54118294", "0.539797", "0.5391347", "0.53842235", "0.5379092", "0.537809", "0.5371577", "0.53692067", "0.5368778", "0.53687704", "0.5361969", "0.53603727", "0.53567857", "0.53550416", "0.5354693", "0.5354382", "0.5351875", "0.5350392", "0.5347525", "0.5346708", "0.5344839", "0.5340896", "0.5332593", "0.53268087", "0.53259265", "0.5317738", "0.5315628", "0.53136563", "0.5311771", "0.53070223", "0.5305321", "0.5304314", "0.5295233", "0.5293714", "0.5290617", "0.52902615", "0.5288129", "0.5286337" ]
0.66869944
1
Send an activity notification if the post being updated matches certain criteria.
public function maybe_notify_updated_post( int $post_id, WP_Post $before, WP_Post $after ) : void { if ( 'publish' !== $before->post_status || 'publish' !== $after->post_status ) { return; } if ( ! $this->is_post_notifiable( $after, 'update' ) ) { return; } $this->notify_blog_post( $after, 'update' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bp_activity_action_post_update() {\n\n\t// Do not proceed if user is not logged in, not viewing activity, or not posting\n\tif ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'post' ) )\n\t\treturn false;\n\n\t// Check the nonce\n\tcheck_admin_referer( 'post_update', '_wpnonce_post_update' );\n\n\t// Get activity info\n\t$content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new'] );\n\n\tif ( ! empty( $_POST['whats-new-post-object'] ) ) {\n\t\t$object = apply_filters( 'bp_activity_post_update_object', $_POST['whats-new-post-object'] );\n\t}\n\n\tif ( ! empty( $_POST['whats-new-post-in'] ) ) {\n\t\t$item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );\n\t}\n\n\t// No activity content so provide feedback and redirect\n\tif ( empty( $content ) ) {\n\t\tbp_core_add_message( __( 'Please enter some content to post.', 'buddypress' ), 'error' );\n\t\tbp_core_redirect( wp_get_referer() );\n\t}\n\n\t// No existing item_id\n\tif ( empty( $item_id ) ) {\n\t\t$activity_id = bp_activity_post_update( array( 'content' => $content ) );\n\n\t// Post to groups object\n\t} else if ( 'groups' == $object && bp_is_active( 'groups' ) ) {\n\t\tif ( (int) $item_id ) {\n\t\t\t$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );\n\t\t}\n\n\t// Special circumstance so let filters handle it\n\t} else {\n\t\t$activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );\n\t}\n\n\t// Provide user feedback\n\tif ( !empty( $activity_id ) )\n\t\tbp_core_add_message( __( 'Update Posted!', 'buddypress' ) );\n\telse\n\t\tbp_core_add_message( __( 'There was an error when posting your update, please try again.', 'buddypress' ), 'error' );\n\n\t// Redirect\n\tbp_core_redirect( wp_get_referer() );\n}", "public function updated(Post $post)\n {\n $post->recordActivity('updated');\n }", "function _sf_send_user_publish_note($new_status, $old_status, $post) {\n\t\tif($post->post_type == 'spot') {\n\t\t\t\n\t\t\t$user = get_user_by('id', $post->post_author);\n\t\t\t\n\t\t\t//// IF THIS POST IS BEING PUBLISHED AND THE AUTHOR IS A SUBMITTER\n\t\t\tif($old_status != 'publish' && $new_status == 'publish' && isset($user->caps['submitter'])) {\n\t\t\t\t\n\t\t\t\t//// SENDS AN EMAIL SAYING HIS POST HAS BEEN SUBMITTED\n\t\t\t\t$message = sprintf2(__(\"Dear %user,\n\t\t\t\t\nThis is to inform you that your submission %title at %site_name has been approved and it is now published.\n\nYou can view it here at %link\n\nKind regards,\nthe %site_name team.\", 'btoa'), array(\n\t\t\t\n\t\t\t\t\t'user' => $user->display_name,\n\t\t\t\t\t'title' => $post->post_title,\n\t\t\t\t\t'site_name' => get_bloginfo('name'),\n\t\t\t\t\t'link' => get_permalink($post->ID),\n\t\t\t\t\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\t$subject = sprintf2(__('Submission approved at %site_name', 'btoa'), array('site_name' => get_bloginfo('name')));\n\t\t\t\t\n\t\t\t\t$headers = \"From: \".get_bloginfo('name').\" <\".get_option('admin_email').\">\";\n\t\t\t\t\n\t\t\t\twp_mail($user->user_email, $subject, $message, $headers);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t///// IF ITS A SPOT\n\t\t\tif($post->post_type == 'spot') {\n\t\t\t\t\n\t\t\t\tif(ddp('future_notification') == 'on' && $old_status != 'publish' && $new_status == 'publish') {\n\t\t\t\t\t\n\t\t\t\t\t//// ALSO CHECKS FOR USER NOTIFICATIONS FOR MATCHING CRITERIA\n\t\t\t\t\tif(function_exists('_sf_check_for_user_notifications_matching_spot')) { _sf_check_for_user_notifications_matching_spot($post->ID); }\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('submission_days') != '' && ddp('submission_days') != '0') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO PENDING IN X AMOUNT OF DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET FOR OUR FEATURED SUBMISSION - AND ITS INDEED FEATURED\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('price_featured_days') != '' && ddp('price_featured_days') != '0' && get_post_meta($post->ID, 'featured', true) == 'on') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO NORMAL SUBMISSION AFTER X DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date_featured($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "protected function check_update_permission($post)\n {\n }", "protected function check_update_permission($post)\n {\n }", "public function handleRestUpdatePost($post)\n {\n if (\"publish\" == $post->post_status) {\n $this->indexPost($post->ID);\n }\n }", "function notify_post($post_id) {\n\n if( ( $_POST['post_status'] == 'publish' ) && ( $_POST['original_post_status'] != 'publish' ) && ( $_POST['post_type'] == 'events' ) ) {\n\n send_event_email($post_id);\n\n }\n\n}", "public function publishPost($POST) {\r\n\t\t$sql = 'UPDATE `posts` SET `post_status` = :post_status\r\n\t\t\t\tWHERE `ID` = :ID AND `post_author` = :post_author LIMIT 1';\r\n\t\t$sth = $this->db->prepare($sql);\r\n\r\n\t\t$ret = $sth->execute(array('ID' => $POST['id'],\r\n\t\t\t\t\t\t\t\t 'post_author' => $GLOBALS['user']['id'],\r\n\t\t\t\t\t\t\t\t 'post_status' => 'publish'));\r\n\r\n\t\tif ($ret) {\r\n\t\t\t$this->putMsg('Successfully published');\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "public function update($post);", "public function updatePost($message, $pos_pk,$notify,$subject,$thr_pk=0)\n\t{\t\n\t\tglobal $ilDB;\n\n\t\t$statement = $ilDB->manipulateF('\n\t\t\tUPDATE frm_posts \n\t\t\tSET pos_message = %s,\n\t\t\t\tpos_subject = %s,\n\t\t\t\tpos_update = %s,\n\t\t\t\tupdate_user = %s,\n\t\t\t notify = %s\n\t\t\tWHERE pos_pk = %s',\n\t\t\tarray(\t'text', \n\t\t\t\t\t'text', \n\t\t\t\t\t'timestamp', \n\t\t\t\t\t'integer', \n\t\t\t\t\t'integer', \n\t\t\t\t\t'integer'\n\t\t\t),\n\t\t\tarray(\t$message,\n\t\t\t\t\t\t$subject,\n\t\t\t\t\t\tdate(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t$_SESSION['AccountId'],\n\t\t\t\t\t\t$notify,\n\t\t\t\t\t\t$pos_pk\n\t\t));\n\t\t\n\t\tif ($thr_pk > 0 &&\n\t\t\t$pos_pk == $this->getFirstPostByThread($thr_pk))\n\t\t{\n\t\t\t$this->updateThread($thr_pk, $subject);\n\t\t}\n\t\t\n\t\t// Change news item accordingly\n\t\tinclude_once(\"./Services/News/classes/class.ilNewsItem.php\");\n\t\t$news_id = ilNewsItem::getFirstNewsIdForContext($this->id,\n\t\t\t\"frm\", $pos_pk, \"pos\");\n\t\tif ($news_id > 0)\n\t\t{\n\t\t\t$news_item = new ilNewsItem($news_id);\n\t\t\t$news_item->setTitle($subject);\n\t\t\t$news_item->setContent(nl2br($this->prepareText($message, 0)));\n\t\t\t$news_item->update();\n\t\t}\n\n\t\treturn true;\t\t\n\t}", "public function update(){\n \n //Validate before updating\n $this->validate([\n 'title'=>'required',\n 'content'=>'required'\n ]);\n \n //Check if the specific record id is submited\n if($this->ids)\n {\n\n $post = Post::find($this->ids);\n\n $post->update([\n 'title' => $this->title,\n 'content' => $this->content,\n ]);\n \n //Set session flash message\n session()->flash('update','Post updated Successfully!');\n \n //Reset the input fields to empty\n $this->resetInputFields();\n \n //Emit To Close Modal after updating\n $this->emit('postUpdated');\n }\n }", "function track_new_or_updated_content( $post_id, $post, $update ) {\n\t// Bail on auto-save.\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\n\tif ( $update ) {\n\t\t$action = 'update';\n\t} else {\n\t\t$action = 'create';\n\t}\n\n\ttrack( [\n\t\t'event' => 'Content',\n\t\t'properties' => [\n\t\t\t'content_type' => $post->post_type,\n\t\t\t'content_action' => $action,\n\t\t],\n\t] );\n}", "function check_and_publish_future_post($post)\n {\n }", "function viewNotification(){\n $sad = $this->session->all_userdata();\n if (!$sad['logged_in'] == true) {\n redirect(base_url());\n }\n\n $data['id'] = $_POST['activity_id'];\n $data['post_id'] = $_POST['post_id'];\n \n // call to the function that performs the update in the database\n $this->Profile_model->update_notification($data);\n\n return true;\n }", "public function update_is_upcoming($post_id){\n global $post;\n if ($post->post_type == $this->slug) {\n $this->is_post_upcoming($post_id);\n }\n }", "public function notify_blog_post( $post, $type ) {\n\t\tif ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$user_id = 'new' === $type ? $post->post_author : get_current_user_id();\n\t\t$user = get_user_by( 'id', $user_id );\n\n\t\t$content = wp_trim_words(\n\t\t\tstrip_shortcodes( has_excerpt( $post ) ? $post->post_excerpt : $post->post_content ),\n\t\t\t55\n\t\t);\n\n\t\t$args = array(\n\t\t\t'action' => 'wporg_handle_activity',\n\t\t\t'type' => $type,\n\t\t\t'source' => 'wordpress',\n\t\t\t'user' => $user->user_login,\n\t\t\t'post_id' => $post->ID,\n\t\t\t'blog' => get_bloginfo( 'name' ),\n\t\t\t'blog_url' => site_url(),\n\t\t\t'post_type' => $post->post_type,\n\t\t\t'title' => get_the_title( $post ),\n\t\t\t'content' => $content,\n\t\t\t'url' => get_permalink( $post->ID ),\n\t\t);\n\n\t\tProfiles\\api( $args );\n\t}", "public function updateStatus()\n\t\t{\n\t\t\t$thingdom = $this->getThingdom();\n\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$page_count = wp_count_posts('page')->publish;\n\t\t\t$post_count = wp_count_posts()->publish;\n\t\t\t$comment_count = wp_count_comments()->approved;\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\t$thing->status('page_count', $page_count);\n\t\t\t$thing->status('post_count', $post_count);\n\t\t\t$thing->status('comment_count', $comment_count);\n\t\t}", "public function update(User $user, Post $post): array|bool\n {\n return $user->ability(roles: 'admin', permissions: 'update_posts');\n }", "public function isUpdated() {}", "public function onPostShowing(Post $post)\n {\n $is_viewed_already=(bool) View::where('user_id', \\Auth::id())\n ->where('post_id', $this->id)\n ->first();\n\n $user = auth()->user();\n if($is_viewed_already == false){\n \\Auth::user()->views()->attach($post->id);\n }\n \n /* $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }*/\n }", "function notify_reviewer( $post_ID, $post, $dowhat='publish' ) {\n\t\t\tglobal $wpdb, $current_user;\n\t\t\t$last_revision = $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_parent=%d AND post_type=%s ORDER BY post_date DESC LIMIT 1\", $post_ID, 'revision' ) );\n\t\t\t$post_content = 'draft' == $dowhat ? get_post( $last_revision ) : get_post( $post_ID );\n\t\t\t$last_mod = $post_content->post_date;\n\t\t\t$post_content = $post_content->post_content;\n\t\t\t$revision_compare_link = admin_url( 'revision.php?action=diff&post_type=' . $post->post_type . '&right=' . $post->ID . '&left=' . $last_revision );\n\t\t\t$body = sprintf( __( \"New changes have been made to \\\"%s\\\" at <%s>. \", $this->text_domain ), $post->post_title, get_permalink( $post->ID ) );\n\t\t\tif( 'draft' == $dowhat ) {\n\t\t\t\t$body .= __( \"The author has requested that you review the new changes and determine whether to remove or approve them. These changes will not appear on the public website until you approve them.\\n\\n\", $this->text_domain );\n\t\t\t} else {\n\t\t\t\t$body .= __( \"The modifications have been published, but the author of the page has requested you be notified of them.\\n\\n\", $this->text_domain );\n\t\t\t}\n\t\t\t$body .= sprintf( __( \"The new content of the page is shown below if you would like to review it. You can also review %s the changes at %s. Thank you. \\n\\n======================================================= \\nRevisions made at %s \\n======================================================= \\n\\n%s\", $this->text_domain ), ( 'draft' == $dowhat ? __( \" and approve/reject \", $this->text_domain ) : '' ), $revision_compare_link, $last_mod, $post_content );\n\t\t\t\n\t\t\t$headers = \"From: {$current_user->display_name} <{$current_user->user_email}>\\r\\n\";\n\t\t\t\n\t\t\twp_mail( $this->reviewers, sprintf( __( '[%s] New modifications to %s' ), get_bloginfo('name'), $post->post_title ), $body, $headers );\n\t\t}", "public function onNewPost(PostEvent $event): bool\n {\n $user = $event->user;\n $badges = Badge::where('type', 'onNewPost')->get();\n\n $collection = $badges->filter(function ($badge) use ($user) {\n return $badge->rule <= $user->discuss_post_count;\n });\n\n $result = $user->badges()->syncWithoutDetaching($collection);\n\n return $this->sendNotifications($result, $badges, $user);\n }", "public function action_post_update_status( $post, $oldvalue, $newvalue )\n\t{\n\t\tif ( is_null( $oldvalue ) ) return;\n\t\tif ( $newvalue == Post::status( 'published' ) && $post->content_type == Post::type('entry') && $newvalue != $oldvalue ) {\n\t\t\tif ( Options::get( 'statusnet__post_status' ) == '1' ) {\n\t\t\t\t$user = User::get_by_id( $post->user_id );\n\t\t\t\tif ( ! empty( $user->info->statusnet_name ) && ! empty( $user->info->statusnet_pass ) ) {\n\t\t\t\t\t$name = $user->info->statusnet_name;\n\t\t\t\t\t$pw = $user->info->statusnet_pass;\n\t\t\t\t} else {\n\t\t\t\t\t$name = Options::get( 'statusnet__username' );\n\t\t\t\t\t$pw = Options::get( 'statusnet__password' );\n\t\t\t\t}\n\t\t\t\t$svcurl = 'http://' . Options::get('statusnet__svc') . '/api/statuses/update.xml';\n\t\t\t\t$this->post_status( $svcurl, Options::get( 'statusnet__prefix' ) . $post->title . ' ' . $post->permalink, $name, $pw );\n\t\t\t}\n\t\t}\n\t}", "public function onPostShowing(Post $post)\n {\n $user = auth()->user();\n if (!isAdmin($user)) {\n $post->increment('view_count');\n }\n if (auth()->check()) {\n $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Model\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }\n }\n }", "public function updatePost(User $user, Post $post)\n {\n return $user->id === $post->user_id;\n }", "public function update(array $data, array $where) {\n\t\tif (! isset($where['ID']) && ! isset($data['ID'])) {\n\t\t\tthrow new RuntimeException(\"Missing Post ID\");\n\t\t}\n\t\treturn (bool)wp_update_post(array_merge(array(), $where, $data));\n\t }", "private function Update() {\n $Update = new Update;\n $Update->ExeUpdate(self::Entity, $this->Data, \"WHERE id = :id\", \"id={$this->Post}\");\n if ($Update->getResult()):\n $this->Error = [\"As informações de <b>contato</b> foram atualizadas com sucesso!\", WS_ACCEPT];\n $this->Result = true;\n endif;\n }", "public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'channel_id', 'link', 'start_time', 'end_time','hits', 'status'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Gou_Service_Notice::updateNotice($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}", "public function onUpdate( $mode, $link_id, $forum_id, $topic_id, $post_id = 0 ) {\n\t\treturn true;\n\t}", "public function onPostShowing(Post $post)\n {\n $user = auth()->user();\n if (!isAdmin($user)) {\n $post->increment('view_count');\n }\n\n if (auth()->check()) {\n $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }\n }\n }", "public function hasUpdates();", "public function update(Users $user, Posts $posts)\n {\n return true; //$user->id === $posts->user_id;\n }", "function _update_blog_date_on_post_publish($new_status, $old_status, $post)\n {\n }", "public function hasUpdate();", "public function updated(BlogPost $modelsBlogPost)\n {\n //\n }", "public function maybe_notify_new_published_post( $new_status, $old_status, $post ) {\n\t\tif ( 'publish' != $new_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $old_status == $new_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->is_post_notifiable( $post, 'publish' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->notify_blog_post( $post, 'new' );\n\t}", "public function controllerActionPredispatch($observer)\n {\n // Run the feed\n Mage::getModel('googleplusone/feed')->updateIfAllowed();\n }", "public function updatePost($data)\n {\n $this->db->query('UPDATE posts SET title = :title, text = :body\n WHERE id = :id');\n $this->db->bind(':id', $data['id']);\n $this->db->bind(':title', $data['title']);\n $this->db->bind(':body', $data['body']);\n if ($this->db->execute())\n return true;\n else\n return false;\n }", "function send_webhook( $post_id, $post, $update ) {\n \t\t\t// Return if build hook isnt set\n \t\t\tif (!is_string($this->BUILD_HOOK_URL) && strlen($this->BUILD_HOOK_URL) === 0) { return; }\n\n\t\t // Don't fire on blank posts\n\t\t\tif (isset($post->post_status) && $post->post_status == 'published') { return; }\n\n\t\t\t// Only run in production\n\t\t\tif (defined('WP_ENV') && WP_ENV !== 'production') { return; }\n\n\t\t\t$client = new \\GuzzleHttp\\Client();\n\t\t\t$response = $client->post($this->BUILD_HOOK_URL);\n\t\t}", "public static function munim_update_estimate_status() {\n\t\t// Get all issued estimate.\n\t\t$args = array(\n\t\t\t'post_type' => 'munim_estimate',\n\t\t\t'post_status' => 'publish',\n\t\t\t'numberposts' => -1,\n\t\t);\n\n\t\t$estimates = get_posts( $args );\n\n\t\tif ( $estimates ) {\n\t\t\t// Get validity period.\n\t\t\t$munim_settings_estimate = get_option( 'munim_settings_estimate', [] );\n\t\t\t$validity_peroid = trim( $munim_settings_estimate['validity'] );\n\n\t\t\t// Update status.\n\t\t\tforeach ( $estimates as $estimate ) {\n\t\t\t\t$estimate_date = $estimate->munim_estimate_date;\n\t\t\t\t// Check if today is more then estimate date + validity peroid.\n\t\t\t\tif ( time() > strtotime( sprintf( '+%s days', $validity_peroid ), $estimate_date ) ) {\n\t\t\t\t\t$post = array(\n\t\t\t\t\t\t'ID' => $estimate->ID,\n\t\t\t\t\t\t'post_status' => 'invalid',\n\t\t\t\t\t);\n\t\t\t\t\twp_update_post( $post );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function markThread(PostRepositoryInterface $post): PodiumResponse;", "function wpachievements_wordpress_post($pid, $status){\r\n if( !empty($pid) ){\r\n $pdata = get_post( $pid );\r\n if( $pdata->post_author && $pdata->post_type == 'post' ){\r\n if(function_exists('is_multisite') && is_multisite()){\r\n $post_count = (int)get_blog_option(1, 'wpachievements_post_min_count');\r\n $post_deduct = (int)get_blog_option(1, 'wpachievements_post_min_deduct');\r\n } else{\r\n $post_count = (int)get_option('wpachievements_post_min_count');\r\n $post_deduct = (int)get_option('wpachievements_post_min_deduct');\r\n }\r\n if( empty($post_count) || $post_count < 1 ){\r\n $post_count = 1;\r\n }\r\n $uid=$pdata->post_author; $postid=$pid;\r\n if( !empty($post_count) && $post_count > 0 ){\r\n if( str_word_count($pdata->post_content) >= $post_count ){\r\n $type='post_added';\r\n if( !function_exists(WPACHIEVEMENTS_CUBEPOINTS) && !function_exists(WPACHIEVEMENTS_MYCRED) ){\r\n if(function_exists('is_multisite') && is_multisite()){\r\n $points = (int)get_blog_option(1, 'wpachievements_post_points');\r\n } else{\r\n $points = (int)get_option('wpachievements_post_points');\r\n }\r\n }\r\n if(empty($points)){$points=0;}\r\n wpachievements_new_activity($type, $uid, $postid, $points);\r\n } else{\r\n $type='post_added_bad';\r\n if( !empty($post_deduct) && $post_deduct > 0 ){\r\n $points=$post_deduct;\r\n } else{\r\n $points=0;\r\n }\r\n if(empty($points)){$points=0;}\r\n wpachievements_new_activity($type, $uid, $postid, -$points);\r\n }\r\n } else{\r\n $type='post_added';\r\n if( !function_exists(WPACHIEVEMENTS_CUBEPOINTS) && !function_exists(WPACHIEVEMENTS_MYCRED) ){\r\n if(function_exists('is_multisite') && is_multisite()){\r\n $points = (int)get_blog_option(1, 'wpachievements_post_points');\r\n } else{\r\n $points = (int)get_option('wpachievements_post_points');\r\n }\r\n }\r\n if(empty($points)){$points=0;}\r\n wpachievements_new_activity($type, $uid, $postid, $points);\r\n }\r\n }\r\n }\r\n }", "public function postReadAllNotification () {\n $owner_id = Auth::user()->id;\n\n $readAll = PosteNotification::where('owner_id', $owner_id)->update(['status' => 1]);\n if ($readAll) {\n return 1;\n }\n return 0;\n }", "public function iN_UpdatePostWhoCanSee($userID, $postID, $WhoCS) {\n\t\t$userID = mysqli_real_escape_string($this->db, $userID);\n\t\t$postID = mysqli_real_escape_string($this->db, $postID);\n\t\t$WhoCS = mysqli_real_escape_string($this->db, $WhoCS);\n\t\tif ($this->iN_CheckUserExist($userID) == '1' && $this->iN_CheckPostIDExist($postID) == '1') {\n\t\t\tif ($this->iN_CheckIsAdmin($userID) == 1) {\n\t\t\t\t$updateNotificationUser = mysqli_query($this->db, \"UPDATE i_posts SET who_can_see = '$WhoCS' WHERE post_id = '$postID'\") or die(mysqli_error($this->db));\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$updateNotificationUser = mysqli_query($this->db, \"UPDATE i_posts SET who_can_see = '$WhoCS' WHERE post_owner_id = '$userID' AND post_id = '$postID'\") or die(mysqli_error($this->db));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function update(Request $request,Post $post)\n {\n if($this->runCheck($request, $post)){\n $post->update($request->all());\n };\n }", "public function edit_postAction() {\n\t\t$info = $this->getPost(array('id', 'status'));\n\t\t$ret = Activity_Service_ShareQq::update($info, intval($info['id']));\n\t\tif (!$ret) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功.');\n\t}", "protected function performPostUpdateCallback()\n {\n // echo 'updated a record ...';\n return true;\n }", "public function postHandler($new_status, $old_status, $post)\n\t\t{\n\t\t\t$thingdom = $this->getThingdom();\n\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$post_title = $post->post_title;\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\tif($post->post_type == 'post' && $this->settings['posts'] == 1 && ($new_status == 'publish' && $old_status != 'publish')) {\n\t\t\t\t$thing->feed('new_post', \"New post published: {$post_title}\");\n\t\t\t} else if($post->post_type == 'page' && $this->settings['pages'] == 1 && ($new_status == 'publish' && $old_status != 'publish')) {\n\t\t\t\t$thing->feed('new_page', \"New page published: {$post_title}\");\n\t\t\t} else if($post->post_type == 'post' && $this->settings['posts_update'] == 1 && ($new_status == 'publish' && $old_status == 'publish')) {\n\t\t\t\t$thing->feed('update_post', \"Post Updated: {$post_title}\");\n\t\t\t} else if($post->post_type == 'page' && $this->settings['pages_update'] == 1 && ($new_status == 'publish' && $old_status == 'publish')) {\n\t\t\t\t$thing->feed('update_page', \"Page Updated: {$post_title}\");\n\t\t\t}\n\t\t}", "public function updated(Post $post)\n {\n //\n $user = $this->userRepository->find($post->user_id, 'name');\n\n $body = [\n 'title' => $post->title,\n 'content' => $post->content,\n 'username' => $user ? $user->name : __('app.anonymous'),\n ];\n\n $this->postElasticSearch->updateDoc($post->id, $body);\n }", "private function updatePostIfChanged($post)\n {\n if (! self::shouldUpdateStatus($post['status'], $this->postData['status'])) {\n info('No changes to update for post', ['post' => $post['id']]);\n\n return $post;\n }\n\n $post = app(Rogue::class)->updatePost($post['id'], ['status' => $this->postData['status']]);\n\n info('Updated post', ['post' => $post['id'], 'status' => $post['status']]);\n\n return $post;\n }", "public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }", "function block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post ) {\n\t\tif ( $new_status === $old_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'post' !== get_post_type( $post ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'publish' !== $new_status && 'publish' !== $old_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tblock_core_calendar_update_has_published_posts();\n\t}", "private function notify_new_approved_comment( $comment, $post ) {\n\t\tif ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $comment->user_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $user = get_user_by( 'id', $comment->user_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$args = array(\n\t\t\t'action' => 'wporg_handle_activity',\n\t\t\t'source' => 'wordpress',\n\t\t\t'user' => $user->user_login,\n\t\t\t'comment_id' => $comment->comment_ID,\n\t\t\t'content' => get_comment_excerpt( $comment ),\n\t\t\t'title' => get_the_title( $post ),\n\t\t\t'blog' => get_bloginfo( 'name' ),\n\t\t\t'blog_url' => site_url(),\n\t\t\t'url' => get_comment_link( $comment ),\n\t\t);\n\n\t\tProfiles\\api( $args );\n\t}", "function _update_blog_date_on_post_publish( $new_status, $old_status, $post ) {\n\t$post_type_obj = get_post_type_object( $post->post_type );\n\tif ( ! $post_type_obj || ! $post_type_obj->public ) {\n\t\treturn;\n\t}\n\n\tif ( 'publish' != $new_status && 'publish' != $old_status ) {\n\t\treturn;\n\t}\n\n\t// Post was freshly published, published post was saved, or published post was unpublished.\n\n\twpmu_update_blogs_date();\n}", "public function update(Customer $customer, Post $post)\n {\n return $customer->id === $post->customer_id;\n }", "function block_core_calendar_update_has_published_post_on_transition_post_status($new_status, $old_status, $post)\n {\n }", "protected function canUpdateStatus() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $this->getEmptyComment());\n }", "public function update(User $user, Post $post);", "function wpgnv_mail_on_post( $post_id ) {\n\tif ( 'pending' == get_post_status( $post_id ) ) {\n\t\t$post_title = get_the_title( $post_id );\n\t\t$subject = 'A new Idea has been submitted on wpgnv.com!';\n\t\t$message = \"Please moderate this Idea as soon as possible.\\n\\n\";\n\t\t$message .= \"TITLE: $post_title \\n\\n\";\t\n\t\t$message .= \"Link: http://wpgnv.com/wp-admin\";\n\t\t//$message = get_post_status( $post_id );\n\t\twp_mail( '[email protected]', $subject, $message );\n\t\twp_mail( '[email protected]', $subject, $message );\n\t\twp_mail( '[email protected]', $subject, $message );\n\t}\n}", "public function updateSubmissionStatus() {\n\n $updateStatus = Usersubmissionstatus::where('user_id', Auth::user()->id)\n ->where('quarter_id', Quarter::getRunningQuarter()->id)\n ->update(['status_id' => config('constant.status.L1_APPROVAL_PENDING')]);\n // Let's notify user and L1 about user submission status.\n return $this->sendMail(config('constant.email_status.INFORM_APPRAISEE'));\n }", "function update_thread_timestamp($thread) {\n $posts = BoincPost::enum(\"thread=$thread->id and hidden=0 order by timestamp desc limit 1\");\n if (count($posts)>0) {\n $post = $posts[0];\n $thread->update(\"timestamp=$post->timestamp\");\n }\n}", "public function publish(Post $post)\n\t{\n\t\t$q = \"UPDATE in_posts \";\n\t\t$q .= \"SET publish_flag=1, read_length=:read_length, publish_time=Now() WHERE id=:post_id\";\n\t\t$vars = array(\n\t\t\t':read_length'=>$post->read_length,\n\t\t\t':post_id'=>$post->id\n\t\t);\n\t\t//$this->logger->logInfo($q);\n\t\t$ps = $this->execute($q, $vars);\n\t}", "public function checkOrdersForUpdateCheckouts()\n {\n $orderCollection = Mage::getModel(\"sales/order\")->getCollection();\n\n //get current timestamp\n $nowTime = new DateTime(null, new DateTimeZone(\"UTC\"));\n $nowTimestamp = $nowTime->getTimestamp();\n\n foreach ($orderCollection as $order) {\n $isTriggered = $order->getUrbitTriggered();\n\n if (isset($isTriggered) && $isTriggered == 'false') {\n $orderUpdateCheckoutTime = $order->getUrbitUpdateCheckoutTime();\n\n if (isset($orderUpdateCheckoutTime) && $orderUpdateCheckoutTime != \"\" && (int)$orderUpdateCheckoutTime <= $nowTimestamp) {\n $this->sendUpdateCheckout($order->getId());\n $order->setData('urbit_triggered', 'true');\n $order->save();\n }\n }\n }\n }", "public function LikePost($id)\n {\n //\n $user = PostController::GetUserByPostId($id);\n if(Auth::guest())\n return false;\n $past = Like::where(['type' => 'post', 'user_id' => Auth::user()->id, 'post_id' => $id])->get();\n\n if($past->count() > 0)\n return false;\n\n if($user == Auth::user()->id)\n return false;\n\n $like = new Like;\n $like->user_id = Auth::user()->id;\n $like->post_id = $id;\n $like->type = 'post';\n $like->save();\n\n NotificationController::store($user, $like);\n\n return 1;\n }", "public function actionWouldSeeUpdate(){\n\t\t$data = Put::get();\n\t\t$token = F3::get('GET.token');\n\n\t\t$getToken = $this->model_users->getToken($token);\n\n\t\tif (!empty($getToken)):\n\n\t\t\tif (!empty($data['user']) && !empty($data['movie'])):\n\t\t\t\t$this->model_likes->updateWouldSee($data['user'], $data['movie'], $statut = 'delete');\n\t\t\t\tApi::response(200, 'Movie updated would see to no would see');;\n\t\t\telse:\n\t\t\t\tApi::response(204, 'No movie');\n\t\t\tendif;\n\n\t\telseif (empty($token)):\n\t\t\tApi::response(401, 'Hum... you need a token');\n\t\telse:\n\t\t\tApi::response(403, 'Invalid token');\n\t\tendif;\n\t}", "public function update() {\n $this->post->update($this->post_params());\n\n if ($this->post->is_valid()) {\n $flash = ['notice' => 'Saved Successfully'];\n } else {\n $flash = ['error' => $this->post->errors_as_string()];\n }\n\n redirect('/backend/posts/edit', $flash, ['id' => $this->post->id]);\n }", "public function updateNotification($tokens){\n $params = array(\n \"read\" => 1 \n ); \n\n $this->db->where('results_token', $tokens);\n if ($this->db->update('chat_tbl', $params) !== FALSE)\n return true; \n return false;\n }", "public function handleFutureToPublish($post) {\n if (\"publish\" == $post->post_status) {\n $this->indexPost($post->ID);\n }\n }", "public function existsfeedupdatesAction()\n {\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // get GET/POST paramter\n $r = $this->_request->getParam('r');\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the subscription id from storage with use of the resource uri\n $subscriptionId = $subscriptionStorage->getSubscriptionIdByResourceUri($r);\n\n // if the subscription id isn't empty\n if (false !== $subscriptionId) {\n //get the erfurt cache dir\n $cacheFiles = scandir($this->_owApp->erfurt->getTmpDir());\n\n // search thrue the cahce dir to find filename with the subscription id\n foreach ($cacheFiles as $filename) {\n if (false !== strpos($filename, 'pubsub_'.$subscriptionId .'_')) {\n // if filename found output 'true' end return\n echo \"true\";\n return;\n }\n }\n }\n\n // if no filname with the subscrition id found or no subscription id was found\n // make output false\n echo \"false\";\n }", "public function update(User $user, Post $post)\n {\n return $user->isAuthorOf($post) || $user->isAdmin();\n }", "function _update_posts_count_on_transition_post_status( $new_status, $old_status, $post = null ) {\n\tif ( $new_status === $old_status ) {\n\t\treturn;\n\t}\n\n\tif ( 'post' !== get_post_type( $post ) ) {\n\t\treturn;\n\t}\n\n\tif ( 'publish' !== $new_status && 'publish' !== $old_status ) {\n\t\treturn;\n\t}\n\n\tupdate_posts_count();\n}", "public function update(User $user, Announcement $announcement)\n {\n return $user->hasPermission('announcements.update');\n }", "public function acfPostObjectStatus($args, $field, $post_id)\n {\n $args['post_status'] = 'publish';\n return $args;\n }", "public function actionMarkUpdated() \r\n {\r\n extract($_POST);\r\n $res=0;\r\n $searchCriteria=new CDbCriteria;\r\n $deedMaster= DeedMaster::model()->findByPk($DeedID);\r\n $deedMaster->ArchiveUpdate = True;\r\n if($deedMaster->save()) $res=1;\r\n \r\n print CJSON::encode($res);\r\n }", "function owa_editPostActionTracker($post_id, $post) {\r\n\t\r\n\t// we don't want to track autosaves...\r\n\tif(wp_is_post_autosave($post)) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t$owa = owa_getInstance();\r\n\t$label = $post->post_title;\r\n\t$owa->trackAction('wordpress', $post->post_type.' edited', $label);\r\n}", "function wp_is_auto_update_forced_for_item($type, $update, $item)\n {\n }", "public function update_social_media_post() {\n $user = \\Drupal::currentUser();\n $current_uid = isset($_GET['team']) ? $_GET['muid'] : \\Drupal::currentUser()->id();\n $uid = \\Drupal::request()->get('uid');\n $response = [];\n if ($current_uid == $uid) {\n $sid = \\Drupal::request()->get('sid');\n $action = \\Drupal::request()->get('action');\n $media_kit_id = \\Drupal::request()->get('media_kit_id');\n $text = \\Drupal::request()->get('text');\n $status = \\Drupal::request()->get('status');\n $ufid = \\Drupal::request()->get('ufid');\n $page_id = \\Drupal::request()->get('page_id');\n if ($action == 'schedule') {\n $schedule_type = \\Drupal::request()->get('schedule_type');\n if ($schedule_type == 'manual_check') {\n $manual_datetime = \\Drupal::request()->get('manual_datetime');\n //convert manual_datetime to utc timestamp\n if ($manual_datetime) {\n $user = \\Drupal::currentUser();\n $date = new DrupalDateTime($manual_datetime, new \\DateTimeZone($user->getTimeZone()));\n $date->setTimezone(new \\DateTimeZone('utc'));\n $manual_datetime = strtotime($date->format('Y-m-d H:i:s'));\n }\n }\n $result = \\Drupal::database()->update('social_media')->fields(['text' => $text, 'page_id' => $page_id, 'schedule_type' => $schedule_type, 'scheduled_timestamp' => $manual_datetime])->condition('uid', $uid, '=')->condition('id', $sid, '=')->execute();\n $response['result'] = 1;\n } else {\n $scheduled_bubble = \\Drupal::request()->get('scheduled_bubble');\n $sm_post_id = NULL;\n $mids = $_POST['mid'];\n $post_data = [];\n $post_data['message'] = $text;\n $post_data['mids'] = $mids;\n $sm = \\Drupal::database()->select('social_media', 'sm')->fields('sm', ['id', 'page_id', 'social_media_name', 'schedule_type', 'scheduled_timestamp', 'status', 'sm_post_id'])->condition('sm.uid', $uid, '=')->condition('id', $sid, '=')->execute()->fetchObject();\n if (!empty($sm)) {\n $social_media_name = $sm->social_media_name;\n $schedule_type = $sm->schedule_type;\n $manual_datetime = $sm->scheduled_timestamp;\n //posts published immediatelly\n $is_published = 0;\n if ($status == 'Post') {\n $user = \\Drupal::currentUser();\n $date = new DrupalDateTime('now', new \\DateTimeZone($user->getTimeZone()));\n $date->setTimezone(new \\DateTimeZone('utc'));\n $manual_datetime = strtotime($date->format('Y-m-d H:i:s'));\n if ($social_media_name == 'Facebook') {\n if ($sm->status == 'Scheduled' && isset($sm->sm_post_id)) {\n $this->fbPostOperation($sm->page_id, $sm->sm_post_id, 'delete');\n }\n $post_data['scheduled_publish_time'] = 0;\n $response = $this->facebook_post_publish($page_id, $post_data, $uid);\n if (array_key_exists(\"id\", $response)) {\n $is_published = 1;\n $sm_post_id = $response['id'];\n }\n }\n if ($social_media_name == 'Twitter') {\n $response = $this->twitter_tweet_publish($post_data, $uid);\n if ($response) {\n $is_published = 1;\n $sm_post_id = $response;\n } else {\n $response_message = \"error\";\n \\Drupal::logger('Social media twitter')->error('<pre><code>' . print_r($response_message, true) . '</code></pre>');\n }\n }\n if ($social_media_name == 'Instagram') {\n $response = $this->instagram_publish_media($page_id, $post_data, $uid);\n if (array_key_exists(\"id\", $response)) {\n $is_published = 1;\n $sm_post_id = $response['id'];\n }\n }\n \\Drupal::database()->update('social_media')->fields(['text' => $text, 'status' => $status, 'media_kit_id' => $media_kit_id, 'page_id' => $page_id, 'is_published' => $is_published, 'mids' => implode(',', $mids), 'sm_post_id' => $sm_post_id, 'scheduled_timestamp' => $manual_datetime, 'scheduled_bubble' => $scheduled_bubble])->condition('uid', $uid, '=')->condition('id', $sid, '=')->execute();\n } elseif ($status == 'Scheduled') {\n if ($social_media_name == 'Facebook') {\n //if post was already sheduled i.e re-sceduled, delete old post and create new post Facebook server.\n if ($sm->status == 'Scheduled' && isset($sm->sm_post_id)) {\n $this->fbPostOperation($sm->page_id, $sm->sm_post_id, 'delete');\n }\n $date = new DrupalDateTime(date('d-m-Y h:i A', $sm->scheduled_timestamp), new \\DateTimeZone('utc'));\n $date->setTimezone(new \\DateTimeZone($user->getTimeZone()));\n $user_timestamp = strtotime($date->format('Y-m-d H:i:s'));\n $post_data['scheduled_publish_time'] = $user_timestamp;\n $response = $this->facebook_post_publish($page_id, $post_data, $uid);\n if (array_key_exists(\"id\", $response)) {\n $sm_post_id = $response['id'];\n }\n }\n \\Drupal::database()->update('social_media')->fields(['text' => $text, 'status' => $status, 'media_kit_id' => $media_kit_id, 'page_id' => $page_id, 'is_published' => $is_published, 'mids' => implode(',', $mids), 'sm_post_id' => $sm_post_id, 'scheduled_bubble' => $scheduled_bubble])->condition('uid', $uid, '=')->condition('id', $sid, '=')->execute();\n } else {\n if ($social_media_name == 'Facebook') {\n if ($sm->status == 'Scheduled') {\n $this->fbPostOperation($sm->page_id, $sm->sm_post_id, 'delete');\n }\n }\n \\Drupal::database()->update('social_media')->fields(['text' => $text, 'status' => $status, 'media_kit_id' => $media_kit_id, 'page_id' => $page_id, 'is_published' => $is_published, 'mids' => implode(',', $mids), 'sm_post_id' => $sm_post_id, 'scheduled_bubble' => $scheduled_bubble])->condition('uid', $uid, '=')->condition('id', $sid, '=')->execute();\n }\n $response['result'] = 1;\n }\n }\n } else {\n $response['result'] = \"unauthorized user\";\n }\n $json_response = json_encode($response);\n return new JsonResponse($json_response);\n }", "public function postUpdated($post_id, $post_after, $post_before)\n {\n\n // only generate a new sitemap if the post is being published\n if (($post_before->post_status != \"publish\")\n && ($post_after->post_status == 'publish')\n ) {\n\n $this->generateSitemap();\n\n }\n\n }", "function dataUpdatePublishStatus($p_id, $p_update_status)\n {\n $result_update = false;\n \n $sql = 'UPDATE user SET ';\n \n if ($p_update_status == 1)\n {\n $sql .= 'isactive = 1 ';\n } else {\n $sql .= 'isactive = 0 ';\n }\n\n $sql .= 'WHERE id = ? ';\n\n $paramtype = 'i';\n \n $paramdata = array(\n 'id' => $p_id \n );\n \n parent::stmtPrepare($sql); \n\n parent::stmtSetParamTypeString($paramtype);\n parent::stmtSetParamData($paramdata);\n parent::stmtBindParam();\n \n parent::stmtExecute();\n $result = parent::stmtGetTotalAffectedRows();\n \n if ($result > 0)\n {\n $result_update = '1';\n }\n\n parent::stmtReset(); \n parent::stmtClose(); \n \n return $result_update; \n }", "public function update(PostsRequest $request, $id)\n {\n $post = Post::findOrFail($id);\n $post->title = $request->title;\n $post->body = $request->body;\n if ($request->hasFile('image')) {\n if (file_exists(public_path('uploads/' . $post->image))) {\n @unlink(public_path('uploads/' . $post->image));\n }\n $post->image = UploadImages('posts', $request->file('image'));\n }\n $post->slug = $request->slug;\n $post->later_publish = $request->later_publish;\n if ($request->later_publish == 'yes') {\n $post->publish_date = $request->publish_date;\n $post->publish_time = $request->publish_time;\n $post->status = 'pending';\n } else {\n if (userCan('Change Posts Status')) {\n $post->status = $request->status;\n }\n }\n $post->user_id = auth()->user()->id;\n $post->save();\n\n @$post->tags_table()->delete();\n\n foreach ($request->tags as $t) {\n if (Tag::find($t)) {\n $post_tag = new PostTags;\n $post_tag->post_id = $post->id;\n $post_tag->tag_id = $t;\n $post_tag->save();\n }\n }\n\n // if ($post->status == 'approved') {\n // $ids = UserSubscribedTags::whereIn('tag_id', $request->tags)->get()->pluck('user_id')->toArray();\n //\n // foreach (User::findMany($ids) as $user) {\n // Notification::send($user, new NewPostAdded($post));\n // }\n // }\n\n session()->flash('success', trans('main.updated'));\n return redirect()->route('posts.show', [$post->id]);\n }", "public function publish(Request $request){\n $id = $request->id;\n $partner = Partner::where('id', $id)->get()->first();\n $new['status'] = 1 - $partner->status;\n Partner::where('id', $id)->update($new);\n if($new['status'] == 1) {\n Session::flash('flash_success', 'Partner has been Published successfully'); \n }else {\n Session::flash('flash_success', 'Partner has been Unpublished successfully'); \n } \n echo \"success\";\n }", "public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }", "public function updateStatusOnNewDay() {\n // Update advs\n UIAdv::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update advgroups\n UIAdvGroup::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update campaign\n UICampaign::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update project\n UIProject::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n }", "public function isScheduledForUpdate($entity)\n {\n return isset($this->entityUpdates[spl_object_hash($entity)]);\n }", "public function update(UsersRepository $user, Post $post)\n {\n return $user->role==='root';\n }", "public function StatusUpdate()\n {\n \n $fb = new Facebook\\Facebook([\n\t\t\t'app_id' => $this->conf_array['appId'],\n\t\t\t'app_secret' => $this->conf_array['secret'],\n\t\t\t'default_graph_version' => 'v2.6'\n\t\t]);\n\t\t\n\t$linkData = [\n 'message' => $this->text,\n ];\n\ttry \n\t{\n // Returns a `Facebook\\FacebookResponse` object\n $response = $fb->post('/me/feed', $linkData, $this->conf_array['accessToken']);\n $graphNode = $response->getGraphNode();\n return 'success';\n\t} \n\tcatch(Facebook\\Exceptions\\FacebookResponseException $e) \n\t{\n return 'error';\n \n\t} \n\tcatch(Facebook\\Exceptions\\FacebookSDKException $e)\n\t{\n return 'error';\n\t}\n \n\t\t\n\t\t\n }", "protected function canUpdate(){\n $emptyComment = $this->getEmptyComment();\n\n return $this->canUserModify() &&\n ($this->isActive() || $this->isPending() ||\n ($this->isSuspended() && parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $emptyComment))) &&\n !$this->isDeleted() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE, $emptyComment);\n }", "function canUpdateItem() {\n\n $ticket = new Ticket();\n if (!$ticket->getFromDB($this->fields['tickets_id'])) {\n return false;\n }\n\n // you can't change if your answer > 12h\n if (!is_null($this->fields['date_answered'])\n && ((strtotime(\"now\") - strtotime($this->fields['date_answered'])) > (12*HOUR_TIMESTAMP))) {\n return false;\n }\n\n if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || ($ticket->fields[\"users_id_recipient\"] === Session::getLoginUserID() && Session::haveRight('ticket', Ticket::SURVEY))\n || (isset($_SESSION[\"glpigroups\"])\n && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"]))) {\n return true;\n }\n return false;\n }", "public function check_changes_action_handler() {\n\t\tglobal $wp_version;\n\n\t\tif ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || // Input var okay.\n\t\t\t( isset( $_REQUEST['action'] ) && 'duplicate_post_check_changes' === $_REQUEST['action'] ) ) ) { // Input var okay.\n\t\t\t\\wp_die(\n\t\t\t\t\\esc_html__( 'No post has been supplied!', 'duplicate-post' )\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t$id = ( isset( $_GET['post'] ) ? \\intval( \\wp_unslash( $_GET['post'] ) ) : \\intval( \\wp_unslash( $_POST['post'] ) ) ); // Input var okay.\n\n\t\t\\check_admin_referer( 'duplicate_post_check_changes_' . $id ); // Input var okay.\n\n\t\t$this->post = \\get_post( $id );\n\n\t\tif ( ! $this->post ) {\n\t\t\t\\wp_die(\n\t\t\t\t\\esc_html(\n\t\t\t\t\t\\sprintf(\n\t\t\t\t\t\t/* translators: %s: post ID. */\n\t\t\t\t\t\t\\__( 'Changes overview failed, could not find post with ID %s.', 'duplicate-post' ),\n\t\t\t\t\t\t$id\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t$this->original = Utils::get_original( $this->post );\n\n\t\tif ( ! $this->original ) {\n\t\t\t\\wp_die(\n\t\t\t\t\\esc_html(\n\t\t\t\t\t\\__( 'Changes overview failed, could not find original post.', 'duplicate-post' )\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\t$post_edit_link = \\get_edit_post_link( $this->post->ID );\n\n\t\t$this->require_wordpress_header();\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1 class=\"long-header\">\n\t\t\t<?php\n\t\t\t\techo \\sprintf(\n\t\t\t\t\t\t/* translators: %s: original item link (to view or edit) or title. */\n\t\t\t\t\t\\esc_html__( 'Compare changes of duplicated post with the original (&#8220;%s&#8221;)', 'duplicate-post' ),\n\t\t\t\t\tUtils::get_edit_or_view_link( $this->original ) // phpcs:ignore WordPress.Security.EscapeOutput\n\t\t\t\t);\n\t\t\t?>\n\t\t\t\t</h1>\n\t\t\t<a href=\"<?php echo \\esc_url( $post_edit_link ); ?>\"><?php \\esc_html_e( '&larr; Return to editor', 'default' ); ?></a>\n\t\t\t<div class=\"revisions\">\n\t\t\t\t<div class=\"revisions-control-frame\">\n\t\t\t\t\t<div class=\"revisions-controls\"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"revisions-diff-frame\">\n\t\t\t\t\t<div class=\"revisions-diff\">\n\t\t\t\t\t\t<div class=\"diff\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$fields = [\n\t\t\t\t\t\t\t'post_title' => \\__( 'Title', 'default' ),\n\t\t\t\t\t\t\t'post_content' => \\__( 'Content', 'default' ),\n\t\t\t\t\t\t\t'post_excerpt' => \\__( 'Excerpt', 'default' ),\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t'show_split_view' => true,\n\t\t\t\t\t\t\t'title_left' => __( 'Removed', 'default' ),\n\t\t\t\t\t\t\t'title_right' => __( 'Added', 'default' ),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( \\version_compare( $wp_version, '5.7' ) < 0 ) {\n\t\t\t\t\t\t\tunset( $args['title_left'] );\n\t\t\t\t\t\t\tunset( $args['title_right'] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$post_array = \\get_post( $this->post, \\ARRAY_A );\n\t\t\t\t\t\t/** This filter is documented in wp-admin/includes/revision.php */\n\t\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reason: we want to use a WP filter from the revision feature.\n\t\t\t\t\t\t$fields = \\apply_filters( '_wp_post_revision_fields', $fields, $post_array );\n\n\t\t\t\t\t\tforeach ( $fields as $field => $name ) {\n\t\t\t\t\t\t\t/** This filter is documented in wp-admin/includes/revision.php */\n\t\t\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reason: we want to use a WP filter from the revision feature.\n\t\t\t\t\t\t\t$content_from = apply_filters( \"_wp_post_revision_field_{$field}\", $this->original->$field, $field, $this->original, 'from' );\n\n\t\t\t\t\t\t\t/** This filter is documented in wp-admin/includes/revision.php */\n\t\t\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reason: we want to use a WP filter from the revision feature.\n\t\t\t\t\t\t\t$content_to = \\apply_filters( \"_wp_post_revision_field_{$field}\", $this->post->$field, $field, $this->post, 'to' );\n\n\t\t\t\t\t\t\t$diff = \\wp_text_diff( $content_from, $content_to, $args );\n\n\t\t\t\t\t\t\tif ( ! $diff && 'post_title' === $field ) {\n\t\t\t\t\t\t\t\t// It's a better user experience to still show the Title, even if it didn't change.\n\t\t\t\t\t\t\t\t$diff = '<table class=\"diff\"><colgroup><col class=\"content diffsplit left\"><col class=\"content diffsplit middle\"><col class=\"content diffsplit right\"></colgroup><tbody><tr>';\n\t\t\t\t\t\t\t\t$diff .= '<td>' . \\esc_html( $this->original->post_title ) . '</td><td></td><td>' . \\esc_html( $this->post->post_title ) . '</td>';\n\t\t\t\t\t\t\t\t$diff .= '</tr></tbody>';\n\t\t\t\t\t\t\t\t$diff .= '</table>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( $diff ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<h3><?php echo \\esc_html( $name ); ?></h3>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo $diff; // phpcs:ignore WordPress.Security.EscapeOutput\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t$this->require_wordpress_footer();\n\t}", "function postCommentNotify($id, $postId){\r\n $commentManager = new CommentsManager();\r\n $notify = $commentManager->postNotify($id);\r\n}", "function block_core_calendar_update_has_published_posts()\n {\n }", "public function update(Request $request, Post $post)\n {\n if ($this->isScheduling($request) && $this->isPublishing($request)) {\n return response()->json([\n 'error' => 'Bad Request',\n ], 400);\n }\n\n $client = $request->user();\n\n if ($client->cannot('edit_article')\n && !$post->users()->contains($client)) {\n return response()->json([\n 'error' => 'Forbidden',\n ], 403);\n }\n\n if ($request->has(['add_authors'])) {\n if ($client->cannot('invite_author')) {\n return response()->json([\n 'error' => 'Forbidden',\n ], 403);\n }\n\n $post->users()->syncWithoutDetaching($request->add_authors);\n }\n\n if ($request->has(['remove_authors'])) {\n if ($client->cannot('remove_author')) {\n return response()->json([\n 'error' => 'Forbidden',\n ], 403);\n }\n\n $post->users()->detach($request->remove_authors);\n }\n\n if ($this->isScheduling($request)\n && $client->cannot('schedule_article')) {\n return response()->json([\n 'error' => 'Forbidden',\n ], 403);\n }\n\n if ($this->isPublishing($request)\n && $client->cannot('publish_article')) {\n return response()->json([\n 'error' => 'Forbidden',\n ], 403);\n }\n else if ($this->isPublishing($request)) {\n $request->request->add(['published_at' => \\Carbon\\Carbon::now()]);\n }\n\n $post->update($request->only([\n 'title',\n 'excerpt',\n 'content',\n 'featured_image',\n 'category',\n 'tag',\n 'status',\n 'published_at',\n ]));\n\n if (!$this->isPublishing($request) && $this->isScheduling($request)) {\n $post->schedule()->create([\n 'scheduled_at' => $request->scheduled_at,\n ]);\n }\n\n return $this->jsonResponse(new PostResource($post));\n }", "static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }", "public function update_post_meta( $meta_id, $status, $user_id ) {\n \n // Get current time\n $time = time();\n \n // Set data\n $data = ['sent_time' => $time, 'status' => $status];\n \n // Verify if post failed\n if ( $status > 1 ) {\n \n // Get the last error\n // Load User model\n $this->load->model( 'User', 'user' );\n $error_code = $this->user->get_user_option( $user_id, 'last-social-error' );\n \n if ( $error_code ) {\n \n $data['network_status'] = $error_code;\n $this->user->delete_user_option( $user_id, 'last-social-error' );\n \n }\n }\n \n $this->db->where('meta_id', $meta_id);\n $this->db->update('posts_meta', $data);\n \n if ( $this->db->affected_rows() ) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n \n }", "public function update()\n {\n $r = false;\n $vars = $this->container->getSiteInstance()->getVariables();\n if (!$vars->hasKey('facebook_number_of_likes')) {\n $r = true;\n }\n if ($vars->getValue('facebook_number_of_likes') != ($n = $this->getRemoteNumberOfLikes())) {\n $r = true;\n $vars->setValue('facebook_number_of_likes', $n);\n }\n if ($this->initializeIdList() && ($l = $this->getRemoteIdList()) != $this->id_list) {\n $r = true;\n $this->initializeIdList($l);\n }\n\n $status = $this->getStatus();\n while ($status != null) {\n if ($status->update()) {\n $r = true;\n }\n\n $status = $status->getNextStatus();\n }\n\n return $r;\n }", "public function actionUpdateSingleNews(){\n\t\t// UPDATE `customer` SET `status` = 1 WHERE `email` LIKE `%@example.com%`\n\t\t$update = NotificationsReaders::updateAll(\n\t\t\t[\n\t\t\t\t'alreadyread' => NotificationsReaders::STATUS_READ\n\t\t\t],\n\t\t\t[\n\t\t\t\t'like', 'id_notification', $_POST['id_notification'],\n\t\t\t]\n\t\t);\n\n\t\tYii::$app->response->format = Response::FORMAT_JSON;\n\t\treturn ['success'=>true,'response'=>$update];\n\t}", "public function update(User $user)\n {\n return $user->hasPermissionTo('update campaign');\n }", "function updateNotificationStatus($userData)\n\t\t{\n\t\t\t//update status\n\t\t\t$update = $this->manageContent->updateValueWhere('notification_info', 'view_status', 1, 'notification_id', $userData['noti_id']);\n\t\t\techo $update;\n\t\t}", "public function updatePost($payload, $post){\n $cols = array();\n $vals = array();\n foreach ($payload as $key => $value) {\n if($key == \"username\" || $key == \"post_id\" || $key == \"UID\" || $key == \"likes\" || $key == \"created_at\"|| $value = null || $key == \"category\" || $key ==\"author\"){\n continue;\n }else if($key == \"body\" || $key == \"title\" || $key == \"image\" ){\n $temp = \"'\".$payload[$key].\"'\";\n array_push($cols, $key);\n array_push($vals, $temp);\n }else{\n throw new error(\"unexpected values for updating post.\");\n }\n }\n array_push($cols, \"updated_at\");\n array_push($vals, \"'\".$formattedTime.\"'\");\n return Message::update($cols, $vals, $payload[\"post_id\"]);\n }", "public function update(Request $request, Post $post) {\n //\n }" ]
[ "0.66687524", "0.65186733", "0.6103425", "0.6051098", "0.6051098", "0.5910067", "0.5798327", "0.5696704", "0.5664538", "0.56612223", "0.56170344", "0.55855864", "0.5571894", "0.5570715", "0.5523245", "0.55169713", "0.5510293", "0.5496269", "0.5494897", "0.5487062", "0.54720545", "0.5460843", "0.5456713", "0.54353315", "0.542597", "0.54236525", "0.5394254", "0.5393782", "0.5392946", "0.5392919", "0.5387245", "0.5381888", "0.5329196", "0.5318577", "0.531623", "0.5303824", "0.52983594", "0.5289501", "0.52816176", "0.52814764", "0.5268011", "0.5267717", "0.5261926", "0.5249844", "0.5242997", "0.52422416", "0.5237435", "0.5231651", "0.5222612", "0.52115417", "0.5208984", "0.52047944", "0.5204358", "0.5202035", "0.5200745", "0.5195043", "0.51929766", "0.5192704", "0.51903415", "0.5188345", "0.51750886", "0.5171164", "0.51670253", "0.5164359", "0.51598394", "0.51559955", "0.5154091", "0.51493174", "0.5145669", "0.51405406", "0.51332784", "0.5127804", "0.5126518", "0.51254016", "0.5124394", "0.51242256", "0.5118126", "0.51136154", "0.5112881", "0.5097081", "0.5095282", "0.5091799", "0.50896305", "0.50865364", "0.50852835", "0.5078738", "0.50782496", "0.5078225", "0.5076468", "0.5075548", "0.50705117", "0.5068435", "0.5066821", "0.50660735", "0.5064896", "0.5057927", "0.5056941", "0.50561833", "0.5054516", "0.5048993" ]
0.5646448
10
Handler for comment creation.
public function insert_comment( $id, $comment ) { if ( 1 == $comment->comment_approved ) { $this->maybe_notify_new_approved_comment( 'approved', '', $comment ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create($comment)\n {\n\n }", "public function doCreateComment()\n {\n if (isset($_POST)) {\n if (!$this->comment_is_valid($_POST['text'])) {\n header('Location: /post/details/?id=' . $_POST['post_id']);\n exit();\n }\n $text = htmlspecialchars($_POST['text']);\n $post_id = $_POST['post_id'];\n $this->commentRepository->create($_SESSION['userid'], $text, $post_id);\n }\n }", "function addCommentHandler() {\n global $inputs;\n\n $content = $inputs['content'];\n $id = $inputs['id'];\n $replyId = insert('reply',[\n 'content' => $content\n ]);\n\n insert('posting_reply',[\n 'posting_id' => $id,\n 'reply_id' => $replyId\n ]);\n\n insert('member_reply',[\n 'member_id' => getLogin()['mid'],\n 'posting_id' => $id\n ]);\n\n formatOutput(true, 'success');\n}", "public function createAction()\n\t{\n\t\t$this->_helper->acl->authorizeUser(new Application_Model_Comment(), 'create', 'You are not allowed to create a new comment');\n\n\t\tif ($this->_request->isPost()) {\n\t\t\t$form = $this->getCreateForm();\n\n\t\t\tif (!$form->isValid($_POST)) {\n\t\t\t\t$this->sendJsonFormError($form);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$data = new Application_Model_Comment();\n\t\t\t$data->id_user = $this->_user->getId();\n\t\t\t$data->comment = $_POST['comment'];\n\t\t\t$data->comment_type = $_POST['comment_type'];\n\n\t\t\t$r = $this->_commentMapper->save($data);\n\n\t\t\t$url = $this->getFrontController()->getRouter()->assemble(array('controller' => 'comment', 'action' => 'index'));\n\t\t\t$this->_redirect($url);\n\t\t}\n\t}", "public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }", "public function ajaxNewCommentAction() {\n if ($this->request->hasArgument('blogid')) {\n $blogid = $this->request->getArgument('blogid');\n }\n if ($this->request->hasArgument('postid')) {\n $postid = $this->request->getArgument('postid');\n }\n if ($this->request->hasArgument('name')) {\n $name = $this->request->getArgument('name');\n }\n if ($this->request->hasArgument('email')) {\n $email = $this->request->getArgument('email');\n }\n if ($this->request->hasArgument('text')) {\n $text = $this->request->getArgument('text');\n }\n \n $commentRepository = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Repository\\\\CommentRepository');\n \n $newComment = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Model\\\\Comment'); \n $newComment->setBlogid($blogid);\n $newComment->setPostid($postid);\n $newComment->setCommentname($name);\n $newComment->setCommentmail($email);\n $newComment->setCommenttext($text);\n $newComment->setCommentdate(time());\n \n $commentRepository->add($newComment);\n $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\PersistenceManager')->persistAll();\n \n exit;\n }", "public function create()\n {\n $this->validation[\"body\"][\"format\"][] = $this->body;\n if (!$this->validate()) {\n throw new ValidationException(\"invalid comment\");\n }\n $db = DB::conn();\n $set_params = array(\n \"thread_id\" => $this->thread_id, \n \"username\" => $this->username, \n \"body\" => $this->body\n );\n $db->insert(self::COMMENT_TABLE, $set_params);\n }", "public function created(Comment $comment)\n {\n //\n }", "public function doCreate(){\n //only logged in users can write comments\n if(Security::isAuthenticated()){\n if($_POST['send']){\n $userid = Security::getUser()->id;\n $postid = $_GET['blogid'];\n //protects from attackers\n $comment = htmlspecialchars($_POST['commentarea']);\n $time = date(\"Y-m-d\");\n $commentRepository = new CommentRepository();\n //call to createComment\n $commentRepository->createComment($userid, $postid, $comment, $time);\n header('Location: /comment/showComments?id='.$postid);\n }\n }else{\n echo'Only logged in users can write comments';\n }\n }", "public function post_create()\n\t{\n\t\tAcl::can('post_comments_create');\n\n\t\t$validation = Validator::make(Input::all(), array(\n\t\t\t'user_id' => array('required', 'integer'),\n\t\t\t'blog_post_id' => array('required', 'integer'),\n\t\t\t'content' => array('required'),\n\t\t));\n\n\t\tif($validation->valid())\n\t\t{\n\t\t\t$comment = new Blog_Comment;\n\n\t\t\t$comment->user_id = Input::get('user_id');\n\t\t\t$comment->blog_post_id = Input::get('blog_post_id');\n\t\t\t$comment->content = Input::get('content');\n\n\t\t\t$comment->save();\n\n\t\t\tCache::forget(Config::get('cache.key').'comments');\n\n\t\t\tSession::flash('message', 'Added comment #'.$comment->id);\n\n\t\t\treturn Redirect::to('blog/comments');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('blog/comments/create')\n\t\t\t\t\t->with_errors($validation->errors)\n\t\t\t\t\t->with_input();\n\t\t}\n\t}", "public function createAction()\n { \n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n \n $comment = new Comments(); \n $comment->model = $this->request->getPost(\"model\");\n $comment->model_id = $this->request->getPost(\"model_id\");\n $comment->body = $this->request->getPost(\"body\");\n \n if (!$comment->save()) {\n foreach ($comment->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n $this->flash->success(\"comment was created successfully\");\n }\n \n $referer = $this->request->getHTTPReferer();\n $path = parse_url($referer, PHP_URL_PATH);\r\n $this->response->redirect($path, true);\n }", "public function create() {\n // we expect a url of form ?controller=comment&action=create\n // if it's a GET request display a blank form for creating a new comment\n // else it's a POST so add to the database using models/comment.php\n if($_SERVER['REQUEST_METHOD'] == 'GET'){\n require_once('views/blogs/read.php');\n }\n else { \n $blogcomment = Comment::addComment($_GET['blogid']);\n require('models/comment.php');\n }\n }", "public function create()\n {\n // @TODO: Either implement create comment view or delete method.\n }", "public function addOneComment(){\n\t\tif (!empty($_POST['user_name']) && !empty($_POST['content'])){\n\t\t\t$values = array(\n \t\t'user_name' => $_POST['user_name'],\n\t\t\t'content' => $_POST['content'],\n\t\t\t'post_id' => $_POST['post_id']\n\t\t);\n\n\t\t$sqlfuncs = array(\n \t\t'date_creation' => 'NOW()',\n\t\t);\n\n\t$this->pInsertFunc(\"INSERT INTO\", \"comment\", $values, $sqlfuncs);\n\t\t\techo '<script>alert(\"Le commentaire a bien été envoyé.\")</script>';\n\t\t}\n\n\t}", "public function NewCommentManga(){\r\n $this->comment(); \r\n $this->pseudoPost();\r\n $this->contentPost();\r\n $this->_commentManager->AddComment($this->_pseudoPostSecure, $this->_contentPostSecure, $_GET['id'],true,false); \r\n header('location: Tome&id='.$_GET[\"id\"]); \r\n }", "function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}", "public static function createComments($request);", "public function record_comment(){\n\t\t\t\n\t\t}", "public function createComment(Request $request){\n try{\n // strip html tags and add authorisation data to request\n $request->request->add(['content' => strip_tags($request->content)]);\n $request->request->add(['authorised' => Auth::check()]);\n\n // parse wether the comment is being made on a post or a comment\n if($request->request->get('post_id') != null){\n // add comment target type to request data\n $request->request->add(['commentable_type' => Post::class]);\n // strip html tags and re-order input for validation\n $request->request->add(['id' => strip_tags($request->post_id)]);\n $request->request->remove('post_id');\n // check the post being commented on exists\n $this->validate($request, [\n 'id' => 'exists:posts',\n ]);\n } else if($request->request->get('comment_id') != null){\n // add comment target type to request data\n $request->request->add(['commentable_type' => Comment::class]);\n // strip html tags and re-order input for validation\n $request->request->add(['id' => strip_tags($request->comment_id)]);\n $request->request->remove('comment_id');\n // check the comment being commented on exists\n $this->validate($request, [\n 'id' => 'exists:comments',\n ]);\n } else{\n // return nothing for unknown error\n return \"\";\n }\n\n // validate the new comment is not empty and the user is authorised (logged in)\n $this->validate($request, [\n 'content' => 'required',\n 'authorised' => 'accepted',\n ]);\n\n // create the new comment and save it to the DB\n $comment = new Comment;\n $comment->content = $request->request->get('content');\n $comment->commentable_id = $request->request->get('id');\n $comment->commentable_type = $request->request->get('commentable_type');\n $comment->profile_id = Auth::user()->profile->id;\n $comment->save();\n\n \n // check if the comment is on an item written by a different user\n if($comment->profile != $comment->commentable->profile){\n // if so, notify the author of the commented item via ItemCommented event\n ItemCommented::dispatch($comment->commentable->profile);\n }\n\n // return the comment to be displayed by the website\n // (seperate fields with \"<a>\", guaranteed no mistakes as html tags were stripped from input data)\n return $comment->id.\"<a>\". $comment->content;\n }catch(\\Exception $e){\n // return nothing to indicate unknown error\n return \"\";\n }\n }", "private function wp_new_comment( $commentdata ) {\n $commentdata = apply_filters('preprocess_comment', $commentdata);\n\n $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];\n if ( isset($commentdata['user_ID']) ) {\n $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];\n } elseif ( isset($commentdata['user_id']) ) {\n $commentdata['user_id'] = (int) $commentdata['user_id'];\n }\n\n $commentdata['comment_date'] = current_time('mysql');\n $commentdata['comment_date_gmt'] = current_time('mysql', 1);\n\n $commentdata = wp_filter_comment($commentdata);\n\n $commentdata['comment_approved'] = 1;\n\n $comment_ID = wp_insert_comment($commentdata);\n\n do_action('comment_post', $comment_ID, $commentdata['comment_approved']);\n \n if (get_option('comments_notify')) {\n wp_notify_postauthor($comment_ID);\n }\n \n return $comment_ID;\n }", "private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}", "public function createComment($comment, $author, $email, $chapter_id) {\n \n global $db; // defined in models/connect.php\n $sql = $db->prepare('\n INSERT INTO comment (comment, author, email, comment_date,chapter_id) \n VALUES(?, ?, ?, NOW(), ?)\n ');\n $affectedLines = $sql->execute(array($comment, $author, $email, $chapter_id));\n //result is commented out\n }", "public function actionCreate()\n {\n $comment = new Comment();\n\n if ($comment->load(Yii::$app->request->post(), '') && $comment->save()) {\n TicketController::openStatus($comment->ticket_id);\n $comment = Comment::find()->with(['createdBy'])->ticketId($comment->ticket_id)->one();\n\n return [\n 'success' => true,\n // returns only a partial to render without applying a whole layout\n 'comment' => $this->renderPartial(\n '@frontend/views/ticket/_comment_item',\n [\n 'model' => $comment,\n ]\n ),\n ];\n }\n\n return [\n 'success' => false,\n 'errors' => $comment->errors,\n ];\n }", "public function actionCreate() {\n $model = new Comment;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Comment'])) {\n $model->attributes = $_POST['Comment'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function commentAction() {\r\n $data = json_decode($_POST['data'], true);\r\n if (empty($data['comments'])) {\r\n exit('access deny!');\r\n }\r\n\r\n if (stristr($data['sourceid'], 'nav_fun_')) {\r\n $id = intval(str_ireplace('nav_fun_', '', $data['sourceid']));\r\n $info = Nav_Service_NewsDB::getRecordDao()->get($id);\r\n if (!empty($info['id'])) {\r\n $total = $info['c_num'] + 1;\r\n Nav_Service_NewsDB::getRecordDao()->update(array('c_num' => $total), $id);\r\n $rcKey = 'NAV_FUN_OP:' . intval($info['id']);\r\n Common::getCache()->hSet($rcKey, 'c_num', $total);\r\n }\r\n }\r\n\r\n $addData = array(\r\n 'content' => trim($data['comments'][0]['content']),\r\n 'ctime' => substr($data['comments'][0]['ctime'], 0, 10),\r\n 'ip' => $data['comments'][0]['ip'],\r\n 'cmtid' => $data['comments'][0]['cmtid'],\r\n 'userid' => $data['comments'][0]['user']['userid'],\r\n 'sourceid' => $data['sourceid'],\r\n 'url' => $data['url'],\r\n 'created_at' => Common::getTime(),\r\n );\r\n\r\n // error_log(date('Y-m-d H:i:s') . \" \" . Common::jsonEncode($addData) . \"\\n\", 3, '/tmp/3g_changyan_comment');\r\n User_Service_Changyan::getDao()->insert($addData);\r\n\r\n exit;\r\n }", "public function create(): string\n\t{\n\t\t$user = $this->user;\n\n\t\tif ($user->users_group_id == 1 ) {\n\t\t\t$status = ucfirst($this->request->post('status'));\n\t\t}else {\n\t\t\t$status = $this->settings;\n\t\t\t$status = $status->get('commentaires_status');\n\t\t}\n\n\t\t$this->data('user_id', $user->id)\n\t\t\t ->data('episode_id', $this->request->post('episode_id'))\n\t\t\t ->data('comment', ucfirst($this->request->post('details')))\n\t\t\t ->data('email', $user->email)\n\t\t\t ->data('created', $now = time())\n\t\t\t ->data('status', $status)\n\t\t\t ->data('reported', 0)\n\t\t\t ->data('ip', $this->request->server('REMOTE_ADDR'))\n\t\t\t ->insert('comments');\n\n\t\t$successMessage = 'votre commentaire est ajouté avec succèss .';\n\n\t\treturn $successMessage;\n\t}", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "public function insertComment() {\n\n if(isset($_POST['btnInsertComment'])){\n $comment = $_POST['comment'];\n $idUser = $_SESSION['user']->id_user;\n $idNews = $_POST['idNews'];\n $created_at = date(\"Y-m-d H-i-s\", time());\n\n\n $regComment = \"/[0-9A-Za-z.,\\n \\r?!]*/\";\n\n $errors = [];\n if($comment == \"\") {\n $errors[] = \"Cant be empty comment\";\n exit;\n }\n else if(!preg_match($regComment, $comment)) {\n $errors[] = \"Wrong format comment\";\n exit;\n }\n try {\n $modelComment = new Comments(Database::instance());\n $modelComment->insertComment($comment, $created_at, $idUser, $idNews);\n\n $this->commentLog($comment, \"INSERT\", 201);\n\n } catch (\\PDOException $ex){\n $this->errorLog(\"insertComment()\", $ex->getMessage());\n\n }\n\n\n } else {\n $this->json(null, 403);\n }\n }", "public function addComment()\n {\n session_start();\n $superglobalsPost = $this->getSuperglobals()->get_POST();\n $newComment = new CommentManager;\n $superglobalsPost['status'] = \"waiting\";\n $newComment->createComment($superglobalsPost);\n if (isset($superglobalsPost['post_id'])) {\n $post_id = $superglobalsPost['post_id'];\n }\n $titleAction = \"Confirmation d'enregistrement\"; //confirmation message\n $actionConfirmation = \"/post?id=\" . $post_id;\n $textConfirmation = \"Votre commentaire a bien été enregistré\";\n echo $this->getRender()->render('confirmationTemplate.twig', [\n 'titleAction' => $titleAction,\n 'actionConfirmation' => $actionConfirmation,\n 'textConfirmation' => $textConfirmation,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function create() {\n\n // Validate blog id in $_GET\n $validator = new \\Validator('GET');\n $validator->required()->integer()->validate('id');\n\n // If error occured return false\n if ($validator->hasErrors()) {\n return false;\n }\n\n // Validate comment\n $this->validator->required()->validate('comment');\n\n // If error occured return false\n if ($this->hasErrors()) {\n return false;\n }\n\n // Get blog to assing comment\n $blog = $this->em->find('Alt68\\Entities\\Blog', $_GET['id']);\n\n // If not find blog return false\n if (!$blog) {\n return false;\n }\n\n // Get commenter user to assing comment\n $commenter = $this->em->find('Alt68\\Entities\\User', $_SESSION['user']['id']);\n\n // If not find commenter return false\n if (!$commenter) {\n return false;\n }\n\n // Create new comment\n $newComment = new Comment();\n\n $newComment->setComment($_POST['comment']);\n $newComment->setBlog($blog);\n $newComment->setCommenter($commenter);\n $newComment->setCreated(new \\DateTime(\"now\"));\n\n $this->em->persist($newComment);\n $this->em->flush();\n\n return true;\n }", "public function comment($comment) {\n $comment['InsertUserID'] = Gdn::session()->UserID;\n $comment['DateInserted'] = Gdn_Format::toDateTime();\n $comment['InsertIPAddress'] = ipEncode(Gdn::request()->ipAddress());\n\n $this->Validation->applyRule('ActivityID', 'Required');\n $this->Validation->applyRule('Body', 'Required');\n $this->Validation->applyRule('DateInserted', 'Required');\n $this->Validation->applyRule('InsertUserID', 'Required');\n\n $this->EventArguments['Comment'] = &$comment;\n $this->fireEvent('BeforeSaveComment');\n\n if ($this->validate($comment)) {\n $activity = $this->getID($comment['ActivityID'], DATASET_TYPE_ARRAY);\n\n $_ActivityID = $comment['ActivityID'];\n // Check to see if this is a shared activity/notification.\n if ($commentActivityID = val('CommentActivityID', $activity['Data'])) {\n Gdn::controller()->json('CommentActivityID', $commentActivityID);\n $comment['ActivityID'] = $commentActivityID;\n }\n\n $storageObject = FloodControlHelper::configure($this, 'Vanilla', 'ActivityComment');\n if ($this->checkUserSpamming(Gdn::session()->User->UserID, $storageObject)) {\n return false;\n }\n\n // Check for spam.\n $spam = SpamModel::isSpam('ActivityComment', $comment);\n if ($spam) {\n return SPAM;\n }\n\n // Check for approval\n $approvalRequired = checkRestriction('Vanilla.Approval.Require');\n if ($approvalRequired && !val('Verified', Gdn::session()->User)) {\n LogModel::insert('Pending', 'ActivityComment', $comment);\n return UNAPPROVED;\n }\n\n $iD = $this->SQL->insert('ActivityComment', $comment);\n\n if ($iD) {\n // Check to see if this comment bumps the activity.\n if ($activity && val('Bump', $activity['Data'])) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $activity['ActivityID']]);\n if ($_ActivityID != $comment['ActivityID']) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $_ActivityID]);\n }\n }\n\n // Send a notification to the original person.\n if (val('ActivityType', $activity) === 'WallPost') {\n $this->notifyWallComment($comment, $activity);\n }\n }\n\n return $iD;\n }\n return false;\n }", "function postComment() {\n $username = $_POST['username'];\n $content = $_POST['content'];\n $commentDate = $_POST['commentDate'];\n $repliedCommentId = null;\n \n if (array_key_exists('repliedCommentId', $_POST)) {\n $repliedCommentId = $_POST['repliedCommentId'];\n }\n\n $response = insertComment($username, $content, $commentDate, $repliedCommentId);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "public function addComment() {\n $body = $this->getData();\n\n $comentario = $body->comentario;\n $usuario = $body->usuario;\n $fecha = $body->fecha;\n $puntaje = $body->puntaje;\n $id_jugador = $body->id_jugador;\n $id_comentario = $this->model->insert($comentario, $usuario, $fecha, $puntaje, $id_jugador);\n\n if($id_comentario) {\n $this->view->response(\"Se agrego el comentario nùmero: {$id_comentario}\", 200);\n } else {\n $this->view->response(\"El comentario no se pudo agregar \", 500);\n }\n\n }", "public function addComment()\n {\n $this->isConnect();\n\n $post = $this->token->check($_POST);\n\n $formMessage = $this->commentsValidationForm->checkForm($post);\n\n if(!$formMessage)\n {\n $post['user_id'] = $_SESSION['id'];\n $post['validated'] = ($_SESSION['statut'] === 'admin') ? 1 : null;\n $this->comments->add($post);\n header('Location: index.php?route=front.postById&id=' . $_POST['post_id'] . '&success=' . $_SESSION['statut'] . '#comments');\n exit;\n }\n else\n {\n $postAddUnvalid = $post;\n $post = $this->posts->postById($_GET['id']);\n $comments = $this->comments->commentsById($_GET['id']);\n $this->render('postById', compact('formMessage', 'postAddUnvalid', 'post', 'comments'));\n }\n }", "function insertComment() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $comment = json_decode(file_get_contents(\"php://input\"),true);\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($comment['user_id'], $auth)) {\n $this->response('', 406);\n }\n \n $columns = 'user_id, video_id, text';\n $values = $comment['user_id'] . ',' . $comment['video_id'] . ',\\'' . $comment['text'] . \"'\";\n \n $query = \"insert into comments(\". $columns . \") VALUES(\". $values . \");\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Comment Posted.\", \"data\" => $comment);\n $this->response(json_encode($success),200);\n }", "public function commentDo() {\n\t\tif($this->user() || $this->fbUser) { \n\t\t\tif(isset($this->args[1]) && isset($_POST['comment']) && isset($_POST['redirect'])) {\n\t\t\t\t$userName = ($this->user()) ? $this->user->model->userName : $this->fbUser['username'];\n\t\t\t\t$_POST['name'] = $userName;\n\n\t\t\t\ttry {\n\t\t\t\t\t$this->commentsModel->insertComment($this->args[1], $_POST);\t\n\t\t\t\t\tHTML::redirect($_POST['redirect']);\n\t\t\t\t} catch(Exception $excpt) {\n\t\t\t\t\t$this->view->setError($excpt);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->view->setError(new Exception('Unable to set up function'));\n\t\t\t}\n\t\t}\n\t}", "public function action_create($atr = null, $event_id = null)\n {\n if (Auth::has_access('comment.create'))\n {\n is_null($atr) and Response::redirect('/');\n is_null($event_id) and Response::redirect('/');\n\n $this->template->page_title = 'Pievieno komentāru!';\n $this->template->content = View::forge('comment/create');\n if ($atr == 'w' )\n {\n // 'whole' stands for comment to whole event\n $this->template->content->form_title = 'Pievieno komentāru pasākumam';\n }\n elseif ($atr == 'l')\n {\n // 'l' stands for comment to event location\n $this->template->content->form_title = 'Pievieno komentāru norises vietai';\n }\n elseif ($atr == 'd')\n {\n // 'd' stands for comment to event date\n $this->template->content->form_title = 'Pievieno komentāru norises laikam';\n }\n elseif ($atr == 'p')\n {\n // 'p' stands for comment to event participants\n $this->template->content->form_title = 'Pievieno komentāru dalībnieku skaitam';\n }\n elseif ($atr == 'f')\n {\n // 'f' stands for comment to event fee\n $this->template->content->form_title = 'Pievieno komentāru dalības maksai';\n }\n elseif ($atr == 't')\n {\n // 't' stands for comment to event takeaway\n $this->template->content->form_title = 'Pievieno komentāru līdzi ņemamajām lietām';\n }\n elseif ($atr == 'dc')\n {\n // 'dc' stands for comment to event dress code\n $this->template->content->form_title = 'Pievieno komentāru ģebšanās sitlam';\n }\n elseif ($atr == 'a')\n {\n // 'a' stands for comment to event assistants\n $this->template->content->form_title = 'Pievieno komentāru nepieciešamajiem palīgiem';\n }\n\n if (Input::method() == 'POST')\n {\n // comment submited, validate it\n if (Input::post('comment') and Input::post('comment') != '')\n {\n // check if comment isn't too long\n if (strlen(Input::post('comment')) <= 300)\n {\n // comments length is valid, create it\n $user_id = Auth::instance()->get_user_id();\n $user_id = $user_id[1];\n\n $comment = array(\n 'author_id' => $user_id,\n 'event_id' => $event_id,\n 'attribute' => $atr,\n 'message' => Input::post('comment'),\n 'created_at' => Date::time()->get_timestamp()\n );\n\n $new_comment = Model_Orm_Comment::forge($comment);\n $new_comment->save();\n\n Session::set_flash('success', 'Komentārs veiksmīgi pievienots');\n Response::redirect('event/view/'.$event_id);\n }\n else\n {\n // comment too long\n $errors[] = 'Komentāra ziņa nevar būt garāka par 300 simboliem!';\n Session::set_flash('errors', $errors);\n }\n }\n else\n {\n // comment not set\n $errors[] = 'Ievadi komentāru!';\n Session::set_flash('errors', $errors);\n }\n }\n }\n else\n {\n Response::redirect('/');\n }\n }", "protected function newComment($post)\n\t{ \n\t\t$comment=new Comment;\n if(isset($_POST['ajax']) && $_POST['ajax']==='comment-form')\n\t\t{\n\t\t\techo CActiveForm::validate($comment);\n\t\t\tYii::app()->end();\n\t\t}\n if(isset($_POST['Comment']))\n\t\t{ $comment->attributes=$_POST['Comment'];\n if($post->addComment($comment))\n {\n Yii::app()->user->setFlash('commentSubmitted','Спасибо за сообщение. Сообщения заказчиков и исполнителей появляются после модерации');\n $this->refresh(); \n } \n }\n\t\treturn $comment;\n\t}", "public function createComment(): CommentableInterface;", "public function testCreateNewCommentRoute()\n {\n \t$response = $this->post('/post-comment', [\n \t\t'content' => 'Lorem Ipsum',\n\t\t\t'parent_id' => null,\n\t\t\t'post_id' => 1,\n\t\t\t'level' => 1\n \t]);\n\n $response->assertStatus(200);\n }", "public function addCommentAction()\n {\n $this->confirmSession();\n\n $this->view->disable();\n if ($this->request->isPost()) {\n $validator = new CommentValidation();\n $errorMessages = $validator->validate($this->request->getPost());\n \n if (count($errorMessages)) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $postId = $this->request->getPost('postId');\n\n $post = News::findFirst([\n 'conditions' => 'id = ?0 AND isDeleted = 0',\n 'bind' => [\n $postId\n ]\n ]);\n \n if (!$post) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $comment = new Comments();\n\n $comment->userId = $this->session->get('user')['id'];\n $comment->newsId = $postId;\n $comment->content = $this->request->getPost('content');\n $comment->createdAt = date('Y-m-d H:i:s');\n\n $comment->save();\n\n $this->redirect(\"/index/postDetails?id={$postId}\");\n }\n }", "abstract public function comment();", "function commentmeta_insert_handler( $meta_id, $comment_id=null ) {\n\t\tif ( empty( $comment_id ) || wp_get_comment_status( $comment_id ) != 'spam' )\n\t\t\t$this->add_ping( 'db', array( 'commentmeta' => $meta_id ) );\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Comment;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Comment']))\n\t\t{\n $model->attributes=$_POST['Comment'];\n\t\t\n \n if($model->save()){\n $dataProvider=new CActiveDataProvider('Comment');\n\t\t\t$this->redirect(array('index'),array(\n 'dataProvider'=>$dataProvider,\n 'updated'=>'1',\n 'message'=>\"Comentario introducido\"\n ));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function createComment(Request $request) {\n // get the post that the user commented on\n $post = Post::find($request['postid']);\n echo 'hello'. $request;\n\n // create a new comment\n $comment = new Comment();\n $comment->name = $request['name'];\n $comment->content = nl2br($request['content']);\n $comment->post_id = $post->id;\n $comment->save();\n\n // save the comment with a relation to the post\n //$post->comments()->save($comment);\n\n // go back to the post\n return Redirect()->route('viewPost', ['id' => $post->id]);\n }", "public function created(TaskComment $taskComment)\n {\n $taskComment->creator;\n $taskComment->updater;\n\n $ticket_id = null;\n if ($taskComment->task->ticket) {\n $ticket_id = $taskComment->task->ticket->id;\n }\n\n\n \\Notification::send(getRoleUsers('Full Administrator'),new CommentAddedNotification($taskComment->task,auth()->user()));\n\n TaskCommentJob::dispatch($taskComment);\n if($taskComment->task->project) {\n $this->activityLog->addToLog('Create Comment on Task: '.$taskComment->task->name, null, $taskComment->task->project->id, $ticket_id, $taskComment->task->id);\n }else if($taskComment->task->ticket && $taskComment->task->ticket->project){\n $this->activityLog->addToLog('Create Comment on Task: '.$taskComment->task->name, null, $taskComment->task->ticket->project->id, $ticket_id, $taskComment->task->id);\n }else {\n $this->activityLog->addToLog('Create Comment on Task: '.$taskComment->task->name, null, null, $ticket_id, $taskComment->task->id);\n }\n }", "protected function newComment($model)\n {\n $comment=new Comment;\n if(isset($_POST['Comment']))\n {\n $comment->attributes=$_POST['Comment'];\n if(!Yii::app()->user->isGuest)\n\t{\n\t\t$comment->authorName=Yii::app()->user->username;\n\t\t$comment->email=Yii::app()->user->email;\n\t\t$comment->authorId=Yii::app()->user->id;\n\t}\n\telse\n\t{\t //MFM\n\t\t$comment->authorName=$comment->attributes['authorName'];\n\t\t$comment->email=$comment->attributes['email'];\n\t}\n\t$comment->content=$comment->attributes['content'];\n\t$comment->url=$comment->attributes['url'];\n\n if(Yii::app()->user->isGuest && Yii::app()->params['commentNeedApproval'])\n $comment->status=Comment::STATUS_PENDING;\n else\n $comment->status=Comment::STATUS_APPROVED;\n\n $comment->postId=$model->id;\n\n if(isset($_POST['previewComment']))\n $comment->validate();\n else\n if(isset($_POST['submitComment']) && $comment->save())\n {\n if($comment->status==Comment::STATUS_PENDING)\n {\n Yii::app()->user->setFlash('commentSubmittedMessage',Yii::t('lan','Thank you for your comment. Your comment will be posted once it is approved.'));\n $this->refresh();\n }\n else\n $this->redirect(array('show','slug'=>$model->slug,'#'=>'c'.$comment->id));\n }\n }\n return $comment;\n }", "public function commentStore() {\n\t\t$post_id = $_POST['post_id'];\n\t\t$text = $_POST['text'];\n\t\t$comment = new Comment([$post_id, $text]);\n\t\t$comment->save();\n\t}", "public function actionCreate()\n {\n\t\tif (!\\Yii::$app->user->can('cmsCommentHistoriesCreate')) {\n\t\t\tthrow new ForbiddenHttpException('You do not have privileges to view this content.');\n\t\t}\n\t\t\n $model = new CommentHistory();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function created(Model $comment)\n {\n $user = $comment->post->owner;\n\n $user->notify(new Notification($comment, 'comment_new_author'));\n }", "public function create()\n {\n // $this->authorize('create', Comment::class);\n\n }", "public function commenting() {\n if(strlen($this->request->getParameter(\"content\")) > 10)\n {\n $postId = $this->request->getParameter(\"id\");\n $author = $this->request->getParameter(\"author\");\n $content = $this->request->getParameter(\"content\");\n \n $this->comment->addComment($author, $content, $postId);\n $this->redirect('Post','index/'.$postId);\n }\n else {\n echo \"Commentaire trop court\";\n }\n \n // Execute the default action to reload and display the Posts list\n $this->executeAction(\"index\");\n\n }", "function save_comment($comment_id)\n {\n }", "function new_comment( $path, $blog_id, $post_id, $comment_parent_id ) {\n\t\tif ( !$post_id ) {\n\t\t\t$comment_parent = get_comment( $comment_parent_id );\n\t\t\tif ( !$comment_parent_id || !$comment_parent || is_wp_error( $comment_parent ) ) {\n\t\t\t\treturn new WP_Error( 'unknown_comment', 'Unknown comment', 404 );\n\t\t\t}\n\n\t\t\t$post_id = $comment_parent->comment_post_ID;\n\t\t}\n\n\t\t$post = get_post( $post_id );\n\t\tif ( !$post || is_wp_error( $post ) ) {\n\t\t\treturn new WP_Error( 'unknown_post', 'Unknown post', 404 );\n\t\t}\n\n\t\tif (\n\t\t\t-1 == get_option( 'blog_public' ) &&\n\t\t\t/**\n\t\t\t * Filter allowing non-registered users on the site to comment.\n\t\t\t *\n\t\t\t * @module json-api\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t *\n\t\t\t * @param bool is_user_member_of_blog() Is the user member of the site.\n\t\t\t */\n\t\t\t! apply_filters( 'wpcom_json_api_user_is_member_of_blog', is_user_member_of_blog() ) &&\n\t\t\t! is_super_admin()\n\t\t) {\n\t\t\treturn new WP_Error( 'unauthorized', 'User cannot create comments', 403 );\n\t\t}\n\n\t\tif ( ! comments_open( $post->ID ) && ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\t\treturn new WP_Error( 'unauthorized', 'Comments on this post are closed', 403 );\n\t\t}\n\n\t\t$can_view = $this->user_can_view_post( $post->ID );\n\t\tif ( !$can_view || is_wp_error( $can_view ) ) {\n\t\t\treturn $can_view;\n\t\t}\n\n\t\t$post_status = get_post_status_object( get_post_status( $post ) );\n\t\tif ( !$post_status->public && !$post_status->private ) {\n\t\t\treturn new WP_Error( 'unauthorized', 'Comments on drafts are not allowed', 403 );\n\t\t}\n\n\t\t$args = $this->query_args();\n\t\t$input = $this->input();\n\t\tif ( !is_array( $input ) || !$input || !strlen( $input['content'] ) ) {\n\t\t\treturn new WP_Error( 'invalid_input', 'Invalid request input', 400 );\n\t\t}\n\n\t\t$user = wp_get_current_user();\n\t\tif ( !$user || is_wp_error( $user ) || !$user->ID ) {\n\t\t\t$auth_required = false;\n\t\t\tif ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {\n\t\t\t\t$auth_required = true;\n\t\t\t} elseif ( isset( $this->api->token_details['user'] ) ) {\n\t\t\t\t$user = (object) $this->api->token_details['user'];\n\t\t\t\tforeach ( array( 'display_name', 'user_email', 'user_url' ) as $user_datum ) {\n\t\t\t\t\tif ( !isset( $user->$user_datum ) ) {\n\t\t\t\t\t\t$auth_required = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( !isset( $user->ID ) ) {\n\t\t\t\t\t$user->ID = 0;\n\t\t\t\t}\n\n\t\t\t\t// If we have a user with an external ID saved, we can use it.\n\t\t\t\tif (\n\t\t\t\t\t! $auth_required\n\t\t\t\t\t&& $user->ID\n\t\t\t\t\t&& (\n\t\t\t\t\t\t$author = get_user_by( 'id', intval( $user->ID ) )\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\t$user = $author;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$auth_required = true;\n\t\t\t}\n\n\t\t\tif ( $auth_required ) {\n\t\t\t\treturn new WP_Error( 'authorization_required', 'An active access token must be used to comment.', 403 );\n\t\t\t}\n\t\t}\n\n\t\t$insert = array(\n\t\t\t'comment_post_ID' => $post->ID,\n\t\t\t'user_ID' => $user->ID,\n\t\t\t'comment_author' => $user->display_name,\n\t\t\t'comment_author_email' => $user->user_email,\n\t\t\t'comment_author_url' => $user->user_url,\n\t\t\t'comment_content' => $input['content'],\n\t\t\t'comment_parent' => $comment_parent_id,\n\t\t\t'comment_type' => '',\n\t\t);\n\n\t\tif ( $comment_parent_id ) {\n\t\t\tif ( $comment_parent->comment_approved === '0' && current_user_can( 'edit_comment', $comment_parent->comment_ID ) ) {\n\t\t\t\twp_set_comment_status( $comment_parent->comment_ID, 'approve' );\n\t\t\t}\n\t\t}\n\n\t\t$this->api->trap_wp_die( 'comment_failure' );\n\t\t$comment_id = wp_new_comment( add_magic_quotes( $insert ) );\n\t\t$this->api->trap_wp_die( null );\n\n\t\t$return = $this->get_comment( $comment_id, $args['context'] );\n\t\tif ( !$return ) {\n\t\t\treturn new WP_Error( 400, __( 'Comment cache problem?', 'jetpack' ) );\n\t\t}\n\t\tif ( is_wp_error( $return ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t/** This action is documented in json-endpoints/class.wpcom-json-api-site-settings-endpoint.php */\n\t\tdo_action( 'wpcom_json_api_objects', 'comments' );\n\t\treturn $return;\n\t}", "protected function emitCommentCreated(NodeInterface $commentNode, NodeInterface $postNode) {}", "public function createAction(){\n \n $this->_form->customSubmitBtn = $this->xhr;\n $this->_form->build( $this->uri,\n $this->consumer_id,\n $this->user_id,\n $this->id);\n \n \n \n $this->result = Main_Forms_Handler::onPost($this->_form ,\n $this->post,\n $this->_model,\n \"createNote\",\n $this->params,\n $this->_helper,\n $this->indexAction . $this->consumer_id,\n \"Note created.\",\n $this->xhr); \n \n $this->_onSubmit();\n\n }", "private function runComment()\n {\n $num = (int) $this->ask('How many records do you want to create for the comments table?');\n factory(Comment::class, $num)->create();\n }", "private function addComment()\n {\n try\n {\n $request = $_POST;\n global $myquery;\n \n $valid_types = array('v','video','videos','t','topic','topics','cl','collection','collections','p','photo','photos');\n\n //check if video id provided\n if( !isset($request['type_id']) || $request['type_id']==\"\" )\n throw_error_msg(\"type id not provided\");\n\n if(!is_numeric($request['type_id']))\n throw_error_msg(\"invalid type id\");\n\n //check if comment provided\n if( !isset($request['comment']) || $request['comment']==\"\" )\n throw_error_msg(\"comment not provided\");\n\n //check if type provided\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n //check if type provided\n if( !in_array($request['type'], $valid_types) )\n throw_error_msg(\"invalid type provided\");\n\n $type = $request['type'];\n\n //check if reply_to provided\n $reply_to = NULL;\n if( isset($request['reply_to']) && $request['reply_to'] !=\"\" && is_numeric($request['reply_to']) )\n $reply_to = $request['reply_to'];\n\n if ( in_array($type, array('v','video','videos') ) ) \n {\n global $cbvid;\n $result = $cbvid->add_comment( clean($request['comment']), (int)$request['type_id'], $reply_to);\n }\n elseif ( in_array($type, array('t','topic','topics') ) ) \n {\n global $cbgroup;\n $result = $cbgroup->add_comment( clean($request['comment']), (int)$request['type_id'], $reply_to);\n }\n elseif ( in_array($type, array('cl','collection','collections') ) ) \n {\n global $cbcollection;\n $result = $cbcollection->add_comment(clean($request['comment']),(int)$request['type_id'],$reply_to);\n }\n elseif ( in_array($type, array('p','photo','photos') ) ) \n {\n global $cbphoto;\n $result = $cbphoto->add_comment(clean($request['comment']),(int)$request['type_id'],$reply_to); \n }\n else \n {\n $result = $myquery->add_comment( clean($request['comment']), (int)$request['type_id'], $reply_to, clean($request['type']));\n }\n if( is_numeric($result) )\n {\n $comment_data = array();\n $uploader_data = array();\n\n $new_comment = $myquery->get_comment($result);\n foreach ($new_comment as $item => $theval) {\n if (isset($new_comment['comment_ip'])) {\n $uploader_data[$item] = $theval;\n } else {\n $comment_data[$item] = $theval;\n }\n\n unset($new_comment[$item]);\n }\n $to_print = array();\n $to_print['Uploader'] = $comment_data;\n $to_print['Comment'] = $uploader_data;\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"comments added\", \"data\" => $to_print);\n $this->response($this->json($data));\n } \n else\n {\n if( error() )\n {\n throw_error_msg(error('single')); \n } \n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function comment()\n {\n $commentManager = new CommentManager();\n \n $comment = $commentManager->getComment($_GET['id']);\n \n require (__DIR__ . '/../view/frontend/commentView.php');\n }", "public function blogCommentPost() {\n\n $data = $this->request->all();\n $this->comment->create($data);\n return json_encode(array('status' => 200, 'message' => 'Saved successfuly'));\n }", "public function actionCreate()\n {\n $model = new Comments();\n $request = Yii::$app->getRequest();\n if ($request->isPost && $model->load($request->post())) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n if (empty($_POST['g-recaptcha-response']) && Yii::$app->user->isGuest) {\n return \"no\";\n }\n else {\n $model->save(false);\n return \"yes\";\n }\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createComment(Request $request){\n $validator = Validator::make($request->all(), [\n 'commenttext' => ['required', 'string', 'max:100'],\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()\n ->withErrors($validator)\n ->withInput();\n }\n $post = Post::find($request->postid);\n $comment = new Comment();\n $comment->user()->associate(Auth::user());\n $comment->post()->associate($post);\n $comment->text = $request->commenttext;\n $comment->save();\n\n flash('Successfully created comment!')->success();\n return redirect()->back();\n }", "public function comment() {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to comment');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n // Sanitize array\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n $data = [\n 'body' => trim($_POST['body']),\n 'post_id' => trim($_POST['post_id']),\n 'user_id' => $_SESSION['user_id'],\n 'user_name' => $this->userModel->getUserById($_SESSION['user_id'])->name\n ];\n\n if (!empty($data['body']) && !empty($data['post_id']) && !empty($data['user_id']) && !empty($data['user_name'])) {\n // Save comment\n $this->postModel->comment($data);\n $post = $this->postModel->getPostById($data['post_id']);\n $receiver = $this->userModel->getUserById($post->user_id);\n if ($receiver->receive_email == true) {\n $this->mail($receiver->email, $receiver->name, $post->id);\n }\n }\n redirect('/posts/show/' . $_POST['post_id']);\n }\n\n }", "public function createComment($pid =null ) { \r\n \r\n date_default_timezone_set('America/New_York');\r\n $now = date( \"h:i:s\", strtotime('now'));\r\n $today = date(\"F j, Y, g:i a\"); \r\n // Create instance of User class, so the author name can be added automatically to each post.\r\n // $user = new User(); \r\n try { \r\n if (!empty($pid) ) {\r\n # Find the post or article with the comments we want to retrieve.\r\n // $post = $this->_collection->findOne(array('_id' => new MongoId($pid) ) );\r\n $post = $this->getSelectedPost($pid) ;\r\n $post_id = (isset($post['_id']) )? $post['_id']: array(); \r\n // return $post['_id'];\r\n } \r\n \r\n // Creat a document or array for the new comment\r\n $new_comment['post_id'] = $post_id; \r\n $new_comment['name'] = $_POST['name'] ;\r\n $new_comment['email'] = $_POST['email'] ;\r\n // REMEMBER: Limit amount of words \r\n $new_comment['comment'] = $_POST['comment'] ; \r\n $new_comment['user_id'] = (isset($_SEESION['user_id']) )? $_SEESION['user_id'] : 'guest'; \r\n $new_comment['user_ip'] = null; \r\n $new_comment['active'] = null; \r\n $new_comment['location'] = null; \r\n $new_comment['votes_up'] = 0; \r\n $new_comment['votes_down'] = 0; \r\n $new_comment['posted_at'] = new MongoDate();\r\n // $this->_new_comment['posted_at'] = $today;\r\n\r\n //$this->_comment_collection->insert($this->_new_comment); \r\n $this->_comment_collection->save($new_comment); \r\n } \r\n catch(MongoException $e) {\r\n die('Failed to insert comment. Error: '.$e->getMessage());\r\n }\r\n catch(MongoConnectionException $e) {\r\n die(\"Failed to connect to database \".$e->getMessage());\r\n } \r\n }", "public function post_order_comment()\n\t{\n\t\tif ($this->checkLogin('A') != '') {\n\t\t\t$product_id = $this->input->post('product_id');\n\t\t\t$comment_from = $this->input->post('comment_from');\n\t\t\t$commentor_id = $this->input->post('commentor_id');\n\t\t\t$deal_code = $this->input->post('deal_code');\n\t\t\t$comment = $this->input->post('comment');\n\t\t\t$data = array('date' => date(\"Y-m-d H:i:s\"),'product_id' => $product_id,'comment_from' => $comment_from,'commentor_id' => $commentor_id,'deal_code' => $deal_code,'comment' => $comment);\n\t\t\t$this->order_model->simple_insert(REVIEW_COMMENTS,$data);\n\t\t}\n\t}", "public function handle($request)\n {\n\n $comment = $this->commentRepository->create($request);\n\n return $comment;\n }", "public function the_comment()\n {\n }", "public function add_comment()\n { \n $data = $this->input->post();\n unset($data['url']);\n $data['postid'] = $data['postid'];\n $comment_id = $this->mention_model->add_comment($data); \n $success = false; \n $success = ($comment_id !== false ? true : false);\n $comment = '';\n if ($comment_id) {\n $comment = $this->comment_single($this->mention_model->get_comment($comment_id, true));\n }\n\n echo json_encode([\n 'success' => $success,\n 'comment' => $comment,\n 'comment_id' => $comment_id\n ]);\n }", "public function store(CommentRequest $request) {\n // dd(request()->all());\n // dd(Auth::user()->name);\n\n\n Comment::create([\n \"tweet_id\" => $request->tweetId,\n \"user_id\" => Auth::user()->id,\n \"comment\" => $request->comment\n ]);\n \n\n $data = [\n \"user_id\" => Auth::user()->id,\n \"user_name\" => Auth::user()->name,\n \"comment\" => $request->comment,\n \"tweet_id\" => $request->tweetId,\n ];\n event(new NewNotification($data));\n\n // $comment->create([\n // 'tweet_id' =>$request->tweetId,\n // 'user_id' => Auth::user()->id,\n // 'comment' =>$request->comment\n // ]);\n return back()->with(['success' => 'comment added']);\n }", "function wyz_new_bus_post_comm_ajax() {\n\t$nonce = filter_input( INPUT_POST, 'nonce' );\n\n\t$_id = intval( $_POST['id'] );\n\n\tif ( ! wp_verify_nonce( $nonce, \"wyz-business-post-comment-nonce-$_id\" ) ) {\n\t\twp_die( 'busted' );\n\t}\n\n\t$_comment = $_POST['comment'];\n\n\tif ( '' == $_comment || ! is_user_logged_in() || ! comments_open( $_id ) ) {\n\t\twp_die( false );\n\t}\n\n\t$_comment = esc_html( $_comment );\n\t$current_user = wp_get_current_user();\n\n\t$time = current_time('mysql');\n\n\t$data = array(\n\t\t'comment_post_ID' => $_id,\n\t\t'comment_author' => $current_user->user_login,\n\t\t'comment_author_email' => $current_user->user_email,\n\t\t'comment_author_url' => $current_user->user_url,\n\t\t'comment_content' => $_comment,\n\t\t'user_id' => $current_user->ID,\n\t\t'comment_date' => $time,\n\t\t'comment_approved' => 1,\n\t);\n\t$comment_id = wp_insert_comment( $data );\n\t$the_comment = get_comment( $comment_id );\n\n\tif ( null == $the_comment ) {\n\t\twp_die( false );\n\t}\n\n\twp_die( WyzBusinessPost::get_the_comment( $the_comment ) );\n}", "public function comment(Request $request)\n {\n $this->validate($request, [\n 'comment' => 'bail|required|max:200',\n 'postId' => 'required|numeric',\n ]);\n\n // creating a new comment\n $comment = new Post_comment();\n $comment->post_id = $request->postId;\n $comment->comment = $request->comment;\n $comment->artist_id = Auth::user()->id;\n \n $comment->save(); \n }", "function create_comment($album_id, $comment){\n $album_id = (int)$album_id;\n $comment = mysql_real_escape_string($comment);\n\n mysql_query(\"INSERT INTO comments (album_id, user_id, comment, timestamp) VALUES ($album_id, \". $_SESSION['user_id'] .\", '$comment', UNIX_TIMESTAMP()) \");\n \n }", "public function InsertComment()\n {\n global $DB, $categoryid, $mainsettings, $sdlanguage, $sdurl, $userinfo;\n\n if(empty($this->_internal_call))\n {\n $this->setPerm($this->plugin_id,$this->object_id);\n }\n if(empty($this->plugin_id) || empty($this->object_id))\n {\n return false;\n }\n $errors_arr = array();\n\n if(!CheckFormToken('comment_token', false))\n {\n $errors_arr[] = $sdlanguage['error_invalid_token'];\n }\n else\n if(!$this->hasPostAccess)\n {\n $errors_arr[] = $sdlanguage['comment_access_denied'];\n }\n\n $comment = GetVar('comment_comment', '', 'string', true, false);\n\t\n if(empty($userinfo['loggedin']))\n {\n $username = GetVar('comment_username', '', 'string', true, false);\n //SD343:\n if((strlen($username) < 3) ||\n ($username != preg_replace(\"/%0A|\\\\r|%0D|\\\\n|%00|\\\\0|\\\\t|%01|%02|%03|%04|%05|%06|%07|%08|%09|%0B|%0C|%0E|%0F|%10|%11|%12|%13/im\", '', $username)) ||\n (function_exists('DetectXSSinjection') && DetectXSSinjection(unhtmlspecialchars($comment))) )\n {\n $errors_arr[] = $sdlanguage['enter_comment_name'];\n }\n }\n else\n {\n $username = $userinfo['username'];\n }\n\n #$comment = htmlspecialchars(strip_tags(sd_htmlawed(unhtmlspecialchars($comment))));\n if(strlen($comment) < 3)\n {\n $errors_arr[] = $sdlanguage['enter_comment'];\n }\n\n if(!CaptchaIsValid())\n {\n $errors_arr[] = $sdlanguage['captcha_not_valid'];\n }\n\n // ########################################################################\n // ##################### SECURITY CHECK - START ###########################\n // ########################################################################\n // SD313: for security - detect SQL/XSS injection in original post\n // Note: functions are in \"functions_security.php\" which is normally\n // included already in \"init.php\", but better check by \"function_exists\"\n if(strlen($comment))\n {\n $comment = sd_unhtmlspecialchars($comment);\n $comment = preg_replace(\"/%0A|%0D|%00|\\\\0|%01|%02|%03|%04|%05|%06|%07|%08|%0B|%0C|%0E|%0F|%11|%12/im\", '', $comment);\n if(function_exists('DetectXSSinjection') && DetectXSSinjection($comment))\n {\n $comment = '';\n $errors_arr[] = $sdlanguage['comment_rejected'];\n unset($_POST['comment_comment']);\n }\n else\n {\n $comment = htmlspecialchars(strip_alltags($comment));\n }\n }\n\n //SD343: combined blacklist check and SFS checking user's email and IP\n $blacklisted = false;\n if(empty($errors_arr))\n {\n if(!empty($mainsettings['comments_sfs_antispam']) && defined('USERIP') &&\n function_exists('sd_sfs_is_spam') &&\n sd_sfs_is_spam((empty($userinfo['email'])?null:$userinfo['email']),USERIP))\n {\n $blacklisted = true;\n }\n if(!$blacklisted && !empty($mainsettings['comments_enable_blocklist_checks']) &&\n function_exists('sd_reputation_check'))\n {\n $blacklisted = sd_reputation_check(USERIP, 1, 'comments_enable_blocklist_checks');\n }\n\n if($blacklisted)\n {\n WatchDog('Comments','<b>Comment rejected (blacklisted): '.$username.\n '</b>, IP: </b><span class=\"ipaddress\">'.USERIP.'</span></b><br />'.\n ' for plugin id: '.$this->plugin_id.', object id: '.$this->object_id,\n WATCHDOG_ERROR);\n $errors_arr[] = $sdlanguage['ip_listed_on_blacklist'];\n }\n }\n\n // ########################################################################\n // ####################### SECURITY CHECK - END ###########################\n // ########################################################################\n\n $comment_id = false;\n $result = false;\n if(empty($errors_arr))\n {\n unset($_POST['comment_comment']);\n // check for repeat posting\n $DB->result_type = MYSQL_ASSOC;\n $lastentry = $DB->query_first('SELECT username, comment FROM {comments}\n WHERE pluginid = %d AND objectid = %d\n ORDER BY commentid DESC LIMIT 1',\n $this->plugin_id, $this->object_id);\n if(($lastentry['username'] == $username) && ($lastentry['comment'] == $comment))\n {\n $addJS = true;\n //SD360: return error message if called by Ajax\n if(Is_Ajax_Request())\n {\n return $sdlanguage['repeat_comment'];\n }\n else\n {\n if(empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($sdlanguage['repeat_comment'], true);\n }\n $this->DisplayCommentRows();\n if(!empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($sdlanguage['repeat_comment'], true);\n }\n }\n }\n else\n {\n $approved = ($userinfo['loggedin'] ||\n !empty($mainsettings['comments_guest_auto_approve'])) ? 1 : 0;\n //SD322: check for groups with approval being required:\n if($approved && empty($userinfo['adminaccess']))\n {\n $groups = isset($mainsettings['comments_require_approval_groups'])?$mainsettings['comments_require_approval_groups']:'';\n if(@in_array($userinfo['usergroupid'], sd_ConvertStrToArray($groups)))\n {\n $approved = 0;\n }\n }\n //SD342: censor comments if enabled\n if(!empty($mainsettings['censor_comments']))\n {\n $comment = sd_removeBadWords($comment);\n }\n if(strlen($comment) &&\n $DB->query('INSERT INTO '.PRGM_TABLE_PREFIX.'comments (pluginid, objectid, date, userid, username, comment, approved, ipaddress, categoryid)'.\n \" VALUES (%d, %d, %d, %d, '%s', '%s', %d, '%s', %d)\",\n $this->plugin_id, $this->object_id, TIME_NOW, $userinfo['userid'],\n $username, $DB->escape_string($comment), $approved, USERIP, $categoryid))\n {\n $this->comment_id = $DB->insert_id();\n $this->UpdateCommentsCount();\n\n //SD342 check for max comments\n if(!empty($this->max_comments) && ($this->GetCommentsCount(false) >= $this->max_comments))\n {\n $this->allow_comments = false;\n }\n\n $this->SendNotification($username, $this->plugin_id, htmlspecialchars(strip_alltags(unhtmlspecialchars($comment))), $approved); //SD332\n\n //SD342: send subscription notifications if comment was approved\n if($approved)\n {\n if(!class_exists('SDSubscription'))\n {\n include_once(SD_INCLUDE_PATH.'class_userprofile.php');\n }\n $sub = new SDSubscription($userinfo['userid'],$this->plugin_id,$this->object_id,'comments',$categoryid);\n $sub->SendNotifications();\n unset($sub);\n }\n }\n\n //SD360: return true if called by ajax\n if(Is_Ajax_Request())\n {\n return true;\n }\n\n if($this->allow_comments && empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($sdlanguage['comment_posted']);\n }\n $this->DisplayCommentRows();\n if($this->allow_comments && !empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($sdlanguage['comment_posted']);\n }\n $result = true;\n }\n }\n else\n if(!Is_Ajax_Request())\n {\n if(empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($errors_arr, true);\n }\n $this->DisplayCommentRows();\n if(!empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($errors_arr, true);\n }\n }\n\n //SD360: return true or first error message for ajax call\n if(Is_Ajax_Request())\n {\n return empty($errors_arr)?'success':$errors_arr[0];\n }\n\n $div_name = ($result?'success_message':'error_message');\n echo '\n<script type=\"text/javascript\">\njQuery(document).ready(function() {\n if (typeof jQuery.fn.scrollTo == \"undefined\") {\n jQuery.getScript(\"'.$sdurl.MINIFY_PREFIX_F.'includes/javascript/jquery.scrollTo-min.js\", function(){\n jQuery.scrollTo(\"form[name=comment-form-p'.$this->plugin_id.']\", 400);\n jQuery(\"div#'.$div_name.'\").delay(3000).slideUp();\n });\n } else {\n jQuery.scrollTo(\"form[name=comment-form-p'.$this->plugin_id.']\", 400);\n jQuery(\"div#'.$div_name.'\").delay(3000).slideUp();\n };\n});\n</script>\n ';\n\n return $result;\n\n }", "public function add_comment(){\r\n\r\n\t\t/* Require user */\r\n\t\tif (!$commenter = $this->_requireUser('Please sign in, or sign up, to post a comment.')) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t/* Build comment arguments from request variables. */\r\n\t\t$arguments = array();\r\n\t\t$this->add_comment_parse_args($arguments);\r\n\t\t$arguments['commentOwner'] = $commenter->userid;\r\n\r\n\t\t/* Do the deed. */\r\n\t\tif ($this->add_comment_call_model_add($arguments)){\r\n\t\t\t$message = $this->add_comment_success_message();\r\n\t\t\t$messageType = 'info';\r\n\t\t} else {\r\n\t\t\t$message = $this->add_comment_failure_message();\r\n\t\t\t$messageType = 'error';\r\n\t\t}\r\n\r\n\t\t/* Tidy up */\r\n\t\tMessages::addMessage($message, $messageType);\r\n\t\treturn $this->_redirect($this->get_redirect_page());\r\n\r\n\t}", "public function actionCreate()\n {\n $model = new BlogComments();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function comments()\n\t{\n\t\t$this->_crud->set_table('ent_cr_comments');\n\t\t$this->_crud->set_subject('Comment');\n\t\t$this->_crud->set_relation('ent_cr_recipes_id','ent_cr_recepies','title');\n\t\t$this->_crud->display_as('ent_cr_recepies_id', 'Recipe');\n\t\t$this->_crud->required_fields('name', 'email', 'comments', 'ent_cr_recipes_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}", "public function comment() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['comment']) && !empty($_POST['comment'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->comment(explode(\"/\", $this->_url)[1], $_POST['comment'])) {\n echo \"error\";\n }\n }\n }\n }", "function CreateComment( $obj )\n\t{\n\t\treturn $this->pDBInterface->Query( $this->pDBInterface->CreateInsertQuery($this->sCommentTb, $obj ) );\n\t}", "function warquest_home_comment_save_do() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\tglobal $comment;\r\n\r\n\t/* output */\r\n\tglobal $output;\r\n\r\n\tif (strlen($comment)>0) {\r\n\t\r\n\t\tif ($uid==0) {\r\n\t\t\twarquest_db_comment_insert(0, 0, $player->pid, $other->pid, $comment);\r\n\t\t} else {\t\t\r\n\t\t\twarquest_db_comment_update($uid, $comment);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($other->pid)) {\r\n\t\t\r\n\t\t\t$other->comment_notification++;\r\n\t\t\twarquest_comment_mail($other->pid, $comment, $player->name);\r\n\t\t\t$message = t('ALLIANCE_COMMENT_PLAYER', player_format($other->pid, $other->name, $other->country));\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\t$message = t('ALLIANCE_COMMENT_ALL');\r\n\t\t\twarquest_info(\"Post message: \".$comment);\t\t\r\n\t\t}\t\t\r\n\r\n\t\t/* Clear input parameters */\r\n\t\t$uid = 0;\r\n\t\t\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\r\n\t}\r\n}", "function comment()\n {\n $this->load->library('service');\n $data = file_get_contents('php://input');\n $ret = array(\n 'out' => $this->service->handle('comment', $data)\n );\n $this->output($ret);\n }", "public function createComment($idPost, $author, $comment)\n\t{\n\n $request = $this->db->db->prepare('INSERT INTO comments (post_id, author, comment) VALUES (:post_id, :author, :comment);');\n $params = [':post_id' => $idPost, ':author' => $author, ':comment' => $comment];\n if ($request->execute($params)) {\n return(\"CommentCreated\");\n }\n return('CommentError');\n }", "public function commentAction() {\n $ses = new Application_Model_Session();\n $ses->startSession();\n {\n $request = $this->getRequest();\n $ExpId = $this->_getParam('expid');\n $form = new Campuswisdom_Form_Comment();\n $this->view->form = $form;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($request->getPost())) {\n $mapper = new Campuswisdom_Model_ExpMapper();\n $Comment = $form->getValue(\"comment\");\n $mapper->setDbTable('campuswisdom_Model_DbTable_Comments');\n $smthn = $mapper->save($ExpId, $Comment);\n if ($smthn == null) {\n //an error occurred so nothing was saved\n } else {\n $ses->setSessionParameter('comnt', 1);\n }\n $this->_helper->redirector('viewcomments', 'exps', 'default', array('expid' => $ExpId));\n }\n }\n }\n }", "public function handleComment($data, $form) {\n\n $existing = $this->Comments()->filter(array(\n 'Comment' => $data['Comment']\n ));\n if($existing->exists() && strlen($data['Comment']) > 20) {\n $form->sessionMessage('That comment already exists! Spammer!','bad');\n\n return $this->redirectBack();\n }\n\n $comment = TutorialComment::create();\n $comment->TutorialPageID = $this->ID;\n $form->saveInto($comment);\n $comment->write();\n\n $form->sessionMessage('Thanks for your comment!','good');\n\n return $this->redirectBack();\n\n }", "public function CreateComments($Payload){\n\t\t\tif(empty($Payload['id'])){\n\t\t\t\tthrow new Exception('id can not be empty.');\n\t\t\t}\n\t\t\tif(empty($Payload['Body'])){\n\t\t\t\tthrow new Exception('body can not be empty.');\n\t\t\t}\n\t\t\t$Payload['Verb']='POST';\n\t\t\t$Payload['URL']='/V1/creditmemo/'.$Payload['id'].'/comments';\n\t\t\t$Payload['Body']=json_encode($Payload['Body']);\n\t\t\treturn $this->Execute($Payload);\n\t\t}", "public function actionAdd()\n {\n $apiName = 'comment/add';\n $sessionId = null;\n \n $_JSON = $this->getJsonInput();\n \n try\n {\n if(!isset($_JSON) || empty($_JSON))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'No input received.');\n else if(!isset($_JSON['sessionId']) || empty($_JSON['sessionId']))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'Please enter session id.');\n else if(!isset($_JSON['postId']) || empty($_JSON['postId']))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'Please enter post id.');\n else if(!isset($_JSON['comment']) || empty($_JSON['comment']))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'Please enter your comment.');\n else\n {\n $userId = $this->isAuthentic($_JSON['sessionId']);\n $user = User::model()->findByPk($userId);\n if (is_null($user))\n $result = $this->error($apiName, WS_ERR_WONG_USER, 'Please login before using this service.');\n else\n {\n $postId = filter_var($_JSON['postId'], FILTER_SANITIZE_NUMBER_INT);\n $post = Post::model()->findByPk($postId);\n if (is_null($post))\n $result = $this->error($apiName, WS_ERR_WONG_VALUE, 'Selected post does not exist.');\n else\n {\n $comment = new Comment('add_api');\n $comment->userId = $userId;\n $comment->postId = $postId;\n $comment->postUserId = $post->userId;\n $comment->comment = trim(mb_convert_encoding( $_JSON['comment'], \"UTF-8\", \"BASE64\" ));\n \n// $comment->comment = filter_var(base64_decode($_JSON['comment']), FILTER_SANITIZE_STRING | FILTER_SANITIZE_MAGIC_QUOTES);\n// $comment->comment = $_JSON['comment'];\n //$comment->comment = filter_var($_JSON['comment'], FILTER_SANITIZE_STRING | FILTER_SANITIZE_MAGIC_QUOTES);\n //save record\n $comment->save();\n \n $ignore_user = array(); \n \n if(isset($_JSON['userMentioned']) && count($_JSON['userMentioned']) > 0){\n \tforeach ($_JSON['userMentioned']as $userM){\t\n\t \t$userMentioned = new UserMentioned();\n\t \t$userMentioned->userId = filter_var($userM['userId'], FILTER_SANITIZE_NUMBER_INT);\n// \t \t$userMentioned->userName = filter_var(base64_decode($userM['userName']), FILTER_SANITIZE_STRING | FILTER_SANITIZE_MAGIC_QUOTES);\n\t \t$userMentioned->userName = $userM['userName'];\n\t \t$userMentioned->postId = $postId;\n\t \t$userMentioned->commentId = $comment->id;\n\t \t$userMentioned->save();\n\t \tEvent::saveEvent(Event::USER_MENTIONED_COMMENT, $userId, $comment->postId, $comment->createDate, $userMentioned->userId);\n\t \t$ignore_user[] = $userMentioned->userId;\n \t}\n }\n \n \n \n\n \n if ($comment->hasErrors()) \n {\n throw new Exception(print_r($comment->getErrors(), true), WS_ERR_UNKNOWN);\n }\n \n //save event\n if($post->type == 'question'){\n \t$eventtype = 14;\n \t$message1 = $user->userName.' answered your question.';\n }\n else{\n \t$eventtype = Event::COMMENT_CREATED;\n \t$message1 = false;\n }\n \n Event::saveEvent($eventtype, $userId, $comment->postId, $comment->createDate, $post->userId);\n \n $ignore_user[] = $post->userId;\n $sql = 'SELECT DISTINCT userId FROM `comment` WHERE postId = '.$postId;\n \n $user_comments = Yii::app()->db->createCommand($sql)->queryAll(true);\n \n \n// var_dump($post->user->userName);\n \n if($post->type == 'question'){\n \t$eventtype = 15;\n \t$message1 = $user->userName.' also answered '.$post->user->userName.\"'s question.\";\n }\n else{\n \t$eventtype = 12;\n \t$message1 = $user->userName.' also commented on '.$post->user->userName.\"'s post.\";\n }\n \n// $message = $user->userName.' also commented on '.$post->user->userName.\"'s post.\";\n \n \n foreach ($user_comments as $comm){\n \t\n \tif(!in_array($comm['userId'], $ignore_user))\n// \t\t Event::saveEvent(12, $userId, $comment->postId, $comment->createDate, $comm['userId']);\n \t\tEvent::saveEvent(12, $userId, $comment->postId, $comment->createDate, $comm['userId'], $message1 );\n }\n \n //send notifications to followers of the post user\n// $sql = Follower::getQueryForFollower($post->userId);\n// $sql .= \" AND (s.deviceToken is not null OR s.deviceToken!='')\";\n// $followers = Yii::app()->db->createCommand($sql)->queryAll(true);\n// $message = $user->userName . ' has commented on a post.';\n// \n// foreach($followers as $follower)\n// {\n// $session = Session::model()->findByAttributes(array('deviceToken'=>$follower['deviceToken']));\n// if($session)\n// {\n// $session->deviceBadge += 1;\n// $session->save();\n// sendApnsNotification($follower['deviceToken'], $message, $follower['deviceBadge']);\n// }\n// }\n \n $imagePath = Yii::app()->getBaseUrl(true) . '/images/user/';\n $thumbPath = Yii::app()->getBaseUrl(true) . '/images/user/thumb/';\n \n $sql = Comment::getQuery($imagePath, $thumbPath, $postId);\n $sql .= ' AND c.id=' . $comment->id;\n $newComment = Yii::app()->db->createCommand($sql)->queryRow(true);\n $newComment['timeElapsed'] = getTimeElapsed(date_create($newComment['createDate']), date_create($newComment['currentDate']));\n $newComment['userMentioned'] = UserMentioned::getUserByComment($newComment['id']);\n \n \n $result = array(\n 'api' => $apiName,\n 'apiMessage' => 'Comment saved successfully.',\n 'status' => 'OK',\n 'commentId' => $comment->id,\n 'comment' => $newComment\n );\n }\n }\n }\n } \n catch (Exception $e)\n {\n $result = $this->error($e->getCode(), Yii::t('app', $e->getMessage()),'TSASTT');\n }\n $this->sendResponse(json_encode($result, JSON_UNESCAPED_UNICODE));\n }", "public function newComment($comment_id) \n\t\t{\n\t\t\t$comment = get_comments(array('ID' => $comment_id));\n\t\t\t$comment = $comment[0];\n\n\t\t\tif($comment->comment_approved != 1) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$thingdom = $this->getThingdom();\n\t\t\t\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$post_title = get_the_title($comment->comment_post_ID);\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\t$thing->feed('new_comment', \"New comment on: {$post_title}\\n<br>From: {$comment->comment_author}<br>\\nComment: {$comment->comment_content}\");\n\t\t}", "public function postComments()\n {\n $commentText = $this->input->post('text');\n $slug = $this->input->post('slug');\n $username = $this->session->userdata('username');\n $response = $this->ReviewModel->postComment($commentText, $username, $slug);\n }", "protected static function createComment(Request $request){\n \t$videoId = InputSanitise::inputInt($request->get('video_id'));\n \t$userComment = $request->get('comment');\n \t$comment = new static;\n \t$comment->body = $userComment;\n \t$comment->course_video_id = $videoId;\n \t$comment->user_id = Auth::user()->id;\n \t$comment->save();\n \treturn $comment;\n }", "public function createComment(array $comment)\n {\n $comment[\"porcelain\"] = null; // wp-Cli returns only id\n return intval($this->runWpCliCommand(\"comment\", \"create\", $comment));\n }", "function comment()\n {\n // form validation\n $this->load->library('form_validation');\n $this->form_validation->set_rules('eventID', 'eventID', 'trim|xss_clean');\n $this->form_validation->set_rules('comment', 'comment', 'trim|xss_clean|strip_tags|htmlspecialchars');\n $this->form_validation->run();\n\n $eventID = $this->input->post('eventID');\n $comment = $this->input->post('comment');\n $userID = $this->session->userdata('UserID');\n\n // check that user is logged in\n if($userID <= 0)\n {\n $this->returnError($this->lang->line('error_logged_out'),false,false);\n return;\n }\n\n // check event id is valid\n if($eventID <= 0)\n {\n $this->returnError($this->lang->line('error_event_invalid'),false,false);\n return;\n }\n\n $this->load->model('User');\n $this->User->addComment($eventID, $userID, $comment);\n\n // add new comment (in HTML) to response so it can be added to the current page\n $this->load->library('md');\n $result['comment'] = $this->md->defaultTransform($comment);\n $result['username'] = $this->session->userdata('Username');\n $result['profileImage'] = $this->session->userdata('ProfileImage');\n $result['userID'] = $userID;\n\n // return success\n $result['error'] = false; \n echo json_encode($result);\n }", "abstract protected function add(Comment $comment);", "public function addComment()\r\n {\r\n $pdoStatment = $this->pdo->prepare(\r\n 'INSERT INTO `comment`(`content`, `id_User`, `id_Article`) \r\n VALUES(:content, :id_User, :id_Article)'\r\n );\r\n $pdoStatment->bindValue(':content', $this->content, PDO::PARAM_STR);\r\n $pdoStatment->bindValue(':id_User', $this->id_User, PDO::PARAM_INT);\r\n $pdoStatment->bindValue(':id_Article', $this->id_Article, PDO::PARAM_INT);\r\n $pdoStatment->execute();\r\n return $this->pdo->lastInsertId();\r\n }", "function newUnderComment();", "public function createComment(Request $request)\n {\n $result = $this->commentService->createComment($request->all());\n if ($result) {\n return Api::r_response($result, \"Create success\", 'S200');\n }\n return Api::r_response(\"\", \"Server error\", 'E500');\n }", "function get_comment_ID()\n {\n }", "public function actionAddVehicleCommentInd(){\t \n\t date_default_timezone_set(\"Europe/London\");\n\t \n\t // Gets basic vehicle info used in the save\n\t $vehicle = Vehicles::model()->getBasicInfo($_POST['vehicle_id']);\n\t \n\t // Adds the vehicle comment\n\t $vC = new VehicleComments();\n\t $vC->added_by = Yii::app()->user->id;\n\t $vC->comment = $_POST['comment'];\n\t $vC->date_added = date(\"Y-m-d H:i:s\");\n\t $vC->vehicle_id = $_POST['vehicle_id'];\n\t $vC->make_model_id = $vehicle['make_model_id'];\n\t $vC->save();\n\t}", "public function add() {\n $post_id = $this->request->data['Comment']['post_id'];\n $user_id = $this->Auth->user('id');\n \n \n if ($this->request->is('post')) {\n \n //Post id is not numeric (avoid SQL injection)\n if (!is_numeric($post_id)) {\n $this->Flash->setError(__(\"Vous ne pouvez pas commenter ce post\"));\n return $this->redirect($this->referer());\n }\n \n //Everything is ok, create the comment\n $this->Comment->create();\n $this->request->data['Comment']['user_id'] = $user_id;\n if ($this->Comment->save($this->request->data)) {\n return $this->redirect($this->referer());\n }\n \n $this->Flash->error(__('Ajout de commentaire impossible.'));\n }\n }", "public function createComment(Request $request)\n {\n\n $validator = Validator::make($request->all(), [\n 'comment' => 'required',\n ]);\n\n if ($validator->fails()) {\n return back()\n ->withErrors($validator)\n ->withInput();\n }\n\n $comment = new BlogComment();\n $comment->user_id = Auth::id();\n $comment->blog_id = $request->bid;\n $comment->comment = $request->comment;\n $comment->save();\n\n $comment = BlogComment::with('user')->find($comment->id);\n\n //send email here\n $comment->notify(new BlogCommentNotification($comment));\n\n return redirect()->back();\n }", "public function create(Request $request)\n {\n /*$data = request()->validate([\n 'content' => ['required', 'string', 'max:255'],\n 'post_id' => 'require'\n ]);*/\n\n $id = Auth::id();\n\n return Comment::create([\n 'content' => $request->input('content'),\n 'post_id' => $request->input('post'),\n 'date_publication' => now(),\n 'compte_id' => $id\n ]);\n }", "public function get_create($blog_post_id = null, $user_id = null)\n\t{\n\t\tAcl::can('get_comments_create');\n\n\t\t\t\t\n\t\t$blog_post = array('' => 'SELECIONE') + Blog_post::order_by('id', 'asc')->take(999999)->lists('id', 'id');\n\t\t\t\t\n\t\t$user = array('' => 'SELECIONE') + User::order_by('id', 'asc')->take(999999)->lists('id', 'id');\n\n\t\t$this->layout->title = 'New Blog Comment';\n\t\t$this->layout->content = View::make('blog.comments.create', array(\n\t\t\t\t\t\t\t\t\t'blog_post' => $blog_post,\n\t\t\t\t\t\t\t\t\t'user' => $user,\n\t\t\t\t\t\t\t\t));\n\t}", "public function createComment($args) {\n $type = \\Helper::getCommentType($args[1], $args[2]);\n $data = FALSE;\n // Type exists\n if($type !== FALSE) {\n // User has permission to comment?\n if(\\Auth::checkComment($args[1], $args[2])) {\n $parameters = \\Helper::getInput(TRUE);\n $parameters['type'] = $args[1];\n $parameters['itemId'] = $args[2];\n $commentCtrl = new \\Controllers\\CommentController();\n // Validate parameters\n if($commentCtrl->validateParametersCreate($parameters)) {\n // Create comment\n $data = $commentCtrl->createComment($parameters);\n }\n } else {\n throw new \\Exception('You do not have permission to comments on the given item', 4);\n }\n } else {\n throw new \\Exception('Type not implemented yet', 1);\n }\n\n // Format the result\n $result = array(\n 'success' => ($data !== FALSE ? TRUE : FALSE),\n 'commentId' => ($data !== FALSE ? $data : 0)\n );\n return $result;\n }" ]
[ "0.7683835", "0.7591246", "0.753815", "0.74653035", "0.73861", "0.7334397", "0.7331976", "0.7209214", "0.71656436", "0.7154594", "0.7142718", "0.7119131", "0.6975333", "0.69745785", "0.691397", "0.6892956", "0.6876621", "0.6862857", "0.68408585", "0.6825996", "0.68184924", "0.6812104", "0.6782769", "0.6696656", "0.6681979", "0.66813695", "0.6674665", "0.66653013", "0.6662249", "0.6637131", "0.662592", "0.6615998", "0.66100144", "0.6594212", "0.6588853", "0.65706587", "0.6568", "0.6562864", "0.6554091", "0.65267307", "0.64973325", "0.64508104", "0.64275014", "0.64222616", "0.64162797", "0.6412629", "0.6401764", "0.63952446", "0.63916504", "0.63862807", "0.63764274", "0.6358273", "0.63571197", "0.6356054", "0.63479704", "0.6345914", "0.6341892", "0.6332691", "0.63319975", "0.6329517", "0.63191766", "0.6312333", "0.6311268", "0.6303399", "0.6294616", "0.6292721", "0.6284559", "0.6277753", "0.6277186", "0.6274898", "0.62638384", "0.6232369", "0.6232291", "0.6221957", "0.6216818", "0.62152076", "0.62124556", "0.6205708", "0.62024724", "0.61981505", "0.6189597", "0.6187906", "0.61799043", "0.6177565", "0.6167436", "0.61638576", "0.6161108", "0.616058", "0.61566913", "0.61444014", "0.61431706", "0.6133527", "0.6132098", "0.61290556", "0.61267036", "0.6124467", "0.61197674", "0.6110417", "0.61045724", "0.610397", "0.6100535" ]
0.0
-1
Only send notification for comment getting published on a public post.
public function maybe_notify_new_approved_comment( $new_status, $old_status, $comment ) { if ( 'approved' != $new_status ) { return; } $post = get_post( $comment->comment_post_ID ); if ( ! $this->is_post_notifiable( $post, 'comment' ) ) { return; } if ( apply_filters( 'wporg_profiles_wp_activity-is_comment_notifiable', true, $comment, $post ) ) { $this->notify_new_approved_comment( $comment, $post ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function comment_post($id_comment){\n if(!(($id_user = PDOQueries::get_post_publisher_id_by_comment($id_comment)) > 0) || !(($id_post = PDOQueries::get_post_id_by_comment($id_comment)) > 0) || !(($id_publisher = PDOQueries::get_publisher_id($id_post)) > 0))\n throw new \\PersonalizeException(2001);\n $marker = '{comment_post}{id_publisher/'.$id_user.'}';\n $link = 'index.php?'.Navigation::$navigation_marker.'='.Timeline::$post_id_page.'#'.$id_post.$id_comment;\n return PDOQueries::add_notification($id_publisher,$marker,$link);\n }", "private function notify_new_approved_comment( $comment, $post ) {\n\t\tif ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $comment->user_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $user = get_user_by( 'id', $comment->user_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$args = array(\n\t\t\t'action' => 'wporg_handle_activity',\n\t\t\t'source' => 'wordpress',\n\t\t\t'user' => $user->user_login,\n\t\t\t'comment_id' => $comment->comment_ID,\n\t\t\t'content' => get_comment_excerpt( $comment ),\n\t\t\t'title' => get_the_title( $post ),\n\t\t\t'blog' => get_bloginfo( 'name' ),\n\t\t\t'blog_url' => site_url(),\n\t\t\t'url' => get_comment_link( $comment ),\n\t\t);\n\n\t\tProfiles\\api( $args );\n\t}", "public function publish()\n {\n // Initialize variables\n $cid = JRequest::getVar('cid', array(), 'post', 'array');\n $task = JRequest::getCmd('task');\n $publish = ($task == 'publish');\n\n if(empty($cid))\n {\n $this->setRedirect($this->_ambit->getRedirectUrl(), JText::_('COM_JOOMGALLERY_COMMAN_MSG_NO_COMMENTS_SELECTED'));\n $this->redirect();\n }\n\n $model = $this->getModel('comments');\n if($count = $model->publish($cid, $publish))\n {\n if($count != 1){\n $msg = JText::sprintf($publish ? 'COM_JOOMGALLERY_COMMAN_MSG_COMMENTS_PUBLISHED' : 'COM_JOOMGALLERY_COMMAN_MSG_COMMENTS_UNPUBLISHED', $count);\n } else {\n $msg = JText::_($publish ? 'COM_JOOMGALLERY_COMMAN_MSG_COMMENT_PUBLISHED' : 'COM_JOOMGALLERY_COMMAN_MSG_COMMENT_UNPUBLISHED');\n }\n $this->setRedirect($this->_ambit->getRedirectUrl(), $msg);\n }\n else\n {\n $msg = JText::_('COM_JOOMGALLERY_COMMON_MSG_ERROR_PUBLISHING_UNPUBLISHING');\n $this->setRedirect($this->_ambit->getRedirectUrl(), $msg, 'error');\n }\n }", "function _sf_send_user_publish_note($new_status, $old_status, $post) {\n\t\tif($post->post_type == 'spot') {\n\t\t\t\n\t\t\t$user = get_user_by('id', $post->post_author);\n\t\t\t\n\t\t\t//// IF THIS POST IS BEING PUBLISHED AND THE AUTHOR IS A SUBMITTER\n\t\t\tif($old_status != 'publish' && $new_status == 'publish' && isset($user->caps['submitter'])) {\n\t\t\t\t\n\t\t\t\t//// SENDS AN EMAIL SAYING HIS POST HAS BEEN SUBMITTED\n\t\t\t\t$message = sprintf2(__(\"Dear %user,\n\t\t\t\t\nThis is to inform you that your submission %title at %site_name has been approved and it is now published.\n\nYou can view it here at %link\n\nKind regards,\nthe %site_name team.\", 'btoa'), array(\n\t\t\t\n\t\t\t\t\t'user' => $user->display_name,\n\t\t\t\t\t'title' => $post->post_title,\n\t\t\t\t\t'site_name' => get_bloginfo('name'),\n\t\t\t\t\t'link' => get_permalink($post->ID),\n\t\t\t\t\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\t$subject = sprintf2(__('Submission approved at %site_name', 'btoa'), array('site_name' => get_bloginfo('name')));\n\t\t\t\t\n\t\t\t\t$headers = \"From: \".get_bloginfo('name').\" <\".get_option('admin_email').\">\";\n\t\t\t\t\n\t\t\t\twp_mail($user->user_email, $subject, $message, $headers);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t///// IF ITS A SPOT\n\t\t\tif($post->post_type == 'spot') {\n\t\t\t\t\n\t\t\t\tif(ddp('future_notification') == 'on' && $old_status != 'publish' && $new_status == 'publish') {\n\t\t\t\t\t\n\t\t\t\t\t//// ALSO CHECKS FOR USER NOTIFICATIONS FOR MATCHING CRITERIA\n\t\t\t\t\tif(function_exists('_sf_check_for_user_notifications_matching_spot')) { _sf_check_for_user_notifications_matching_spot($post->ID); }\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('submission_days') != '' && ddp('submission_days') != '0') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO PENDING IN X AMOUNT OF DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET FOR OUR FEATURED SUBMISSION - AND ITS INDEED FEATURED\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('price_featured_days') != '' && ddp('price_featured_days') != '0' && get_post_meta($post->ID, 'featured', true) == 'on') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO NORMAL SUBMISSION AFTER X DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date_featured($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "function post_publish_notification($ID , $post){\n\t$email = get_the_author_meta('user_email',$post->post_author);\n\t$subject = 'Published '.$post->post_title;\n\t$message = 'We just Published your post '.$post->post_title.\n\t ' take a look at : '. get_permalink($ID);\n\twp_mail($email,$subject,$message);\n}", "function postCommentNotify($id, $postId){\r\n $commentManager = new CommentsManager();\r\n $notify = $commentManager->postNotify($id);\r\n}", "function wp_notify_postauthor($comment_id, $deprecated = \\null)\n {\n }", "public function publishComment($id){\n $getDetail = Comment::select('publish')->where(['id' => $id])->first();\n if ($getDetail->publish == '1') {\n $data = array(\n 'publish' => '0'\n );\n $msg = \"Comment unpublish successfully\";\n } else {\n $data = array(\n 'publish' => '1'\n );\n $msg = \"Comment publish successfully\";\n }\n\n Comment::where(['id' => $id])->update($data);\n return redirect()->back()->with('success', $msg);\n }", "function notify_post($post_id) {\n\n if( ( $_POST['post_status'] == 'publish' ) && ( $_POST['original_post_status'] != 'publish' ) && ( $_POST['post_type'] == 'events' ) ) {\n\n send_event_email($post_id);\n\n }\n\n}", "public function action_public()\n {\n\t\t$id = $this->request->param('id', 0);\n\n\t\t// Comment must have a parent\n\t\tif ($id == 0)\n\t\t{\n\t\t\tKohana::$log->add(LOG::INFO, 'Attempt to load all public comments without a defined parent');\n\t\t\t//$this->request->response = FALSE;\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->create_list('publish', FALSE);\n\t\t}\n\t}", "function wp_new_comment_notify_moderator($comment_id)\n {\n }", "public function published()\n {\n $userManager = new UserManager;\n $infoUser = $userManager->getInfo($_SESSION['id_user']);\n if ($_SESSION['id_user'] == $infoUser['id'] and $infoUser['rank_id'] == 1) {\n if (isset($_GET['id']) && $_GET['id'] > 0) {\n\n $commentManager = new CommentManager;\n $unpublished = $commentManager->published($_GET['id']);\n $resetReport = $commentManager->resetReport($_GET['id']);\n header('Location: administration');\n } else {\n throw new Exception('Impossible de trouvé le commentaire');\n }\n } else {\n throw new Exception('Vous n\\'êtes pas autorisé à faire cela');\n }\n }", "public function notifyUser(&$comment) {\n if (!$comment instanceof modxTalksPost) {\n return false;\n }\n\n $this->modx->lexicon->load('modxtalks:emails');\n\n /**\n * Get User info\n */\n $user = $comment->getUserData();\n\n $cid = $comment->conversationId;\n $idx = $comment->idx;\n\n $link = $this->generateLink($cid, $idx, 'full');\n $images_url = $this->modx->getOption('site_url') . substr($this->config['imgUrl'], 1);\n\n $subject = $this->modx->lexicon('modxtalks.email_comment_approved');\n $text = $this->modx->lexicon('modxtalks.email_user_approve_comment', array(\n 'link' => $link,\n ));\n\n $params = array(\n 'title' => 'Заголовок',\n 'content' => $this->modx->stripTags($this->bbcode($comment->content)),\n 'images_url' => $images_url,\n 'avatar' => $this->getAvatar($user['email'], 50),\n 'text' => $text,\n 'date' => date($this->config['dateFormat'] . ' O', $comment->time),\n );\n\n /**\n * Get email body\n */\n $body = $this->getChunk('mt_send_mail', $params);\n\n /**\n * Send notifications to user\n */\n $success = false;\n if (!empty($user['email'])) {\n if ($this->sendEmail($subject, $body, $user['email'])) {\n $success = true;\n }\n }\n\n return $success;\n }", "public function notifyModerators(&$comment) {\n if (!$comment instanceof modxTalksPost && !$comment instanceof modxTalksTempPost) {\n return false;\n }\n\n $this->modx->lexicon->load('modxtalks:emails');\n\n /**\n * Get User info\n */\n $user = $comment->getUserData();\n $images_url = $this->modx->getOption('site_url') . substr($this->config['imgUrl'], 1);\n\n if ($comment instanceof modxTalksPost) {\n $cid = $comment->conversationId;\n $idx = $comment->idx;\n $link = $this->generateLink($cid, $idx, 'full');\n $subject = $this->modx->lexicon('modxtalks.email_new_comment');\n $text = $this->modx->lexicon('modxtalks.email_added_new_comment', array(\n 'link' => $link,\n 'name' => $user['name'],\n ));\n } elseif ($comment instanceof modxTalksTempPost) {\n $subject = $this->modx->lexicon('modxtalks.email_new_premoderated_comment');\n $text = $this->modx->lexicon('modxtalks.email_user_add_premoderated_comment', array(\n 'name' => $user['name'],\n ));\n }\n\n $params = array(\n 'title' => 'Заголовок',\n 'content' => $this->modx->stripTags($this->bbcode($comment->content)),\n 'images_url' => $images_url,\n 'avatar' => $this->getAvatar($user['email'], 50),\n 'text' => $text,\n 'date' => date($this->config['dateFormat'] . ' O', $comment->time),\n );\n\n /**\n * get email body\n */\n $body = $this->getChunk('mt_send_mail', $params);\n\n /**\n * send notifications\n */\n $success = false;\n\n $emails = $this->getUsersEmailsByGroups($this->config['moderator'], $comment);\n\n /**\n * send notifications to moderators\n */\n if (!empty($emails)) {\n if ($this->sendEmail($subject, $body, $emails)) {\n $success = true;\n }\n }\n\n return $success;\n }", "function block_core_calendar_update_has_published_posts()\n {\n }", "public function onPostShowing(Post $post)\n {\n $user = auth()->user();\n if (!isAdmin($user)) {\n $post->increment('view_count');\n }\n if (auth()->check()) {\n $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Model\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }\n }\n }", "public function send_subscriptions(){\r\n //send email to all those who have subscribed to posts from this author\r\n\r\n }", "public function onPostShowing(Post $post)\n {\n $is_viewed_already=(bool) View::where('user_id', \\Auth::id())\n ->where('post_id', $this->id)\n ->first();\n\n $user = auth()->user();\n if($is_viewed_already == false){\n \\Auth::user()->views()->attach($post->id);\n }\n \n /* $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }*/\n }", "protected function AllowSendAuthorReviewCommentNotification()\n {\n $bAllowSendAuthorCommentNotification = false;\n if ($this->fieldSendCommentNotification) {\n if (!empty($this->fieldAuthorEmail) || !empty($this->fieldDataExtranetUserId)) {\n $bAllowSendAuthorCommentNotification = true;\n }\n }\n\n return $bAllowSendAuthorCommentNotification;\n }", "function wyz_business_post_comments_toggle() {\n\t$nonce = filter_input( INPUT_POST, 'nonce' );\n\n\tif ( ! wp_verify_nonce( $nonce, 'wyz_ajax_custom_nonce' ) ) {\n\t\twp_die( 'busted' );\n\t}\n\n\tglobal $current_user;\n\twp_get_current_user();\n\n\t$_post_id = intval( $_POST['post-id'] );\n\t$_user_id = $current_user->ID;\n\t$_comm_stat = $_POST['comm-stat'];\n\t$_post = get_post( $_post_id );\n\n\tif ( ! $_post || ( $_user_id != $_post->post_author && ! user_can( $_user_id, 'manage_options' ) ) ) {\n\t\twp_die( false );\n\t}\n\t\n\tif ( 'open' == $_comm_stat || 'closed' == $_comm_stat ) { \n\t\t$_post->comment_status = $_comm_stat;\n\t}\n\twp_update_post( $_post );\n\twp_die( true );\n}", "public function comment() {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to comment');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n // Sanitize array\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n $data = [\n 'body' => trim($_POST['body']),\n 'post_id' => trim($_POST['post_id']),\n 'user_id' => $_SESSION['user_id'],\n 'user_name' => $this->userModel->getUserById($_SESSION['user_id'])->name\n ];\n\n if (!empty($data['body']) && !empty($data['post_id']) && !empty($data['user_id']) && !empty($data['user_name'])) {\n // Save comment\n $this->postModel->comment($data);\n $post = $this->postModel->getPostById($data['post_id']);\n $receiver = $this->userModel->getUserById($post->user_id);\n if ($receiver->receive_email == true) {\n $this->mail($receiver->email, $receiver->name, $post->id);\n }\n }\n redirect('/posts/show/' . $_POST['post_id']);\n }\n\n }", "public function getPublishComment() \n {\n $select = $this->select()\n ->from($this->_name)\n ->where(\"status =?\", 'publish')\n // ->where(\"blog_id =?\", $commentId)\n ->order(array(\"{$this->_primaryKey} DESC\"));\n\n return $this->returnResultAsAnArray($this->fetchAll($select));\n }", "public function onPostShowing(Post $post)\n {\n $user = auth()->user();\n if (!isAdmin($user)) {\n $post->increment('view_count');\n }\n\n if (auth()->check()) {\n $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }\n }\n }", "public function publish($id)\n {\n $comment = CourseComment::where('published', 0)->where('id', $id);\n\n if($comment)\n {\n $comment->update([\n 'published' => 1\n ]);\n \n session()->flash('success', 'Comment Published Successfully');\n\n return redirect()->back();\n }\n }", "function authorNotification2( $post_id ) {\n\tglobal $wpdb;\n\t$post = get_post( $post_id );\n\t$author = get_userdata( $post->post_author );\n\t$message = \"\";\n\twp_mail( $author->user_email, \"\", $message );\n}", "public function sendPostNotification() {\n\t\t$getNotificatin = \\DB::table('notification')\n\t\t\t->where('type', 'post_added')\n\t\t\t->where('push_status', '0')\n\t\t\t->where('receiver', '0')\n\t\t\t->orderBy('id', 'ASC')\n\t\t\t->get();\n\t\tif (count($getNotificatin) > 0) {\n\t\t\tforeach ($getNotificatin as $nKey => $rows) {\n\t\t\t\t$notification_id = $rows->id;\n\t\t\t\t$senderId = $rows->sender;\n\t\t\t\t$senderInfo = \\DB::table('users')->where('id', $rows->sender)->first();\n\t\t\t\t$user_details[] = array(\n\t\t\t\t\t'ID' => $senderInfo->id,\n\t\t\t\t\t'user_image' => '',\n\t\t\t\t\t'Name' => $senderInfo->username,\n\t\t\t\t);\n\t\t\t\t$my_user = \\DB::table('user_connection')\n\t\t\t\t\t->where('user_connection.friend_id', $senderId)\n\t\t\t\t\t->where('user_connection.follow', '1')\n\t\t\t\t\t->where('user_connection.status', '1')\n\t\t\t\t\t->pluck('user_connection.user_id');\n\t\t\t\t$userRow = \\DB::table('users')\n\t\t\t\t\t->where('player_id', '!=', '')\n\t\t\t\t\t->WhereIn('id', $my_user)\n\t\t\t\t\t->pluck('player_id');\n\t\t\t\tif (!empty($userRow)) {\n\t\t\t\t\tif ($userRow) {\n\t\t\t\t\t\t$title = 'New Post';\n\t\t\t\t\t\t$message = $senderInfo->username . ' added new post';\n\t\t\t\t\t\t$msg = array(\n\t\t\t\t\t\t\t'title' => $title,\n\t\t\t\t\t\t\t'message' => $message,\n\t\t\t\t\t\t\t'push_notification_id' => $notification_id,\n\t\t\t\t\t\t\t'type' => $rows->type,\n\t\t\t\t\t\t\t'ID' => $rows->receiver,\n\t\t\t\t\t\t\t'sender_user_id' => $rows->sender,\n\t\t\t\t\t\t\t'sender_user_name' => $senderInfo->username,\n\t\t\t\t\t\t\t'object_id' => $rows->object_id ? $rows->object_id : 0,\n\t\t\t\t\t\t\t'user_details' => $user_details,\n\t\t\t\t\t\t\t'batch_count' => 0,\n\t\t\t\t\t\t\t'vibrate' => 1,\n\t\t\t\t\t\t\t'sound' => 1,\n\t\t\t\t\t\t\t'largeIcon' => 'large_icon',\n\t\t\t\t\t\t\t'smallIcon' => 'small_icon',\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$response = \\OneSignalServiceHelpers::sendPushNotification($userRow, $msg);\n\t\t\t\t\t\t$this->info($response);\n\t\t\t\t\t}\n\t\t\t\t\t$this->info(json_encode($userRow));\n\t\t\t\t}\n\t\t\t\t$this->updateNotificationStatus($notification_id);\n\t\t\t}\n\t\t}\n\t}", "function proitdev_publish_send_mail(){\n\tglobal $post;\n\t$author = $post->post_author; /* Post author ID */\n\t$name = get_the_author_meta('display_name',$author);\n\t$mail = get_the_author_meta('user_email',author);\n\t$title = $post->post_title;\n\t$permalink = get_permalink( $ID );\n\t$edit = get_edit_post_link($ID, '');\n\t$to[] = $sprintf('%s <%s>' , $name, $email);\n\t$subject = sprintf('Published: %s', $title);\n\t$message = sprintf('Congratulations, %s! Your article \"%s\" has been published.'. \"\\n\\n\", $name, $title);\n\t$message .= sprintf('View %s', $permalink);\n\t$header[] = '';\n\twp_mail($to, $subject, $messagge, $header);\n}", "function check_and_publish_future_post($post)\n {\n }", "function wpgnv_mail_on_post( $post_id ) {\n\tif ( 'pending' == get_post_status( $post_id ) ) {\n\t\t$post_title = get_the_title( $post_id );\n\t\t$subject = 'A new Idea has been submitted on wpgnv.com!';\n\t\t$message = \"Please moderate this Idea as soon as possible.\\n\\n\";\n\t\t$message .= \"TITLE: $post_title \\n\\n\";\t\n\t\t$message .= \"Link: http://wpgnv.com/wp-admin\";\n\t\t//$message = get_post_status( $post_id );\n\t\twp_mail( '[email protected]', $subject, $message );\n\t\twp_mail( '[email protected]', $subject, $message );\n\t\twp_mail( '[email protected]', $subject, $message );\n\t}\n}", "public function notify(quipComment &$comment) {\n if (!$this->_loadLexicon()) return false;\n $this->xpdo->lexicon->load('quip:emails');\n \n /* get the poster's email address */\n $posterEmail = false;\n $user = $comment->getOne('Author');\n if ($user) {\n $profile = $user->getOne('Profile');\n if ($profile) {\n $posterEmail = $profile->get('email');\n }\n }\n\n /* get email body/subject */\n $properties = $comment->toArray();\n $properties['url'] = $comment->makeUrl('',array(),array('scheme' => 'full'));\n $body = $this->xpdo->lexicon('quip.email_notify',$properties);\n $subject = $this->xpdo->lexicon('quip.email_notify_subject');\n\n /* send notifications */\n $success = true;\n $notifyEmails = $this->get('notify_emails');\n $emails = explode(',',$notifyEmails);\n\n /* send notifications to notify_emails subjects */\n if (!empty($emails)) {\n $this->sendEmail($subject,$body,$emails);\n }\n\n /* now send to notified users */\n $notifiees = $this->getMany('Notifications');\n /** @var quipCommentNotify $notification */\n foreach ($notifiees as $notification) {\n $email = $notification->get('email');\n /* remove invalid emails */\n if (empty($email) || strpos($email,'@') == false) {\n $notification->remove();\n continue;\n }\n /* don't notify the poster, since they posted the comment. */\n if ($posterEmail == $email) {\n continue;\n }\n\n $notification->send($comment,$properties);\n }\n\n return $success;\n }", "public function broadcastOn()\n {\n return (new PrivateChannel('editor-notify'));\n }", "public function iN_InsertNotificationForCommented($userID, $postID) {\n\t\t$userID = mysqli_real_escape_string($this->db, $userID);\n\t\t$postID = mysqli_real_escape_string($this->db, $postID);\n\t\t$postData = $this->iN_GetAllPostDetails($postID);\n\t\t$postFile = isset($postData['post_file']) ? $postData['post_file'] : NULL;\n\t\t$postOwnerID = isset($postData['post_owner_id']) ? $postData['post_owner_id'] : NULL;\n\t\tif ($postFile) {\n\t\t\t$notType = 'image';\n\t\t} else {\n\t\t\t$notType = 'text';\n\t\t}\n\t\t$time = time();\n\t\tmysqli_query($this->db, \"INSERT INTO i_user_notifications (not_iuid, not_post_id, not_own_iuid, not_type, not_not_type, not_time)VALUES('$userID','$postID','$postOwnerID','$notType','commented','$time')\") or die(mysqli_error($this->db));\n\t\tmysqli_query($this->db, \"UPDATE i_users SET notification_read_status = '1' WHERE iuid = '$postOwnerID'\") or die(mysqli_error($this->db));\n\t\treturn true;\n\t}", "public function putPublish($id) {\n return $this->changeStatus(Comment::find((int)$id), 'publish');\n }", "function notify_reviewer( $post_ID, $post, $dowhat='publish' ) {\n\t\t\tglobal $wpdb, $current_user;\n\t\t\t$last_revision = $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_parent=%d AND post_type=%s ORDER BY post_date DESC LIMIT 1\", $post_ID, 'revision' ) );\n\t\t\t$post_content = 'draft' == $dowhat ? get_post( $last_revision ) : get_post( $post_ID );\n\t\t\t$last_mod = $post_content->post_date;\n\t\t\t$post_content = $post_content->post_content;\n\t\t\t$revision_compare_link = admin_url( 'revision.php?action=diff&post_type=' . $post->post_type . '&right=' . $post->ID . '&left=' . $last_revision );\n\t\t\t$body = sprintf( __( \"New changes have been made to \\\"%s\\\" at <%s>. \", $this->text_domain ), $post->post_title, get_permalink( $post->ID ) );\n\t\t\tif( 'draft' == $dowhat ) {\n\t\t\t\t$body .= __( \"The author has requested that you review the new changes and determine whether to remove or approve them. These changes will not appear on the public website until you approve them.\\n\\n\", $this->text_domain );\n\t\t\t} else {\n\t\t\t\t$body .= __( \"The modifications have been published, but the author of the page has requested you be notified of them.\\n\\n\", $this->text_domain );\n\t\t\t}\n\t\t\t$body .= sprintf( __( \"The new content of the page is shown below if you would like to review it. You can also review %s the changes at %s. Thank you. \\n\\n======================================================= \\nRevisions made at %s \\n======================================================= \\n\\n%s\", $this->text_domain ), ( 'draft' == $dowhat ? __( \" and approve/reject \", $this->text_domain ) : '' ), $revision_compare_link, $last_mod, $post_content );\n\t\t\t\n\t\t\t$headers = \"From: {$current_user->display_name} <{$current_user->user_email}>\\r\\n\";\n\t\t\t\n\t\t\twp_mail( $this->reviewers, sprintf( __( '[%s] New modifications to %s' ), get_bloginfo('name'), $post->post_title ), $body, $headers );\n\t\t}", "private function update_atozsites_comment(WP_Post $post)\n {\n $comment_count = wp_count_comments($post->ID);\n\n if (!is_object($comment_count) || $comment_count->approved < 3) {\n return;\n }\n\n $atozsites_comment = array_reduce(get_comments(array('post_id' => $post->ID)), array($this, 'compare_comments'));\n \n /**\n\t\t * Filter: atozsites_allow_post_author\n\t\t *\n\t\t * Whether to allow post author comments to be atozsites.\n\t\t *\n\t\t * @since 1.1.6\n\t\t *\n\t\t * @param bool false if not, true if yes\n\t\t */\n $allow_post_author = apply_filters( 'atozsites_allow_post_author', false );\n if ( $post->post_author === $atozsites_comment->user_id && ! $allow_post_author ) {\n\t return;\n }\n\n if ($atozsites_comment instanceof WP_Comment) {\n update_post_meta($post->ID, $this->atozsites_comment_id_meta_key, $atozsites_comment->comment_ID);\n }\n }", "public function handleFutureToPublish($post) {\n if (\"publish\" == $post->post_status) {\n $this->indexPost($post->ID);\n }\n }", "protected function notifyWallComment($comment, $wallPost) {\n $notifyUser = Gdn::userModel()->getID($wallPost['ActivityUserID']);\n\n $activity = [\n 'ActivityType' => 'WallComment',\n 'ActivityUserID' => $comment['InsertUserID'],\n 'Format' => $comment['Format'],\n 'NotifyUserID' => $wallPost['ActivityUserID'],\n 'RecordType' => 'ActivityComment',\n 'RecordID' => $comment['ActivityCommentID'],\n 'RegardingUserID' => $wallPost['ActivityUserID'],\n 'Route' => userUrl($notifyUser, ''),\n 'Story' => $comment['Body'],\n 'HeadlineFormat' => t('HeadlineFormat.NotifyWallComment', '{ActivityUserID,User} commented on your <a href=\"{Url,url}\">wall</a>.')\n ];\n\n $this->save($activity, 'WallComment');\n }", "public function getPublish();", "public function unsubscribePostCommentsAction()\r\n\t{\r\n\t\t$user_id = $this->_request->get('user_id');\r\n\r\n\t\tif (!v::regex('/' . My_Regex::BASE64 . '/')->validate($user_id))\r\n\t\t{\r\n\t\t\tthrow new RuntimeException('Incorrect user ID value');\r\n\t\t}\r\n\r\n\t\t$user_id = base64_decode($user_id);\r\n\r\n\t\tif (!v::intVal()->validate($user_id))\r\n\t\t{\r\n\t\t\tthrow new RuntimeException('Incorrect user ID value');\r\n\t\t}\r\n\r\n\t\t$userModel = new Application_Model_User;\r\n\t\t$authUser = $userModel->getAuth();\r\n\r\n\t\tif ($user_id == $authUser['id'])\r\n\t\t{\r\n\t\t\t$user = $authUser['id'];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (!$userModel->checkId($user_id, $user))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect user ID: ' .\r\n\t\t\t\t\tvar_export($user_id, true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$data = ['user_id' => $user_id];\r\n\r\n\t\t$post_id = $this->_request->get('post_id');\r\n\r\n\t\tif (!v::optional(v::regex('/' . My_Regex::BASE64 . '/'))->validate($post_id))\r\n\t\t{\r\n\t\t\tthrow new RuntimeException('Incorrect post ID value');\r\n\t\t}\r\n\r\n\t\t$commentSubscriptionModel = new Application_Model_CommentSubscription;\r\n\r\n\t\tif ($post_id != null)\r\n\t\t{\r\n\t\t\t$post_id = base64_decode($post_id);\r\n\r\n\t\t\tif (!v::intVal()->validate($post_id))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post ID value');\r\n\t\t\t}\r\n\r\n\t\t\tif (!Application_Model_News::checkId($post_id, $post, ['join'=>false]))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post ID: ' .\r\n\t\t\t\t\tvar_export($post_id, true));\r\n\t\t\t}\r\n\r\n\t\t\tif ($user_id != $post['user_id'])\r\n\t\t\t{\r\n\t\t\t\t$existComment = (new Application_Model_Comments)->findByAttributes([\r\n\t\t\t\t\t'user_id' => $user_id,\r\n\t\t\t\t\t'news_id' => $post_id\r\n\t\t\t\t]);\r\n\r\n\t\t\t\tif (!$existComment)\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new RuntimeException('You are not authorized to access this action');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$data['post_id'] = $post_id;\r\n\t\t}\r\n\r\n\t\t$isSubscribed = false;\r\n\r\n\t\tif ($commentSubscriptionModel->findByAttributes($data))\r\n\t\t{\r\n\t\t\t$isSubscribed = true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif ($post_id != null)\r\n\t\t\t{\r\n\t\t\t\tif ($commentSubscriptionModel->findByAttributes(\r\n\t\t\t\t\t['user_id' => $user_id, 'post_id' => null]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$isSubscribed = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($isSubscribed)\r\n\t\t{\r\n\t\t\t$redirectUrl = 'unsubscribe-post-comments/already';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$redirectUrl = 'unsubscribe-post-comments/success';\r\n\t\t\t$commentSubscriptionModel->insert($data);\r\n\t\t}\r\n\r\n\t\t$this->_redirect($redirectUrl);\r\n\t}", "function block_core_calendar_has_published_posts()\n {\n }", "function wputh_disable_comments_send_spam($approved, $commentdata) {\n return 'spam';\n}", "protected function comments_bubble($post_id, $pending_comments)\n {\n }", "public function getPendingPost();", "public function isPublished()\n {\n return $this->postID > 0;\n }", "public function maybe_notify_new_published_post( $new_status, $old_status, $post ) {\n\t\tif ( 'publish' != $new_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $old_status == $new_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->is_post_notifiable( $post, 'publish' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->notify_blog_post( $post, 'new' );\n\t}", "public function publish()\n {\n $message = new MailMessage;\n $message->greeting(\"Hi {$this->post->reporting->name}!\");\n $message->line(\"The post {$this->post->titile} has been published successfully.\"); \n foreach ($this->workflow as $key => $value) {\n if ($key == 0) {\n $message->action($value->action, url('workflows/workflow/' . $value->id));\n continue;\n }\n $message->line('<a href=\"'.url('workflows/workflow/' . $value->id).'\">'.$value->action.'</a>');\n }\n\n return $message;\n }", "function charangoten_custom_comment(&$a1, $op) {\n if ($op == 'insert' || $op == 'update') {\n if ($a1['stream_publish']) {\n //dpm($a1, \"dff_custom_comment, publishing to stream\");\n $node = node_load($a1['nid']);\n \n // http://wiki.developers.facebook.com/index.php/Attachment_(Streams)\n $attachment = array(\n 'name' => $a1['subject'],\n 'href' => url('node/' . $a1['nid'], array('absolute' => TRUE, 'fragment' => 'comment-' . $a1['cid'])),\n 'description' => $a1['comment'],\n 'properties' => array(t('In reply to') => array('text' => $node->title, 'href' => url(\"node/\" . $node->nid, array('absolute' => TRUE)))),\n );\n\n $user_message = t('Check out my latest comment on !site...',\n array('!site' => variable_get('site_name', t('my Drupal for Facebook powered site'))));\n $actions = array();\n $actions[] = array('text' => t('Read More'),\n 'href' => url('node/'.$a1['nid'], array('absolute' => TRUE)),\n );\n fb_stream_publish_dialog(array('user_message' => $user_message,\n 'attachment' => $attachment,\n 'action_links' => $actions,\n ));\n }\n }\n\n}", "public function publishInstagramComments($instagram_media_id) {\n $data['message'] = \\Drupal::request()->get('message');\n $current_uid = isset($_GET['team']) ? $_GET['muid'] : \\Drupal::currentUser()->id();\n $facebookHelper = new FacebookHelperFunction();\n $fb = $facebookHelper->getFBObject();\n $properties = ['token_access', 'id', 'status'];\n $network_properties = $this->getKabbodeNetworkStatusProperty(168, $current_uid, $properties);\n $access_token = $network_properties['token_access'];\n // we need to validate token\n $validToken = $facebookHelper->getFBTokenProperty($access_token, 'is_valid');\n if ($validToken) {\n $access_token_val = $access_token->getValue();\n // check if comments is enabled.\n // $result = $this->isCommentEnabled($instagram_media_id, $access_token_val);\n // if ($result['is_comment_enabled']) {\n try {\n // Returns a `FacebookFacebookResponse` object\n $response = $fb->post('/' . $instagram_media_id . '/comments', $data, $access_token_val);\n }\n catch(\\Facebook\\Exceptions\\FacebookResponseException $e) {\n $output = array('error' => array('msg' => $e->getMessage(), 'code' => $e->getCode(), 'type' => 'Facebook SDK Exception', 'custom_type' => 'Facebook Error Reported',));\n echo json_encode($output);\n exit;\n }\n catch(\\Facebook\\Exceptions\\FacebookSDKException $e) {\n $output = array('error' => array('msg' => $e->getMessage(), 'code' => $e->getCode(), 'type' => 'Facebook SDK Exception', 'custom_type' => 'Facebook Error Reported',));\n echo json_encode($output);\n exit;\n }\n $response = $response->getDecodedBody();\n if ($response) {\n // Returns a `FacebookFacebookResponse` object\n $response2 = $fb->get('/' . $response['id'] . '?fields=username,text,timestamp', $access_token_val);\n }\n $response2 = $response2->getDecodedBody();\n $data['single_insta_post']['comments']['data']['0'] = $response2;\n $twigFilePath = drupal_get_path('module', 'social_media') . '/templates/instagram/instagram-comments.html.twig';\n $template = $this->twig->loadTemplate($twigFilePath);\n $markup = $template->render(array('data' => $data));\n //\\Drupal::logger('social media insta')->warning('<pre><code>' . print_r($markup, TRUE) . '</code></pre>');\n $output = array('response' => array('data' => $markup));\n $json_response = json_encode($output);\n return new JsonResponse($json_response);\n \n }\n }", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "function publish() {\n\t\t$option = JRequest::getCmd('option');\n\n\t\t// Se obtiene el modelo\n\t\t$model = $this->getModel('comments');\n\t\t// Se obtienen los ids de los registros a publicar\n\t\t$cids = JRequest::getVar('cid', array(0), 'post', 'array');\n\t\tJArrayHelper::toInteger($cids);\n $product_type_code = JRequest::getVar('product_type_code');\n\n\t\t// Lanzar error si no se ha seleccionado al menos un registro a publicar\n if (count($cids) < 1 || !$product_type_code) {\n\t\t\tJError::raiseError(500, JText::_('CP.SELECT_AN_ITEM_TO_PUBLISH'));\n\t\t}\n\n\t\tif ($model->publish($cids, true, $product_type_code)) {\n\t\t\t$msg = JText::_('CP.ROWS_PUBLISHED');\n\t\t\t$type = 'message';\n\t\t} else {\n\t\t\t// Si hay algún error se ajusta el mensaje\n\t\t\t$msg = $model->getError();\n\t\t\tif (!$msg) {\n\t\t\t\t$msg = JText::_('CP.ERROR_ONE_OR_MORE_DATA_COULD_NOT_BE_PUBLISHED');\n\t\t\t}\n\t\t\t$type = 'error';\n\t\t}\n\t\t$this->setRedirect('index.php?option=' . $option . '&view=comments', $msg, $type);\n\t}", "public function sendNotification($post = null, $attachmentList = null) {\n\t\t$sql = \"SELECT\t\tuser.*\n\t\t\tFROM\t\twbb\".WBB_N.\"_board_subscription subscription\n\t\t\tLEFT JOIN\twcf\".WCF_N.\"_user user\n\t\t\tON\t\t(user.userID = subscription.userID)\n\t\t\tWHERE\t\tsubscription.boardID = \".$this->boardID.\"\n\t\t\t\t\tAND subscription.enableNotification = 1\n\t\t\t\t\tAND subscription.emails = 0\n\t\t\t\t\tAND subscription.userID <> \".$this->userID.\"\n\t\t\t\t\tAND user.userID IS NOT NULL\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\tif (WCF::getDB()->countRows($result)) {\n\t\t\t// get first post\n\t\t\tif ($post === null) {\n\t\t\t\trequire_once(WBB_DIR.'lib/data/post/Post.class.php');\n\t\t\t\t$post = new Post($this->firstPostID);\n\t\t\t}\n\t\t\t\n\t\t\t// get attachments\n\t\t\tif ($attachmentList === null) {\n\t\t\t\trequire_once(WCF_DIR.'lib/data/attachment/MessageAttachmentList.class.php');\n\t\t\t\t$attachmentList = new MessageAttachmentList($this->firstPostID);\n\t\t\t\t$attachmentList->readObjects();\n\t\t\t}\n\t\t\t\n\t\t\t// set attachments\n\t\t\trequire_once(WCF_DIR.'lib/data/message/bbcode/AttachmentBBCode.class.php');\n\t\t\tAttachmentBBCode::setAttachments($attachmentList->getSortedAttachments());\n\t\t\t\n\t\t\t// parse text\n\t\t\trequire_once(WCF_DIR.'lib/data/message/bbcode/MessageParser.class.php');\n\t\t\t$parser = MessageParser::getInstance();\n\t\t\t$parser->setOutputType('text/plain');\n\t\t\t$parsedText = $parser->parse($post->message, $post->enableSmilies, $post->enableHtml, $post->enableBBCodes, false);\n\t\t\t// truncate message\n\t\t\tif (!POST_NOTIFICATION_SEND_FULL_MESSAGE && StringUtil::length($parsedText) > 500) $parsedText = StringUtil::substring($parsedText, 0, 500) . '...';\n\t\t\t\n\t\t\t// send notifications\n\t\t\t$languages = array();\n\t\t\t$languages[WCF::getLanguage()->getLanguageID()] = WCF::getLanguage();\n\t\t\t$languages[0] = WCF::getLanguage();\n\t\t\trequire_once(WCF_DIR.'lib/data/mail/Mail.class.php');\n\t\t\trequire_once(WCF_DIR.'lib/data/user/User.class.php');\n\t\t\trequire_once(WBB_DIR.'lib/data/board/Board.class.php');\n\t\t\t$board = Board::getBoard($this->boardID);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\t$recipient = new User(null, $row);\n\t\t\t\t\n\t\t\t\t// get language\n\t\t\t\tif (!isset($languages[$recipient->languageID])) {\n\t\t\t\t\t$languages[$recipient->languageID] = new Language($recipient->languageID);\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// enable language\n\t\t\t\t$languages[$recipient->languageID]->setLocale();\n\t\t\t\t\n\t\t\t\t// send mail\n\t\t\t\t$data = array(\n\t\t\t\t\t'PAGE_TITLE' => $languages[$recipient->languageID]->get(PAGE_TITLE),\n\t\t\t\t\t'PAGE_URL' => PAGE_URL,\n\t\t\t\t\t'$recipient' => $recipient->username,\n\t\t\t\t\t'$author' => $this->username,\n\t\t\t\t\t'$boardTitle' => $languages[$recipient->languageID]->get($board->title),\n\t\t\t\t\t'$topic' => $this->topic,\n\t\t\t\t\t'$threadID' => $this->threadID,\n\t\t\t\t\t'$text' => $parsedText);\n\t\t\t\t$mail = new Mail(\tarray($recipient->username => $recipient->email),\n\t\t\t\t\t\t\t$languages[$recipient->languageID]->get('wbb.threadAdd.notification.subject', array('$title' => $languages[$recipient->languageID]->get($board->title))),\n\t\t\t\t\t\t\t$languages[$recipient->languageID]->get('wbb.threadAdd.notification.mail', $data));\n\t\t\t\t$mail->send();\n\t\t\t}\n\t\t\t\n\t\t\t// enable user language\n\t\t\tWCF::getLanguage()->setLocale();\n\t\t\t\n\t\t\t// update notification count\n\t\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_board_subscription\n\t\t\t\tSET \temails = emails + 1\n\t\t\t\tWHERE\tboardID = \".$this->boardID.\"\n\t\t\t\t\tAND enableNotification = 1\n\t\t\t\t\tAND emails = 0\";\n\t\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t\t}\n\t}", "public function FbPublishComments($fb_page_id, $fb_object_id) {\n $mode = \\Drupal::request()->get('mode');\n if (isset($mode) && $mode == 'ajax') {\n $op = \\Drupal::request()->get('op');\n if ($op == 'publish') {\n $message = \\Drupal::request()->get('message');\n $requests['message'] = $message;\n } elseif ($op == 'Remove') {\n } else {\n //edit comment\n $op = 'Edit';\n $message = \\Drupal::request()->get('message');\n $requests['message'] = $message;\n }\n }\n $current_uid = isset($_GET['team']) ? $_GET['muid'] : \\Drupal::currentUser()->id();\n $properties = ['token_access'];\n $network_properties = $this->getKabbodeNetworkStatusProperty(166, $current_uid, $properties);\n $access_token = $network_properties['token_access'];\n $facebookHelper = new FacebookHelperFunction();\n $output = $facebookHelper->facebookCommentOperations($access_token, $fb_page_id, $fb_object_id, $requests, $op);\n $json_response = json_encode($output);\n return new JsonResponse($json_response);\n }", "function block_core_calendar_update_has_published_post_on_delete( $post_id ) {\n\t\t$post = get_post( $post_id );\n\n\t\tif ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {\n\t\t\treturn;\n\t\t}\n\n\t\tblock_core_calendar_update_has_published_posts();\n\t}", "function block_core_calendar_update_has_published_post_on_delete($post_id)\n {\n }", "public function publish(Post $post)\n\t{\n\t\t$q = \"UPDATE in_posts \";\n\t\t$q .= \"SET publish_flag=1, read_length=:read_length, publish_time=Now() WHERE id=:post_id\";\n\t\t$vars = array(\n\t\t\t':read_length'=>$post->read_length,\n\t\t\t':post_id'=>$post->id\n\t\t);\n\t\t//$this->logger->logInfo($q);\n\t\t$ps = $this->execute($q, $vars);\n\t}", "function comment_action_handler( $comment_id ) {\n\t\tif ( !is_array( $comment_id ) ) {\n\t\t\tif ( wp_get_comment_status( $comment_id ) != 'spam' )\n\t\t\t\t$this->add_ping( 'db', array( 'comment' => $comment_id ) );\n\t\t} else {\n\t\t\tforeach ( $comment_id as $id ) {\n\t\t\t\tif ( wp_get_comment_status( $comment_id ) != 'spam' )\n\t\t\t\t\t$this->add_ping( 'db', array( 'comment' => $id) );\n\t\t\t}\n\t\t}\n\t}", "public function only_post_user_can_answered_his_post()\n {\n $comment = factory(\\App\\Comment::class)->create();\n\n $policy = new CommentPolicy();\n\n $policy->accept($comment->post->user,$comment);\n\n $this->assertTrue($policy->accept($comment->post->user,$comment));\n }", "public function publishPost($POST) {\r\n\t\t$sql = 'UPDATE `posts` SET `post_status` = :post_status\r\n\t\t\t\tWHERE `ID` = :ID AND `post_author` = :post_author LIMIT 1';\r\n\t\t$sth = $this->db->prepare($sql);\r\n\r\n\t\t$ret = $sth->execute(array('ID' => $POST['id'],\r\n\t\t\t\t\t\t\t\t 'post_author' => $GLOBALS['user']['id'],\r\n\t\t\t\t\t\t\t\t 'post_status' => 'publish'));\r\n\r\n\t\tif ($ret) {\r\n\t\t\t$this->putMsg('Successfully published');\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "public function have_comments()\n {\n }", "public function no_post_author_cannot_accept_a_comment_as_post_answer()\n {\n $comment = factory(\\App\\Comment::class)->create();\n\n $this->actingAs(factory(\\App\\User::class)->create());\n\n $this->visit($comment->post->url);\n\n $this->post(route('comment.accept',$comment));\n $this->seeInDatabase('posts',[\n 'id' => $comment->post_id,\n 'pending' => true\n ]);\n\n\n }", "function comment_subscription_status() {\n\tglobal $comment;\n\treturn !!_stc()->is_subscribed( $comment->comment_ID );\n}", "public function post_publish()\n\t{\n\t\t$this->get_publish();\n\t}", "function custom_pings($comment, $args, $depth) {\n $GLOBALS['comment'] = $comment;\n ?>\n <li id=\"comment-<?php comment_ID() ?>\" <?php comment_class() ?>>\n <div class=\"comment-author\"><?php printf(__('By %1$s on %2$s at %3$s', 'Foundation'),\n get_comment_author_link(),\n get_comment_date(),\n get_comment_time() );\n edit_comment_link(__('Edit', 'Foundation'), ' <span class=\"meta-sep\">|</span> <span class=\"edit-link\">', '</span>'); ?></div>\n <?php if ($comment->comment_approved == '0') _e('\\t\\t\\t\\t\\t<span class=\"unapproved\">Your trackback is awaiting moderation.</span>\\n', 'Foundation') ?>\n <div class=\"comment-content\">\n <?php comment_text() ?>\n </div>\n<?php }", "function is_post_publicly_viewable($post = \\null)\n {\n }", "public function broadcastOn()\n {\n return ['new-comment-on-item-'.$this->comment->item_id];\n }", "public function broadcastOn()\n {\n return new PrivateChannel('notification-'.$this->postNotification->broadcast_id);\n }", "public function isPublished()\n {\n if(!strcmp($this->getStatus(), 'approved')) {\n return true;\n }\n\n return false;\n }", "static public function comment_submission() {\n ?>\n\n /**\n * Déclenchement d'événements Google analytics lors de la soumission\n * d'un commentaire.\n *\n * source https://felix-arntz.me/blog/customizing-google-analytics-configuration-site-kit-plugin/\n */\n $('#commentform input[type=\"submit\"]').on('click',function(){\n console.log('SFP: Comment submited');\n if(typeof gtag=='function'){\n gtag('event','Commentaire',{\n 'event_category':'Implication',\n 'event_label':window.location.href\n });\n }\n });\n\n <?php\n }", "function custom_pings($comment, $args, $depth) {\n $GLOBALS['comment'] = $comment;\n ?>\n <li id=\"comment-<?php comment_ID() ?>\" <?php comment_class() ?>>\n <div class=\"comment-author\"><?php printf(__('By %1$s on %2$s at %3$s', 'flipblog'),\n get_comment_author_link(),\n get_comment_date(),\n get_comment_time() );\n edit_comment_link(__('Edit', 'flipblog'), ' <span class=\"meta-sep\">|</span> <span class=\"edit-link\">', '</span>'); ?></div>\n <?php if ($comment->comment_approved == '0') _e('\\t\\t\\t\\t\\t<span class=\"unapproved\">Your trackback is awaiting moderation.</span>\\n', 'your-theme') ?>\n <div class=\"comment-content\">\n <?php comment_text() ?>\n </div>\n<?php }", "protected function checkSendImmediately($post)\n {\n if (isset($_GET['sendImmediately'])) {\n /** @var CronHandler $cronHandler */\n $cronHandler = new CronHandler();\n $cronHandler->executeCron('hourly');\n // And redirect back to the page\n header('Location: /wp-admin/post.php?post=' .$post->ID . '&action=edit');\n exit;\n }\n }", "public function publishForEverOneComment($id){\n\t\t$sql = \"UPDATE `comment` SET state= :state WHERE id=\" . $id;\n\t\t$resultat = $this->db->prepare($sql);\n\t\t$resultat->execute(['state' => $_POST['state']]);\n\t}", "public function notify_blog_post( $post, $type ) {\n\t\tif ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$user_id = 'new' === $type ? $post->post_author : get_current_user_id();\n\t\t$user = get_user_by( 'id', $user_id );\n\n\t\t$content = wp_trim_words(\n\t\t\tstrip_shortcodes( has_excerpt( $post ) ? $post->post_excerpt : $post->post_content ),\n\t\t\t55\n\t\t);\n\n\t\t$args = array(\n\t\t\t'action' => 'wporg_handle_activity',\n\t\t\t'type' => $type,\n\t\t\t'source' => 'wordpress',\n\t\t\t'user' => $user->user_login,\n\t\t\t'post_id' => $post->ID,\n\t\t\t'blog' => get_bloginfo( 'name' ),\n\t\t\t'blog_url' => site_url(),\n\t\t\t'post_type' => $post->post_type,\n\t\t\t'title' => get_the_title( $post ),\n\t\t\t'content' => $content,\n\t\t\t'url' => get_permalink( $post->ID ),\n\t\t);\n\n\t\tProfiles\\api( $args );\n\t}", "public function iN_CheckNotificationLikeInsertedBeforeForComment($userID, $commentID, $postID) {\n\t\t$userID = mysqli_real_escape_string($this->db, $userID);\n\t\t$postID = mysqli_real_escape_string($this->db, $postID);\n\t\t$commentID = mysqli_real_escape_string($this->db, $commentID);\n\t\t$check = mysqli_query($this->db, \"SELECT not_iuid, not_post_id, not_comment_id FROM i_user_notifications WHERE not_iuid = '$userID' AND not_post_id = '$postID' AND not_comment_id = '$commentID' AND not_not_type = 'commentLike'\") or die(mysqli_error($this->db));\n\t\tif (mysqli_num_rows($check) == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function publish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\t/* This method formerly updated the published_date, but that was removed in \n\t\t * favor of giving manual control of the published_date to the author\n\t\t * $this->saveField('published_date', date('Y-m-d', time()).' 00:00:00') */\n\t\treturn $this->saveField('is_published', 1);\n\t}", "function notifyWebMaster($iDocumentID, $sComment) {\n\t\tglobal $default;\n\t\t$sQuery = \"SELECT WS.web_master_id, WS.web_site_name, WS.web_site_url \" ./*ok*/\n\t\t\t\t \"FROM $default->web_sites_table AS WS \" .\n \"INNER JOIN $default->web_documents_table AS WD ON WS.id = WD.web_site_id \" .\n\t\t\t\t \"WHERE WD.document_id = ?\";\n $aParams = array($iDocumentID);\n\t\t$sql = $default->db;\n\t\t$sql->query(array($sQuery, $aParams));\n\t\tif ($sql->next_record()) {\n\t\t\t$oUser = User::get($sql->f(\"web_master_id\"));\n\t\t\tif (!($oUser === false)) {\n\t\t\t\tif ($oUser->getEmailNotification()) {\n\t\t\t\t\t$oDocument = Document::get($iDocumentID);\n $sBody = $oUser->getUserName() . \", the document, '\" . generateLink(\"/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php\", \"fDocumentID=\" . $oDocument->iId, $oDocument->getName()) . \"' \" . \n\t\t\t\t\t\t\t \"is pending web publishing to \" . $sql->f(\"web_site_name\") . \" (\" . $sql->f(\"web_site_url\") . \").\\n\\n The publisher had these additional comments to make:\\n$sComment\" ;\n\t\t\t\t\t\t\n\t\t\t\t\t$oEmail = & new Email();\n\t\t\t\t\t$oEmail->send($oUser->getEmail(), \"Document for Web Publishing\", $sBody);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "public function future_to_published($post) {\n\t\t\n\t\tdefine(\"WPU_JUST_POSTED_{$postID}\", TRUE);\n\t\t$this->handle_new_post($post->ID, $post, true);\n\t}", "public function flag_comment() {\n\t\t\tif ( empty( $_REQUEST[ 'comment_id' ] ) || (int) $_REQUEST[ 'comment_id' ] != $_REQUEST[ 'comment_id' ] ) {\n\t\t\t\t$this->cond_die( __( $this->invalid_values_message ) );\n\t\t\t}\n\n\t\t\t$comment_id = (int) $_REQUEST[ 'comment_id' ];\n\t\t\tif ( $this->already_flagged( $comment_id ) ) {\n\t\t\t\t$this->cond_die( __( $this->already_flagged_message ) );\n\t\t\t}\n\n\t\t\t// checking if nonces help\n\t\t\tif ( ! isset( $_REQUEST[ 'sc_nonce' ] ) || ! wp_verify_nonce( $_REQUEST[ 'sc_nonce' ], $this->_plugin_prefix . '_' . $this->_nonce_key ) ) {\n\t\t\t\t$this->cond_die( __( $this->invalid_nonce_message ) );\n\t\t\t} else {\n\t\t\t\t$this->mark_flagged( $comment_id );\n\t\t\t\t$this->cond_die( __( $this->thank_you_message ) );\n\t\t\t}\n\n\t\t}", "function filter_media_comment_status( $open, $post_id ) {\n$post = get_post( $post_id );\nif( $post->post_type == 'attachment' ) {\nreturn false;\n}\nreturn $open;\n}", "public function send_expiry_notification() {\n $expired_posts = $this->get_expired_posts();\n\n $subject = 'Posts that need your attention';\n $recipient = \\get_bloginfo('admin_email');\n $content = $this->_generate_expiry_notification_content( $expired_posts );\n\n // Set post to draft\n // bb_log( $content, 'Sending an email to ' . $recipient );\n // Helper\\Email::send_email( $recipient, $subject, $content );\n }", "function custom_pings($comment, $args, $depth) {\n $GLOBALS['comment'] = $comment;\n ?>\n <li id=\"comment-<?php comment_ID() ?>\" <?php comment_class() ?>>\n <div class=\"comment-author\"><?php printf(__('By %1$s on %2$s at %3$s', 'your-theme'),\n get_comment_author_link(),\n get_comment_date(),\n get_comment_time() );\n edit_comment_link(__('Edit', 'your-theme'), ' <span class=\"meta-sep\">|</span> <span class=\"edit-link\">', '</span>'); ?></div>\n <?php if ($comment->comment_approved == '0') _e('\\t\\t\\t\\t\\t<span class=\"unapproved\">Your trackback is awaiting moderation.</span>\\n', 'your-theme') ?>\n <div class=\"comment-content\">\n <?php comment_text() ?>\n </div>\n<?php }", "public function onNewPost(PostEvent $event): bool\n {\n $user = $event->user;\n $badges = Badge::where('type', 'onNewPost')->get();\n\n $collection = $badges->filter(function ($badge) use ($user) {\n return $badge->rule <= $user->discuss_post_count;\n });\n\n $result = $user->badges()->syncWithoutDetaching($collection);\n\n return $this->sendNotifications($result, $badges, $user);\n }", "public function broadcastOn()\n {\n// return new PrivateChannel('news-action');\n// return ['news-action'];\n return new Channel('news-action.');\n }", "public function publish();", "public function publish();", "function wp_spam_comment($comment_id)\n {\n }", "public function get_portfolio_notification();", "protected function emitCommentCreated(NodeInterface $commentNode, NodeInterface $postNode) {}", "function do_salmon_as_comment($module,$id,$self_url,$self_title,$title=NULL,$post=NULL,$email='',$poster_name_if_guest='',$forum=NULL,$validated=NULL)\n\t{\n\t\tif (!is_null($post)) $_POST['post'] = $post;\n\t\tif (!is_null($title)) $_POST['title'] = $title;\n\t\t$_POST['email'] = $email;\n\t\t$_POST['poster_name_if_guest'] = $poster_name_if_guest;\n\t\t\n\t\treturn do_comments(true,$module,$id,$self_url,$self_title,$forum,true,$validated,false,true);\n\t}", "public function onBeforeSave()\n\t{\n\t\tif (empty($this->allow_comments))\n\t\t{\n\t\t\t$this->allow_comments = $this->Channel->deft_comments;\n\t\t}\n\t}" ]
[ "0.6552116", "0.65290844", "0.6394561", "0.6351165", "0.6287217", "0.626058", "0.616753", "0.61293286", "0.60957456", "0.6051083", "0.60471225", "0.6010277", "0.59532756", "0.5885874", "0.5859183", "0.5802466", "0.57987803", "0.5796491", "0.5789107", "0.5758429", "0.5755578", "0.57547104", "0.57450634", "0.5696928", "0.5661535", "0.56498617", "0.5638132", "0.5630989", "0.5617699", "0.5617581", "0.5594098", "0.55922073", "0.5570939", "0.55685896", "0.55627346", "0.5523614", "0.5516301", "0.550947", "0.55076396", "0.55039877", "0.5502974", "0.5494559", "0.5484816", "0.5473217", "0.54634625", "0.5461014", "0.5452756", "0.5430873", "0.5430206", "0.5430206", "0.5430206", "0.5430206", "0.5430206", "0.5430206", "0.5430206", "0.5430206", "0.5430206", "0.5430206", "0.5430206", "0.5430206", "0.5430206", "0.5427967", "0.5426421", "0.5417896", "0.539673", "0.53875506", "0.53834516", "0.5379796", "0.5375265", "0.53743863", "0.53491026", "0.53422683", "0.5337142", "0.5329962", "0.5317065", "0.53141403", "0.53126365", "0.53067017", "0.53059316", "0.5305893", "0.5301309", "0.5300479", "0.52988774", "0.52950096", "0.52912545", "0.52885526", "0.527802", "0.52757436", "0.52742463", "0.5272679", "0.5269548", "0.5268484", "0.52631265", "0.5250643", "0.52478033", "0.52478033", "0.5243263", "0.5241727", "0.5237986", "0.5235091", "0.5234308" ]
0.0
-1
Sends activity notification for new comment.
private function notify_new_approved_comment( $comment, $post ) { if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { return; } if ( ! $comment->user_id ) { return; } if ( ! $user = get_user_by( 'id', $comment->user_id ) ) { return; } $args = array( 'action' => 'wporg_handle_activity', 'source' => 'wordpress', 'user' => $user->user_login, 'comment_id' => $comment->comment_ID, 'content' => get_comment_excerpt( $comment ), 'title' => get_the_title( $post ), 'blog' => get_bloginfo( 'name' ), 'blog_url' => site_url(), 'url' => get_comment_link( $comment ), ); Profiles\api( $args ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function comment($comment) {\n $comment['InsertUserID'] = Gdn::session()->UserID;\n $comment['DateInserted'] = Gdn_Format::toDateTime();\n $comment['InsertIPAddress'] = ipEncode(Gdn::request()->ipAddress());\n\n $this->Validation->applyRule('ActivityID', 'Required');\n $this->Validation->applyRule('Body', 'Required');\n $this->Validation->applyRule('DateInserted', 'Required');\n $this->Validation->applyRule('InsertUserID', 'Required');\n\n $this->EventArguments['Comment'] = &$comment;\n $this->fireEvent('BeforeSaveComment');\n\n if ($this->validate($comment)) {\n $activity = $this->getID($comment['ActivityID'], DATASET_TYPE_ARRAY);\n\n $_ActivityID = $comment['ActivityID'];\n // Check to see if this is a shared activity/notification.\n if ($commentActivityID = val('CommentActivityID', $activity['Data'])) {\n Gdn::controller()->json('CommentActivityID', $commentActivityID);\n $comment['ActivityID'] = $commentActivityID;\n }\n\n $storageObject = FloodControlHelper::configure($this, 'Vanilla', 'ActivityComment');\n if ($this->checkUserSpamming(Gdn::session()->User->UserID, $storageObject)) {\n return false;\n }\n\n // Check for spam.\n $spam = SpamModel::isSpam('ActivityComment', $comment);\n if ($spam) {\n return SPAM;\n }\n\n // Check for approval\n $approvalRequired = checkRestriction('Vanilla.Approval.Require');\n if ($approvalRequired && !val('Verified', Gdn::session()->User)) {\n LogModel::insert('Pending', 'ActivityComment', $comment);\n return UNAPPROVED;\n }\n\n $iD = $this->SQL->insert('ActivityComment', $comment);\n\n if ($iD) {\n // Check to see if this comment bumps the activity.\n if ($activity && val('Bump', $activity['Data'])) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $activity['ActivityID']]);\n if ($_ActivityID != $comment['ActivityID']) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $_ActivityID]);\n }\n }\n\n // Send a notification to the original person.\n if (val('ActivityType', $activity) === 'WallPost') {\n $this->notifyWallComment($comment, $activity);\n }\n }\n\n return $iD;\n }\n return false;\n }", "public function ajaxNewCommentAction() {\n if ($this->request->hasArgument('blogid')) {\n $blogid = $this->request->getArgument('blogid');\n }\n if ($this->request->hasArgument('postid')) {\n $postid = $this->request->getArgument('postid');\n }\n if ($this->request->hasArgument('name')) {\n $name = $this->request->getArgument('name');\n }\n if ($this->request->hasArgument('email')) {\n $email = $this->request->getArgument('email');\n }\n if ($this->request->hasArgument('text')) {\n $text = $this->request->getArgument('text');\n }\n \n $commentRepository = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Repository\\\\CommentRepository');\n \n $newComment = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Model\\\\Comment'); \n $newComment->setBlogid($blogid);\n $newComment->setPostid($postid);\n $newComment->setCommentname($name);\n $newComment->setCommentmail($email);\n $newComment->setCommenttext($text);\n $newComment->setCommentdate(time());\n \n $commentRepository->add($newComment);\n $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\PersistenceManager')->persistAll();\n \n exit;\n }", "public function createComment(Request $request)\n {\n\n $validator = Validator::make($request->all(), [\n 'comment' => 'required',\n ]);\n\n if ($validator->fails()) {\n return back()\n ->withErrors($validator)\n ->withInput();\n }\n\n $comment = new BlogComment();\n $comment->user_id = Auth::id();\n $comment->blog_id = $request->bid;\n $comment->comment = $request->comment;\n $comment->save();\n\n $comment = BlogComment::with('user')->find($comment->id);\n\n //send email here\n $comment->notify(new BlogCommentNotification($comment));\n\n return redirect()->back();\n }", "public function addComment()\n {\n session_start();\n $superglobalsPost = $this->getSuperglobals()->get_POST();\n $newComment = new CommentManager;\n $superglobalsPost['status'] = \"waiting\";\n $newComment->createComment($superglobalsPost);\n if (isset($superglobalsPost['post_id'])) {\n $post_id = $superglobalsPost['post_id'];\n }\n $titleAction = \"Confirmation d'enregistrement\"; //confirmation message\n $actionConfirmation = \"/post?id=\" . $post_id;\n $textConfirmation = \"Votre commentaire a bien été enregistré\";\n echo $this->getRender()->render('confirmationTemplate.twig', [\n 'titleAction' => $titleAction,\n 'actionConfirmation' => $actionConfirmation,\n 'textConfirmation' => $textConfirmation,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function comment()\n {\n $commentManager = new CommentManager();\n \n $comment = $commentManager->getComment($_GET['id']);\n \n require (__DIR__ . '/../view/frontend/commentView.php');\n }", "public function created(Comment $comment)\n {\n //\n }", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "public function onNewComment(CommentEvent $event): bool\n {\n $user = $event->user;\n $badges = Badge::where('type', 'onNewComment')->get();\n\n $collection = $badges->filter(function ($badge) use ($user) {\n return $badge->rule <= $user->comment_count;\n });\n\n $result = $user->badges()->syncWithoutDetaching($collection);\n\n return $this->sendNotifications($result, $badges, $user);\n }", "public function created(Model $comment)\n {\n $user = $comment->post->owner;\n\n $user->notify(new Notification($comment, 'comment_new_author'));\n }", "function wp_new_comment_notify_moderator($comment_id)\n {\n }", "function bp_activity_action_post_comment() {\n\n\tif ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'reply' ) )\n\t\treturn false;\n\n\t// Check the nonce\n\tcheck_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );\n\n\t$activity_id = apply_filters( 'bp_activity_post_comment_activity_id', $_POST['comment_form_id'] );\n\t$content = apply_filters( 'bp_activity_post_comment_content', $_POST['ac_input_' . $activity_id] );\n\n\tif ( empty( $content ) ) {\n\t\tbp_core_add_message( __( 'Please do not leave the comment area blank.', 'buddypress' ), 'error' );\n\t\tbp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );\n\t}\n\n\t$comment_id = bp_activity_new_comment( array(\n\t\t'content' => $content,\n\t\t'activity_id' => $activity_id,\n\t\t'parent_id' => false\n\t));\n\n\tif ( !empty( $comment_id ) )\n\t\tbp_core_add_message( __( 'Reply Posted!', 'buddypress' ) );\n\telse\n\t\tbp_core_add_message( __( 'There was an error posting that reply, please try again.', 'buddypress' ), 'error' );\n\n\tbp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );\n}", "public function actionComment()\n {\n\n if(isset($_POST['Comment']))\n {\n $model = new Comment;\n //$model->attributes=$_POST['Comment'];\n $model->a_id = $_POST['answer_id'];\n $model->author_id = $_POST['author_id'];\n\n $model->text = strip_tags($_POST['Comment']['text']);\n\n if($model->save()) {\n $receivers = User::model()->with(array('follow_question' => array('condition' => 'follow_question.q_id = ' . $_POST['question_id'])))->findAll();\n if ($receivers) {\n foreach ($receivers as $key => $receiver) {\n $notifications = UserNotifications::model()->findByPk($receiver->id);\n\n if ($receiver && $notifications)\n if ($notifications->comment_on_question == 1) {\n\n $subject = 'Question has been commented at ' . Yii::app()->name . '!';\n $message = CHtml::link('Question',\n 'http://' . $_SERVER['HTTP_HOST']. Yii::app()->baseUrl . '/question/view/id/' . $_POST['question_id']) . ' you are following has been commented ';\n\n UserModule::sendMail($receiver->email,$subject,$message);\n }\n }\n }\n Yii::app()->user->setFlash('answerCommented', \"Comment was posted successfully\");\n $this->redirect($this->createUrl('/question/view/id/' . $_POST['question_id']));\n }\n\n }\n\n }", "public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }", "public function actionAddComment()\n {\n $profile = (new UsersProfile())->getProfile();\n $model = new Comment();\n $model->task_id = Yii::$app->request->get('task_id');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->task_id]);\n }\n\n return $this->render('add-comment', \\compact('model', 'profile'));\n }", "function notify_new_comment($id){\n\t\t// nactu si comment\n\t\t$comment = $this->find('first', array(\n\t\t\t'conditions' => array('Comment.id' => $id),\n\t\t\t'contain' => array()\n\t\t));\n\t\t// natahnu si mailovaci skript\n\t\tApp::import('Vendor', 'PHPMailer', array('file' => 'class.phpmailer.php'));\n\t\t$mail = new PHPMailer();\n\t\t\n\t\t// uvodni nastaveni\n\t\t$mail->CharSet = 'utf-8';\n\t\t$mail->Hostname = CUST_ROOT;\n\t\t$mail->Sender = '[email protected]';\n\t\t\n\t\t// nastavim adresu, od koho se poslal email\n\t\t$mail->From = '[email protected]';\n\t\t$mail->FromName = \"sportnutrition.cz\";\n\t\t\n//\t\t$mail->AddReplyTo(CUST_MAIL, CUST_NAME);\n\n\t\t$mail->AddAddress(CUST_MAIL, CUST_NAME);\n//\t\t$mail->AddBCC(\"[email protected]\", \"Vlado Tovarnak\");\n\t\t\n\t\t$mail->Subject = 'E-SHOP (' . CUST_ROOT . ') - NOVÝ DOTAZ';\n\t\t$mail->Body = 'Právě byl položen nový dotaz.' . \"\\n\\n\";\n\t\t$mail->Body .= $comment['Comment']['subject'] . \"\\n\";\n\t\t$mail->Body .= $comment['Comment']['author'] . ' - ' . $comment['Comment']['email'] . \"\\n\";\n\t\t$mail->Body .= $comment['Comment']['body'] . \"\\n\\n\";\n\t\t$mail->Body .= 'Spravovat jej můžete zde: http://www.' . CUST_ROOT . '/admin/comments/edit/' . $id . \"\\n\";\n\n\t\treturn $mail->Send();\n\t}", "function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}", "public function commentAction() {\r\n $data = json_decode($_POST['data'], true);\r\n if (empty($data['comments'])) {\r\n exit('access deny!');\r\n }\r\n\r\n if (stristr($data['sourceid'], 'nav_fun_')) {\r\n $id = intval(str_ireplace('nav_fun_', '', $data['sourceid']));\r\n $info = Nav_Service_NewsDB::getRecordDao()->get($id);\r\n if (!empty($info['id'])) {\r\n $total = $info['c_num'] + 1;\r\n Nav_Service_NewsDB::getRecordDao()->update(array('c_num' => $total), $id);\r\n $rcKey = 'NAV_FUN_OP:' . intval($info['id']);\r\n Common::getCache()->hSet($rcKey, 'c_num', $total);\r\n }\r\n }\r\n\r\n $addData = array(\r\n 'content' => trim($data['comments'][0]['content']),\r\n 'ctime' => substr($data['comments'][0]['ctime'], 0, 10),\r\n 'ip' => $data['comments'][0]['ip'],\r\n 'cmtid' => $data['comments'][0]['cmtid'],\r\n 'userid' => $data['comments'][0]['user']['userid'],\r\n 'sourceid' => $data['sourceid'],\r\n 'url' => $data['url'],\r\n 'created_at' => Common::getTime(),\r\n );\r\n\r\n // error_log(date('Y-m-d H:i:s') . \" \" . Common::jsonEncode($addData) . \"\\n\", 3, '/tmp/3g_changyan_comment');\r\n User_Service_Changyan::getDao()->insert($addData);\r\n\r\n exit;\r\n }", "public function created(TaskComment $taskComment)\n {\n $taskComment->creator;\n $taskComment->updater;\n\n $ticket_id = null;\n if ($taskComment->task->ticket) {\n $ticket_id = $taskComment->task->ticket->id;\n }\n\n\n \\Notification::send(getRoleUsers('Full Administrator'),new CommentAddedNotification($taskComment->task,auth()->user()));\n\n TaskCommentJob::dispatch($taskComment);\n if($taskComment->task->project) {\n $this->activityLog->addToLog('Create Comment on Task: '.$taskComment->task->name, null, $taskComment->task->project->id, $ticket_id, $taskComment->task->id);\n }else if($taskComment->task->ticket && $taskComment->task->ticket->project){\n $this->activityLog->addToLog('Create Comment on Task: '.$taskComment->task->name, null, $taskComment->task->ticket->project->id, $ticket_id, $taskComment->task->id);\n }else {\n $this->activityLog->addToLog('Create Comment on Task: '.$taskComment->task->name, null, null, $ticket_id, $taskComment->task->id);\n }\n }", "public function comment($comment)\n {\n $this->comments[] = $comment;\n }", "public function actionCreate() {\n $model = new Comment;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Comment'])) {\n $model->attributes = $_POST['Comment'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "function slack_comment( $comment_id ) : void {\n\t$comment = get_comment( $comment_id );\n\t$post = get_post( $comment->comment_post_ID );\n\t$category = get_the_category( $post->ID )[0]->slug;\n\t$author = get_user_by( 'id', $comment->user_id );\n\t$message = stripslashes( wp_strip_all_tags( sanitize_textarea_field( wp_unslash( $comment->comment_content ) ) ) );\n\n\t$channel = [\n\t\t'air' => '#airseries',\n\t\t'air-pro' => '#airseries-pro',\n\t\t'capsules' => '#capsules',\n\t\t'in-training-exam-prep' => '#ite-prep',\n\t][ $category ] ?? '#aliemu';\n\n\tslack_message(\n\t\t$channel,\n\t\t[\n\t\t\t'fallback' => \"Comment from {$comment->comment_author} on {$post->post_title}: {$message}\",\n\t\t\t'pretext' => \"*Comment Received: <{$post->guid}|{$post->post_title}>*\",\n\t\t\t'author_name' => $comment->comment_author,\n\t\t\t'author_link' => \"https://www.aliemu.com/user/{$author->user_login}\",\n\t\t\t'author_icon' => add_query_arg(\n\t\t\t\t[\n\t\t\t\t\t'size' => 16,\n\t\t\t\t\t'default' => 'mp',\n\t\t\t\t],\n\t\t\t\t'https://www.gravatar.com/avatar/' . md5( strtolower( trim( $author->user_email ) ) )\n\t\t\t),\n\t\t\t'text' => $message,\n\t\t\t'actions' => [\n\t\t\t\t(object) [\n\t\t\t\t\t'type' => 'button',\n\t\t\t\t\t'text' => 'View Comment',\n\t\t\t\t\t'url' => get_comment_link( $comment ),\n\t\t\t\t],\n\t\t\t],\n\t\t]\n\t);\n}", "public function create($comment)\n {\n\n }", "public function actionCreate()\n {\n $comment = new Comment();\n\n if ($comment->load(Yii::$app->request->post(), '') && $comment->save()) {\n TicketController::openStatus($comment->ticket_id);\n $comment = Comment::find()->with(['createdBy'])->ticketId($comment->ticket_id)->one();\n\n return [\n 'success' => true,\n // returns only a partial to render without applying a whole layout\n 'comment' => $this->renderPartial(\n '@frontend/views/ticket/_comment_item',\n [\n 'model' => $comment,\n ]\n ),\n ];\n }\n\n return [\n 'success' => false,\n 'errors' => $comment->errors,\n ];\n }", "public function addCommentAction()\n {\n $this->confirmSession();\n\n $this->view->disable();\n if ($this->request->isPost()) {\n $validator = new CommentValidation();\n $errorMessages = $validator->validate($this->request->getPost());\n \n if (count($errorMessages)) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $postId = $this->request->getPost('postId');\n\n $post = News::findFirst([\n 'conditions' => 'id = ?0 AND isDeleted = 0',\n 'bind' => [\n $postId\n ]\n ]);\n \n if (!$post) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $comment = new Comments();\n\n $comment->userId = $this->session->get('user')['id'];\n $comment->newsId = $postId;\n $comment->content = $this->request->getPost('content');\n $comment->createdAt = date('Y-m-d H:i:s');\n\n $comment->save();\n\n $this->redirect(\"/index/postDetails?id={$postId}\");\n }\n }", "public function newComment($comment_id) \n\t\t{\n\t\t\t$comment = get_comments(array('ID' => $comment_id));\n\t\t\t$comment = $comment[0];\n\n\t\t\tif($comment->comment_approved != 1) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$thingdom = $this->getThingdom();\n\t\t\t\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$post_title = get_the_title($comment->comment_post_ID);\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\t$thing->feed('new_comment', \"New comment on: {$post_title}\\n<br>From: {$comment->comment_author}<br>\\nComment: {$comment->comment_content}\");\n\t\t}", "public function createAction()\n\t{\n\t\t$this->_helper->acl->authorizeUser(new Application_Model_Comment(), 'create', 'You are not allowed to create a new comment');\n\n\t\tif ($this->_request->isPost()) {\n\t\t\t$form = $this->getCreateForm();\n\n\t\t\tif (!$form->isValid($_POST)) {\n\t\t\t\t$this->sendJsonFormError($form);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$data = new Application_Model_Comment();\n\t\t\t$data->id_user = $this->_user->getId();\n\t\t\t$data->comment = $_POST['comment'];\n\t\t\t$data->comment_type = $_POST['comment_type'];\n\n\t\t\t$r = $this->_commentMapper->save($data);\n\n\t\t\t$url = $this->getFrontController()->getRouter()->assemble(array('controller' => 'comment', 'action' => 'index'));\n\t\t\t$this->_redirect($url);\n\t\t}\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Comment;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Comment']))\n\t\t{\n $model->attributes=$_POST['Comment'];\n\t\t\n \n if($model->save()){\n $dataProvider=new CActiveDataProvider('Comment');\n\t\t\t$this->redirect(array('index'),array(\n 'dataProvider'=>$dataProvider,\n 'updated'=>'1',\n 'message'=>\"Comentario introducido\"\n ));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionSaveNew()\n {\n $now = new DateTime();\n\n $comment = new SensorarioComments();\n $comment->attributes = $_POST['SensorarioModuleComment'];\n $comment->save();\n\n echo json_encode(true);\n\n Yii::app()->end();\n }", "function postCommentNotify($id, $postId){\r\n $commentManager = new CommentsManager();\r\n $notify = $commentManager->postNotify($id);\r\n}", "public function commentDo() {\n\t\tif($this->user() || $this->fbUser) { \n\t\t\tif(isset($this->args[1]) && isset($_POST['comment']) && isset($_POST['redirect'])) {\n\t\t\t\t$userName = ($this->user()) ? $this->user->model->userName : $this->fbUser['username'];\n\t\t\t\t$_POST['name'] = $userName;\n\n\t\t\t\ttry {\n\t\t\t\t\t$this->commentsModel->insertComment($this->args[1], $_POST);\t\n\t\t\t\t\tHTML::redirect($_POST['redirect']);\n\t\t\t\t} catch(Exception $excpt) {\n\t\t\t\t\t$this->view->setError($excpt);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->view->setError(new Exception('Unable to set up function'));\n\t\t\t}\n\t\t}\n\t}", "public function commentAction() {\n $ses = new Application_Model_Session();\n $ses->startSession();\n {\n $request = $this->getRequest();\n $ExpId = $this->_getParam('expid');\n $form = new Campuswisdom_Form_Comment();\n $this->view->form = $form;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($request->getPost())) {\n $mapper = new Campuswisdom_Model_ExpMapper();\n $Comment = $form->getValue(\"comment\");\n $mapper->setDbTable('campuswisdom_Model_DbTable_Comments');\n $smthn = $mapper->save($ExpId, $Comment);\n if ($smthn == null) {\n //an error occurred so nothing was saved\n } else {\n $ses->setSessionParameter('comnt', 1);\n }\n $this->_helper->redirector('viewcomments', 'exps', 'default', array('expid' => $ExpId));\n }\n }\n }\n }", "public function addComment() {\n $body = $this->getData();\n\n $comentario = $body->comentario;\n $usuario = $body->usuario;\n $fecha = $body->fecha;\n $puntaje = $body->puntaje;\n $id_jugador = $body->id_jugador;\n $id_comentario = $this->model->insert($comentario, $usuario, $fecha, $puntaje, $id_jugador);\n\n if($id_comentario) {\n $this->view->response(\"Se agrego el comentario nùmero: {$id_comentario}\", 200);\n } else {\n $this->view->response(\"El comentario no se pudo agregar \", 500);\n }\n\n }", "public function addOneComment(){\n\t\tif (!empty($_POST['user_name']) && !empty($_POST['content'])){\n\t\t\t$values = array(\n \t\t'user_name' => $_POST['user_name'],\n\t\t\t'content' => $_POST['content'],\n\t\t\t'post_id' => $_POST['post_id']\n\t\t);\n\n\t\t$sqlfuncs = array(\n \t\t'date_creation' => 'NOW()',\n\t\t);\n\n\t$this->pInsertFunc(\"INSERT INTO\", \"comment\", $values, $sqlfuncs);\n\t\t\techo '<script>alert(\"Le commentaire a bien été envoyé.\")</script>';\n\t\t}\n\n\t}", "protected function report_comment_success_message(){\r\n\t\treturn 'The comment has been reported.';\r\n\t}", "private function wp_new_comment( $commentdata ) {\n $commentdata = apply_filters('preprocess_comment', $commentdata);\n\n $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];\n if ( isset($commentdata['user_ID']) ) {\n $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];\n } elseif ( isset($commentdata['user_id']) ) {\n $commentdata['user_id'] = (int) $commentdata['user_id'];\n }\n\n $commentdata['comment_date'] = current_time('mysql');\n $commentdata['comment_date_gmt'] = current_time('mysql', 1);\n\n $commentdata = wp_filter_comment($commentdata);\n\n $commentdata['comment_approved'] = 1;\n\n $comment_ID = wp_insert_comment($commentdata);\n\n do_action('comment_post', $comment_ID, $commentdata['comment_approved']);\n \n if (get_option('comments_notify')) {\n wp_notify_postauthor($comment_ID);\n }\n \n return $comment_ID;\n }", "public function store(CommentRequest $request) {\n // dd(request()->all());\n // dd(Auth::user()->name);\n\n\n Comment::create([\n \"tweet_id\" => $request->tweetId,\n \"user_id\" => Auth::user()->id,\n \"comment\" => $request->comment\n ]);\n \n\n $data = [\n \"user_id\" => Auth::user()->id,\n \"user_name\" => Auth::user()->name,\n \"comment\" => $request->comment,\n \"tweet_id\" => $request->tweetId,\n ];\n event(new NewNotification($data));\n\n // $comment->create([\n // 'tweet_id' =>$request->tweetId,\n // 'user_id' => Auth::user()->id,\n // 'comment' =>$request->comment\n // ]);\n return back()->with(['success' => 'comment added']);\n }", "public function onMessage(ConnectionInterface $from, $msg): void\n {\n $data = json_decode($msg, false);\n\n $comment = $this->service->createComment($data->comment, $data->taskId, $data->userId);\n if ($comment) {\n $this->sendMessage($comment);\n }\n }", "public function comments()\n {\n $task = $this->getTask();\n $commentSortingDirection = $this->userMetadataCacheDecorator->get(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, 'ASC');\n\n $this->response->html($this->template->render('CommentTooltip:board/tooltip_comments', array(\n 'task' => $task,\n 'comments' => $this->commentModel->getAll($task['id'], $commentSortingDirection)\n )));\n }", "public function actionAddcomment(){\n if(isset($_POST['text'])){\n $comment = new Comment();\n $comment->text = $_POST['text'];\n $comment->id_trainingentry = $_POST['id_trainingentry'];\n $comment->id_user = Yii::app()->user->id;\n $comment->id_visibility = $_POST['id_visibility'];\n $comment->date = date('Y-m-d G:i:s');\n $comment->seen = 0;\n \n $user = User::model()->findByPk(Yii::app()->user->id);\n \n header('Content-Type: text/xml');\n echo '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n echo '<response>';\n echo '<validation>';\n if($comment->save()){\n echo 'ok';\n echo '</validation>';\n echo $this->createXmlComment($user, $comment);\n }else{\n echo 'error';\n echo '</validation>';\n }\n echo '</response>';\n }\n }", "public function actionComments()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render(\n\t\t\t'comments',\n\t\t\tarray(\n\t\t\t\t'_Comments' => Feedback::model()->findAll(array('order'=>'date_inserted DESC'))\n\t\t\t)\n\t\t);\n\t}", "public function newsCommentCreate(CommentFormRequest $request, $id)\n {\n $article = News::findOrFail($id);\n $article->comments()->save(new Comment([\n 'name' => $request->name,\n 'email' => $request->email,\n 'text' => $request->text\n ]));\n\n Session::flash('success', 'Success! Your comment is awaiting approval!');\n return redirect()->route('news.show', ['id' => $id]);\n }", "public function doCreateComment()\n {\n if (isset($_POST)) {\n if (!$this->comment_is_valid($_POST['text'])) {\n header('Location: /post/details/?id=' . $_POST['post_id']);\n exit();\n }\n $text = htmlspecialchars($_POST['text']);\n $post_id = $_POST['post_id'];\n $this->commentRepository->create($_SESSION['userid'], $text, $post_id);\n }\n }", "public function record_comment(){\n\t\t\t\n\t\t}", "public function createAction()\n { \n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n \n $comment = new Comments(); \n $comment->model = $this->request->getPost(\"model\");\n $comment->model_id = $this->request->getPost(\"model_id\");\n $comment->body = $this->request->getPost(\"body\");\n \n if (!$comment->save()) {\n foreach ($comment->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n $this->flash->success(\"comment was created successfully\");\n }\n \n $referer = $this->request->getHTTPReferer();\n $path = parse_url($referer, PHP_URL_PATH);\r\n $this->response->redirect($path, true);\n }", "public function comment() {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to comment');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n // Sanitize array\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n $data = [\n 'body' => trim($_POST['body']),\n 'post_id' => trim($_POST['post_id']),\n 'user_id' => $_SESSION['user_id'],\n 'user_name' => $this->userModel->getUserById($_SESSION['user_id'])->name\n ];\n\n if (!empty($data['body']) && !empty($data['post_id']) && !empty($data['user_id']) && !empty($data['user_name'])) {\n // Save comment\n $this->postModel->comment($data);\n $post = $this->postModel->getPostById($data['post_id']);\n $receiver = $this->userModel->getUserById($post->user_id);\n if ($receiver->receive_email == true) {\n $this->mail($receiver->email, $receiver->name, $post->id);\n }\n }\n redirect('/posts/show/' . $_POST['post_id']);\n }\n\n }", "public function on_comment_new($comment_id)\n {\n $comment = get_comment($comment_id);\n\n if (!$comment instanceof WP_Comment || !$this->is_valid_comment($comment)) {\n return false;\n }\n\n $post = get_post($comment->comment_post_ID);\n\n if (!$post instanceof WP_Post) {\n return false;\n }\n\n $article_id = get_post_meta($post->ID, $this->article_id_meta_key, true);\n\n if ( false === $article_id || empty( $article_id ) ) {\n\t $this->on_post_save( $post->ID, $post );\n\t $article_id = get_post_meta($post->ID, $this->article_id_meta_key, true);\n }\n\n if (!is_numeric($article_id)) {\n return false;\n }\n\n $comment_details = $this->api_client->add_comment($article_id, $comment->comment_content, $comment->comment_date_gmt, $comment->comment_author);\n\n if ($comment_details instanceof WP_Error) {\n return false;\n }\n\n $this->update_comment_details( $comment_id, $comment_details );\n $this->update_atozsites_comment( $post );\n\n return true;\n }", "public function NewCommentManga(){\r\n $this->comment(); \r\n $this->pseudoPost();\r\n $this->contentPost();\r\n $this->_commentManager->AddComment($this->_pseudoPostSecure, $this->_contentPostSecure, $_GET['id'],true,false); \r\n header('location: Tome&id='.$_GET[\"id\"]); \r\n }", "public function add_comment()\n { \n $data = $this->input->post();\n unset($data['url']);\n $data['postid'] = $data['postid'];\n $comment_id = $this->mention_model->add_comment($data); \n $success = false; \n $success = ($comment_id !== false ? true : false);\n $comment = '';\n if ($comment_id) {\n $comment = $this->comment_single($this->mention_model->get_comment($comment_id, true));\n }\n\n echo json_encode([\n 'success' => $success,\n 'comment' => $comment,\n 'comment_id' => $comment_id\n ]);\n }", "public function insertComment() {\n\n if(isset($_POST['btnInsertComment'])){\n $comment = $_POST['comment'];\n $idUser = $_SESSION['user']->id_user;\n $idNews = $_POST['idNews'];\n $created_at = date(\"Y-m-d H-i-s\", time());\n\n\n $regComment = \"/[0-9A-Za-z.,\\n \\r?!]*/\";\n\n $errors = [];\n if($comment == \"\") {\n $errors[] = \"Cant be empty comment\";\n exit;\n }\n else if(!preg_match($regComment, $comment)) {\n $errors[] = \"Wrong format comment\";\n exit;\n }\n try {\n $modelComment = new Comments(Database::instance());\n $modelComment->insertComment($comment, $created_at, $idUser, $idNews);\n\n $this->commentLog($comment, \"INSERT\", 201);\n\n } catch (\\PDOException $ex){\n $this->errorLog(\"insertComment()\", $ex->getMessage());\n\n }\n\n\n } else {\n $this->json(null, 403);\n }\n }", "public function alertComment($id,$alertComment)\n\t{\n\t\t$commentsManager = new Comments();\n\t\t$alertComments = $commentsManager-> updateComment($id,$alertComment); //appel d'une fonction d'un objet\n\t\trequire('view/ViewFrontEnd/signalCommentView.php');\n\t}", "public static function createComments($request);", "private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}", "public function report_comment(){\r\n\t\t\r\n\t\t/* Require user. */\r\n\t\tif (!$this->_requireUser('Please sign in to report a comment.')){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t/* Get arguments */\r\n\t\t$commentId = Request::getInt('comment');\r\n\t\t\r\n\t\t/* Report object. */\r\n\t\tif ($this->report('comment', $commentId)){\r\n\t\t\t$message = $this->report_comment_success_message();\r\n\t\t\t$messageType = 'info';\r\n\t\t} else {\r\n\t\t\t$message = $this->report_comment_failure_message();\r\n\t\t\t$messageType = 'error';\r\n\t\t}\r\n\r\n\t\t/* Tidy up */\r\n\t\tMessages::addMessage($message, $messageType);\r\n\t\treturn $this->_redirect($this->get_redirect_page());\r\n\r\n\t}", "public function add_comm()\n {\n $this->comments++;\n }", "public function commentsAction()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$user = Application_Model_User::getAuth();\r\n\r\n\t\t\t$id = $this->_request->getPost('id');\r\n\r\n\t\t\tif (!v::intVal()->validate($id))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post value: ' .\r\n\t\t\t\t\tvar_export($id, true));\r\n\t\t\t}\r\n\r\n\t\t\tif (!Application_Model_News::checkId($id, $post, ['join'=>false]))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post ID');\r\n\t\t\t}\r\n\r\n\t\t\t$start = $this->_request->getPost('start', 0);\r\n\r\n\t\t\tif (!v::intVal()->validate($start))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect start value: ' .\r\n\t\t\t\t\tvar_export($start, true));\r\n\t\t\t}\r\n\r\n\t\t\t$limit = 30;\r\n\t\t\t$model = new Application_Model_Comments;\r\n\t\t\t$comments = $model->findAllByNewsId($id, [\r\n\t\t\t\t'limit' => $limit,\r\n\t\t\t\t'start' => $start,\r\n\t\t\t\t'owner_thumbs' => [[55,55]]\r\n\t\t\t]);\r\n\r\n\t\t\t$response = ['status' => 1];\r\n\r\n\t\t\tif (count($comments))\r\n\t\t\t{\r\n\t\t\t\tforeach ($comments as $comment)\r\n\t\t\t\t{\r\n\t\t\t\t\t$response['data'][] = My_ViewHelper::render('post/_comment', [\r\n\t\t\t\t\t\t'user' => $user,\r\n\t\t\t\t\t\t'comment' => $comment,\r\n\t\t\t\t\t\t'post' => $post,\r\n\t\t\t\t\t\t'limit' => 250\r\n\t\t\t\t\t]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$count = max($post->comment - ($start + $limit), 0);\r\n\r\n\t\t\t\tif ($count > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$response['label'] = $model->viewMoreLabel($count);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\tMy_Log::exception($e);\r\n\t\t\t$response = [\r\n\t\t\t\t'status' => 0,\r\n\t\t\t\t'message' => $e instanceof RuntimeException ? $e->getMessage() :\r\n\t\t\t\t\t'Internal Server Error'\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\t$this->_helper->json($response);\r\n\t}", "public function create()\n {\n // @TODO: Either implement create comment view or delete method.\n }", "public function actionCreate()\n {\n $model = new Comments();\n $request = Yii::$app->getRequest();\n if ($request->isPost && $model->load($request->post())) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n if (empty($_POST['g-recaptcha-response']) && Yii::$app->user->isGuest) {\n return \"no\";\n }\n else {\n $model->save(false);\n return \"yes\";\n }\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n }", "function wyz_new_bus_post_comm_ajax() {\n\t$nonce = filter_input( INPUT_POST, 'nonce' );\n\n\t$_id = intval( $_POST['id'] );\n\n\tif ( ! wp_verify_nonce( $nonce, \"wyz-business-post-comment-nonce-$_id\" ) ) {\n\t\twp_die( 'busted' );\n\t}\n\n\t$_comment = $_POST['comment'];\n\n\tif ( '' == $_comment || ! is_user_logged_in() || ! comments_open( $_id ) ) {\n\t\twp_die( false );\n\t}\n\n\t$_comment = esc_html( $_comment );\n\t$current_user = wp_get_current_user();\n\n\t$time = current_time('mysql');\n\n\t$data = array(\n\t\t'comment_post_ID' => $_id,\n\t\t'comment_author' => $current_user->user_login,\n\t\t'comment_author_email' => $current_user->user_email,\n\t\t'comment_author_url' => $current_user->user_url,\n\t\t'comment_content' => $_comment,\n\t\t'user_id' => $current_user->ID,\n\t\t'comment_date' => $time,\n\t\t'comment_approved' => 1,\n\t);\n\t$comment_id = wp_insert_comment( $data );\n\t$the_comment = get_comment( $comment_id );\n\n\tif ( null == $the_comment ) {\n\t\twp_die( false );\n\t}\n\n\twp_die( WyzBusinessPost::get_the_comment( $the_comment ) );\n}", "function insertComment() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $comment = json_decode(file_get_contents(\"php://input\"),true);\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($comment['user_id'], $auth)) {\n $this->response('', 406);\n }\n \n $columns = 'user_id, video_id, text';\n $values = $comment['user_id'] . ',' . $comment['video_id'] . ',\\'' . $comment['text'] . \"'\";\n \n $query = \"insert into comments(\". $columns . \") VALUES(\". $values . \");\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Comment Posted.\", \"data\" => $comment);\n $this->response(json_encode($success),200);\n }", "public function actionCreate()\n {\n\t\tif (!\\Yii::$app->user->can('cmsCommentHistoriesCreate')) {\n\t\t\tthrow new ForbiddenHttpException('You do not have privileges to view this content.');\n\t\t}\n\t\t\n $model = new CommentHistory();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function comments()\n\t{\n\t\t$this->_crud->set_table('ent_cr_comments');\n\t\t$this->_crud->set_subject('Comment');\n\t\t$this->_crud->set_relation('ent_cr_recipes_id','ent_cr_recepies','title');\n\t\t$this->_crud->display_as('ent_cr_recepies_id', 'Recipe');\n\t\t$this->_crud->required_fields('name', 'email', 'comments', 'ent_cr_recipes_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}", "public function addComment( $comment )\n\t{\n\t\tif ( Yii::app()->params['commentNeedApproval'] )\n\t\t\t$comment->status = Comment::STATUS_PENDING;\n\t\telse\n\t\t\t$comment->status = Comment::STATUS_APPROVED;\n\t\t$comment->howto_id = $this->id;\n\t\treturn $comment->save();\n\t}", "function charangoten_custom_comment(&$a1, $op) {\n if ($op == 'insert' || $op == 'update') {\n if ($a1['stream_publish']) {\n //dpm($a1, \"dff_custom_comment, publishing to stream\");\n $node = node_load($a1['nid']);\n \n // http://wiki.developers.facebook.com/index.php/Attachment_(Streams)\n $attachment = array(\n 'name' => $a1['subject'],\n 'href' => url('node/' . $a1['nid'], array('absolute' => TRUE, 'fragment' => 'comment-' . $a1['cid'])),\n 'description' => $a1['comment'],\n 'properties' => array(t('In reply to') => array('text' => $node->title, 'href' => url(\"node/\" . $node->nid, array('absolute' => TRUE)))),\n );\n\n $user_message = t('Check out my latest comment on !site...',\n array('!site' => variable_get('site_name', t('my Drupal for Facebook powered site'))));\n $actions = array();\n $actions[] = array('text' => t('Read More'),\n 'href' => url('node/'.$a1['nid'], array('absolute' => TRUE)),\n );\n fb_stream_publish_dialog(array('user_message' => $user_message,\n 'attachment' => $attachment,\n 'action_links' => $actions,\n ));\n }\n }\n\n}", "private function runComment()\n {\n $num = (int) $this->ask('How many records do you want to create for the comments table?');\n factory(Comment::class, $num)->create();\n }", "function set_comment($new_comment)\n {\n $this->comment = $new_comment;\n }", "public function created(ClientComment $clientComment)\n {\n $clientComment->creator;\n $clientComment->updater;\n\n $this->activityLog->addToLog('Create Comment on Client: '.$clientComment->client->name, $clientComment->client->id);\n }", "public function create(): string\n\t{\n\t\t$user = $this->user;\n\n\t\tif ($user->users_group_id == 1 ) {\n\t\t\t$status = ucfirst($this->request->post('status'));\n\t\t}else {\n\t\t\t$status = $this->settings;\n\t\t\t$status = $status->get('commentaires_status');\n\t\t}\n\n\t\t$this->data('user_id', $user->id)\n\t\t\t ->data('episode_id', $this->request->post('episode_id'))\n\t\t\t ->data('comment', ucfirst($this->request->post('details')))\n\t\t\t ->data('email', $user->email)\n\t\t\t ->data('created', $now = time())\n\t\t\t ->data('status', $status)\n\t\t\t ->data('reported', 0)\n\t\t\t ->data('ip', $this->request->server('REMOTE_ADDR'))\n\t\t\t ->insert('comments');\n\n\t\t$successMessage = 'votre commentaire est ajouté avec succèss .';\n\n\t\treturn $successMessage;\n\t}", "protected function comment($cmntdata) {\n\t\t//$usercomment\t= array();\n\t\t$pid \t\t\t= $cmntdata->pid;\n\t\t$user_id \t\t= $cmntdata->user_id;\n\t\t$reddit_id \t\t= $cmntdata->name;\n\t\t$comment \t\t= $cmntdata->comment;\n\t\t$data = array(\n\t\t\t'reddit_id' \t=> $reddit_id,\n\t\t\t'post_id'\t\t=> $pid,\n\t\t\t'comment'\t\t=> $comment, \n\t\t\t'user_id'\t\t=> $user_id\n\t\t);\n\t\t$result\t\t\t\t= $this->db->insert('appcomments', $data);\n\t\t//add activity\n\t\t$activity_data= array(\n\t\t\t'reddit_id' \t=> $reddit_id,\n\t\t\t'post_id'\t\t=> $pid,\n\t\t\t'mode'\t\t\t=> '2', \n\t\t\t'user_id'\t\t=> $user_id\n\t\t\n\t\t);\t\t\n\t\tif ($result) {\n\t\t\t$activity\t\t\t\t= $this->db->insert('activity', $activity_data);\n\t\t\t//pr($activity);die;\n\t\t\t$username \t\t\t\t= $this->app_model->getUsernameById($user_id);\n\t\t\t$usercomment['commentdata'][0]['comment'] \t= $comment; \n\t\t\t$usercomment['commentdata'][0]['username'] \t= $username['username']; \n\t\t\t$usercomment['commentdata'][0]['user_id'] \t= $user_id; \n\t\t\t$sql = \"select commentcount from appstats where post_id= \".$pid;\n\t\t\t$query = $this->db->query($sql);\n\t\t\tif ($query->num_rows() > 0) {\n\t\t\t\t$commentcount \t\t= $query->row_array();\n\t\t\t\t$commentcount['commentcount'] = $commentcount['commentcount']+1;\n\t\t\t\t$update_comment \t= \"UPDATE appstats SET commentcount= \".$commentcount['commentcount'].\" WHERE post_id=\".$pid;\n\t\t\t\tif($this->db->query($update_comment)){\n\t\t\t\t\t//$usercomment['commentdata'][0]['commentcount'] = $commentcount['commentcount'];\n\t\t\t\t}\n\t\t\t} else { // this is for first time\n\t\t\t\t$statsdata = array(\n\t\t\t\t\t'reddit_id' \t=> $reddit_id,\n\t\t\t\t\t'likecount'\t\t=> '',\n\t\t\t\t\t'viewcount'\t\t=> '', \n\t\t\t\t\t'commentcount'\t=> 1, //first time increament\n\t\t\t\t\t//'user_id'\t\t=> $user_id,\n\t\t\t\t\t'post_id'\t\t=> $pid\n\t\t\t\t); \n\t\t\t\t$result\t\t\t\t= $this->db->insert('appstats', $statsdata);\n\t\t\t\tif ($result) {\n\t\t\t\t\t$sql \t= \"select commentcount from appstats where post_id='$pid'\";\n\t\t\t\t\t$query \t= $this->db->query($sql);\n\t\t\t\t\tif ($query->num_rows() > 0) {\n\t\t\t\t\t\t$commentcount \t\t= $query->row_array();\n\t\t\t\t\t\t//$usercomment['commentdata'][0]['commentcount'] = $commentcount['commentcount'];\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->trueResponse($usercomment,'success', $encode = true);\n\t\t}\n\t}", "public function actionAddVehicleCommentInd(){\t \n\t date_default_timezone_set(\"Europe/London\");\n\t \n\t // Gets basic vehicle info used in the save\n\t $vehicle = Vehicles::model()->getBasicInfo($_POST['vehicle_id']);\n\t \n\t // Adds the vehicle comment\n\t $vC = new VehicleComments();\n\t $vC->added_by = Yii::app()->user->id;\n\t $vC->comment = $_POST['comment'];\n\t $vC->date_added = date(\"Y-m-d H:i:s\");\n\t $vC->vehicle_id = $_POST['vehicle_id'];\n\t $vC->make_model_id = $vehicle['make_model_id'];\n\t $vC->save();\n\t}", "public function sendComments(request $request , $id)\n {\n $this->validate($request,[\n 'comment' => 'required|max:200',\n\n ]);\n $news = News::findOrFail($id);\n $comments = new Comment();\n $comments->comment = $request->comment ;\n $comments->news_id = $news->id ;\n $comments->user_id = auth()->user()->id ;\n $comments->save();\n\n return response()->json(['message'=>'comment Added']);\n }", "function comment()\n {\n // form validation\n $this->load->library('form_validation');\n $this->form_validation->set_rules('eventID', 'eventID', 'trim|xss_clean');\n $this->form_validation->set_rules('comment', 'comment', 'trim|xss_clean|strip_tags|htmlspecialchars');\n $this->form_validation->run();\n\n $eventID = $this->input->post('eventID');\n $comment = $this->input->post('comment');\n $userID = $this->session->userdata('UserID');\n\n // check that user is logged in\n if($userID <= 0)\n {\n $this->returnError($this->lang->line('error_logged_out'),false,false);\n return;\n }\n\n // check event id is valid\n if($eventID <= 0)\n {\n $this->returnError($this->lang->line('error_event_invalid'),false,false);\n return;\n }\n\n $this->load->model('User');\n $this->User->addComment($eventID, $userID, $comment);\n\n // add new comment (in HTML) to response so it can be added to the current page\n $this->load->library('md');\n $result['comment'] = $this->md->defaultTransform($comment);\n $result['username'] = $this->session->userdata('Username');\n $result['profileImage'] = $this->session->userdata('ProfileImage');\n $result['userID'] = $userID;\n\n // return success\n $result['error'] = false; \n echo json_encode($result);\n }", "public function createComment($comment, $author, $email, $chapter_id) {\n \n global $db; // defined in models/connect.php\n $sql = $db->prepare('\n INSERT INTO comment (comment, author, email, comment_date,chapter_id) \n VALUES(?, ?, ?, NOW(), ?)\n ');\n $affectedLines = $sql->execute(array($comment, $author, $email, $chapter_id));\n //result is commented out\n }", "public function comment(Request $request)\n {\n $inputs = $request->all();\n $encodeId = $this->getHashIds()->encode($inputs['project_id']);\n //Set the user as the update owner\n $inputs['user_id'] = Auth::user()->user_id;\n $project_comment = ProjectComment::create($inputs);\n // Set the flash message\n ($project_comment)\n ? $this->setFlashMessage(' Thread on project updates has been successful.', 1)\n : $this->setFlashMessage(' Error!!! Unable to update try again later.', 1);\n // redirect to the create a new inmate page\n return redirect('/projects/timeline/' . $encodeId);\n }", "protected function newComment($post)\n\t{ \n\t\t$comment=new Comment;\n if(isset($_POST['ajax']) && $_POST['ajax']==='comment-form')\n\t\t{\n\t\t\techo CActiveForm::validate($comment);\n\t\t\tYii::app()->end();\n\t\t}\n if(isset($_POST['Comment']))\n\t\t{ $comment->attributes=$_POST['Comment'];\n if($post->addComment($comment))\n {\n Yii::app()->user->setFlash('commentSubmitted','Спасибо за сообщение. Сообщения заказчиков и исполнителей появляются после модерации');\n $this->refresh(); \n } \n }\n\t\treturn $comment;\n\t}", "protected function newComment($model)\n {\n $comment=new Comment;\n if(isset($_POST['Comment']))\n {\n $comment->attributes=$_POST['Comment'];\n if(!Yii::app()->user->isGuest)\n\t{\n\t\t$comment->authorName=Yii::app()->user->username;\n\t\t$comment->email=Yii::app()->user->email;\n\t\t$comment->authorId=Yii::app()->user->id;\n\t}\n\telse\n\t{\t //MFM\n\t\t$comment->authorName=$comment->attributes['authorName'];\n\t\t$comment->email=$comment->attributes['email'];\n\t}\n\t$comment->content=$comment->attributes['content'];\n\t$comment->url=$comment->attributes['url'];\n\n if(Yii::app()->user->isGuest && Yii::app()->params['commentNeedApproval'])\n $comment->status=Comment::STATUS_PENDING;\n else\n $comment->status=Comment::STATUS_APPROVED;\n\n $comment->postId=$model->id;\n\n if(isset($_POST['previewComment']))\n $comment->validate();\n else\n if(isset($_POST['submitComment']) && $comment->save())\n {\n if($comment->status==Comment::STATUS_PENDING)\n {\n Yii::app()->user->setFlash('commentSubmittedMessage',Yii::t('lan','Thank you for your comment. Your comment will be posted once it is approved.'));\n $this->refresh();\n }\n else\n $this->redirect(array('show','slug'=>$model->slug,'#'=>'c'.$comment->id));\n }\n }\n return $comment;\n }", "public function reportComment() {\n $commentId = $this->request->getParameter(\"comId\");\n $postId = $this->request->getParameter(\"postId\");\n $this->comment->report($commentId);\n $this->redirect('Post','index/'.$postId);\n }", "public function add_comment(){\r\n\r\n\t\t/* Require user */\r\n\t\tif (!$commenter = $this->_requireUser('Please sign in, or sign up, to post a comment.')) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t/* Build comment arguments from request variables. */\r\n\t\t$arguments = array();\r\n\t\t$this->add_comment_parse_args($arguments);\r\n\t\t$arguments['commentOwner'] = $commenter->userid;\r\n\r\n\t\t/* Do the deed. */\r\n\t\tif ($this->add_comment_call_model_add($arguments)){\r\n\t\t\t$message = $this->add_comment_success_message();\r\n\t\t\t$messageType = 'info';\r\n\t\t} else {\r\n\t\t\t$message = $this->add_comment_failure_message();\r\n\t\t\t$messageType = 'error';\r\n\t\t}\r\n\r\n\t\t/* Tidy up */\r\n\t\tMessages::addMessage($message, $messageType);\r\n\t\treturn $this->_redirect($this->get_redirect_page());\r\n\r\n\t}", "protected function notifyWallComment($comment, $wallPost) {\n $notifyUser = Gdn::userModel()->getID($wallPost['ActivityUserID']);\n\n $activity = [\n 'ActivityType' => 'WallComment',\n 'ActivityUserID' => $comment['InsertUserID'],\n 'Format' => $comment['Format'],\n 'NotifyUserID' => $wallPost['ActivityUserID'],\n 'RecordType' => 'ActivityComment',\n 'RecordID' => $comment['ActivityCommentID'],\n 'RegardingUserID' => $wallPost['ActivityUserID'],\n 'Route' => userUrl($notifyUser, ''),\n 'Story' => $comment['Body'],\n 'HeadlineFormat' => t('HeadlineFormat.NotifyWallComment', '{ActivityUserID,User} commented on your <a href=\"{Url,url}\">wall</a>.')\n ];\n\n $this->save($activity, 'WallComment');\n }", "public function addComment()\n {\n $this->isConnect();\n\n $post = $this->token->check($_POST);\n\n $formMessage = $this->commentsValidationForm->checkForm($post);\n\n if(!$formMessage)\n {\n $post['user_id'] = $_SESSION['id'];\n $post['validated'] = ($_SESSION['statut'] === 'admin') ? 1 : null;\n $this->comments->add($post);\n header('Location: index.php?route=front.postById&id=' . $_POST['post_id'] . '&success=' . $_SESSION['statut'] . '#comments');\n exit;\n }\n else\n {\n $postAddUnvalid = $post;\n $post = $this->posts->postById($_GET['id']);\n $comments = $this->comments->commentsById($_GET['id']);\n $this->render('postById', compact('formMessage', 'postAddUnvalid', 'post', 'comments'));\n }\n }", "public function after_comment_create($ticket_id, $comment_id){\n\n\t\t$admin_emails = $this->get_ticket_admin_emails($ticket_id);\n\t\t$author_email = wt_get_ticket_author_meta($ticket_id, 'email');\n\n\t\t// add html email header\n\t\tadd_filter( 'wp_mail_content_type', array($this, 'set_html_content_type') );\n\t\n\t\t// current comment author\n\t\t$comment_email = get_comment($comment_id)->comment_author_email;\n\t\tif(in_array($comment_email, $admin_emails)){\n\n\t\t\t// check to see if the current comment was not public or private then dont notify\n\t\t\tif( !in_array( get_comment_meta( $comment_id, '_comment_access',true), array('public', 'private') ) ){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// author posted\n\t\t\tif(is_member_ticket($ticket_id)){\n\n\t\t\t\t// send member email\n\t\t\t\t$email_subject = 'new comment member';\n\t\t\t\t$email_message = $this->get_email_content( 'member_update', array('test' => 'Member'));\n\t\t\t\t$template = $this->set_template_content($email_message, $email_subject);\n\t\t\t\twp_mail( $author_email, $email_subject, $template);\n\t\t\t}else{\n\n\t\t\t\t$email_vars = array(\n\t\t\t\t\t'pass' => get_post_meta( $ticket_id, '_view_key', true ),\n\t\t\t\t\t'name' => get_post_meta( $ticket_id, '_user_name', true ),\n\t\t\t\t);\n\n\t\t\t\t// send public email\n\t\t\t\t$email_subject = 'new comment public';\n\t\t\t\t$email_message = $this->get_email_content( 'public_update', $email_vars);\n\t\t\t\t$template = $this->set_template_content($email_message, $email_subject);\n\t\t\t\twp_mail( $author_email, $email_subject, $template);\n\t\t\t}\n\t\t}else{\n\n\t\t\t// non author, send admin emails\n\t\t\t$email_subject = 'new comment admin';\n\t\t\t$email_message = $this->get_email_content( 'admin_update', array('test' => 'Admin'));\n\t\t\t$template = $this->set_template_content($email_message, $email_subject);\n\t\t\twp_mail( $admin_emails, $email_subject, $template);\n\t\t}\n\n\t\t// remove html email header filter\n\t\tremove_filter( 'wp_mail_content_type', array($this, 'set_html_content_type') );\n\t}", "public function the_comment()\n {\n }", "public function notifyModerators(&$comment) {\n if (!$comment instanceof modxTalksPost && !$comment instanceof modxTalksTempPost) {\n return false;\n }\n\n $this->modx->lexicon->load('modxtalks:emails');\n\n /**\n * Get User info\n */\n $user = $comment->getUserData();\n $images_url = $this->modx->getOption('site_url') . substr($this->config['imgUrl'], 1);\n\n if ($comment instanceof modxTalksPost) {\n $cid = $comment->conversationId;\n $idx = $comment->idx;\n $link = $this->generateLink($cid, $idx, 'full');\n $subject = $this->modx->lexicon('modxtalks.email_new_comment');\n $text = $this->modx->lexicon('modxtalks.email_added_new_comment', array(\n 'link' => $link,\n 'name' => $user['name'],\n ));\n } elseif ($comment instanceof modxTalksTempPost) {\n $subject = $this->modx->lexicon('modxtalks.email_new_premoderated_comment');\n $text = $this->modx->lexicon('modxtalks.email_user_add_premoderated_comment', array(\n 'name' => $user['name'],\n ));\n }\n\n $params = array(\n 'title' => 'Заголовок',\n 'content' => $this->modx->stripTags($this->bbcode($comment->content)),\n 'images_url' => $images_url,\n 'avatar' => $this->getAvatar($user['email'], 50),\n 'text' => $text,\n 'date' => date($this->config['dateFormat'] . ' O', $comment->time),\n );\n\n /**\n * get email body\n */\n $body = $this->getChunk('mt_send_mail', $params);\n\n /**\n * send notifications\n */\n $success = false;\n\n $emails = $this->getUsersEmailsByGroups($this->config['moderator'], $comment);\n\n /**\n * send notifications to moderators\n */\n if (!empty($emails)) {\n if ($this->sendEmail($subject, $body, $emails)) {\n $success = true;\n }\n }\n\n return $success;\n }", "static public function comment_submission() {\n ?>\n\n /**\n * Déclenchement d'événements Google analytics lors de la soumission\n * d'un commentaire.\n *\n * source https://felix-arntz.me/blog/customizing-google-analytics-configuration-site-kit-plugin/\n */\n $('#commentform input[type=\"submit\"]').on('click',function(){\n console.log('SFP: Comment submited');\n if(typeof gtag=='function'){\n gtag('event','Commentaire',{\n 'event_category':'Implication',\n 'event_label':window.location.href\n });\n }\n });\n\n <?php\n }", "public function insert_comment( $id, $comment ) {\n\t\tif ( 1 == $comment->comment_approved ) {\n\t\t\t$this->maybe_notify_new_approved_comment( 'approved', '', $comment );\n\t\t}\n\t}", "public function add() {\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->ActivityLog->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash('Comment saved', 'flash_success');\n\t\t\t\tif (array_key_exists('parent_flag_status', $this->request->data['ActivityLog'])) {\n\t\t\t\t\t$this->ActivityLog->updateParentFlag($this->ActivityLog->id, $this->request->data['ActivityLog']['parent_flag_status']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Error saving comment. Try again', 'flash_error');\n\t\t\t}\n\t\t}\n\t\t$this->redirect($this->referer('/'));\n\t}", "public function InsertComment($details)\n {\n $this->comments[] = $details;\n }", "public function newsCommentReplyCreate(CommentFormRequest $request, $id)\n {\n $article = News::findOrFail($id);\n $article->comments()->save(new Comment([\n 'name' => $request->name,\n 'email' => $request->email,\n 'text' => $request->text,\n 'parent_id' => $request->comment_id\n ]));\n\n Session::flash('success', 'Success! Your comment is awaiting approval!');\n return redirect()->route('news.show', ['id' => $id]);\n }", "public function post_create()\n\t{\n\t\tAcl::can('post_comments_create');\n\n\t\t$validation = Validator::make(Input::all(), array(\n\t\t\t'user_id' => array('required', 'integer'),\n\t\t\t'blog_post_id' => array('required', 'integer'),\n\t\t\t'content' => array('required'),\n\t\t));\n\n\t\tif($validation->valid())\n\t\t{\n\t\t\t$comment = new Blog_Comment;\n\n\t\t\t$comment->user_id = Input::get('user_id');\n\t\t\t$comment->blog_post_id = Input::get('blog_post_id');\n\t\t\t$comment->content = Input::get('content');\n\n\t\t\t$comment->save();\n\n\t\t\tCache::forget(Config::get('cache.key').'comments');\n\n\t\t\tSession::flash('message', 'Added comment #'.$comment->id);\n\n\t\t\treturn Redirect::to('blog/comments');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('blog/comments/create')\n\t\t\t\t\t->with_errors($validation->errors)\n\t\t\t\t\t->with_input();\n\t\t}\n\t}", "public function actionNewComment($id){\n $model = new Comments();\n $this->renderPartial('newComment',array('model'=>$model, 'id'=>$id),false,true);\n\t}", "protected function add_comment_success_message(){\r\n\t\treturn 'Thank you for <a href=\"#comments\" class=\"scroll\">commenting</a>.';\r\n\t}", "public function testCreateNewCommentRoute()\n {\n \t$response = $this->post('/post-comment', [\n \t\t'content' => 'Lorem Ipsum',\n\t\t\t'parent_id' => null,\n\t\t\t'post_id' => 1,\n\t\t\t'level' => 1\n \t]);\n\n $response->assertStatus(200);\n }", "public function NewCommentEpisode(){\r\n $this->comment();\r\n $this->pseudoPost();\r\n $this->contentPost();\r\n $this->_commentManager->AddComment($this->_pseudoPostSecure, $this->_contentPostSecure, $_GET['id'],false,true); \r\n header('location: Episode&id='.$_GET[\"id\"]); \r\n }", "public function actionCreate()\n {\n $model = new BlogComments();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function flag_comment() {\n\t\t\tif ( empty( $_REQUEST[ 'comment_id' ] ) || (int) $_REQUEST[ 'comment_id' ] != $_REQUEST[ 'comment_id' ] ) {\n\t\t\t\t$this->cond_die( __( $this->invalid_values_message ) );\n\t\t\t}\n\n\t\t\t$comment_id = (int) $_REQUEST[ 'comment_id' ];\n\t\t\tif ( $this->already_flagged( $comment_id ) ) {\n\t\t\t\t$this->cond_die( __( $this->already_flagged_message ) );\n\t\t\t}\n\n\t\t\t// checking if nonces help\n\t\t\tif ( ! isset( $_REQUEST[ 'sc_nonce' ] ) || ! wp_verify_nonce( $_REQUEST[ 'sc_nonce' ], $this->_plugin_prefix . '_' . $this->_nonce_key ) ) {\n\t\t\t\t$this->cond_die( __( $this->invalid_nonce_message ) );\n\t\t\t} else {\n\t\t\t\t$this->mark_flagged( $comment_id );\n\t\t\t\t$this->cond_die( __( $this->thank_you_message ) );\n\t\t\t}\n\n\t\t}", "public function doCreate(){\n //only logged in users can write comments\n if(Security::isAuthenticated()){\n if($_POST['send']){\n $userid = Security::getUser()->id;\n $postid = $_GET['blogid'];\n //protects from attackers\n $comment = htmlspecialchars($_POST['commentarea']);\n $time = date(\"Y-m-d\");\n $commentRepository = new CommentRepository();\n //call to createComment\n $commentRepository->createComment($userid, $postid, $comment, $time);\n header('Location: /comment/showComments?id='.$postid);\n }\n }else{\n echo'Only logged in users can write comments';\n }\n }", "public function addComment(): void{\n Quizzes::addComment($_SESSION[\"quizID\"], $_SESSION[\"email\"], $_POST[\"commentText\"]);\n\n $qfa = new QuizFinishUser($_SESSION[\"q\"], $_SESSION[\"ua\"], $_SESSION[\"aa\"]);\n $qfa->generateHTML();\n }", "public function comm($c){\n\t\t$this->comment = $c;\n\t}", "public function ReportComment(){ \r\n $this->comment();\r\n $this->reportPost();\r\n $this->_commentManager->getReportComment($this->_reportPostSecure,\"1\");\r\n header('location: '.$_GET[\"url\"].'&id='.$_GET[\"id\"]);\r\n }", "function addComments($artifact, $comments){\n\t\tforeach($comments as $c){\n\t\t\t$time = strtotime($c['date']);\n\t\t\t$uid = user_get_object_by_name($c['submitter'])->getID();\n\t\t\t$importData = array('time' => $time, 'user' => $uid);\n\t\t\t$artifact->addMessage($c['comment'], $importData);\n\t\t}\n\t}", "public function testCreateComment() {\n // Find any active product\n $product = ShopProduct::model()->published()->find();\n $this->assertTrue($product instanceof ShopProduct);\n\n $email = '[email protected]';\n $text = 'this is test comment' . microtime();\n\n // Open product page and post comment\n $this->open(Yii::app()->createAbsoluteUrl('/shop/product/view', array('seo_alias' => $product->seo_alias)));\n $this->type('id=Comment_name', 'tester');\n $this->type('id=Comment_email', $email);\n $this->type('id=Comment_text', $text);\n $this->clickAndWait(\"//input[@value='Отправить']\");\n\n $this->open(Yii::app()->createAbsoluteUrl('/shop/product/view', array('seo_alias' => $product->seo_alias)));\n $this->assertTrue($this->isTextPresent('Ваш комментарий успешно добавлен. Он будет опубликован после проверки администратором.'));\n\n $this->adminLogin();\n $this->open('/admin/shop/products/update?id=' . $product->id);\n $this->click('xpath=//a[contains(.,\"Отзывы\")]');\n $this->assertTrue($this->isTextPresent($email));\n $this->assertTrue($this->isTextPresent($text));\n }" ]
[ "0.7074814", "0.6581473", "0.6519927", "0.64650357", "0.64277303", "0.6328328", "0.63116556", "0.62874657", "0.6272671", "0.62661654", "0.6254638", "0.6215995", "0.6167386", "0.6166804", "0.61505485", "0.6144829", "0.61312264", "0.6105554", "0.6081027", "0.6080401", "0.60557866", "0.60541344", "0.60499626", "0.604966", "0.60495836", "0.59966415", "0.5996202", "0.597863", "0.59711903", "0.59555846", "0.5943198", "0.59299093", "0.58947784", "0.5851837", "0.5844404", "0.5844303", "0.58255905", "0.5811416", "0.58032274", "0.57983613", "0.5796828", "0.57956153", "0.57833016", "0.5780322", "0.57674754", "0.5764699", "0.57621014", "0.5754501", "0.57266337", "0.57230544", "0.571654", "0.5716508", "0.57081884", "0.57070124", "0.5694365", "0.56931573", "0.56926197", "0.568998", "0.5687934", "0.5676439", "0.56729925", "0.56697434", "0.56667066", "0.56622773", "0.56617033", "0.5652474", "0.5649376", "0.5649121", "0.5636084", "0.56263274", "0.5621952", "0.5621465", "0.56117", "0.5604597", "0.5603009", "0.5588869", "0.55764914", "0.5569401", "0.55665016", "0.55661553", "0.5545592", "0.55340105", "0.55330175", "0.55274695", "0.55263114", "0.5520495", "0.551935", "0.55183524", "0.551669", "0.5516268", "0.55086654", "0.55066806", "0.5506241", "0.5501372", "0.55008763", "0.54999536", "0.5499621", "0.5498019", "0.5488157", "0.54841906" ]
0.6245018
11
Handler to actual send topicrelated activity payload.
private function notify_forum_topic_payload( $activity, $topic_id ) { if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { return; } if ( ! bbp_is_site_public() ) { return; } if ( ! in_array( $activity, array( 'create-topic', 'remove-topic' ), true ) ) { return; } if ( 'create-topic' === $activity && ! bbp_is_topic_published( $topic_id ) ) { return; } $url = bbp_get_topic_permalink( $topic_id ); // Remove moderator flags. $url = remove_query_arg( array( 'view' ), $url ); $args = array( 'action' => 'wporg_handle_activity', 'activity' => $activity, 'source' => 'forum', 'user' => get_user_by( 'id', bbp_get_topic_author_id( $topic_id ) )->user_login, 'post_id' => '', 'topic_id' => $topic_id, 'forum_id' => bbp_get_topic_forum_id( $topic_id ), 'title' => strip_tags( bbp_get_topic_title( $topic_id ) ), 'url' => $url, 'message' => bbp_get_topic_excerpt( $topic_id, 55 ), 'site' => get_bloginfo( 'name' ), 'site_url' => site_url(), ); Profiles\api( $args ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onSend($msg){\n $data = json_decode($msg);\n $action = isset($data['action'])? $data['action']:'';\n echo \"Message has been sent\";\n \n if(array_key_exists($action,$this->subscriber_topics)){\n echo \"Received msg, broacasting to $action\";\n $this->subscriber_topics[$action]->broadcast($msg);\n }\n }", "public function onPush(Topic $topic, WampRequest $request, $data, $provider)\n {\n }", "function sendBoardNotifications(&$topicData)\n{\n\t// Redirects to PostNotifications class sendBoardNotifications method\n\t(new PostNotifications())->sendBoardNotifications($topicData);\n}", "public function publish_to_stream($activity)\n {\n\n }", "public function sendEvent(string $topic, $message): void;", "public function handleSendMessage() {\n\t\t$json = file_get_contents(\"php://input\"); //vytánutí všech dat z POST požadavku - data ve formátu JSON\n\t\t$data = Json::decode($json); //prijata zprava dekodovana z JSONu\n\t\t$user = $this->getPresenter()->getUser();\n\t\t$addMessage = $this->addMessage($data, $user);\n\t\tif (!empty($addMessage)) {\n\t\t\t$this->sendRefreshResponse($data->lastid);\n\t\t}\n\t}", "function en_send_transdata() {\n\t// Handle sending of data\n}", "public function sendPayload() { \n \n \n /* Check and add last-second data that may have been changed by public methods */\n $this->createProxyData();\n $this->createCustomDimensions();\n if(!$this->payload['cn']) $this->createCampaignParameters(); /* ie, check $_GET array for them if still unset */\n \n foreach($this->payload as $i => $v) {\n if(strlen($v) > 0) {\n $params[] = urlencode($i) . '=' . urlencode($v) ;\n }\n }\n \n \n $url = ( ( $this->testing) ? ( $this->test_url ) : ( $this->base_url ) ) . \n '?' . implode('&', $params);\n \n// $url = ( ( $this->testing) ? ( $this->test_url ) : ( $this->base_url ) ) . \n// '?' . http_build_query($this->payload, \"&\");\n\n \n switch($this->output) {\n case 'silent':\n $this->sendCurl($url);\n break;\n case 'noscript':\n /* outputs only a noscript element containing the pixel for Non-Java Operation */\n $this->displayNoScriptPixel($url);\n break;\n case 'pixel':\n echo \"<img height='1' width='1' style='border-style:none;' alt='' src='https://$url&method=NAKED_PIXEL' />\";\n break;\n case 'javascript':\n /* TODO build dynamic javascript version */\n $this->displayJavascript();\n break;\n case 'auto':\n $this->displayJavascript();\n $this->displayNoScriptPixel($url);\n break;\n case 'test':\n $this->displayTestPixel($url);\n break;\n case 'iframe':\n $this->displayIframe($url);\n \n break;\n \n } \n \n \n \n\n \n \n $this->payload_is_sent = TRUE ;\n $this->writeLog($url); \n }", "protected function run()\n {\n $slug = $this->get('slug');\n\n $category = $this->categories->findBySlug($slug);\n\n $creator = User::current();\n $now = Carbon::now();\n\n $conversation = (object) [\n 'poster' => $creator->username,\n 'title' => $this->get('subject'),\n 'posted' => $now,\n 'last_post' => $now,\n 'last_poster' => $creator->username,\n 'category_slug' => $category->slug,\n ];\n\n $post = (new Post([\n 'poster'\t=> $creator->username,\n 'poster_id'\t=> $creator->id,\n 'message'\t=> $this->get('message'),\n 'posted'\t=> $now,\n ]));\n\n $this->categories->addNewTopic($category, $conversation, $post->toArray());\n\n $this->raise(new UserHasPosted($creator, $post));\n }", "public function mail_sending_mechanism() {\n add_action( 'publish_post', [ $this, 'mail_handler' ], 10, 2 );\n }", "public function postAction() {\n\t\t$this->sendMessage();\n\t}", "public function receive(){\n $eslId = $this->uri->segment(3); //Get the flower shop ID\n $this->load->model('esls_model');\n\n $formData = $this->input->post(NULL, TRUE);\n\n //DATA THAT COMES FROM PRODUCERS\n $domain = $formData['_domain'];\n $name = $formData['_name'];\n\n if($name === \"delivery_ready\"){\n $this->process_delivery_ready_event($formData);\n }\n else if($name === \"bid_awarded\"){\n $this->process_bid_awarded_event($formData);\n }\n }", "public function onMessage($msgData) {\r\n\r\n }", "public function handle()\n {\n dispatch(new SendPushNotificationAlert());\n Log::info('Envio de notificações de alertas');\n }", "function sendApprovalNotifications(&$topicData)\n{\n\t(new PostNotifications())->sendApprovalNotifications($topicData);\n}", "private function send(): void\n {\n $data = [\n 'code' => $this->status,\n 'message' => $this->message,\n 'datetime' => Carbon::now()\n ];\n\n $config = config(\"tebot.$this->channelConfig\");\n\n $data['title'] = $this->title . ' ' . $config['name'];\n\n if (!empty($this->detail)) $data['detail'] = json_encode($this->detail);\n\n Http::withHeaders(['x-api-key' => $config['key']])->post($config['url'] . '/api/message', $data);\n }", "public function onTopic( $sTopic )\n\t{\n\t\t$this -> m_sTopic = $sTopic;\n\t}", "public function ambassade_single_topic(&$event) {\n global $user;\n // IF IS AMBASSADE\n if($event[\"row\"][\"forum_id\"] == 29 && !$this->topic_ambassade_set_up) {\n $guild = new \\scfr\\main\\ambassade\\Guild($this->db);\n $first_reply = $event[\"topic_data\"][\"topic_first_post_id\"];\n $guild->__topic_init($event[\"row\"][\"topic_id\"]);\n\n //var_dump();\n\n $templates[\"GUILD_JSON\"] = json_encode(false);\n if($guild->is_registerd) {\n $templates[\"TOPIC_IS_REGISTERED_GUILD\"] = true;\n foreach($guild->RSI as $name => $val)\n $templates[\"GUILD_\".strtoupper($name)] = $val;\n\n $templates[\"GUILD_JSON\"] = json_encode($guild->RSI);\n }\n\n\n if($templates['GUILD_BACKGROUND']) $templates['CUSTOM_BACKGROUND'] = $templates['GUILD_BACKGROUND'];\n\n\n $templates[\"TOPIC_IS_GUILD\"] = true;\n $templates[\"GUILD_TOPIC_ID\"] = $event[\"topic_data\"][\"topic_id\"];\n\n $templates[\"S_REQUIRE_ANGULAR\"] = true;\n $this->template->assign_vars($templates);\n $this->topic_set_up = true;\n }\n }", "function process()\n\t{\n\t\tswitch(getPOST('action',''))\n\t\t{\n\t\t\tcase 'forum_send':\n\t\t\t\tif(isInPOST(array(\"body\")))\n\t\t\t\t{\n\t\t\t\t\tif($this->sendMessage($_POST['body'],getGET($this->reply_to_get,0)))\n\t\t\t\t\t\t$this->message(FORUM_MESSAGE_SEND_MESSAGE_OK);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'cat_operation':\n\t\t\t\tif(isset($_POST['cat_id']))\n\t\t\t\t{\n\t\t\t\t\tif(isset($_POST['pub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubCat($_POST['cat_id'],true))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_PUB_CAT_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['unpub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubCat($_POST['cat_id'],false))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_UNPUB_CAT_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['del']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($_POST['del_bizt'])) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->delCat($_POST['cat_id']))\n\t\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_DEL_CAT_OK);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $this->message(FORUM_MESSAGE_DEL_BIZT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'topic_operation':\n\t\t\t\tif(isset($_POST['topic_id']))\n\t\t\t\t{\n\t\t\t\t\tif(isset($_POST['pub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubTopic($_POST['topic_id'],true))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_PUB_TOPIC_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['unpub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubTopic($_POST['topic_id'],false))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_UNPUB_TOPIC_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['del']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($_POST['del_bizt']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->delTopic($_POST['topic_id']))\n\t\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_DEL_TOPIC_OK);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $this->message(FORUM_MESSAGE_DEL_BIZT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'post_operation':\n\t\t\t\tif(isset($_POST['post_id']))\n\t\t\t\t{\n\t\t\t\t\tif(isset($_POST['pub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubMessage($_POST['post_id'],true))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_PUB_POST_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['unpub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubMessage($_POST['post_id'],false))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_UNPUB_POST_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['del']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($_POST['del_bizt']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->delMessage($_POST['post_id']))\n\t\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_DEL_POST_OK);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $this->message(FORUM_MESSAGE_DEL_BIZT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'new_topic':\n\t\t\t\tif(isset($_POST['topic_name']))\n\t\t\t\t{\n\t\t\t\t\t$this->createTopic($_POST['topic_name']);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'new_cat':\n\t\t\t\tif(isset($_POST['cat_name']))\n\t\t\t\t{\n\t\t\t\t\t$this->createCat($_POST['cat_name']);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Topic $topic)\n {\n $this->info(\"开始执行加链接任务...\");\n\n $topic->autoLink();\n\n $this->info(\"完成加链接任务\");\n }", "public function postSend()\n {\n }", "public function postHandleCallback() {\n $data = \\Input::all();\n $msg = new Message();\n $msg->text = trim($data['text']);\n $msg->api_id = $data['id'];\n $msg->sender = $data['from'];\n $msg->receiver = $data['to'];\n $msg->save();\n\n //for correct counting\n \\DB::transaction(function() use ($msg) {\n $response = MessageHelper::decode($msg);\n if ($response) {\n $msg->campaign_id = $response->campaign_id;\n $msg->save();\n }\n });\n return 'Hello World';\n }", "public function produce(int $partition, int $msgflags, string $payload, string $key = NULL): void { }", "public function send()\n {\n // Stream post the data\n $this->evaluateResponse($this->httpPost($this->str_endpoint . '/event', $this->compile()));\n }", "public function publish_help_selling_data_topic(Request $request){\n Session::put('menu_item_parent', 'help');\n Session::put('menu_item_child', 'selling_data');\n Session::put('menu_item_child_child', 'selling_topics');\n\n $helpTopicIdx = $request->helpTopicIdx;\n $topic = HelpTopic::where('helpTopicIdx', $helpTopicIdx)->get()->first();\n $new['active'] = 1 - $topic->active;\n HelpTopic::where('helpTopicIdx', $helpTopicIdx)->update($new);\n Session::flash('flash_success', 'Help Selling Data has been published successfully');\n echo \"success\";\n }", "public function publishAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the GET/POST paramter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n\n // check if the url are not empty\n if (\"\" != $hubUrl && \"\" != $topicUrl) {\n // get the zend pubplisher\n $publisher = new Zend_Feed_Pubsubhubbub_Publisher;\n\n // hand over the paramter\n $publisher->addHubUrl($hubUrl);\n $publisher->addUpdatedTopicUrl($topicUrl);\n\n // start the publishing process\n $publisher->notifyAll();\n\n // check the publisher, if the publishing was correct, else output the errors\n if ($publisher->isSuccess() && 0 == count($publisher->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($publisher->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n // if the url's are empty\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n }", "public function send()\n\t{\n\t\t$message = $this->message ?: ucwords($this->getSystemUser()).' ran the ['.$this->task.'] task.';\n\n\t\t$payload = ['text' => $message, 'channel' => $this->channel];\n\n Request::post(\"https://{$this->team}.slack.com/services/hooks/incoming-webhook?token={$this->token}\")->sendsJson()->body($payload)->send();\n\t}", "public function handleDataSubmission() {}", "public function post($msg) {\r\n\t\tif (isset ( $_GET ['oauth_token'] )) {\r\n\t\t\t/* exchange the request token for access token */\r\n\t\t\t$key = $_COOKIE ['key'];\r\n\t\t\t$secret = $_COOKIE ['secret'];\r\n\t\t\t$result = $this->client->getAccessToken ( $key, $secret );\r\n\t\t\t$key = $result [\"oauth_token\"];\r\n\t\t\t$secret = $result [\"oauth_token_secret\"];\r\n\t\t\tif ($key) {\r\n\t\t\t\t\r\n\t\t\t\t/* access success, let's say something. */\r\n\t\t\t\t$this->client->programmaticLogin ( $key, $secret );\r\n\t\t\t\t//echo 'logged in.';\r\n\t\t\t\t$entry = new Zend_Gdata_Douban_BroadcastingEntry();\r\n\t\t\t\t$content = new Zend_Gdata_App_Extension_Content($msg);\r\n\t\t\t\t$entry->setContent ( $content );\r\n\t\t\t\t$entry = $this->client->addBroadcasting ( \"saying\", $entry );\r\n\t\t\t\t//echo '<br/>you just posted: ' . $entry->getContent ()->getText ();\r\n\t\t\t} else {\r\n\t\t\t\techo 'Oops, get access token failed';\r\n\t\t\t}\r\n\t\t} \r\n\r\n\t}", "public function onMessage($connect, $data)\n {\n// echo $this->decode($data)['payload'] . PHP_EOL;\n }", "public function postTopicLog($topic_id, Request $request) {\n $topic = Topic::findOrFail($topic_id);\n\n // get necessary param\n $page = $request->get('page');\n $itemInPage = $request->get('itemInPage') ? $request->get('itemInPage') : $this->itemInPage;\n\n $pages = ceil($topic->histories()->count() / $itemInPage);\n $histories = $topic->histories()\n ->orderBy('created_at', 'desc')->get()->forPage($page, $itemInPage);\n\n // for name\n $names = [];\n foreach ($histories->filter(function ($value, $key) {\n return $value->type == 1;\n }) as $history) {\n $user = User::findOrFail($history->user_id);\n $user_arr = [\n 'id' => $user->id,\n 'name' => $user->name,\n 'url' => action('PeopleController@show', $user->url_name)\n ];\n array_push($names, [\n 'id' => $history->id,\n 'type' => $history->type,\n 'user' => $user_arr,\n 'text' => $history->text,\n 'time' => Carbon::parse($history->created_at)->diffForHumans(),\n 'timestamp' => Carbon::parse($history->created_at)->timestamp,\n 'canRollback' => Auth::user()->operation(12),\n 'canReport' => true,\n ]);\n }\n array_unshift($names, [\n 'text' => $topic->name\n ]);\n\n // for description\n $descriptions = [];\n foreach ($histories->filter(function ($value, $key) {\n return $value->type == 2;\n }) as $history) {\n $user = User::findOrFail($history->user_id);\n $user_arr = [\n 'id' => $user->id,\n 'name' => $user->name,\n 'url' => action('PeopleController@show', $user->url_name)\n ];\n array_push($descriptions, [\n 'id' => $history->id,\n 'type' => $history->type,\n 'user' => $user_arr,\n 'text' => $history->text,\n 'time' => Carbon::parse($history->created_at)->diffForHumans(),\n 'timestamp' => Carbon::parse($history->created_at)->timestamp,\n 'canRollback' => Auth::user()->operation(12),\n 'canReport' => true,\n ]);\n }\n array_unshift($descriptions, [\n 'text' => $topic->description\n ]);\n\n // for topics\n $topics = [];\n foreach ($histories->filter(function ($value, $key) {\n return 3 <= $value->type && $value->type <= 6;\n }) as $history) {\n $user = User::findOrFail($history->user_id);\n $user_arr = [\n 'id' => $user->id,\n 'name' => $user->name,\n 'url' => action('PeopleController@show', $user->url_name)\n ];\n $topic = Topic::findOrFail($history->text);\n array_push($topics, [\n 'id' => $history->id,\n 'type' => $history->type,\n 'user' => $user_arr,\n 'topic' => [\n 'name' => $topic->name,\n 'url' => '/topic/' . $topic->id\n ],\n 'time' => Carbon::parse($history->created_at)->diffForHumans(),\n 'timestamp' => Carbon::parse($history->created_at)->timestamp,\n 'canRollback' => Auth::user()->operation(12),\n 'canReport' => true,\n ]);\n }\n\n\n // fore image\n $images = [];\n foreach ($histories->filter(function ($value, $key) {\n return $value->type == 7;\n }) as $history) {\n $user = User::findOrFail($history->user_id);\n $user_arr = [\n 'id' => $user->id,\n 'name' => $user->name,\n 'url' => action('PeopleController@show', $user->url_name)\n ];\n array_push($images, [\n 'id' => $history->id,\n 'type' => $history->type,\n 'topic' => [\n 'name' => $topic->name,\n 'url' => '/topic/' . $topic->id\n ],\n 'user' => $user_arr,\n 'time' => Carbon::parse($history->created_at)->diffForHumans(),\n 'timestamp' => Carbon::parse($history->created_at)->timestamp,\n 'canRollback' => false,\n 'canReport' => true,\n ]);\n }\n\n // for merges\n $merges = [];\n foreach ($histories->filter(function ($value, $key) {\n return $value->type == 8 || $value->type == 9;\n }) as $history) {\n $user = User::findOrFail($history->user_id);\n $user_arr = [\n 'id' => $user->id,\n 'name' => $user->name,\n 'url' => action('PeopleController@show', $user->url_name)\n ];\n $topic = Topic::findOrFail($history->text);\n array_push($merges, [\n 'id' => $history->id,\n 'type' => $history->type,\n 'topic' => [\n 'name' => $topic->name,\n 'url' => '/topic/' . $topic->id\n ],\n 'user' => $user_arr,\n 'time' => Carbon::parse($history->created_at)->diffForHumans(),\n 'timestamp' => Carbon::parse($history->created_at)->timestamp,\n 'canRollback' => false,\n 'canReport' => true,\n ]);\n }\n\n // for operations\n $operations = [];\n foreach ($histories->filter(function ($value, $key) {\n return $value->type == 10 || $value->type == 11;\n }) as $history) {\n $user = User::findOrFail($history->user_id);\n $user_arr = [\n 'id' => $user->id,\n 'name' => $user->name,\n 'url' => action('PeopleController@show', $user->url_name)\n ];\n array_push($operations, [\n 'id' => $history->id,\n 'type' => $history->type,\n 'user' => $user_arr,\n 'text' => $history->text,\n 'time' => Carbon::parse($history->created_at)->diffForHumans(),\n 'timestamp' => Carbon::parse($history->created_at)->timestamp,\n 'canRollback' => Auth::user()->operation(9),\n 'canReport' => true,\n ]);\n }\n\n\n\n return [\n 'pages' => $pages,\n 'data' => [\n 'names' => $names,\n 'descriptions' => $descriptions,\n 'topics' => $topics,\n 'images' => $images,\n 'merges' => $merges,\n 'operations' => $operations\n ]\n ];\n\n\n }", "function mqqtPublish($mqtt, $SrcAddr, $ClusterId, $AttributId, $data, $qos = 0)\n {\n // Abeille / short addr / Cluster ID - Attr ID -> data\n // deamonlog(\"debug\",\"mqttPublish with Qos: \".$qos);\n if ($mqtt->connect(true, null, $GLOBALS['username'], $GLOBALS['password'])) {\n $mqtt->publish(\"Abeille/\".$SrcAddr.\"/\".$ClusterId.\"-\".$AttributId, $data, $qos);\n $mqtt->publish(\"Abeille/\".$SrcAddr.\"/Time-TimeStamp\", time(), $qos);\n $mqtt->publish(\"Abeille/\".$SrcAddr.\"/Time-Time\", date(\"Y-m-d H:i:s\"), $qos);\n $mqtt->close();\n } else {\n deamonlog('WARNING', 'Time out!');\n echo \"\\n\\nWARNING', Time out!\\n\\n\";\n }\n }", "abstract function doSend();", "function AnnouncementSend()\n{\n\tglobal $topic, $board, $context, $settings;\n\n\tcheckSession();\n\n\t// !!! Might need an interface?\n\t$chunkSize = empty($settings['mail_queue']) ? 50 : 500;\n\n\t$context['start'] = empty($_REQUEST['start']) ? 0 : (int) $_REQUEST['start'];\n\t$groups = getAnnounceGroups();\n\n\tif (isset($_POST['membergroups']))\n\t\t$_POST['who'] = explode(',', $_POST['membergroups']);\n\n\t// Check whether at least one membergroup was selected.\n\tif (empty($_POST['who']))\n\t\tfatal_lang_error('no_membergroup_selected');\n\n\t// Make sure all membergroups are integers and can access the board of the announcement.\n\tforeach ($_POST['who'] as $id => $mg)\n\t\t$_POST['who'][$id] = in_array((int) $mg, $groups) ? (int) $mg : 0;\n\n\t// Get the topic subject and censor it.\n\t$request = wesql::query('\n\t\tSELECT m.id_msg, m.subject, m.body, m.id_member\n\t\tFROM {db_prefix}topics AS t\n\t\t\tINNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)\n\t\tWHERE t.id_topic = {int:current_topic}',\n\t\tarray(\n\t\t\t'current_topic' => $topic,\n\t\t)\n\t);\n\tlist ($id_msg, $context['topic_subject'], $message, $owner) = wesql::fetch_row($request);\n\twesql::free_result($request);\n\n\tcensorText($context['topic_subject']);\n\tcensorText($message);\n\n\t$message = trim(un_htmlspecialchars(strip_tags(strtr(parse_bbc($message, 'post', array('smileys' => false, 'cache' => $id_msg, 'user' => $owner)), array('<br>' => \"\\n\", '</div>' => \"\\n\", '</li>' => \"\\n\", '&#91;' => '[', '&#93;' => ']')))));\n\n\t// We need this in order to be able send emails.\n\tloadSource('Subs-Post');\n\n\t// Select the email addresses for this batch.\n\t$request = wesql::query('\n\t\tSELECT mem.id_member, mem.email_address, mem.lngfile\n\t\tFROM {db_prefix}members AS mem\n\t\tWHERE mem.id_member != {int:current_member}' . (!empty($settings['allow_disableAnnounce']) ? '\n\t\t\tAND mem.notify_announcements = {int:notify_announcements}' : '') . '\n\t\t\tAND mem.is_activated = {int:is_activated}\n\t\t\tAND (mem.id_group IN ({array_int:group_list}) OR mem.id_post_group IN ({array_int:group_list}) OR FIND_IN_SET({raw:additional_group_list}, mem.additional_groups) != 0)\n\t\t\tAND mem.id_member > {int:start}\n\t\tORDER BY mem.id_member\n\t\tLIMIT ' . $chunkSize,\n\t\tarray(\n\t\t\t'current_member' => MID,\n\t\t\t'group_list' => $_POST['who'],\n\t\t\t'notify_announcements' => 1,\n\t\t\t'is_activated' => 1,\n\t\t\t'start' => $context['start'],\n\t\t\t'additional_group_list' => implode(', mem.additional_groups) != 0 OR FIND_IN_SET(', $_POST['who']),\n\t\t)\n\t);\n\n\t// All members have received a mail. Go to the next screen.\n\tif (wesql::num_rows($request) == 0)\n\t{\n\t\tif (!empty($_REQUEST['move']) && allowedTo('move_any'))\n\t\t\tredirectexit('action=movetopic;topic=' . $topic . '.0' . (empty($_REQUEST['goback']) ? '' : ';goback'));\n\t\telseif (!empty($_REQUEST['goback']))\n\t\t\tredirectexit('topic=' . $topic . '.new#new', we::is('ie'));\n\t\telse\n\t\t\tredirectexit('board=' . $board . '.0');\n\t}\n\n\t// Loop through all members that'll receive an announcement in this batch.\n\twhile ($row = wesql::fetch_assoc($request))\n\t{\n\t\t$cur_language = empty($row['lngfile']) || empty($settings['userLanguage']) ? $settings['language'] : $row['lngfile'];\n\n\t\t// If the language wasn't defined yet, load it and compose a notification message.\n\t\tif (!isset($announcements[$cur_language]))\n\t\t{\n\t\t\t$replacements = array(\n\t\t\t\t'TOPICSUBJECT' => $context['topic_subject'],\n\t\t\t\t'MESSAGE' => $message,\n\t\t\t\t'TOPICLINK' => SCRIPT . '?topic=' . $topic . '.0',\n\t\t\t);\n\n\t\t\t$emaildata = loadEmailTemplate('new_announcement', $replacements, $cur_language);\n\n\t\t\t$announcements[$cur_language] = array(\n\t\t\t\t'subject' => $emaildata['subject'],\n\t\t\t\t'body' => $emaildata['body'],\n\t\t\t\t'recipients' => array(),\n\t\t\t);\n\t\t}\n\n\t\t$announcements[$cur_language]['recipients'][$row['id_member']] = $row['email_address'];\n\t\t$context['start'] = $row['id_member'];\n\t}\n\twesql::free_result($request);\n\n\t// For each language send a different mail - low priority...\n\tforeach ($announcements as $lang => $mail)\n\t\tsendmail($mail['recipients'], $mail['subject'], $mail['body'], null, null, false, 5);\n\n\t$context['percentage_done'] = round(100 * $context['start'] / $settings['latestMember'], 1);\n\n\t$context['move'] = empty($_REQUEST['move']) ? 0 : 1;\n\t$context['go_back'] = empty($_REQUEST['goback']) ? 0 : 1;\n\t$context['membergroups'] = implode(',', $_POST['who']);\n\twetem::load('announcement_send');\n\n\t// Go back to the correct language for the user ;).\n\tif (!empty($settings['userLanguage']))\n\t\tloadLanguage('Post');\n}", "public function getTopic() {}", "public function handleSendEvent(object $message): void;", "public function publish($topic,$payload)\n {\n \treturn $this->getClient()->publish([\n \t\t'Message' => json_encode($payload),\n \t\t'TopicArn' => $this->getTopic($topic)['arn'],\n 'Subject' => $topic,\n \t]);\n }", "public function callback(){\n $body = file_get_contents('php://input');\n $res = json_decode($body, true);\n \\Think\\Log::write('点播回调开始 begin');\n \n if($res['status'] == 'fail'){\n \\Think\\Log::write('点播回调失败 fail');\n }else{\n \\Think\\Log::write('点播回调成功 success');\n $this->_handle($res);\n }\n }", "protected function pushWechat()\n {\n if ($this->wechatTemplateMsg) {\n $flag = true;\n array_walk($this->wechatTemplateMsg, function ($row, $index) use (&$flag) {\n $wechat = new Wechat($row['cid']);\n $result = $this->db->table('c_awoke')->where('id', $row['id'])->update(['PlanVisitDate' => date('Y-m-d')]);\n Log::info('update c_awoke sql: ' . json_encode($this->db->getQueryLog(), JSON_UNESCAPED_UNICODE));\n Log::info('update c_awoke data: PlanVisitDate=>' . date('Y-m-d'));\n if (!$result) {\n return false;\n }\n $result = $wechat->sendTemplateMessage($row['msg']);\n Log::info('send wechat tplmsg: ' . $result);\n if (!$result) {\n $flag = false;\n $this->redis->lPush('');\n return false;\n }\n });\n }\n }", "public function publish($data)\n {\n// $fp = fopen('/tmp/mana.txt', 'w');\n// fwrite($fp, 'yuyuyuy');\n// fclose($fp);\n\n $this->publisher->publish(self::TOPIC_NAME, json_encode($data));\n }", "protected function send() {}", "function publishLog() {\n\t\t$id = $this->current_log;\t\t\n\t\t$res = $this->query(\"SELECT event_id FROM $this->table_log WHERE id=$id\");\n\t\t$row = $res->fetch_assoc();\n\t\t$cal_id = explode(\",\",$row['event_id']);\n\t\t$calEvent = $this->calendar_instance->getEventDetails($row['event_id']);\n\t\t$topic = $calEvent['caption'];\n\t\t$year = $calEvent['year'];\n\t\t$slug = $calEvent['slug'];\n\t\t$url = $this->generateCoolURL(\"/$year/$slug\");\n\t\t$this->addToActivityLog(\"publiserte logg fra <a href=\\\"$url\\\">$topic</a>.\",false,\"major\");\n\t}", "function _on_initialize()\n {\n $this->_request_data['content_topic'] = $this->_topic;\n\n /**\n * Prepare the request switch, which contains URL handlers for the component\n */\n\n // Handle /config\n $this->_request_switch['config'] = array\n (\n 'handler' => array('midcom_core_handler_configdm2', 'config'),\n 'schema' => 'config',\n 'fixed_args' => array('config'),\n );\n\n // Handle /\n $this->_request_switch['index'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_index', 'index'),\n );\n \n /* Crud for events */\n // Handle /create_event/<schema name>\n $this->_request_switch['create_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'create'),\n 'fixed_args' => array('create_event'),\n 'variable_args' => 1,\n );\n // Handle /view_event/<event_guid>\n $this->_request_switch['view_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'read'),\n 'fixed_args' => array('view_event'),\n 'variable_args' => 1,\n );\n // Handle /edit_event/<event_guid>\n $this->_request_switch['edit_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'update'),\n 'fixed_args' => array('edit_event'),\n 'variable_args' => 1,\n );\n // Handle /delete_event/<event_guid>\n $this->_request_switch['delete_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'delete'),\n 'fixed_args' => array('delete_event'),\n 'variable_args' => 1,\n );\n \n // /archive/between/<from date>/<to date> shows all events of selected week\n // in Archive mode, only relevant for style code, it sets a flag\n // which allows better URL handling: The request context key 'archive_mode'\n // will be true in this case.\n $this->_request_switch['archive-between'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'between'),\n 'fixed_args' => array('archive', 'between'),\n 'variable_args' => 2,\n );\n\n // /archive Main archive page\n $this->_request_switch['archive-welcome'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_archive', 'welcome'),\n 'fixed_args' => array('archive'),\n );\n\n // /archive/view/<event GUID> duplicate of the view handler for archive\n // operation, only relevant for style code, it sets a flag\n // which allows better URL handling: The request context key 'archive_mode'\n // will be true in this case.\n $this->_request_switch['archive-view'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'view'),\n 'fixed_args' => array('archive', 'view'),\n 'variable_args' => 1,\n );\n // Handle /upcoming/trips/<count>\n $this->_request_switch['upcoming_trips'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'upcoming'),\n 'fixed_args' => array('upcoming', 'trips'),\n 'variable_args' => 1,\n );\n // Handle /upcoming/meetings/<count>\n $this->_request_switch['upcoming_meetings'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'upcoming'),\n 'fixed_args' => array('upcoming', 'meetings'),\n 'variable_args' => 1,\n );\n \n /* Crud for location */\n // Handle /location/create/<schema name>\n $this->_request_switch['create_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'create'),\n 'fixed_args' => array('location', 'create'),\n 'variable_args' => 1,\n );\n // Handle /location/view/<location_guid>\n $this->_request_switch['view_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'read'),\n 'fixed_args' => array('location', 'view'),\n 'variable_args' => 1,\n );\n // Handle /location/dl_view/<location_guid>\n $this->_request_switch['view_location_dl'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'read'),\n 'fixed_args' => array('location', 'dl_view'),\n 'variable_args' => 1,\n );\n // Handle /location/edit/<location_guid>\n $this->_request_switch['edit_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'update'),\n 'fixed_args' => array('location', 'edit'),\n 'variable_args' => 1,\n );\n // Handle /location/delete/<location_guid>\n $this->_request_switch['delete_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'delete'),\n 'fixed_args' => array('location', 'delete'),\n 'variable_args' => 1,\n );\n \n // Handle /locations\n $this->_request_switch['locations'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'index'),\n 'fixed_args' => array('locations'),\n 'variable_args' => 0,\n );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-rss2'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'rss'),\n 'fixed_args' => array('rss.xml'),\n );\n\n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-rss2-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'rss'),\n\t 'fixed_args' => array('user', 'rss.xml'),\n\t );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-ical'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('ical.ics'),\n );\n \n // / shows next N (configured number) meetings in RSS format\n $this->_request_switch['feed-ical-meetings'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('meetings','ical.ics'),\n );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-ical-trips'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('trips','ical.ics'),\n );\n\n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-ical-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'ical.ics'),\n\t );\n \n\t // / shows next N (configured number) meetings in RSS format\n\t $this->_request_switch['feed-ical-meetings-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'meetings','ical.ics'),\n\t );\n \n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-ical-trips-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'trips','ical.ics'),\n\t );\n \n $this->_request_switch['feeds'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'index'),\n 'fixed_args' => array('feeds'),\n );\n }", "private function notify_forum_reply_payload( $activity, $reply_id ) {\n\t\tif ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! bbp_is_site_public() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! in_array( $activity, array( 'create-reply', 'remove-reply' ), true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'create-reply' === $activity && ! bbp_is_reply_published( $reply_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$url = bbp_get_reply_url( $reply_id );\n\t\t// Remove moderator flags.\n\t\t$url = remove_query_arg( array( 'view' ), $url );\n\n\t\t$args = array(\n\t\t\t'action' => 'wporg_handle_activity',\n\t\t\t'activity' => $activity,\n\t\t\t'source' => 'forum',\n\t\t\t'user' => get_user_by( 'id', bbp_get_reply_author_id( $reply_id ) )->user_login,\n\t\t\t'post_id' => $reply_id,\n\t\t\t'topic_id' => bbp_get_reply_topic_id( $reply_id ),\n\t\t\t'forum_id' => bbp_get_reply_forum_id( $reply_id ),\n\t\t\t'title' => strip_tags( bbp_get_reply_topic_title( $reply_id ) ),\n\t\t\t'url' => $url,\n\t\t\t'message' => $this->get_reply_excerpt( $reply_id, 15 ),\n\t\t\t'site' => get_bloginfo( 'name' ),\n\t\t\t'site_url' => site_url(),\n\t\t);\n\n\t\tProfiles\\api( $args );\n\t}", "public function handleDeliveryEvent(object $message): void;", "public function onPostConsume(PostConsume $context): void;", "public function publish_help_buying_data_topic(Request $request){\n Session::put('menu_item_parent', 'help');\n Session::put('menu_item_child', 'buying_data');\n Session::put('menu_item_child_child', 'buying_topics');\n $helpTopicIdx = $request->helpTopicIdx;\n $topic = HelpTopic::where('helpTopicIdx', $helpTopicIdx)->get()->first();\n $new['active'] = 1 - $topic->active;\n HelpTopic::where('helpTopicIdx', $helpTopicIdx)->update($new);\n echo \"success\";\n }", "function send($entity){\n\t\t//vazco_newsletter::publications_send();\n\t\t//return vazco_newsletter::publication2queue(2831);\n\t\t//return vazco_newsletter::publication2queue(2634);\n\t\t//return vazco_newsletter::messages_send(2);\n\t\tvazco_newsletter::publications_send();\n\t\treturn true;\n\t}", "public function broadCast($MSG = '', $topicARN = '', $endPointARN = '', $TARGET = 'all', $USERDATA = ARRAY()) {\n try {\n\n if ($MSG != '') {\n $PUBLISH_ARR = array(\n 'MessageStructure' => 'json',\n 'Message' => json_encode(array(\n 'default' => '',\n $this->PLATEFORM_APNS => json_encode(array(\n 'aps' => array(\n 'alert' => $MSG,\n 'sound' => 'default',\n 'badge' => 0\n ),\n 'userdata' => $USERDATA,\n \n )),\n // FOR THE ANDROID\n /* 'GCM' => json_encode(array(\n 'data' => array(\n 'message' => $MSG,\n 'xdata' => array(\n 'type' => 'broadcast',\n 'id' => 1\n )\n ),\n ))*/ \n ))\n );\n if ($TARGET == 'all')\n $PUBLISH_ARR['TopicArn'] = $topicARN != '' ? $topicARN : $this->TOPIC_ARN;\n else\n $PUBLISH_ARR['TargetArn'] = $endPointARN != '' ? $endPointARN : $this->END_POINT_ARN;\n\n // mprd($PUBLISH_ARR);\n\n $this->SNS_OBJ->publish($PUBLISH_ARR);\n \n }\n } catch (Exception $ex) {\n throw new Exception('Error in broadCast function - ' . $ex);\n }\n }", "public function onProcess(){\n $id = $this->event->getData();\n \n // retrieve data from database\n $tweet = $this->appmanager->getInfosById($id); \n \n $this->event->setResponse($tweet); \n \n }", "public function beforeSendPerformed (Swift_Events_SendEvent $evt)\n {\n $message = $evt->getMessage();\n $message->setBody($message->getBody(), $this->contentType);\n }", "final public function execute() {\r\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\r\n Trace::debug('post: '.serialize($postStr));\r\n\r\n $echostr = MRequest::get('echostr');\r\n if (!empty($echostr)) {\r\n Trace::debug('echostr '.$echostr);\r\n echo $echostr;\r\n return;\r\n }\r\n//*\r\n if (!$this->checkSignature()) {\r\n $this->signatureFailed();\r\n return;\r\n }\r\n//*/\r\n //extract post data\r\n if (empty($postStr)){\r\n Trace::debug('empty poststr');\r\n $this->errorOccured();\r\n return;\r\n }\r\n\r\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\r\n\r\n $this->fromUser = $postObj->FromUserName;\r\n $this->toUser = $postObj->ToUserName;\r\n\r\n $this->xmlObj = $postObj;\r\n\r\n $msgtype = strval($postObj->MsgType);\r\n\r\n if ('text' === $msgtype) {\r\n $text = strval($postObj->Content);\r\n $this->receivedText($postObj, $text);\r\n } elseif ('event' === $msgtype) {\r\n $event = strval($postObj->Event);\r\n $eventKey = strval($postObj->EventKey);\r\n $this->receivedEvent($postObj, $event, $eventKey);\r\n } else {\r\n $this->receivedUnknown($postObj);\r\n }\r\n\r\n }", "public function onSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)\n {}", "function ProcessMessage( $event, &$data, $wparam=NULL, $lparam=NULL )\n\t{\n\t\tswitch( $event )\n\t\t{\n\t\t\t# ----------------------\n\t\t\t# standard events\n\t\t\t# ----------------------\n\t\t\tcase 'info':\n\t\t\t{\n\t\t\t\tif( get_class($data) == 'module_data_request_t' )\n\t\t\t\t{\n\t\t\t\t\t$data->ID \t\t\t\t= MODULEID_INETOPIA_NEWSLETTER;\n\t\t\t\t\t$data->sName \t\t\t= \"Newsletter\";\n\t\t\t\t\t$data->sVersion \t\t= \"1.0\";\n\t\t\t\t\t$data->sDevelopment \t= \"Inetopia\";\n\t\t\t\t\t$data->sHomepage \t\t= \"http://www.inetopia.de\";\n\t\t\t\t\t$data->sDescription\t\t= \"Newsletter mailing system \";\n\t\t\t\t\t//$data->sSourceConst\t\t= \"modconst_news\";\n\t\t\t\t\t\n\t\t\t\t\t# localize cmod data\n\t\t\t\t\t$this->oInfos = $data;\n\t\t\t\t\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}break;\n\t\t\tcase 'load':\n\t\t\t{\n\t\t\t\t#save params\n\t\t\t\t$this->aParams = $data;\n\t\t\t\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\tcase 'unload':\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\tcase 'install':\n\t\t\t{\n\t\t\t\t# install tables\n\t\t\t\t\n\t\t\t\treturn $this->SQLInstall();\n\t\t\t}break;\n\t\t\tcase 'uninstall':\n\t\t\t{\n\n\t\t\t\treturn $this->SQLUninstall();\n\t\t\t\t# uninstall tables\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\tcase 'reset':\n\t\t\t{\n\n\t\t\t\treturn $this->SQLReset();\n\t\t\t\t# uninstall tables\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tcase 'optimize':\n\t\t\t{\n\t\t\t\t\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\n\t\t\t# ----------------------\n\t\t\t# specific events\n\t\t\t# ----------------------\n\n\t\t\tcase 'on_register_member':\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\tcase 'on_unregister_member':\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\tcase 'on_teamjoin_request':\n\t\t\t{\n\t\t\t\t\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t# ----------------------\n\t\t\t# page events\n\t\t\t# ----------------------\n\t\t\t\n\t\n\t\t\tcase 'match_info':\n\t\t\t{\n\t\t\t\t\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'match_first_report':\n\t\t\t{\n\t\t\t\t\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'match_second_report':\n\t\t\t{\t\t\t\t\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'match_administration':\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\n\t\t\t/*\n\t\t\tcase 'match_revolk_administration':\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}break;*/\n\t\t\t\n\t\t\t\n\t\t\tcase 'page_init':\n\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Input: \t$data => workspace\n\t\t\t#\t\t\t$wparam => $page_tpl\n\t\t\t#\t\t\t$lparam => $gl_oVars->bCModActivated\n\t\t\t# Output: *true/false\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'exec_template':\n\t\t\t{\n\t\t\t\tglobal $gl_oVars;\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t\t$data => Workspace\n\t\t\t\t\t$wparam => $page_tpl\n\t\t\t\t\t$lparam => $ModuleID\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t# ----------------------------------------\n\t\t\t\t# \n\t\t\t\t#\n\t\t\t\t# ----------------------------------------\n\t\t\t\tif( $data == 'hp' )\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t} // if 'hp'\n\t\t\t\treturn true;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'exec_document':\n\t\t\t{\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\tcase 'exec_admin_cmod':\n\t\t\t{\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t# ----------------------\n\t\t\t# Kommunication Template/Page <=> cMod\n\t\t\t# ----------------------\n\t\t\t\n\t\t\t\n\t\t\tcase 'get_admin_links':\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$aLinkPool = array();\n\t\t\t\t\n\t\t\t\treturn 1;\t\t\t\t\n\t\t\t\t\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# multiplayer (team)\n\t\t\tcase 'get_team_links':\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\t\n\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# single player (member)\n\t\t\tcase 'get_member_links':\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# attachments on team.info.. => templates\n\t\t\tcase 'get_teaminfo_attachment':\n\t\t\t{\n\t\t\t\t\n\t\t\t\treturn NULL;\n\t\t\t}break;\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# attachments on member.info.. => templates\n\t\t\tcase 'get_memberinfo_attachment':\n\t\t\t{\n\t\t\t\treturn NULL;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tcase 'get_matchinfo_attachment':\n\t\t\t{\n\t\t\t\treturn NULL;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'entry_list':\n\t\t\t{\n\t\t\t\treturn NULL;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'match_list':\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\tglobal $gl_oVars;\n\t\t\t\t$cCup = new Cup( $gl_oVars->cDBInterface, NULL );\n\n\t\t\t\t$cup_id\t\t\t\t= $data->entry_id; ## entry_id \n\t\t\t\t$participant_id\t\t= $data->part_id;\t# overgiven by engine\n\t\t\t\t$participant_type\t= $data->part_type;\t# overgiven by engine\n\t\t\t\t$status\t\t\t\t= NULL;\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\treturn NULL;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose: Zuständig, ob ein Member (abhängig von den Admin-Permissions) auf das match adminrechte hat\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'match_access':\n\t\t\t{\n\n\t\t\t\t#\tif( $obj ) return PAGEACCESS_OK;\n\t\t\t\treturn PAGEACCESS_FAILED;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'entry_access':\n\t\t\t{\n\t\t\t\t\n\t\t\t\t\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'add_email':\n\t\t\t{\n\t\t\t\tglobal $gl_oVars;\n\t\t\t\t$cNewsletter = new InetNewsletter( $gl_oVars->cDBInterface, \"egl_inetopia_newsletter\" );\n\t\t\t\t\n\t\t\t\t$email = $wparam;\n\t\t\t\t// check email??\n\t\t\t\tif( !$cNewsletter->MailExists($email))\n\t\t\t\t{\n\t\t\t\t\t$cNewsletter->AddMail( array( \"code\" => CreateRandomPassword(20),\n\t\t\t\t\t\t\t\t\t\t\t\t \"email\" => $email,\n\t\t\t\t\t\t\t\t\t\t\t\t \"created\" => EGL_TIME ) );\n\t\t\t\t\treturn 1;\n\t\t\t\t}else return 0;\n\t\t\t}break;\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'page_access':\n\t\t\t{\n\t\t\t\t# $data -> $aAccesslist\n\t\t\t\t# wparam -> $ocModAdmin\n\t\t\t\t# lparam -> page\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\n\t\t\t\tif( sizeof($wparam) > 0 ) return PAGEACCESS_OK;\n\t\t\t\treturn PAGEACCESS_FAILED;\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tcase 'admin_page_access':\n\t\t\t{\n\t\t\t\t# $data -> $aAccesslist\n\t\t\t\t# wparam -> $ocModAdmin\n\t\t\t\t# lparam -> page\n\t\t\t\t\t\t\t\n\t\t\t\t$page\t\t\t= $lparam;\n\t\t\t\t$acModAdmin \t= $wparam;\n\t\t\t\t$aAccesslist \t= $data;\n\n\t\t\t\t/*\n\t\t\t\t\n\t\t\t\t\t=> sollter nicht zum Einsatz kommen\n\t\t\t\t\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\treturn PAGEACCESS_FAILED;\n\t\t\t}break;\n\t\t\t\n\t\t\t#=============================================================================================================\t\n\t\t\t#=============================================================================================================\t\n\t\t\t#=============================================================================================================\t\n\t\t\t#================ SPECIAL MESSAGE EVENTS ====================\t\n\t\t\t#=============================================================================================================\t\n\t\t\t#=============================================================================================================\t\n\n\t\t\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\t# Purpose:\n\t\t\t# Output:\n\t\t\t#-----------------------------------------------------------------------------------------------------\n\t\t\tdefault:\n\t\t\t{\n\t\t\t\treturn MODULERESULT_UNKNOWN;\n\t\t\t\t//return CModule::ProcessMessage( $event, $data, $wparam, $lparam );\n\t\t\t}break;\n\t\t\t\n\t\t\t\n\t\t}//switch\n\t\t\n\t\treturn 1;\n\t}", "private function send_msg() {\r\n }", "public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n \t//extract post data\n\t\tif (!empty($postStr))\n { \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $msgType = $postObj->MsgType;\n \n $time = time();\n \n $textTpl = \"<xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n <FuncFlag>0</FuncFlag>\n </xml>\";\n \n if($msgType == \"text\")\n {\n \t/*\n $keyword = trim($postObj->Content);\n\t\t\t\t\n\t\t\t\t\n $msgType = \"text\";\n \n $contentStr = $keyword;\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n\t\t\t\t * \n\t\t\t\t */\n }\n else if($msgType == \"event\")\n {\n $event = $postObj->Event;\n if($event == \"subscribe\")\n {\n $msgType = \"text\";\n \n $contentStr = \"你好,欢迎你的关注!\";\n \n \n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }\n\t\t\t\telse if($event == \"CLICK\")\n\t\t\t\t{\n\t\t\t\t\t$eventKey = $postObj->EventKey;\n\t\t\t\t\t\n\t\t\t\t\tif($eventKey == \"VK_RECENT\")\n\t { \n\t \n\t $query = \"select `id`, `post_title`, `post_content`\n\t from `wp_posts`\n\t where `post_status` like 'publish' and `post_type` like 'post'\n\t order by `post_date` desc\n\t limit 0, 5\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t$sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"近期文章:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= '「<a href=\"'. SITE . '/?p=' . $row['id'] . '\">';\n\t\t $strTitle .= $row['post_title'];\n\t\t $strTitle .= \"</a>」\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\n\t \n\t }\n\t else if($eventKey == \"VK_DATE\")\n\t {\n\t $query = \"select year(`post_date`), month(`post_date`), extract(year_month from(`post_date`)), count(extract(year_month from(`post_date`))) \n\t from `wp_posts`\n\t where `post_status` like 'publish' and `post_type` like 'post' \n\t group by extract(year_month from(`post_date`))\n\t order by extract(year_month from(`post_date`)) desc\";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"文章归档:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?m=' . $row['extract(year_month from(`post_date`))'] . '\">';\n\t\t $strTitle .= $row['year(`post_date`)'] . \"年\".\n\t\t chineseMonth($row['month(`post_date`)']) . \"月\";\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count(extract(year_month from(`post_date`)))']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t \t}\n\t \n\t }\n\t else if($eventKey == \"VK_CATEGORY\")\n\t {\n\t \t$query = \"select `wp_terms`.`term_id`, `wp_terms`.`name`, `wp_term_taxonomy`.`count`\n\t from `wp_terms`, `wp_term_taxonomy`\n\t where `wp_term_taxonomy`.`taxonomy` like 'category' and `wp_term_taxonomy`.`count` != 0\n\t and `wp_terms`.`term_id` = `wp_term_taxonomy`.`term_id`\";\n\t \n\t \n\t $sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"分类目录:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?cat=' . $row['term_id'] . '\">';\n\t\t $strTitle .= $row['name'];\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t} \n\t }\n\t else if($eventKey == \"VK_TAG\")\n\t {\n\t $query = \"select `wp_terms`.`slug`, `wp_terms`.`name`, `wp_term_taxonomy`.`count`\n\t from `wp_terms`, `wp_term_taxonomy`\n\t where `wp_term_taxonomy`.`taxonomy` like 'post_tag' and `wp_term_taxonomy`.`count` != 0\n\t and `wp_terms`.`term_id` = `wp_term_taxonomy`.`term_id`\";\n\t \n\t \n\t $sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"标签列表:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?tag=' . $row['slug'] . '\">';\n\t\t $strTitle .= $row['name'];\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t }\t\t\t\t\t\n\t\t\t\t}\n }\n\n }\n else\n {\n \techo \"\";\n \texit;\n }\n }", "public function sendAction() {\n\t\t$this->certificateAction(TRUE);\n\t\t$this->groupAction(TRUE);\n\t\t$this->statAction(TRUE);\n\t}", "public function rss_topic()\n\t{\n\t\tif (!$this->id)\n\t\t{\n\t\t\tDisplay::message('not_allowed');\n\t\t}\n\n\t\t// Liste des messages\n\t\t$sql = 'SELECT p.p_id, p.p_text, p.p_time, p.u_id, p.p_nickname, p.p_map, t.t_title, t.t_description, t.f_id, t.t_id, u.u_activate_email, u.u_email, u.u_auth\n\t\t\t\tFROM ' . SQL_PREFIX . 'posts p\n\t\t\t\tINNER JOIN ' . SQL_PREFIX . 'topics t\n\t\t\t\t\tON p.t_id = t.t_id\n\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'users u\n\t\t\t\t\tON u.u_id = p.u_id\n\t\t\t\tWHERE t.t_id = ' . $this->id . '\n\t\t\t\t\tAND p.p_approve = 0\n\t\t\t\tORDER BY p.p_time DESC';\n\t\t$result = Fsb::$db->query($sql);\n\t\tif ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\tif (!Fsb::$session->is_authorized($row['f_id'], 'ga_read') || !Fsb::$session->is_authorized($row['f_id'], 'ga_view') || !Fsb::$session->is_authorized($row['f_id'], 'ga_view_topics'))\n\t\t\t{\n\t\t\t\tDisplay::message('not_allowed');\n\t\t\t}\n\n\t\t\t$parser = new Parser();\n\t\t\t$parser->parse_html = (Fsb::$cfg->get('activate_html') && $row['u_auth'] >= MODOSUP) ? true : false;\n\n\t\t\t$this->rss->open(\n\t\t\t\tParser::title($row['t_title']),\n\t\t\t\thtmlspecialchars(($row['t_description']) ? $row['t_description'] : $parser->mapped_message($row['p_text'], $row['p_map'])),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=topic&amp;id=' . $this->id),\n\t\t\t\t$row['p_time']\n\t\t\t);\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\t// Informations passees au parseur de message\n\t\t\t\t$parser_info = array(\n\t\t\t\t\t'u_id' =>\t\t\t$row['u_id'],\n\t\t\t\t\t'p_nickname' =>\t\t$row['p_nickname'],\n\t\t\t\t\t'u_auth' =>\t\t\t$row['u_auth'],\n\t\t\t\t\t'f_id' =>\t\t\t$row['f_id'],\n\t\t\t\t\t't_id' =>\t\t\t$row['t_id'],\n\t\t\t\t);\n\t\t\t\t$parser->parse_html = (Fsb::$cfg->get('activate_html') && $row['u_auth'] >= MODOSUP) ? true : false;\n\n\t\t\t\t$this->rss->add_entry(\n\t\t\t\t\tParser::title($row['t_title']),\n\t\t\t\t\thtmlspecialchars($parser->mapped_message($row['p_text'], $row['p_map'], $parser_info)),\n\t\t\t\t\t(($row['u_activate_email'] & 2) ? 'mailto:' . $row['u_email'] : Fsb::$cfg->get('forum_mail')) . ' ' . htmlspecialchars($row['p_nickname']),\n\t\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=topic&p_id=' . $row['p_id'] . '#p' . $row['p_id']),\n\t\t\t\t\t$row['p_time']\n\t\t\t\t);\n\t\t\t}\n\t\t\twhile ($row = Fsb::$db->row($result));\n\t\t}\n\t\t// Aucun message, on pioche donc directement les informations dans le sujet\n\t\telse \n\t\t{\n\t\t\t$sql = 'SELECT t_id, t_title, t_description, t_time\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'topics\n\t\t\t\t\tWHERE t_id = ' . $this->id;\n\t\t\t$row = Fsb::$db->request($sql);\n\t\t\t$this->rss->open(\n\t\t\t\tParser::title($row['t_title']),\n\t\t\t\thtmlspecialchars($row['t_description']),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=topic&amp;id=' . $this->id),\n\t\t\t\t$row['t_time']\n\t\t\t);\n\t\t}\n\t}", "public function sendResponse(Payload $payload): void;", "public function callback() {\n $params = array();\n parse_str( $_POST['form_data'], $params );\n\n if ( !wp_verify_nonce( $params['nonce'], 'sk-operation-messages' ) ) {\n die( 'Hey hey, stop messing around!!!' );\n }\n\n if ( isset( $params['om_message_id'] ) ) {\n\n if ( $this->update_message( $params['om_message_id'], $params ) ) {\n\n wp_send_json_success(\n 'Updated!!'\n );\n\n }\n\n }\n\n // Check OK. Save the message.\n if ( $this->save_message( $params ) ) {\n\n wp_send_json_success(\n 'Created!'\n );\n\n }\n\n wp_send_json_error( 'Failed!' );\n\n }", "public function handle()\n {\n foreach ($this->posts as $post) {\n PublishPost::dispatch($post)->delay(Carbon::now());\n }\n }", "function pushActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access,$integration_option,$params='')\n\t{\n\t\t$activityintegrationstream= new activityintegrationstream();\n\t\tif($integration_option=='joomla')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse if($integration_option=='Community Builder')\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_comprofiler');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToCBActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($integration_option=='JomSocial' )\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_community');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToJomsocialActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($integration_option=='Jomwall')\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_awdwall');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToJomwallActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access,$params);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($integration_option=='EasySocial')\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_easysocial');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToEasySocialActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function sendGenericMessage($recipientId) {\n}", "public function _DO_push()\n {\n// $res = $this->tim->group_send_group_msg('admin', 'L5900888378d29-T', 'hello');\n// $res = servTIM::sole(null)->systemMessage('L591a745be656f-T', 'hint', '老师暂时离开');\n $res = servTIM::sole(null)->systemMessage('L598bfa8b8da85-D', 'hint', '老师暂时离开');\n print_r($res);\n// $res = servTIM::sole(null)->systemMessage('L598bfa8b8da85-T', 'hint', '老师暂时离开');\n// print_r($res);\n }", "public function sendPost(){\n\t\t\t// record the post in the database\n\t\t\t\n\t\t}", "public function handle()\n {\n $plan = get_current_plan();\n Log::info(__CLASS__, ['任务触发', $plan]);\n dispatch(new SendWxMsg([\n 'type' => 3,\n 'model'=> $plan\n ]));\n }", "public static function send_alert_on_new_post($self = NULL,$topic = NULL, $para = NULL) {\n\t\t$send_to=explode(',',cfg('alert.email'));\n\t\t$mail->title='++'.strip_tags($topic->post->title).' : '.$topic->tags[0]->name;\n\t\t$mail->name=i()->name?i()->name:$topic->post->poster;\n\t\t$mail->from='alert@'.cfg('domain.short');\n\t\tif (cfg('alert.cc')) $mail->cc=cfg('alert.cc');\n\t\tif (cfg('alert.bcc')) $mail->bcc=cfg('alert.bcc');\n\n\t\t$mail->body='<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<meta content=\"text/html;charset='.cfg('client.characterset').'\" http-equiv=\"Content-Type\">\n<title>'.$topic->post->title.'</title>\n</head>\n<body>\n<a href=\"'.cfg('domain').url('paper/'.$topic->post->tpid).'\" target=_blank><strong>'.$topic->post->title.'</strong></a> ('.sg_status_text($topic->post->status).') | <a href=\"'.cfg('domain').url('paper/'.$topic->post->tpid).'\" target=_blank>view</a><br />\nSubmit by <strong>'.($topic->post->poster?$topic->post->poster.(i()->name && i()->name!=$topic->post->poster?'('.i()->name.')':''):i()->name).(i()->uid?'('.i()->uid.')':'').'</strong> on <strong>'.date('Y-m-d H:i:s').'</strong> | paper id : <strong>'.$topic->post->tpid.'</strong> in ';\n\tforeach ($topic->tags as $tag) $mail->body.='<strong>'.$tag->name.'</strong> , ';\n\t$mail->body=trim($mail->body,' , ');\n\t$mail->body.='<br />\n<em>poster host : '.gethostbyaddr(long2ip($topic->post->ip)).' ('.long2ip($topic->post->ip).')</em> '.($photo? ' | <strong>'.count($photo).'</strong> Photo(s).':'').'\n<hr size=1>'.\nsg_text2html($topic->post->body).'\n<hr /><p>เมล์ฉบับนี้เป็นการส่งเมล์อัตโนมัติจากการตั้งหัวข้อใหม่ในเว็บไซท์ '.cfg('domain').'</p><p>หากท่านไม่ต้องการให้มีการส่งเมล์นี้มาให้ท่านอีกต่อไป กรุณาติดต่อผู้ดูแลเว็บไซท์เพื่อทำการยกเลิก</p>\n</body>\n</html>';\n\n\t\tforeach ($send_to as $to) {\n\t\t\t$to=trim($to);\n\t\t\tif (empty($to)) continue;\n\t\t\t$mail->to=$to;\n\t\t\t$mail->result.=BasicModel::sendmail($mail).'<br /><br />';\n\t\t}\n\t\treturn $mail;\n\t}", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n \n //extract post data\n if (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $msgType = $postObj->MsgType;//消息类型\n $event = $postObj->Event;//时间类型,subscribe(订阅)、unsubscribe(取消订阅)\n $textTpl = \"<xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n <FuncFlag>0</FuncFlag>\n </xml>\"; \n \n switch($msgType){\n case \"event\":\n if($event==\"subscribe\"){\n $contentStr = \"最新更新说明:\".\"\\n\".\"A:优化二维码搜索功能,搜索更精准\".\"\\n\".\"B:微信群二维码采集源更新:\".\"\\n\".\"1、百度贴吧\".\"\\n\".\"2、新浪微博\".\"\\n\".\"3、兴趣部落\".\"\\n\".\"4、700+陌陌群\".\"\\n\".\"5、3500+个微信群\".\"\\n\".\"6、1300+个QQ群\".\"\\n\".\"C:支持支付方式:\".\"\\n\".\"1、微信支付\".\"\\n\".\"2、支付宝(敬请期待)\";\n } \n break;\n case \"text\":\n /*switch($keyword){\n case \"1\":\n $contentStr = \"店铺地址:\".\"\\n\".\"杭州市江干艮山西路233号新东升市场地下室第一排.\"; \n break;\n case \"2\":\n $contentStr = \"商品种类:\".\"\\n\".\"杯子、碗、棉签、水桶、垃圾桶、洗碗巾(刷)、拖把、扫把、\"\n .\"衣架、粘钩、牙签、垃圾袋、保鲜袋(膜)、剪刀、水果刀、饭盒等.\";\n break;\n default:\n $contentStr = \"对不起,你的内容我会稍后回复\";\n }*/\n $contentStr = \"对不起,你的内容我会稍后回复\";\n break;\n }\n $msgType = \"text\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else {\n echo \"post str is null\";\n exit;\n }\n }", "public function post_publish()\n\t{\n\t\t$this->get_publish();\n\t}", "public function sendEvent($context) {\n\t\t\n\t\t\t//Store some information on the Symphony Entry.\n\t\t\t$entry = $context['entry'];\n\t\t\t\n\t\t\t$entry_settings = $entry->get();\n\t\t\t$entry_id = $entry_settings['id'];\t\n\t\n\t\t\t$e_data = array();\n\t\t\tforeach($context['fields'] as $key => $value) {\n\t\t\t\tif($this->string_begins_with($key, 'e-')) {\n\t\t\t\t\t$e_data[str_replace('e-', 'e_', $key)] = $value;\n\t\t\t\t} else if ($this->string_begins_with($key, 'g-')) {\n\t\t\t\t\t$e_data[str_replace('g-', 'g_', $key)] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Change the e_status property to a value the API understands\n\t\t\tif($e_data['e_status'] == 'yes') {\n\t\t\t\t$e_data['e_status'] = 'active';\n\t\t\t} else {\n\t\t\t\t$e_data['e_status'] = 'pending';\n\t\t\t}\t\n\t\t\t//Set the format of the Date/Times\n\t\t\t$e_data['e_start'] = date('Y-m-d G:i:s', strtotime($e_data['e_start']));\n\t\t\t$e_data['e_stop'] = date('Y-m-d G:i:s', strtotime($e_data['e_stop']));\n\t\t\t$e_data['e_deadline'] = date('Y-m-d G:i:s', strtotime($e_data['e_deadline']));\n\n\t\t\t//Another Required field is the User ID\n\t\t\t$e_data['u_id'] = $this->u_id;\n\t\t\t\n\t\t\t//Create a unique Push URL (e_pushurl) from the entry ID.\n\t\t\t$e_data['e_pushurl'] = URL .'/eventarc-updater/?hash='.sha1($entry_id).'&id='.$entry_id;\n\t\t\n\t\t\t//Address Data\n\t\t\t$a_data = array();\n\t\t\tforeach($context['fields'] as $key => $value) {\n\t\t\t\tif($this->string_begins_with($key, 'a-')) {\n\t\t\t\t\t$a_data[str_replace('a-', 'a_', $key)] = $value;\n\t\t\t\t} \n\t\t\t}\n\t\t\t\n\t\t\t//If the ID & URL are not set - Create a new event.\n\t\t\tif($e_data['e_id'] == '' && $e_data['e_url'] == '') {\n\t\t\t\n\t\t\t\tunset($e_data['e_id']);\n\t\t\t\tunset($e_data['e_url']);\t\n\t\t\t\tif(!empty($a_data)) {\n\t\t\t\t\t//Set the type as venue.\n\t\t\t\t\t$a_data['a_type'] = 'venue';\n\t\t\t\t\t// Send the event to eventarc with the address details\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->add_address($a_data)\n\t\t\t\t\t ->event_create();\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Send the event to eventarc\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->event_create();\n\t\t\t\t}\n\n\t\t\t\t if($result) {\n\t\n\t\t\t\t \tif(!isset(self::$fieldManager)) {\n\t\t\t\t \t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t \t}\n\t\t\t\t \t\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-id');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['e_id'],\n\t\t\t\t \t\t'value' => $result['e_id'],\n\t\t\t\t \t\t'value_formatted' => $result['e_id'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t//Save the returned Eventarc URL (e_url).\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-url');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['url'],\n\t\t\t\t \t\t'value' => $result['url'],\n\t\t\t\t \t\t'value_formatted' => $result['url'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t//Save the returned Eventarc Address ID (a_id).\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('a-id');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['a_id'],\n\t\t\t\t \t\t'value' => $result['a_id'],\n\t\t\t\t \t\t'value_formatted' => $result['a_id'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t$entry->commit();\n\t\t\t \n\t\t\t\t }\n\t\t\t\t \n\t\t\t} \n\t\t\t//Event already exists - update the event. \n\t\t\telse {\n\t\t\t\t\n\t\t\t\t//Check that the URL is not empty.\t\n\t\t\t\tif($e_data['e_url'] == '') {\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->eventarc->event_get($e_data['e_id']);\n\t\t\t\t\t\n\t\t\t\t\tif(!isset(self::$fieldManager)) {\n\t\t\t\t\t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Save the returned Eventarc URL (e_url).\n\t\t\t\t\t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-url');\n\t\t\t\t\t$entry->setData($field_id, array(\n\t\t\t\t\t\t'handle' => $result['url'],\n\t\t\t\t\t\t'value' => $result['url'],\n\t\t\t\t\t\t'value_formatted' => $result['url'],\n\t\t\t\t\t\t'word_count' => 0\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t$entry->commit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Check that the Address ID is not empty.\t\n\t\t\t\tif($a_data['a_id'] == '') {\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->eventarc->event_get_address($e_data['e_id']);\n\t\t\t\t\t\n\t\t\t\t\tif(!isset(self::$fieldManager)) {\n\t\t\t\t\t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Save the returned Eventarc Address ID (a_id).\n\t\t\t\t\t$field_id = self::$fieldManager->fetchFieldIDFromElementName('a-id');\n\t\t\t\t\t$entry->setData($field_id, array(\n\t\t\t\t\t\t'handle' => $result['a_id'],\n\t\t\t\t\t\t'value' => $result['a_id'],\n\t\t\t\t\t\t'value_formatted' => $result['a_id'],\n\t\t\t\t\t\t'word_count' => 0\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t//Store the retrieved address ID.\n\t\t\t\t\t$a_data['a_id'] = $result['a_id'];\n\t\t\t\t\t$entry->commit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Don't want to manually change the URL generated by Eventarc.\n\t\t\t\tunset($e_data['e_url']);\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Edit the Event.\n\t\t\t\tif(!empty($a_data)) {\n\t\t\t\t\t//Set the type as venue.\n\t\t\t\t\t$a_data['a_type'] = 'venue';\n\t\t\t\t\t// Send the event to eventarc with the address details\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\t\n\t\t\t\t\t ->event_update();\n\t\t\t\t\t $result = $this->eventarc\n\t\t\t\t\t ->add_address($a_data)\n\t\t\t\t\t ->address_update();\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Send the event to eventarc\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->event_update();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "protected function beforeSending()\n {\n }", "public function onData($payload, $connection)\n {\n $id = $connection->getId();\n if($id != null) {\n $str = pack(\"S\", strlen($id)) . $id . $payload->__toString();\n\n $this->thread->synchronized(function($thread, $connection, $id, $str){\n $pId = ord($str[0]);\n if($pId != 0) {\n $thread->readQueue[] = $str;\n }\n\n foreach($thread->sendQueue as $eid => $ent) {\n $playerIdLen = unpack(\"S\", substr($ent, 0, 2))[1];\n $playerId = substr($ent, 2, $playerIdLen);\n if($playerId == $id) {\n unset($thread->sendQueue[$eid]);\n $connection->send(substr($ent, 2 + $playerIdLen), Protocol::TYPE_BINARY);\n }\n }\n }, $this->thread, $connection, $id, $str);\n }\n }", "public function push()\n\t{\n\t\t\n\t\t/*\n\t\t * This happens when the user has an active session with the application,\n\t\t * and not represented by an application. We assume that there's no intermediary.\n\t\t *\n\t\t * Applications should log into the application using their signature, and\n\t\t * while they will receive very open privileges, Ping likes to be\n\t\t * transparent about where pings originated from.\n\t\t */\n\t\tif ($this->user) {\n\t\t\t$srcid = $this->user->id;\n\t\t\t$authapp = $this->authapp instanceof AppAuthentication? $this->authapp->getSrc()->getId() : null;\n\t\t}\n\t\telse {\n\t\t\tthrow new PublicException('Authentication required', 403);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Default optional input to null. Spitfire already handles validation via\n\t\t * the @validate annotation, so we just have to assume that we need to set\n\t\t * fields that were empty to null.\n\t\t */\n\t\t$tgtid = $_POST['target']?? null;\n\t\t$content = str_replace(\"\\r\", '', $_POST['content']);\n\t\t$url = $_POST['url']?? null;\n\t\t$media = $_POST['media']?? null;\n\t\t$poll = $_POST['poll']?? null;\n\t\t$irt = $_POST['irt']?? null;\n\t\t$explicit = !!($_POST['explicit']?? false);\n\t\t\n\t\t#There needs to be a src user. That means that somebody is originating the\n\t\t#notification. There has to be one, and no more than one.\n\t\t$src = AuthorModel::get(db()->table('user')->get('_id', $srcid)->first());\n\t\t\n\t\tif (!$src) {\n\t\t\t$src = UserModel::makeFromSSO($this->sso->getUser($srcid));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Check whether the source defined a target for this ping. If the target\n\t\t * can be traced to an author, we will record that.\n\t\t */\n\t\t$target = $tgtid === null? null : AuthorModel::find($tgtid);\n\t\t\n\t\t/*\n\t\t * If there is a target, and it's not an author known to the server, then\n\t\t * we must stop the application from creating the ping.\n\t\t */\n\t\tif (!($target instanceof AuthorModel || $target === null)) {\n\t\t\tthrow new PublicException('Invalid target', 400);\n\t\t}\n\t\t\n\t\t#Make it a record\n\t\t$notification = db()->table('ping')->newRecord();\n\t\t$notification->src = $src;\n\t\t$notification->authapp = $authapp;\n\t\t$notification->target = $target;\n\t\t$notification->content = Mention::mentionsToId($content);\n\t\t$notification->url = $url;\n\t\t$notification->explicit= $explicit;\n\t\t$notification->irt = $irt? db()->table('ping')->get('_id', $irt)->first(true) : null;\n\t\t$notification->processed = false;\n\t\t$notification->locked = false;\n\t\t\n\t\t\n\t\t/**\n\t\t * @todo This method should be deprecated in favor of batch processing the\n\t\t * files\n\t\t */\n\t\tif (is_string($media)) {\n\t\t\t$notification->media = $media;\n\t\t\t\n\t\t\t$media = [];\n\t\t}\n\t\t\n\t\t/**\n\t\t * If the user uploaded a file instead, we process it. This should be DRYed\n\t\t * so it doesn't repeat the code from the media::upload action.\n\t\t */\n\t\tif ($media instanceof \\spitfire\\io\\Upload) {\n\t\t\t$local = $media->store();\n\t\t\t$media = media()->load($local);\n\t\t\t\n\t\t\t/**\n\t\t\t * We need to determine what kind of content the user uploaded. If the user has a video\n\t\t\t * file without audio we treat it as image.\n\t\t\t */\n\t\t\t$type = $media instanceof FFMPEGManipulator && $media->hasAudio()? 'video' : 'image';\n\t\t\t\n\t\t\t$record = db()->table('media\\media')->newRecord();\n\t\t\t$record->file = $local->uri();\n\t\t\t$record->source = null;\n\t\t\t$record->type = $type;\n\t\t\t$record->secret = base64_encode(random_bytes(50));\n\t\t\t$record->store();\n\t\t\t\n\t\t\t$media = [sprintf('%s:%s', $record->_id, $record->secret)];\n\t\t}\n\t\t\n\t\t/*\n\t\t * Once all the validation has been performed and we are sure that data can\n\t\t * be handled properly by the database we send it to the event handler that\n\t\t * will execute the code appropriately.\n\t\t */\n\t\t$this->core->feed->push->do(function ($notification) use ($poll, $media) {\n\t\t\t$notification->store();\n\t\t\t\n\t\t\t#Attach the media\n\t\t\tforeach (array_filter($media?: []) as $file) {\n\t\t\t\tlist($id, $secret) = explode(':', $file);\n\t\t\t\t$record = db()->table('media\\media')->get('_id', $id)->where('secret', $secret)->first(true);\n\t\t\t\t$record->ping = $notification;\n\t\t\t\t$record->store();\n\t\t\t}\n\t\t\t\n\t\t\t#Create poll options\n\t\t\tforeach (array_filter($poll?: []) as $option) {\n\t\t\t\t$record = db()->table('poll\\option')->newRecord();\n\t\t\t\t$record->ping = $notification;\n\t\t\t\t$record->text = $option;\n\t\t\t\t$record->store();\n\t\t\t}\n\t\t}, $notification);\n\t\t\n\t\t/*\n\t\t * This will notify the cron job, allowing the system to process the ping\n\t\t * immediately as it is received.\n\t\t */\n\t\ttry {\n\t\t\t$sem = new FlipFlop(spitfire()->getCWD() . '/bin/usr/.media.cron.lock');\n\t\t\t$sem->notify();\n\t\t}\n\t\tcatch (Exception $ex) {\n\t\t\t#Notifying the cron-job failed. Gracefully recover.\n\t\t}\n\t\t\n\t\t$this->view->set('ping', $notification);\n\t}", "public function handle($payload = null)\n {\n Log::debug(\"@EventMessageHandler payload=\".json_encode($payload));\n return true;\n }", "function send_message() \n {\n $device_token = $this->get_device_token();\n\n // Put your private key's passphrase here:\n $passphrase = $this->get_api_key();\n\n // Put your alert message here:\n $msg_data = $this->get_message();\n\n $ctx = stream_context_create();\n stream_context_set_option($ctx, 'ssl', 'local_cert', $this->certificate);\n stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);\n\n // Open a connection to the APNS server\n $fp = stream_socket_client($this->get_post_url(), $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);\n\n if (!$fp)\n exit(\"Failed to connect: $err $errstr\" . PHP_EOL);\n\n // Create the payload body\n $body['aps'] = array(\n 'alert' => $msg_data['message'],\n 'badge' => 1,\n 'sound' => 'default',\n );\n $body['message'] = array(\n 'message_ID' => isset($msg_data['message_id']) ? $msg_data['message_id'] : '',\n 'message_title' => $msg_data['title'],\n 'message_type' => isset($msg_data['type']) ? $msg_data['type'] : '',\n 'message_shortDescription' => isset($msg_data['short_descr']) ? $msg_data['short_descr'] : '',\n 'message_date' => date('d/m/Y'));\n \n // \"message\":{\"message_ID\":\"1012\",\"message_title\":\"push message\",\"message_type\":\"push\",\"message_shortDescription\":\"sample message\",\"message_date\": \"12/05/2014\"}}\n\n // Encode the payload as JSON\n $payload = json_encode($body);\n\n // Build the binary notification\n $msg = chr(0) . pack('n', 32) . pack('H*', $device_token) . pack('n', strlen($payload)) . $payload;\n\n // Send it to the server\n $result = fwrite($fp, $msg, strlen($msg));\n\n /* if (!$result)\n echo 'Message not delivered' . PHP_EOL;\n else\n echo 'Message successfully delivered' . PHP_EOL;*/\n\n // Close the connection to the server\n fclose($fp);\n }", "public function onPublish(ConnectionInterface $connection, Topic $topic, WampRequest $request, $event, array $exclude, array $eligible)\n {\n\n // $topic->broadcast($event, [$connection->WAMP->sessionId]);\n $topic->broadcast($event);\n }", "public function perform()\n {\n $hook = $this->args['hook'];\n $subscriber = $this->args['subscriber'];\n $event_data = $this->args['event_data'];\n $url = (array_key_exists('url', $subscriber['variables'])) ? $subscriber['variables']['url'] : '';\n\n $classname = 'AllPlayers\\\\Webhooks\\\\' . $hook['name'];\n $webhook = new $classname($subscriber['variables']);\n $webhook_data = array(\n 'event_name' => $hook['name'],\n 'event_data' => $event_data\n );\n if (!empty($this->test_url)) {\n $webhook_data['original_url'] = $url;\n $url = $this->test_url;\n }\n $webhook->post($url);\n $result = $webhook->send($webhook_data);\n }", "function AddTopic()\n{\n global $context, $txt, $mbname, $db_prefix;\n\n // Check permission\n $a_add = allowedTo('smftags_add');\n\n if ($a_add == false)\n fatal_error($txt['cannot_smftags_add'],false);\n\n // get query results to build array of all tags\n $query = db_query(\"\n SELECT t.tag AS tag, t.ID_TAG AS ID_TAG, COUNT(l.ID_TAG) AS quantity, t.approved AS approved\n FROM {$db_prefix}tags AS t\n LEFT JOIN {$db_prefix}tags_log AS l ON t.ID_TAG = l.ID_TAG\n GROUP BY t.ID_TAG\n ORDER BY t.tag ASC\",\n __FILE__, __LINE__);\n\n $context['tags'] = array();\n while ($row = mysql_fetch_assoc($query))\n {\n $context['tags'][] = array(\n 'ID_TAG' => $row['ID_TAG'],\n 'tag' => $row['tag'],\n 'quantity' => $row['quantity'],\n 'approved' => $row['approved'],\n 'tagged' => 0,\n );\n }\n // don't load the subtemplate\n}", "protected function receiveAWS() {\n // @todo DI\n $message = Message::fromRawPostData();\n\n if (config('tenfour.messaging.validate_sns_message')) {\n // Validate the message and log errors if invalid.\n $validator = new MessageValidator();\n\n try {\n $validator->validate($message);\n } catch (InvalidSnsMessageException $e) {\n Log::info('SNS Message Validation Error: ' . $e->getMessage());\n // Pretend we're not here if the message is invalid.\n abort(404);\n }\n }\n\n // Check the type of the message and handle the subscription.\n if ($message['Type'] === 'SubscriptionConfirmation') {\n Log::info('SNS Subscription Confirmed');\n // Confirm the subscription by sending a GET request to the SubscribeURL\n file_get_contents($message['SubscribeURL']);\n }\n\n if ($message['Type'] === 'UnsubscribeConfirmation') {\n Log::info('SNS Unsubscribe');\n // Confirm the subscription by sending a GET request to the SubscribeURL\n file_get_contents($message['SubscribeURL']);\n }\n\n if ($message['Type'] === 'Notification') {\n $emailMessage = json_decode($message['Message'], true);\n $original_content = $emailMessage['content'];\n $emailMessage = new EmailMessage(['raw' => $original_content]);\n\n // Output first text/plain part\n $plainText = null;\n $html = null;\n foreach (new \\RecursiveIteratorIterator($emailMessage) as $part) {\n try {\n if (strtok($part->contentType, ';') == 'text/plain') {\n $plainText = $part;\n break;\n }\n if (strtok($part->contentType, ';') == 'text/html') {\n $html = $part;\n }\n } catch (\\Zend\\Mail\\Exception $e) {\n Log::warning($e);\n }\n }\n\n $from = $emailMessage->getHeader('From')->getAddressList()->current()->getEmail();\n $to = $emailMessage->getHeader('To')->getAddressList()->current()->getEmail();\n\n if ($plainText) {\n Log::info(\"Received message (plain text): \". $message['MessageId']);\n $this->saveEmail($from, $plainText->getContent(), $to, $message['MessageId'], 'aws-ses-sns');\n }\n elseif ($html) {\n Log::info(\"Received message (html): \". $message['MessageId']);\n $text = strip_tags($html->getContent());\n $this->saveEmail($from, $text, $to, $message['MessageId'], 'aws-ses-sns');\n }\n else {\n $parts = preg_split(\"/\\n\\r?\\n/\", $original_content);\n\n if (count($parts)>1) {\n Log::info(\"Received message (regex): \". $message['MessageId']);\n\n $text = strip_tags($parts[1]);\n\n $this->saveEmail($from, $text, $to, $message['MessageId'], 'aws-ses-sns');\n } else {\n app('sentry')->captureMessage(\"Could not parse weird email: %s\", $message);\n\n Log::info(\"No plain text or html found for \" . $message['MessageId'], ['original_content' => $original_content]);\n }\n }\n }\n }", "public function handle( $timestamp, $level, $message, $context );", "function publish_message($msg, $topic, $server, $port, $keepalive) {\n\t\t\t$client = new Mosquitto\\Client();\n\t\t\t$client->onConnect('connect');\n\t\t\t$client->onDisconnect('disconnect');\n\t\t\t$client->onPublish('publish');\n\t\t\t$client->connect($server, $port, $keepalive);\n\t\n\t\t\ttry {\n\t\t\t\t$client->loop();\n \t\t\t\t$mid = $client->publish($topic, $msg);\n\t\t\t\t\n\t\t\t\t}catch(Mosquitto\\Exception $e){\n\t\t\t\t\t\techo 'Exception'; \n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t $client->disconnect();\n\t\t unset($client);\t\t\t\t\t \n\t\t}", "public function handleTransactionWebhook(Wallet $wallet, $payload);", "public function onPublish(ConnectionInterface $connection, Topic $topic, WampRequest $request, $event, array $exclude, array $eligible) {\n\n $user = $this->clientManipulator->getClient($connection)->getUser();\n\n if (is_array($event)) {\n $data = json_decode($event[\"data\"]);\n } else {\n $data = json_decode($event);\n $data = $data->data;\n }\n\n $channel = $this->entityManager->getRepository(Groupe::class)->findOneBy(['id' => $data->channel]);\n\n $sendData = array();\n\n $sendData[\"channel\"] = $data->channel;\n $sendData[\"channelType\"] = $channel->getTypeGroupeId()->getId();\n\n switch ($data->event->type) {\n case 'startWriting':\n $sendData[\"event\"][\"type\"] = 'startWriting';\n $sendData[\"event\"][\"valeur\"] = $user->getId();\n $sendData[\"event\"][\"pseudo\"] = $user->getPseudo();\n break;\n case 'stopWriting':\n $sendData[\"event\"][\"type\"] = 'stopWriting';\n $sendData[\"event\"][\"valeur\"] = $user->getId();\n $sendData[\"event\"][\"pseudo\"] = $user->getPseudo();\n break;\n case 'channelTitleUpdate':\n $sendData[\"event\"][\"type\"] = 'channelTitleUpdate';\n $sendData[\"event\"][\"valeur\"] = $data->channelTitre;\n break;\n case 'channelDescriptionUpdate':\n $sendData[\"event\"][\"type\"] = 'channelDescriptionUpdate';\n $sendData[\"event\"][\"valeur\"] = $data->channelDescription;\n break;\n default:\n return;\n }\n\n $topic->broadcast([\"data\" => $sendData]);\n\n }", "function __destruct() {\n if(!$this->payload_is_sent) $this->sendPayload();\n\n\n }", "public function handle($postData){\r\n\t\t\r\n\t}", "public function run()\n {\n while (($payload = array_shift($this->payloads)) !== null) {\n list($ttr, $message) = $payload;\n $this->startedId = $this->finishedId + 1;\n $this->handleMessage($this->startedId, $message, $ttr, 1);\n $this->finishedId = $this->startedId;\n $this->startedId = 0;\n }\n }", "public function on($eventKey, $data = null) {\n\t\tif (($eventKey == 'request_uri') && ($this->settings['draft_url'] == $data['uri'])) {\n\t\t\t// Getting the payload, decoding it and saving to file system inside content dir\n\t\t\tif ($_POST['payload']) {\n\t\t\t\t// We have a request from Draft, let's save it to file\n\t\t\t\t$payload = json_decode($_POST['payload']);\n\t\t\t\t$name = strtolower($payload->name);\n $name = str_replace(\" \",\"-\",$name);\n $fileName = $name . CONTENT_EXT;\n\t\t\t\t@file_put_contents(CONTENT_DIR . $this->settings['publish_dir'] . \"/\" . $fileName, $payload->content);\n\t\t\t}\n\t\t\texit;\n\t\t}\n\t}", "function _thumbwhere_content_collection_item_notify() {\n\n if (twCanDebug()) {\n watchdog('thumbwhere_content_collection_item', 'incoming notification.');\n }\n\n $numargs = func_num_args();\n $arg_list = func_get_args();\n\n \n\tif (twCanDebug()) debug('$numargs = ' . $numargs);\n\t\n\tif (twCanDebug()) debug('$arg_list = ' . $arg_list);\n\t\n\tif (twCanDebug()) debug('$_REQUEST');\n\tif (twCanDebug()) debug($_REQUEST);\n\t\n\tif (twCanDebug()) debug('$_GET');\n\tif (twCanDebug()) debug($_GET);\n\t\n\tif (twCanDebug()) debug('$_POST');\n\tif (twCanDebug()) debug($_POST);\n\t\n\t//if (twCanDebug()) debug('$HTTP_RAW_POST_DATA');\n\t//if (twCanDebug()) debug($HTTP_RAW_POST_DATA);\n\t\n\tif (twCanDebug()) debug('$_SERVER');\n\tif (twCanDebug()) debug($_SERVER);\n\t\n\t//if (twCanDebug()) debug('$GLOBALS');\n\t//if (twCanDebug()) debug($GLOBALS);\n\n \n\n if (variable_get('thumbwhere_api_log_debug', 0) == 1) {\n foreach ($arg_list as $arg) {\n if (twCanDebug()) debug('$arg = ' . $arg);\n }\n }\n\n\n //////////////////////////////////////////////////\n //\n //\n\n switch ($_SERVER['REQUEST_METHOD']) {\n\n case 'POST': {\n if ($numargs == 1) {\n if ($arg_list[0] == 'content_collection_item') {\n\n //\n // Get the POST data as XML\n //\n\n $post_xml = new SimpleXMLElement('php://input', null, true);\n if (twCanDebug()) debug('$post_xml');\n if (twCanDebug()) debug($post_xml);\n\n if (twCanDebug()) debug('$post_xml->getName()');\n if (twCanDebug()) debug($post_xml->getName());\n\n // We expect 'action' as the root element. TODO: I would rather this was the more generic 'request'\n if ($post_xml->getName() != 'action') {\n drupal_add_http_header('Status', '404 not found.');\n print('We were expecting \\'action\\', as the root element, not \\'' . $post_xml->getName() . '\\'.');\n exit(0);\n }\n\n /*\n * SimpleXMLElement::__set_state(array(\n * 'content_collection_item' =>\n * SimpleXMLElement::__set_state(array(\n * '@attributes' =>\n * array (\n * 'key' => '8e9ff318-3cd7-4593-99de-4c37c0fb335a',\n * 'op' => 'create',\n * ),\n * )),\n * ))\n */\n\n\n // We expect 'action' as the root element.\n if (!isset($post_xml->content_collection_item)) {\n drupal_add_http_header('Status', '404 not found.');\n print('We were expecting a \\'content_collection_item\\', element in the action payload.');\n exit(0);\n }\n\n // Handle the incoming notification for content ingest\n _thumbwhere_handle_content_collection_item_notify_xml($post_xml->content_collection_item);\n\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid resource');\n exit(0);\n }\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid notification request url format.');\n exit(0);\n }\n }\n break;\n\n case 'GET': {\n\n if ($numargs == 1) {\n\n // If we are returning the index.xml file for the webservice.\n if ($arg_list[0] == 'index.xml') {\n // return index.xml\n drupal_add_http_header('Content-Type', 'text/xml');\n readfile(dirname(__FILE__) . '/index.xml');\n exit(0);\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('File not found.');\n exit(0);\n }\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid notification request url format.');\n exit(0);\n }\n }\n break;\n\n default: {\n drupal_add_http_header('Status', '404 not found.');\n exit(0);\n }\n break;\n }\n\n //\n //\n ////////////////////////////////////////////////////////////////////////////////////\n \n}", "public function sendMessage()\n {\n $this->getTemplate(\"审核结果通知\");\n\n if (empty($this->temp_open)) {\n $back['message'] = \"消息通知未开启\";\n \\Log::debug($back['message']);\n return ;\n }\n\n $this->organizeData();\n\n \\Log::debug(\"新版小程序消息-直播审核1\",$this->temp_id);\n \\Log::debug(\"新版小程序消息-直播审核2\",$this->member->hasOneMiniApp->openid);\n \\Log::debug(\"新版小程序消息-直播审核3\",$this->data);\n\n $result = (new AppletMessageNotice($this->temp_id,$this->member->hasOneMiniApp->openid,$this->data,[],2))->sendMessage();\n\n if ($result['status'] == 0) {\n \\Log::debug($result['message']);\n }\n }", "public function onAfterPublish()\n {\n\t\t$context = [\n PublishingEngine::CONTEXT_ACTION => PublishingEngine::CONTEXT_ACTION_PUBLISH\n\t\t];\n\t\t$this->collectChanges($context);\n\t\t$this->flushChanges();\n\t}", "abstract protected function internalPushTopicTask($queueName, $task);", "public static function sendAndroidNotification($deviceId, $param, $title, $type, $cat_id, $post_id)\n {\n if($type == 1){ // post\n\n $msg = array\n (\n 'title' => \"Let's Go\",\n 'message' => $title,\n 'type' => $type, \n 'cat_id' => $cat_id\n ); \n\n }else if($type == 2){ // post\n\n $msg = array\n (\n 'title' => \"Let's Go\",\n 'message' => $title,\n 'type' => $type, \n 'cat_id' => $cat_id,\n 'post_id' => $post_id,\n );\n\n }else{ // category\n $msg = array\n (\n 'title' => \"Let's Go\",\n 'message' => $title,\n 'type' => $type\n ); \n }\n\n\n $fields = array\n (\n 'to' => $deviceId,\n 'data' => array('M' => $msg),\n 'priority' => 'high'\n );\n\n $headers = array\n (\n 'Authorization: key=' . Yii::$app->params['ANDROID_API_KEY'],\n 'Content-Type: application/json'\n );\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\n $result = curl_exec($ch);\n\n curl_close($ch);\n }", "abstract public function handler(string $message);", "public function onSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request): void\n {\n $topic->broadcast(['msg' => $connection->resourceId.' has joined '.$topic->getId()]);\n }", "public function sendMessage(){\n\n\n }", "protected function _sendPush($senderId, $recEntityArr, $message, $notifType, $sname, $datetime, $user_type, $aplContent, $andrContent, $user_device = NULL) {\n\n $entity_string = '';\n $aplTokenArr = array();\n $andiTokenArr = array();\n $return_arr = array();\n\n $notifications = $this->mongo->selectCollection('notifications');\n\n foreach ($recEntityArr as $entity) {\n\n $entity_string = $entity . ',';\n }\n\n $entity_comma = rtrim($entity_string, ',');\n//echo '--'.$entity_comma.'--';\n\n $device_check = '';\n if ($user_device != NULL)\n $device_check = \" and device = '\" . $user_device . \"'\";\n\n $getUserDevTypeQry = \"select distinct type,push_token from user_sessions where oid in (\" . $entity_comma . \") and loggedIn = '1' and user_type = '\" . $user_type . \"' and LENGTH(push_token) > 63\" . $device_check;\n $getUserDevTypeRes = mysql_query($getUserDevTypeQry, $this->db->conn);\n\n if (mysql_num_rows($getUserDevTypeRes) > 0) {\n\n while ($tokenArr = mysql_fetch_assoc($getUserDevTypeRes)) {\n\n if ($tokenArr['type'] == 1)\n $aplTokenArr[] = $tokenArr['push_token'];\n else if ($tokenArr['type'] == 2)\n $andiTokenArr[] = $tokenArr['push_token'];\n }\n\n $aplTokenArr = array_values(array_filter(array_unique($aplTokenArr)));\n $andiTokenArr = array_values(array_filter(array_unique($andiTokenArr)));\n// print_r($andiTokenArr);\n if (count($aplTokenArr) > 0)\n $aplResponse = $this->_sendApplePush($aplTokenArr, $aplContent, $user_type);\n\n if (count($andiTokenArr) > 0)\n $andiResponse = $this->_sendAndroidPush($andiTokenArr, $andrContent, $user_type);\n\n foreach ($recEntityArr as $entity) {\n\n $ins_arr = array('notif_type' => (int) $notifType, 'sender' => (int) $senderId, 'reciever' => (int) $entity, 'message' => $message, 'notif_dt' => $datetime, 'apl' => $aplTokenArr, 'andr' => $andiTokenArr); //'aplTokens' => $aplTokenArr, 'andiTokens' => $andiTokenArr, 'andiRes' => $andiResponse, \n\n $notifications->insert($ins_arr);\n\n $newDocID = $ins_arr['_id'];\n\n $return_arr[] = array($entity => $newDocID);\n }\n\n $return_arr[] = $aplResponse;\n $return_arr[] = $aplTokenArr;\n $return_arr[] = $recEntityArr;\n\n if ($aplResponse['errorNo'] != '')\n $errNum = $aplResponse['errorNo'];\n else if ($andiResponse['errorNo'] != '')\n $errNum = $andiResponse['errorNo'];\n else\n $errNum = 46;\n\n return array('insEnt' => $return_arr, 'errNum' => $errNum, 'andiRes' => $andiResponse);\n } else {\n return array('insEnt' => $return_arr, 'errNum' => 45, 'andiRes' => $andiResponse); //means push not sent\n }\n }", "public function handle()\n\t{\n\t\t\n\t\techo '通知淘宝发货',PHP_EOL;\n\t\techo json_encode($this->getData(),JSON_UNESCAPED_UNICODE),PHP_EOL;\n\t}", "public abstract function sendMessage();", "protected function sendNotification(){\n\t\t$events = Event::getEvents(0);\n\t\t\n\t\t\n\t\tforeach($events as $event)\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\t$eventType = $event['eventType'];\n\t\t\t$message = '';\n\t\t\n\t\t\t//notify followers\n\t\t\tif($eventType == Event::POST_CREATED)\n\t\t\t\t$message = $event['raiserName'] . ' added a new post.';\n\t\t\telse if($eventType == Event::POST_LIKED)\n\t\t\t\t$message = $event['raiserName'] . ' liked a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::POST_FLAGGED)\n\t\t\t\t$message = $event['raiserName'] . ' flagged a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::COMMENT_CREATED)\n\t\t\t\t$message = $event['raiserName'] . ' commented on a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::RESTAURANT_MARKED_FAVOURITE)\n\t\t\t\t$message = $event['raiserName'] . ' marked a restaurant as favourite.';\n\t\t\telse if($eventType == Event::USER_FOLLOWED)\n\t\t\t\t$message = $event['raiserName'] . ' is now following ' . $event['relatedUserName'];\n\t\t\n\t\t\tif(!empty($message))\n\t\t\t{\n\t\t\t\t//fetch all followers of the event raiser or related user\n\t\t\t\t$sql = Follower::getQueryForFollower($event['raiserId']);\n\t\t\n\t\t\t\tif($event['relatedUserId'])\n\t\t\t\t\t$sql .= ' OR f.followedUserId =' . $event['relatedUserId'];\n\t\t\n// \t\t\t\t$followers = Yii::app()->db->createCommand($sql)->queryAll(true);\n// \t\t\t\tforeach($followers as $follower)\n// \t\t\t\t{\n// \t\t\t\t\tif($follower['id'] != $event['raiserId'] && $follower['id'] != $event['relatedUserId'])\n// \t\t\t\t\t{\n// // \t\t\t\t\t\t$did = Notification::saveNotification($follower['id'], Notification::NOTIFICATION_GROUP_WORLD, $message, $event['id']);\n// // \t\t\t\t\t\terror_log('DID : => '.$did);\n// \t\t\t\t\t\t//send push notification\n// \t\t\t\t\t\t/**----- commented as no followers will be notified, as suggested by the client\n// \t\t\t\t\t\t$session = Session::model()->findByAttributes(array('deviceToken'=>$follower['deviceToken']));\n// \t\t\t\t\t\tif($session)\n// \t\t\t\t\t\t{\n// \t\t\t\t\t\t$session->deviceBadge += 1;\n// \t\t\t\t\t\t$session->save();\n// \t\t\t\t\t\tsendApnsNotification($follower['deviceToken'], $message, $follower['deviceBadge']);\n// \t\t\t\t\t\t}\n// \t\t\t\t\t\t*****/\n// \t\t\t\t\t}\n// \t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t//notify the related user\n\t\t\tif($event['relatedUserId'] && $event['relatedUserId'] != $event['raiserId'])\n\t\t\t{\n\t\t\t\tif($eventType == Event::POST_LIKED)\n\t\t\t\t\t$message = $event['raiserName'] . ' liked your post.';\n\t\t\t\telse if($eventType == Event::POST_FLAGGED)\n\t\t\t\t\t$message = $event['raiserName'] . ' flagged your post.';\n\t\t\t\telse if($eventType == Event::COMMENT_CREATED)\n\t\t\t\t\t$message = $event['raiserName'] . ' commented on your post.';\n\t\t\t\telse if($eventType == Event::USER_FOLLOWED)\n\t\t\t\t\t$message = $event['raiserName'] . ' is now following you.';\n\t\t\t\telse if($eventType == Event::USER_MENTIONED_COMMENT){\n\t\t\t\t\t$message = $event['raiserName'] . ' mentioned you in a comment.';\n// \t\t\t\t\t$eventType = Event::COMMENT_CREATED;\n\t\t\t\t}\n\t\t\t\telse if($eventType == Event::USER_MENTIONED_POST){\n\t\t\t\t\t$message = $event['raiserName'] . ' mentioned you in a post.';\n// \t\t\t\t\t$eventType = Event::COMMENT_CREATED;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(!empty($message))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$notfyId = Notification::saveNotification($event['relatedUserId'], Notification::NOTIFICATION_GROUP_YOU, $message, $event['id']);\n\t\t\t\t\t$session = Session::model()->findByAttributes(array('userId'=>$event['relatedUserId']));\n// \t\t\t\t\terror_log('SESSION_LOG : '. print_r( $session, true ) );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(!is_null($session) && !empty($session) && $session->deviceToken)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$notifyData = array(\n// \t\t\t\t\t\t\t\t\"id\" => $notfyId,\n// \t\t\t\t\t\t\t\t\"receiverId\" => $event['relatedUserId'],\n// \t\t\t\t\t\t\t\t\"notificationGroup\" => Notification::NOTIFICATION_GROUP_YOU,\n\t\t\t\t\t\t\t\t\"alert\" => $message,\n// \t\t\t\t\t\t\t\t\"eventId\" => $event['id'],\n// \t\t\t\t\t\t\t\t\"isSeen\" => \"0\",\n\t\t\t\t\t\t\t\t\"eventType\" => $eventType,\n// \t\t\t\t\t\t\t\t\"raiserId\" => $event['raiserId'],\n// \t\t\t\t\t\t\t\t\"raiserName\" => $event['raiserName'],\n// \t\t\t\t\t\t\t\t\"relatedUserId\" => $event['relatedUserId'],\n// \t\t\t\t\t\t\t\t\"relatedUserName\" => $event['relatedUserName'],\n\t\t\t\t\t\t\t\t\"elementId\" => $event['elementId'],\n\t\t\t\t\t\t\t\t\"eventDate\" => $event['eventDate'],\n// \t\t\t\t\t\t\t\t\"isNotified\" => $event['isNotified'],\n\t\t\t\t\t\t\t\t'badge' => $session->deviceBadge,\n\t\t\t\t\t\t\t\t'sound' => 'default'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n// \t\t\t\t\t\t\techo 'Notify Data : ';\n// \t\t\t\t\t\tprint_r($notifyData);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$session->deviceBadge += 1;\n\t\t\t\t\t\t$session->save();\n\t\t\t\t\t\tsendApnsNotification($session->deviceToken, $message, $session->deviceBadge, $notifyData);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}elseif( isset($event['message']) && $event['message'] !=null){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$devices = array();\n\t\t\t\t$sql = 'SELECT id, deviceToken, deviceBadge from session where role=\"manager\"';\n\t\t\t\t\n\t\t\t $rows = Yii::app()->db->createCommand($sql)->queryAll(true);\n\t\t \t$chunk=1;\t\t \n\t\t \n\t\t\t\tforeach ($rows as $row){\n\t\t\t\t\t$devices[] = array(\n\t\t\t\t\t\t\t'deviceToken'=>$row['deviceToken'],\n\t\t\t\t\t\t\t'notifyData' => array('aps'=> array(\n\t\t\t\t\t\t\t\t\t\"alert\" => $event['message'],\n\t\t\t\t\t\t\t\t\t\"eventType\" => $event['eventType'],\n\t\t\t\t\t\t\t\t\t\"elementId\" => $event['id'],\n\t\t\t\t\t\t\t\t\t\"eventDate\" => $event['eventDate'],\n\t\t\t\t\t\t\t\t\t'badge' => $row['deviceBadge'],\n\t\t\t\t\t\t\t\t\t'sound' => 'default'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($chunk > 4){\n\t\t\t\t\t\tsendApnsNotification($devices, '');\n\t\t\t\t\t\t$chunk=1;\n\t\t\t\t\t\t$devices = array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$chunk++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(!empty($devices)){\n\t\t\t\t\techo 'Sending...'.date(DATE_RFC850).\"\\n\";\n\t\t\t\t\tsendApnsNotification($devices, '');\n\t\t\t\t\techo 'done '.date(DATE_RFC850).\"\\n\";\n\t\t\t\t}\n// \t\t\t\t$notfyId = Notification::saveNotification($event['relatedUserId'], Notification::NOTIFICATION_GROUP_YOU, $message, $event['id']);\n\n// \t\t\t\t$insertSql = 'INSERT into notification (receiverId, notificationGroup, message, eventId) (select id, \"1\", \"'.$event['message'].'\", '.$event['id'].' from user where isDisabled = 0 and role=\"manager\")';\n// \t\t\t\tYii::app()->db->createCommand($insertSql)->query();\n\t\t\t\t\n\t\t\t}\n\t\t\tEvent::model()->updateByPk($event['id'], array('isNotified'=>1));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function serveRequest()\n {\n $msg = $this->connection->read();\n if (!$msg) return;\n $this->connection->acknowledge($msg);\n \n $replyMsg = $this->act($msg);\n\n // write correlation id\n $replyMsg->setHeader(\"correlation-id\", $msg->getId());\n\n $this->connection->send($msg->getReplyTo(), $replyMsg);\t\t\n }" ]
[ "0.58663356", "0.5851877", "0.5630609", "0.562751", "0.5621317", "0.5369642", "0.5323702", "0.53118145", "0.5306066", "0.5263835", "0.52325994", "0.5181421", "0.51743144", "0.517253", "0.51522344", "0.5148622", "0.5145064", "0.5125137", "0.51244366", "0.511293", "0.5111846", "0.51106423", "0.5095686", "0.5078345", "0.50688744", "0.5068608", "0.50542426", "0.5030237", "0.50187814", "0.49866518", "0.49694213", "0.49524093", "0.49354872", "0.49341923", "0.49303436", "0.49238843", "0.4915824", "0.49125868", "0.49122757", "0.49117744", "0.49013752", "0.48905873", "0.48896176", "0.4881245", "0.48781702", "0.487054", "0.4864365", "0.4854058", "0.4842892", "0.48427114", "0.48258412", "0.481388", "0.48114517", "0.48052058", "0.4805074", "0.480447", "0.48039272", "0.4783185", "0.47732154", "0.477234", "0.47693792", "0.47612372", "0.47582278", "0.47581202", "0.47551072", "0.47544444", "0.4750105", "0.4741131", "0.47404692", "0.4739635", "0.4733668", "0.47328267", "0.47258902", "0.47245982", "0.47118658", "0.46975273", "0.46893704", "0.46883866", "0.46833998", "0.46828917", "0.46816874", "0.4673394", "0.46725345", "0.46683258", "0.46668404", "0.46663538", "0.4657269", "0.46555734", "0.46537358", "0.46498805", "0.46432108", "0.4641008", "0.46407577", "0.46348315", "0.46344757", "0.46333706", "0.4631621", "0.46261325", "0.46206728", "0.46205026" ]
0.59201396
0
Handler for bbPress 2.x topic creation.
public function notify_forum_new_topic( $topic_id ) { $this->notify_forum_topic_payload( 'create-topic', $topic_id ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTopic($name)\n\t{\n\t\tif(trim($name) == \"\")return $this->message(FORUM_URES_MEZO);\n\t\tif($this->isHavePriv(FORUM_PRIV_TOPIC_CREATE))\n\t\t\treturn mysql_query(\t\"INSERT INTO `\".$this->prefix.\"topic`(`topic_name`,`topic_cat`,`topic_created_by`,`topic_created_time`) \".\n\t\t\t\t\t\t\t\"VALUES('\".specChars($name,\"forum::createTopic\").\"',\".$this->cat_id.\",\".$this->akt_user.\",\".time().\")\");\n\t\telse return $this->message(FORUM_MESSAGE_PRIV_ERROR);\n\t}", "function create_CPTs ()\n\t{\n\t\t\n\t\t\n\t\t$naming = getTopicNaming();\t\t\n\t\t$singular = $naming[0];\n\t\t$plural = pluralize($singular);\n\t\n\t\t//Topics\n\t\t$labels = array(\n\t\t\t'name' => $plural,\n\t\t\t'singular_name' => $singular,\n\t\t\t'menu_name' => $plural,\n\t\t\t'name_admin_bar' => $plural,\n\t\t\t'add_new' => 'Add New '.$singular,\n\t\t\t'add_new_item' => 'Add New '.$singular,\n\t\t\t'new_item' => 'New '.$singular,\n\t\t\t'edit_item' => 'Edit '.$singular,\n\t\t\t'view_item' => 'View '.$plural,\n\t\t\t'all_items' => 'All '.$plural,\n\t\t\t'search_items' => 'Search '.$plural,\n\t\t\t'parent_item_colon' => '',\n\t\t\t'not_found' => 'No '.$plural.' found.',\n\t\t\t'not_found_in_trash' => 'No '.$plural.' found in Trash.'\n\t\t);\n\t\n\t\t$args = array(\n\t\t\t'menu_icon' => 'dashicons-portfolio',\t\t\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_nav_menus'\t => false,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array( 'slug' => 'topics' ),\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => true,\n\t\t\t'hierarchical' => true,\n\t\t\t'menu_position' => 21,\n\t\t\t'supports' => array( 'title', 'editor', 'revisions', 'thumbnail' )\n\t\t\t\n\t\t);\n\t\t\n\t\t\n\t\t\n\t\tregister_post_type( 'imperial_topic', $args );\n\t\t//remove_post_type_support('term-session', 'editor');\t\n\t\t\n\t}", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function createAction()\n {\n if ($this->getRequest()->isPost())\t\t\t//avoids direct access without having an ID pass\n {\n $this->view->title = ' - Thema';\n\n $this->view->topicID = $_POST[\"topicID\"];\t\t//sends topicID to view\n $this->view->topicName = $_POST[\"topicName\"];\t//sends topicName to view\n }\n else\n {\n $this->_redirect('/');\t\t\t\t//goes to mainpage\n }\n }", "public function create_topic() {\n $this->validate($this->request, [\n 'title' => 'required|string|max:255',\n 'is_guardian_blocked' => 'integer|min:0|max:1',\n 'status' => 'integer|min:0|max:1',\n 'is_featured' => 'integer|min:0|max:1',\n 'content' => 'string'\n ]);\n\n $is_guardian_blocked = 0;\n $is_featured = 0;\n $status = 0;\n\n $topic = new Topic;\n $topic->franchise_id = $this->franchise_id;\n $topic->club_id = $this->club_id;\n $topic->title = $this->request['title'];\n\n if( isset($this->request['is_guardian_blocked']) && !empty($this->request['is_guardian_blocked']) ) {\n $is_guardian_blocked = $this->request['is_guardian_blocked'];\n }\n\n if( isset($this->request['status']) && !empty($this->request['status']) ) {\n $status = $this->request['status'];\n }\n\n if( isset($this->request['is_featured']) && !empty($this->request['is_featured']) ) {\n $is_featured = $this->request['is_featured'];\n }\n\n if( isset($this->request['content']) && !empty($this->request['content']) ) {\n $topic->content = $this->request['content'];\n }\n\n $topic->is_guardian_blocked = $is_guardian_blocked;\n $topic->is_featured = $is_featured;\n $topic->created_by = $this->user_id;\n $topic->status = $status;\n\n $topic->save();\n\n return response()->json($topic, 200);\n }", "public function create()\n {\n return view('admin.topic.create');\n }", "function AddTopic()\n{\n global $context, $txt, $mbname, $db_prefix;\n\n // Check permission\n $a_add = allowedTo('smftags_add');\n\n if ($a_add == false)\n fatal_error($txt['cannot_smftags_add'],false);\n\n // get query results to build array of all tags\n $query = db_query(\"\n SELECT t.tag AS tag, t.ID_TAG AS ID_TAG, COUNT(l.ID_TAG) AS quantity, t.approved AS approved\n FROM {$db_prefix}tags AS t\n LEFT JOIN {$db_prefix}tags_log AS l ON t.ID_TAG = l.ID_TAG\n GROUP BY t.ID_TAG\n ORDER BY t.tag ASC\",\n __FILE__, __LINE__);\n\n $context['tags'] = array();\n while ($row = mysql_fetch_assoc($query))\n {\n $context['tags'][] = array(\n 'ID_TAG' => $row['ID_TAG'],\n 'tag' => $row['tag'],\n 'quantity' => $row['quantity'],\n 'approved' => $row['approved'],\n 'tagged' => 0,\n );\n }\n // don't load the subtemplate\n}", "public function create_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['to'] = $this->input->get('to');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\n\t\t$this->Messages_model->create($data);\n\t}", "public function createTopic($topic){\n \tif(!array_key_exists($topic, $this->topics)){\n \t\tthrow new \\InvalidArgumentException('Topic not in configuration');\n \t}\n \t$result = $this->getClient()->createTopic([\n \t\t'Name' => $this->getTopic($topic)['name'],\n \t]);\n\n \treturn $result;\n }", "public function create()\n {\n return view('topic.create');\n }", "function addTopic()\n{\n\tglobal $xoopsDB, $xoopsModule, $xoopsModuleConfig;\n $topicpid = isset($_POST['topic_pid']) ? intval($_POST['topic_pid']) : 0;\n $xt = new NewsTopic();\n if (!$xt->topicExists($topicpid, $_POST['topic_title'])) {\n $xt->setTopicPid($topicpid);\n if (empty($_POST['topic_title']) || xoops_trim($_POST['topic_title'])=='') {\n redirect_header( \"index.php?op=topicsmanager\", 2, _AM_ERRORTOPICNAME );\n }\n $xt->setTopicTitle($_POST['topic_title']);\n //$xt->Settopic_rssurl($_POST['topic_rssfeed']);\n $xt->setTopic_color($_POST['topic_color']);\n if (isset($_POST['topic_imgurl'] ) && $_POST['topic_imgurl'] != \"\") {\n $xt->setTopicImgurl($_POST['topic_imgurl'] );\n }\n\t\t$xt->setMenu(intval($_POST['submenu']));\n\t\t$xt->setTopicFrontpage(intval($_POST['topic_frontpage']));\n\t\tif(isset($_POST['xoops_upload_file'])) {\n\t\t\t$fldname = $_FILES[$_POST['xoops_upload_file'][0]];\n\t\t\t$fldname = (get_magic_quotes_gpc()) ? stripslashes($fldname['name']) : $fldname['name'];\n\t\t\tif(xoops_trim($fldname!='')) {\n\t\t\t\t$sfiles = new sFiles();\n\t\t\t\t$dstpath = XOOPS_ROOT_PATH . \"/modules/\" . $xoopsModule -> dirname() . '/images/topics';\n\t\t\t\t$destname=$sfiles->createUploadName($dstpath ,$fldname, true);\n\t\t\t\t$permittedtypes=array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');\n\t\t\t\t$uploader = new XoopsMediaUploader($dstpath, $permittedtypes, $xoopsModuleConfig['maxuploadsize']);\n\t\t\t\t$uploader->setTargetFileName($destname);\n\t\t\t\tif ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {\n\t\t\t\t\tif ($uploader->upload()) {\n\t\t\t\t\t\t$xt->setTopicImgurl(basename($destname));\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo _AM_UPLOAD_ERROR . ' ' . $uploader->getErrors();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $uploader->getErrors();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$xt->setTopicDescription($_POST['topic_description']);\n\t\t$xt->store();\n\t\tupdateCache();\n\n $notification_handler = & xoops_gethandler('notification');\n $tags = array();\n $tags['TOPIC_NAME'] = $_POST['topic_title'];\n $notification_handler->triggerEvent( 'global', 0, 'new_category', $tags);\n redirect_header('index.php?op=topicsmanager', 1, _AM_DBUPDATED);\n } else {\n redirect_header('index.php?op=topicsmanager', 2, _AM_ADD_TOPIC_ERROR);\n }\n exit();\n}", "public function create()\n {\n return view('backend.topics.create');\n }", "public function executeTopicCreate(sfWebRequest $request)\n {\n $this->forward404Unless($request->isMethod(sfRequest::POST));\n\n $this->form = new ForumTopicsForm();\n\n $flagForumsId = '';\n\t\t$flagForumsId = $request->getPostParameter('flagForumsId');\n\t\t$this->flagForumsId = $flagForumsId;\n $this->processTopicForm($request, $this->form, $flagForumsId);\n\n //$this->processTopicForm($request, $this->form);\n $this->setTemplate('topicNew');\n }", "public function store(CreateTopic $request)\n { \n $topic = new Topic();\n $topic->section_id = $request->input('section_id');\n $topic->title = $request->title;\n $topic->save();\n\n $post = new Post();\n $post->user_id = Auth::user()->id;\n $post->topic_id = $topic->id;\n $post->body = $request->input('body');\n $post->save();\n\n return redirect(\"/topic/$topic->id\")->with('success', 'Topic was saved with success');\n }", "public function make_post_forum_topic($forum_name, $topic_identifier, $member, $post_title, $_post, $content_title, $topic_identifier_encapsulation_prefix, $content_url = null, $time = null, $ip = null, $validated = null, $topic_validated = 1, $skip_post_checks = false, $poster_name_if_guest = '', $parent_id = null, $staff_only = false)\n {\n $__post = comcode_to_tempcode($_post);\n $post = $__post->evaluate();\n\n if (is_null($time)) {\n $time = time();\n }\n if (is_null($ip)) {\n $ip = get_ip_address();\n }\n $forum_id = $this->forum_id_from_name($forum_name);\n if (is_null($forum_id)) {\n warn_exit(do_lang_tempcode('MISSING_FORUM', escape_html($forum_name)));\n }\n\n $username = $this->_get_username($member);//needed for the mybb_theads DB table\n\n $test = $this->connection->query_select('forums', array('*'), null, '', 1);\n $fm = array_key_exists('status', $test[0]);\n\n $topic_id = $this->find_topic_id_for_topic_identifier($forum_name, $topic_identifier);\n\n $ip_address = $ip;\n $long_ip_address = $this->_phpbb_ip($ip);\n $local_ip_address = '127.0.0.1'; //$this->_phpbb_ip('127.0.0.1');\n\n $is_new = is_null($topic_id);\n if ($is_new) {\n $topic_id = $this->connection->query_insert('threads', array('fid' => $forum_id, 'subject' => $content_title . ', ' . $topic_identifier_encapsulation_prefix . ': #' . $topic_identifier, 'username' => $username, 'uid' => $member, 'lastposter' => $username, 'lastposteruid' => $member, 'visible' => 1, 'dateline' => $time, 'lastpost' => $time), true);\n $home_link = hyperlink($content_url, $content_title, false, true);\n $this->connection->query_insert('posts', array('fid' => $forum_id, 'tid' => $topic_id, 'username' => do_lang('SYSTEM', '', '', '', get_site_default_lang()), 'uid' => $member, 'message' => do_lang('SPACER_POST', $home_link->evaluate(), '', '', get_site_default_lang()), 'subject' => '', 'dateline' => $time, 'visible' => 1, 'ipaddress' => $ip_address, 'longipaddress' => $long_ip_address));\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'forums SET posts=(posts+1), threads=(threads+1) WHERE fid=' . (string)intval($forum_id), 1);\n }\n\n $GLOBALS['LAST_TOPIC_ID'] = $topic_id;\n $GLOBALS['LAST_TOPIC_IS_NEW'] = $is_new;\n\n if ($post == '') {\n return array($topic_id, false);\n }\n\n $this->connection->query_insert('posts', array('fid' => $forum_id, 'tid' => $topic_id, 'username' => $username, 'uid' => $member, 'message' => $post, 'subject' => $post_title, 'dateline' => $time, 'visible' => 1, 'ipaddress' => $ip_address, 'longipaddress' => $long_ip_address));\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'forums SET posts=(posts+1), lastpost=' . strval($time) . ', lastposter=\\'' . db_escape_string($username) . '\\' WHERE fid=' . (string)intval($forum_id), 1);\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'threads SET lastpost=' . strval($time) . ', lastposter=\\'' . db_escape_string($username) . '\\', lastposteruid=' . strval($member) . ', replies=(replies+1) WHERE tid=' . (string)intval($topic_id), 1);\n\n return array($topic_id, false);\n }", "function ticketCreate($creator, $cat, $topic, $text)\r\n{\r\n\tglobal $db, $_cfg;\r\n\tif (!is_array($creator))\r\n\t{\r\n\t\t$usr = opReadUser($creator);\r\n\t\tif (!$usr)\r\n\t\t\treturn 'user_not_found';\r\n\t\t$creator = array('uID' => $creator, 'Name' => $usr['aName'], 'Mail' => $usr['uMail']);\r\n\t}\r\n//\tif (!validMail($frommail))\r\n//\t\treturn 'mail_wrong';\r\n\tif (!$topic)\r\n\t\treturn 'topic_empty';\r\n\tif (!$text)\r\n\t\treturn 'text_empty';\r\n\t$tid = $db->insert('Tickets', array(\r\n\t\t'tuID' => $creator['uID'],\r\n\t\t'tTS' => timeToStamp(),\r\n//\t\t'tTID' => ???,\r\n\t\t'tName' => $creator['Name'],\r\n\t\t'tMail' => $creator['Mail'],\r\n\t\t'tCat' => $cat,\r\n\t\t'tTopic' => $topic,\r\n\t\t'tText' => $text,\r\n\t\t'tPriority' => 1,\r\n\t\t'tState' => 1,\r\n\t\t'tLTS' => timeToStamp()\r\n\t));\r\n\t$creator['id'] = $tid;\r\n\t$creator['topic'] = $topic;\r\n\t$creator['text'] = $text;\r\n\t$creator['url'] = fullURL(moduleToLink('tickets/admin/ticket'));\r\n\tsendMailToAdmin('NewTicket', $creator);\r\n\treturn $tid;\r\n}", "public function new_topic( $topic_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_topic', 'new_group_forum_topic' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_topic', $topic_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_topic',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_topic']['creds'],\n\t\t\t\t$this->prefs['new_topic']['log'],\n\t\t\t\t$topic_id,\n\t\t\t\t'bp_ftopic',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}", "public function create()\n\t{\n\t\t$breadcrumbs = ['Home', 'Manage Forum', 'Topic', 'Create'];\n\t\t$sections = Section::all();\n\t\treturn View::make('admin.forum.topic.create')\n\t\t\t\t\t->withSections($sections)\n\t\t\t\t\t->withBreadcrumbs($breadcrumbs);\n\t}", "public function actionCreate()\r\n\t{\r\n\r\n $groupId = Yii::app()->request->getParam('groupId');\r\n\r\n $model=new GroupTopic;\r\n $model->group_id = $groupId ;\r\n $model->creator_id = user()->getId() ;\r\n\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['GroupTopic']))\r\n\t\t{\r\n\t\t\t$model->attributes=$_POST['GroupTopic'];\r\n\r\n $model->created = time() ;\r\n\r\n\t\t\tif($model->save())\r\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\r\n\t\t}\r\n\r\n\t\t$this->render('create',array(\r\n\t\t\t'model'=>$model,\r\n\t\t));\r\n\t}", "function target_add_topic($topic)\n{\n\t// if ($GLOBALS['VERBOSE']) pf('...'. $topic['id']);\n\n\tif (!isset($topic['orderexpiry'])) {\n\t\t$topic['orderexpiry'] = 0;\n\t}\n\n\t// Set orderexpiry for announcement and sticky topics.\n\tif (($topic['thread_opt'] & 2) || ($topic['thread_opt'] & 4)) {\n\t\t$topic['orderexpiry'] = 1000000000;\n\t}\n\n\t// Skip topics that doesn't belong to a forum.\n\tif (!isset($GLOBALS['forum_map'][ (int)$topic['forum_id'] ])) {\n\t\tpf('WARNING: Skip topic #'. $topic['id'] .'. Probably an announcement or orphaned message!');\n\t\treturn;\n\t}\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread (\n\t\tid, forum_id, root_msg_id, views, replies, thread_opt, orderexpiry\n\t\t) VALUES(\n\t\t\t'. (int)$topic['id'] .',\n\t\t\t'. $GLOBALS['forum_map'][ (int)$topic['forum_id'] ] .',\n\t\t\t'. (int)$topic['root_msg_id'] .',\n\t\t\t'. (int)$topic['views'] .',\n\t\t\t'. (int)$topic['replies'] .',\n\t\t\t'. (int)$topic['thread_opt'] .',\n\t\t\t'. (int)$topic['orderexpiry'] .')\n\t');\n}", "public function create()\n {\n $topic = new Topic;\n return view('topics.create')->with(compact('topic'));\n }", "public function forum_create() {\n\n if ( ! in('slug') ) ferror(-50020, 'category_nicename(Forum ID) is not provided');\n if ( ! in('category_description') ) wp_send_json_error(['code'=>-50021,'message'=>'category_description is not provided']);\n if ( ! in('cat_name') ) wp_send_json_error(['code'=>-50022,'message'=>'cat_name(Forum Name) is not provided']);\n\n /**\n * Put category parent ID\n */\n if ( ! $category_parent = in('category_parent') ) {\n $category_parent = get_category_by_slug( FORUM_CATEGORY_SLUG )->term_id;\n }\n $catarr = array(\n 'cat_name' =>in('cat_name'),\n 'category_description' => in('category_description'),\n 'category_nicename' => in('slug'),\n 'category_parent' => $category_parent\n );\n\n $term_ID = $this->createOrUpdate( $catarr );\n\n if ( is_wp_error( $term_ID ) ) {\n wp_send_json_error( ['code'=>-4100, 'message'=>$term_ID->get_error_message()] );\n }\n\n $this->updateMeta( $term_ID );\n $this->response();\n }", "public function create()\n {\n return view('admin.topics.create');\n }", "public function InsertTopic($fromArticle=false,$useArticleDescr=false,\n $useArticleText=false,$link2article=false)\n {\n global $DB, $categoryid, $sdlanguage, $sdurl, $userinfo, $usersystem;\n\n //SD351: create topic from article\n $fromArticle = (defined('IN_ADMIN') && !empty($fromArticle));\n if($fromArticle && empty($useArticleDescr) && empty($useArticleText))\n {\n return false;\n }\n\n // SD313: security check against spam/bot submissions\n if(empty($fromArticle))\n {\n if(!CheckFormToken(FORUM_TOKEN, false))\n {\n $this->conf->RedirectPageDefault('<strong>'.$sdlanguage['error_invalid_token'].'</strong><br />',true);\n return false;\n }\n if(empty($this->conf->forum_arr['forum_id']) || ($this->conf->forum_arr['forum_id']<1))\n {\n $this->conf->RedirectPageDefault('<strong>'.$this->conf->plugin_phrases_arr['err_invalid_forum_id'] . '</strong>',true);\n return false;\n }\n }\n\n $errors_arr = array();\n\n if(empty($fromArticle))\n {\n $topic_title = trim(GetVar('forum_topic_title', '', 'string', true, false));\n $post_text = trim(GetVar('forum_post', '', 'string', true, false));\n\n if(!($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator) ||\n !empty($userinfo['require_vvc'])) //SD340: require_vvc\n {\n if(!CaptchaIsValid('amihuman'))\n {\n $errors_arr[] = $sdlanguage['captcha_not_valid'];\n }\n }\n\n //SD343: combined blacklist check\n if($this->conf->IsUserBlacklisted())\n {\n WatchDog('Forum','<b>Forum spam topic: '.$userinfo['username'].\n '</b>, IP: </b><span class=\"ipaddress\">'.USERIP.'</span></b><br />'.\n 'in TopicID: '.$this->conf->topic_arr['topic_id'].', PostID: '.$post_id,\n WATCHDOG_ERROR);\n $this->DisplayTopic(true,$sdlanguage['ip_listed_on_blacklist'].' '.USERIP);\n return false;\n }\n\n //SD342: censor non-admin text if enabled\n if($this->conf->censor_posts)\n {\n $topic_title = sd_censor($topic_title);\n $post_text = sd_censor($post_text);\n }\n }\n else\n {\n // #################################################################\n // SD351: post article as forum topic\n // #################################################################\n $topic_title = trim(GetVar('title', '', 'html', true, false));\n $topic_title = htmlspecialchars(strip_alltags($topic_title));\n\n $post_text = '';\n if(!empty($useArticleDescr))\n {\n $article_descr = trim(GetVar('description', '', 'html', true, false));\n if(sd_strlen($article_descr))\n {\n $post_text = trim(sd_ConvertHtmlToBBCode($article_descr));\n if(sd_strlen($post_text))\n {\n $post_text .= \"\\r\\n\\r\\n\";\n }\n }\n }\n if(!empty($useArticleText))\n {\n $article_text = trim(GetVar('article', '', 'html', true, false));\n $article_text = sd_ConvertHtmlToBBCode($article_text);\n if(sd_strlen($article_text))\n {\n $post_text2 = trim($article_text);\n if(sd_strlen($post_text2))\n {\n $post_text .= \"\\r\\n\\r\\n\".$post_text2;\n }\n }\n }\n if(!empty($link2article) && ($link2article!==false))\n {\n $post_text .= $link2article;\n }\n unset($article_descr,$article_text,$post_text2,$useArticleDescr);\n }\n\n $sticky = 0;\n $open = 1;\n $moderated = GetVar('moderate_topic', false, 'bool', true, false)?1:0;\n if($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator)\n {\n $open = GetVar('lock_topic', 0, 'bool', true, false)?0:1; //SD351\n $sticky = GetVar('stick_topic', false, 'bool', true, false)?1:0;\n }\n else\n {\n if(!empty($this->conf->forum_arr['moderated']))\n {\n $moderated = SDForumConfig::UsergroupsModerated($userinfo['usergroupids'],\n $this->conf->forum_arr['moderated'])?1:0;\n }\n }\n\n //SD343: content filter for moderated posts\n if(empty($errors_arr) && $moderated &&\n !$this->conf->IsSiteAdmin && !$this->conf->IsAdmin && !$this->conf->IsModerator)\n {\n //SD343: up to x posts within y minutes if moderated\n if($this->conf->mod_post_limit && $this->conf->mod_time_limit)\n {\n $trigger = $DB->query_first('SELECT COUNT(post_id) postcount FROM {p_forum_posts}'.\n \" WHERE ((user_id = %d) OR (ip_address = '%s')) AND (`date` > %d) AND (moderated = 1)\",\n $userinfo['userid'], USERIP, (TIME_NOW - ($this->conf->mod_time_limit*60)));\n if(!empty($trigger['postcount']) && ($trigger['postcount'] >= $this->conf->mod_post_limit))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['message_too_many_moderated'];\n }\n }\n\n if(empty($errors_arr))\n {\n $topic_title = htmlspecialchars(strip_alltags(sd_htmlawed(unhtmlspecialchars($topic_title))));\n $post_text = htmlspecialchars(sd_htmlawed(unhtmlspecialchars($post_text)));\n }\n }\n\n //SD343: min. topic/post length checks\n $topic_title = trim($topic_title);\n $post_text = trim($post_text);\n $plen = strlen($topic_title);\n\n if(empty($fromArticle))\n {\n if(($plen < 3) || ($plen < $this->conf->plugin_settings_arr['minimum_topic_title_length']))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['err_topic_no_title'];\n }\n\n $plen = strlen($post_text);\n if(($plen < 2) || ($plen < $this->conf->plugin_settings_arr['minimum_post_text_length']))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['post_too_short'];\n }\n }\n\n if(empty($errors_arr))\n {\n $DB->result_type = MYSQL_ASSOC;\n if($topic_exists_arr = $DB->query_first('SELECT ft.topic_id FROM {p_forum_topics} ft'.\n ' INNER JOIN {p_forum_forums} ff ON ft.forum_id = ff.forum_id'.\n ' WHERE ff.forum_id = %d'.\n ($this->conf->IsSiteAdmin ? '' : ' AND ff.online = 1').\n \" AND trim(ft.title) = '%s' AND ft.post_user_id = %d\",\n $this->conf->forum_arr['forum_id'],\n $DB->escape_string($topic_title),\n $userinfo['userid']))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['err_topic_no_repeat'];\n }\n }\n\n if(count($errors_arr))\n {\n DisplayMessage('<strong>'.implode('<br />', $errors_arr). '</strong>', true);\n if(empty($fromArticle))\n {\n $this->DisplayTopicForm();\n }\n return false;\n }\n\n // all is good, insert new topic\n $DB->query('INSERT INTO {p_forum_topics}'.\n ' (forum_id, date, post_count, views, open, post_user_id,'.\n ' post_username, title, last_post_date, last_post_username, sticky, moderated)'.\n ' VALUES (%d, %d, 1, 0, %d, ' . $userinfo['userid'] .\n \", '%s', '%s', %d, '%s', $sticky, $moderated)\",\n $this->conf->forum_id, TIME_NOW, $open,\n $DB->escape_string($userinfo['username']),\n $DB->escape_string($topic_title),\n TIME_NOW,\n $DB->escape_string($userinfo['username']));\n\n if($topic_id = $DB->insert_id())\n {\n $DB->query('INSERT INTO {p_forum_posts}'.\n ' (topic_id, username, user_id, date, post, ip_address, moderated) VALUES'.\n \" (%d, '%s', %d, %d, '%s', '%s', %d)\",\n $topic_id, $DB->escape_string($userinfo['username']),\n $userinfo['userid'], TIME_NOW,\n $DB->escape_string($post_text), IPADDRESS, $moderated);\n\n if($post_id = $DB->insert_id())\n {\n //SD351: set config's settings\n $this->conf->topic_id = $topic_id;\n $this->conf->topic_arr = array();\n $this->conf->topic_arr['topic_id'] = (int)$topic_id;\n $this->conf->topic_arr['forum_id'] = (int)$this->conf->forum_arr['forum_id'];\n $this->conf->topic_arr['title'] = $topic_title;\n $this->conf->topic_arr['sticky'] = $sticky;\n $this->conf->topic_arr['moderated'] = $moderated;\n $this->conf->topic_arr['open'] = $open;\n $this->conf->topic_arr['post_user_id'] = (int)$userinfo['userid'];\n $this->conf->topic_arr['post_username'] = $userinfo['username'];\n $this->conf->topic_arr['first_post_id'] = (int)$post_id;\n $this->conf->topic_arr['last_post_id'] = (int)$post_id;\n $this->conf->topic_arr['last_post_date'] = TIME_NOW;\n $this->conf->topic_arr['last_post_username'] = $userinfo['username'];\n\n $DB->query(\"UPDATE {p_forum_topics} SET first_post_id = $post_id, last_post_id = $post_id\n WHERE topic_id = $topic_id LIMIT 1\");\n\n if(!$moderated)\n {\n $DB->query(\"UPDATE {p_forum_forums} SET last_topic_title = '\".$DB->escape_string(trim($topic_title)).\"',\n topic_count = (IFNULL(topic_count,0) + 1),\n post_count = (IFNULL(post_count,0) + 1),\n last_post_date = \" . TIME_NOW . \",\n last_post_username = '\" . $DB->escape_string($userinfo['username']) . \"',\n last_topic_id = $topic_id,\n last_post_id = $post_id\n WHERE forum_id = \" . $this->conf->forum_arr['forum_id'] . '\n LIMIT 1');\n\n //SD322: update user's thread count\n //SD332: update to \"user_post_count\" was missing till now\n if($this->conf->is_sd_users) //SD342\n $DB->query('UPDATE {users} SET user_thread_count = (IFNULL(user_thread_count,0) + 1),'.\n ' user_post_count = (IFNULL(user_post_count,0) + 1) WHERE userid = %d', $userinfo['userid']);\n\n //SD351: update user title\n SDUserCache::UpdateUserTitle($userinfo['userid']);\n }\n\n if(empty($fromArticle))\n {\n //SD343: check selected prefix (if present) against tags table, based on sub-forum/usergroup\n if($prefix_id = Is_Valid_Number(GetVar('prefix_id', 0, 'whole_number', true, false),0,1,999999999))\n {\n $tconf = array(\n 'chk_ugroups' => !$this->conf->IsSiteAdmin,\n 'pluginid' => $this->conf->plugin_id,\n 'objectid' => 0,\n 'tagtype' => 2,\n 'ref_id' => 0,\n 'allowed_id' => $this->conf->forum_arr['forum_id'],\n );\n require_once(SD_INCLUDE_PATH.'class_sd_tags.php');\n $prefixes = SD_Tags::GetPluginTagsAsArray($tconf);\n if(($prefixes !== false) && isset($prefixes[$prefix_id]))\n {\n SD_Tags::StorePluginTags($this->conf->plugin_id, $topic_id, $prefixes[$prefix_id], 2, $prefix_id, true);\n }\n }\n\n //SD343: add topic tags if allowed for usergroup\n $tag_ug = sd_ConvertStrToArray($this->conf->plugin_settings_arr['tag_submit_permissions'],'|');\n if($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ||\n (!empty($tag_ug) && @array_intersect($userinfo['usergroupids'], $tag_ug)))\n {\n require_once(SD_INCLUDE_PATH.'class_sd_tags.php');\n $tags = GetVar('tags', '', 'string', true, false);\n SD_Tags::StorePluginTags($this->conf->plugin_id, $topic_id, $tags, 0, 0, true);\n }\n\n // insert attachment\n if($this->conf->attach_path_ok && isset($_FILES['attachment']) && !empty($_FILES['attachment']['name']) &&\n ($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ||\n (!empty($userinfo['plugindownloadids']) &&\n @in_array($this->conf->plugin_id,$userinfo['plugindownloadids']) &&\n !empty($this->conf->plugin_settings_arr['valid_attachment_types']))))\n {\n $attachment_arr = $_FILES['attachment'];\n // if an attachment was uploaded, then it will be inserted after the ticket is created\n $attachment_uploaded = false;\n // check if attachment was uploaded\n if($attachment_arr['error'] != 4)\n {\n list($attachment_uploaded, $attachment_stored_filename, $error) = $this->UploadAttachment($attachment_arr);\n if(!$attachment_uploaded)\n {\n if($error !== false)\n $errors_arr[] = $error;\n }\n else\n {\n $DB->query(\"INSERT INTO {p_forum_attachments}\n (attachment_id, post_id, attachment_name, filename, filesize, filetype, user_id, username, uploaded_date)\n VALUES (NULL, %d, '%s', '%s', %d, '%s', %d, '%s', \" . TIME_NOW . \")\",\n $post_id,\n $DB->escape_string($attachment_arr['name']),\n $DB->escape_string($attachment_stored_filename),\n $attachment_arr['size'],\n $DB->escape_string($attachment_arr['type']),\n $userinfo['userid'],\n $DB->escape_string($userinfo['username']));\n $DB->query('UPDATE {p_forum_posts}'.\n ' SET attachment_count = (IFNULL(attachment_count,0)+1)'.\n ' WHERE post_id = %d', $post_id);\n }\n }\n }\n } //$fromArticle\n\n }\n }\n\n //SD351: if from article then return topic_id\n if(!empty($fromArticle))\n {\n return empty($topic_id)?false:(int)$topic_id;\n }\n\n //SD342: send email notifications for subscriptions\n if(empty($errors_arr))\n {\n if($sub = new SDSubscription($userinfo['userid'],$this->conf->plugin_id,\n $this->conf->forum_arr['forum_id'],'forum',$categoryid))\n {\n $sub->SendNotifications();\n }\n unset($sub);\n\n global $SDCache;\n if(!empty($SDCache) && $SDCache->IsActive()) $SDCache->delete_cacheid(FORUM_CACHE_FORUMS);\n\n $link = $this->conf->RewritePostLink($topic_id,$topic_title,$post_id);\n RedirectFrontPage($link, $this->conf->plugin_phrases_arr[$moderated ?\n 'message_topic_awaits_approval' : 'message_topic_created']);\n\n return true;\n }\n $this->conf->RedirectPageDefault('Error!');\n return false;\n }", "public function run()\n {\n Topic::create([\n 'name' => 'Чому варто купляти великий будинок?',\n ]);\n Topic::create([\n 'name' => 'Чи потребую я бдуинок?',\n ]);\n Topic::create([\n 'name' => 'Квартира чи Будинок?',\n ]);\n Topic::create([\n 'name' => 'Чому варто бути обережним при купівлі квартири?',\n ]);\n Topic::create([\n 'name' => 'Чи варто мати свій сад?',\n ]);\n\n }", "public function create(Request $request)\n {\n $rules = [\n 'group_id' => 'required',\n 'title' => 'required',\n 'content' => 'required'\n ];\n $this->validate($request, $rules);\n $input = $request->all();\n $input['user_id'] = $this->thisUserId();\n $topic = Topic::create($input);\n\n if ($topic) {\n $topic = Topic::with('photos','author')->find($topic->id);\n return $this->apiSuccess($topic);\n } else {\n return $this->apiError(\"save topic wish error\",1001);\n }\n }", "public function create()\n {\n return redirect()->route('topic.index');\n }", "function CreateNewsletter()\n\t{\n\t\t$newsletterapi = $this->GetApi();\n\n\t\t$GLOBALS['Action'] = 'Create&SubAction=Step2';\n\t\t$GLOBALS['CancelButton'] = GetLang('CreateNewsletterCancelButton');\n\t\t$GLOBALS['Heading'] = GetLang('CreateNewsletter');\n\t\t$GLOBALS['Intro'] = GetLang('CreateNewsletterIntro');\n\t\t$GLOBALS['NewsletterDetails'] = GetLang('CreateNewsletterHeading');\n\n\t\t$GLOBALS['FormatList'] = '';\n\t\t$allformats = $newsletterapi->GetAllFormats();\n\t\tforeach ($allformats as $id => $name) {\n\t\t\tif ($name == 'TextAndHTML') {\n\t\t\t\t$recommended = ' ' . GetLang('Recommended');\n\t\t\t} else {\n\t\t\t\t$recommended = '';\n\t\t\t}\n\t\t\t$GLOBALS['FormatList'] .= '<option value=\"' . $id . '\">' . GetLang('Format_' . $name) . $recommended .'</option>';\n\t\t}\n\n\t\t$templateselects = $this->GetTemplateList();\n\t\t$GLOBALS['TemplateList'] = $templateselects;\n\n\t\t$this->ParseTemplate('Newsletter_Form_Step1');\n\t}", "public function executeTopicNew(sfWebRequest $request)\n {\n\t\t$this->flagForumsId = '';\n\t\tif($request->hasParameter('flagForumsId'))\n\t\t\tif($request->getParameter('flagForumsId'))\n\t\t\t\t$this->flagForumsId = $request->getParameter('flagForumsId');\n\t\t\t\t\n $this->form = new ForumTopicsForm();\n }", "public function createTopic(Topic $topic, TopicBind ...$binds): Promise\n {\n return $this->transport->createTopic($topic, ...$binds);\n }", "public function createTopic($data){\n DB::beginTransaction();\n try {\n $topic = $this->create($data);\n $topic->category()->increment('topic_count');\n $topic->user()->increment('topic_count');\n if($data['tags']){\n $topic->tags()->sync($data['tags']);\n $topic->tags()->increment('topic_count');\n }\n }catch (\\Exception $e){\n DB::rollback();\n throw $e;\n }\n DB::commit();\n return $topic->id;\n }", "public function declareTopic(string $topic): void;", "private function addGroupTopic()\n {\n try\n {\n $request = $_POST;\n\n if(!isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg('provide group id');\n else if(!is_numeric($request['group_id'])) \n throw_error_msg('invalid group id'); \n else\n $gid = (int)$request['group_id'];\n\n if(!isset($request['topic_title']) || $request['topic_title']==\"\" )\n throw_error_msg('provide topic title');\n\n if(!isset($request['topic_post']) || $request['topic_post']==\"\" )\n throw_error_msg('provide topic post');\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $cbgroup->add_topic($request);\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'group topic added', \"data\" => array());\n $this->response($this->json($data));\n }\n\n if( error() )\n {\n throw_error(error('single')); \n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function __construct(Topic $topic)\n {\n $this->topic = $topic;\n }", "public function create()\n {\n //\n $this->message->sendMessage();\n }", "public function create()\n {\n $this->viewData['create'] = [\n 'parents' => Topic::where('contents.key', 'discussion-topic')->get(),\n ];\n\n return parent::contentCreate();\n }", "public function create()\n {\n $topics = Topics::whereIn('status',['1',1])->get();\n $status = Constant::$status;\n return View::make('admin.subtopics.create',compact('status','topics'));\n }", "public function getCreateTitle()\n {\n return sprintf($this->_('New %s...'), $this->getTopic(1));\n }", "public static function create(array $attributes = [], $created_by = null) {\n $topic = parent::create($attributes); // TODO: Change the autogenerated stub\n // bookmark hit\n Hit::create([\n 'owner_type' => 'App\\Topic',\n 'owner_id' => $topic->id\n ]);\n\n // create by who?\n $user = Auth::user() ? Auth::user() : User::findOrFail($created_by);\n\n // title\n $history = History::create([\n 'user_id' => $user->id,\n 'type' => 1,\n 'text' => $topic->name\n ]);\n $topic->histories()->save($history);\n\n // description\n if ($topic->description != \"\") {\n $history = History::create([\n 'user_id' => $user->id,\n 'type' => 2,\n 'text' => $topic->description\n ]);\n $topic->histories()->save($history);\n }\n\n // create image for it\n // check if topic folder exist\n // generate file name\n $filename = 'topic-' . $topic->id . '.png';\n File::copy(base_path('public/static/images/default_topic.png'),\n base_path('images/topic/' . $filename));\n\n // create new image instance\n $img_database = Image::create([\n 'path' => 'images/topic/' . $filename,\n 'width' => 600,\n 'height' => 529\n ]);\n $img_database->save();\n\n // update reference id\n $img_database->reference_id = $img_database->id;\n $img_database->save();\n\n // update new user pic id\n $topic->avatar_img_id = $img_database->id;\n $topic->save();\n\n return $topic;\n }", "public function createTopic($user, $title, $content) {\n\t\t$topic = parent::create([\n\t\t\t\"section_id\"\t=> $this->getID(),\n\t\t\t\"title\"\t\t\t=> $title\n\t\t]);\n\n\t\t$topic->createComment($user, $content);\n\n\t\treturn $topic;\n\t}", "function get_createlink() {\n\treturn BASE . 'discussion' . DS . 'create';\n}", "function create(){\n\t // insert query\n\t $query = \"INSERT INTO \" . $this->table_name . \" SET name = :name, topic_slug = :topic_slug\";\n\t // prepare the query\n\t $stmt = $this->conn->prepare($query);\n\t // sanitize\n\t $this->name=htmlspecialchars(strip_tags($this->name));\n\t $this->topic_slug=htmlspecialchars(strip_tags($this->topic_slug));\n\t // bind the values\n\t $stmt->bindParam(':name', $this->name);\n\t $stmt->bindParam(':topic_slug', $this->topic_slug);\n\t // execute the query, also check if query was successful\n\t if($stmt->execute()){\n\t return true;\n\t }else{\n\t $this->showError($stmt);\n\t return false;\n\t }\n\t}", "public function ambassade_single_topic(&$event) {\n global $user;\n // IF IS AMBASSADE\n if($event[\"row\"][\"forum_id\"] == 29 && !$this->topic_ambassade_set_up) {\n $guild = new \\scfr\\main\\ambassade\\Guild($this->db);\n $first_reply = $event[\"topic_data\"][\"topic_first_post_id\"];\n $guild->__topic_init($event[\"row\"][\"topic_id\"]);\n\n //var_dump();\n\n $templates[\"GUILD_JSON\"] = json_encode(false);\n if($guild->is_registerd) {\n $templates[\"TOPIC_IS_REGISTERED_GUILD\"] = true;\n foreach($guild->RSI as $name => $val)\n $templates[\"GUILD_\".strtoupper($name)] = $val;\n\n $templates[\"GUILD_JSON\"] = json_encode($guild->RSI);\n }\n\n\n if($templates['GUILD_BACKGROUND']) $templates['CUSTOM_BACKGROUND'] = $templates['GUILD_BACKGROUND'];\n\n\n $templates[\"TOPIC_IS_GUILD\"] = true;\n $templates[\"GUILD_TOPIC_ID\"] = $event[\"topic_data\"][\"topic_id\"];\n\n $templates[\"S_REQUIRE_ANGULAR\"] = true;\n $this->template->assign_vars($templates);\n $this->topic_set_up = true;\n }\n }", "public function getTopic() {}", "function createThread(&$dbparams, &$contentitem, $forumid, &$status)\n\t{\n\t\ttry {\n\t\t\t//setup some variables\n\t\t\t$userid = $this->getThreadAuthor($dbparams, $contentitem);\n\t\t\t$db = JFusionFactory::getDatabase($this->getJname());\n\t\t\t$subject = trim(strip_tags($contentitem->title));\n\n\t\t\t//prepare the content body\n\t\t\t$text = $this->prepareFirstPostBody($dbparams, $contentitem);\n\n\t\t\t//the user information\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->select('username, username_clean, user_colour, user_permissions')\n\t\t\t\t->from('#__users')\n\t\t\t\t->where('user_id = ' . (int) $userid);\n\n\t\t\t$db->setQuery($query);\n\t\t\t$user = $db->loadObject();\n\n\t\t\tif ($dbparams->get('use_content_created_date', false)) {\n\t\t\t\t$timezone = JFusionFactory::getConfig()->get('offset');\n\t\t\t\t$timestamp = strtotime($contentitem->created);\n\t\t\t\t//undo Joomla timezone offset\n\t\t\t\t$timestamp += ($timezone * 3600);\n\t\t\t} else {\n\t\t\t\t$timestamp = time();\n\t\t\t}\n\n\t\t\t$topic = new stdClass();\n\t\t\t$topic->topic_poster = (int) $userid;\n\t\t\t$topic->topic_time = $timestamp;\n\t\t\t$topic->forum_id = $forumid;\n\t\t\t$topic->icon_id = false;\n\t\t\t$topic->topic_visibility = 1;\n\t\t\t$topic->topic_title = $subject;\n\t\t\t$topic->topic_first_poster_name\t= $user->username;\n\t\t\t$topic->topic_first_poster_colour = $user->user_colour;\n\t\t\t$topic->topic_type = 0;\n\t\t\t$topic->topic_time_limit = 0;\n\t\t\t$topic->topic_attachment = 0;\n\n\t\t\t$db->insertObject('#__topics', $topic, 'topic_id' );\n\n\t\t\t$bbcode = $this->helper->bbcode_parser($text);\n\n\t\t\t$post = new stdClass();\n\t\t\t$post->forum_id\t\t\t= (int) $forumid;\n\t\t\t$post->topic_id \t\t= (int) $topic->topic_id;\n\t\t\t$post->poster_id\t\t= (int) $userid;\n\t\t\t$post->icon_id\t\t\t= 0;\n\t\t\t$post->poster_ip\t\t= $_SERVER['REMOTE_ADDR'];\n\t\t\t$post->post_time\t\t= (int) $timestamp;\n\t\t\t$post->post_visibility\t= 1;\n\t\t\t$post->enable_bbcode\t= 1;\n\t\t\t$post->enable_smilies\t= 1;\n\t\t\t$post->enable_magic_url\t= 1;\n\t\t\t$post->enable_sig\t\t= 1;\n\t\t\t$post->post_username\t= $user->username;\n\t\t\t$post->post_subject\t\t= $subject;\n\t\t\t$post->post_text\t\t= $bbcode->text;\n\t\t\t$post->post_checksum\t= md5($bbcode->text);\n\t\t\t$post->post_attachment\t= 0;\n\t\t\t$post->bbcode_bitfield\t= $bbcode->bbcode_bitfield;\n\t\t\t$post->bbcode_uid\t\t= $bbcode->bbcode_uid;\n\t\t\t$post->post_postcount\t= 1;\n\t\t\t$post->post_edit_locked\t= 0;\n\n\t\t\t$db->insertObject('#__posts', $post, 'post_id');\n\n\t\t\t$topic->topic_first_post_id\t\t\t= $post->post_id;\n\t\t\t$topic->topic_last_post_id\t\t\t= $post->post_id;\n\t\t\t$topic->topic_last_post_time\t\t= (int) $timestamp;\n\t\t\t$topic->topic_last_poster_id\t\t= (int) $userid;\n\t\t\t$topic->topic_last_poster_name\t\t= $user->username;\n\t\t\t$topic->topic_last_poster_colour\t= $user->user_colour;\n\t\t\t$topic->topic_last_post_subject\t\t= (string) $subject;\n\t\t\t$topic->topic_posts_approved = 1;\n\n\t\t\t$db->updateObject('#__topics', $topic, 'topic_id' );\n\n\t\t\tif ($dbparams->get('use_content_created_date', false)) {\n\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t->select('forum_last_post_time')\n\t\t\t\t\t->from('#__forums')\n\t\t\t\t\t->where('forum_id = ' . (int) $forumid);\n\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$forum_last_post_time = $db->loadResult();\n\n\t\t\t\t//only update the last post for the topic if it really is newer\n\t\t\t\t$updateLastPost = ($timestamp > $forum_last_post_time) ? true : false;\n\t\t\t} else {\n\t\t\t\t$updateLastPost = true;\n\t\t\t}\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__forums');\n\n\t\t\tif($updateLastPost) {\n\t\t\t\t$query->set('forum_last_post_id = ' . $db->quote($post->post_id))\n\t\t\t\t\t->set('forum_last_post_subject = ' . $db->quote($subject))\n\t\t\t\t\t->set('forum_last_post_time = ' . (int) $timestamp)\n\t\t\t\t\t->set('forum_last_poster_id = ' . (int) $userid)\n\t\t\t\t\t->set('forum_last_poster_name = ' . $db->quote($user->username))\n\t\t\t\t\t->set('forum_last_poster_colour = ' . $db->quote($user->user_colour));\n\t\t\t}\n\n\t\t\t//update some stats\n\t\t\t$query->set('forum_posts_approved = forum_posts_approved + 1')\n\t\t\t\t->set('forum_topics_approved = forum_topics_approved + 1')\n\t\t\t\t->where('forum_id = ' . $db->quote($forumid));\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\t//update some stats\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__users')\n\t\t\t\t->set('user_posts = user_posts + 1')\n\t\t\t\t->where('user_id = ' . (int) $userid);\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__config')\n\t\t\t\t->set('config_value = config_value + 1')\n\t\t\t\t->where('config_name = ' . $db->quote('num_topics'));\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\tif(!empty($topic->topic_id) && !empty($post->post_id)) {\n\t\t\t\t//add information to update forum lookup\n\t\t\t\t$status['threadinfo']->forumid = $forumid;\n\t\t\t\t$status['threadinfo']->threadid = $topic->topic_id;\n\t\t\t\t$status['threadinfo']->postid = $post->post_id;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t$status['error'] = $e->getMessage();\n\t\t}\n\t}", "public function createLink() {\n\t\t$sql = \"INSERT INTO\twbb\".WBB_N.\"_thread\n\t\t\t\t\t(boardID, languageID, prefix, topic, time, userID, username, lastPostTime, \n\t\t\t\t\tlastPosterID, lastPoster, replies, views, ratings, rating, attachments,\n\t\t\t\t\tpolls, isAnnouncement, isSticky, isDisabled, everEnabled, isClosed, isDeleted,\n\t\t\t\t\tmovedThreadID, movedTime, deleteTime, deletedBy, deletedByID, deleteReason)\n\t\t\tVALUES\t\t(\".$this->boardID.\",\n\t\t\t\t\t\".$this->languageID.\",\n\t\t\t\t\t'\".escapeString($this->prefix).\"',\n\t\t\t\t\t'\".escapeString($this->topic).\"',\n\t\t\t\t\t\".$this->time.\",\n\t\t\t\t\t\".$this->userID.\",\n\t\t\t\t\t'\".escapeString($this->username).\"',\n\t\t\t\t\t\".$this->lastPostTime.\",\n\t\t\t\t\t\".$this->lastPosterID.\",\n\t\t\t\t\t'\".escapeString($this->lastPoster).\"',\n\t\t\t\t\t\".$this->replies.\",\n\t\t\t\t\t\".$this->views.\",\n\t\t\t\t\t\".$this->ratings.\",\n\t\t\t\t\t\".$this->rating.\",\n\t\t\t\t\t\".$this->attachments.\",\n\t\t\t\t\t\".$this->polls.\",\n\t\t\t\t\t\".$this->isAnnouncement.\",\n\t\t\t\t\t\".$this->isSticky.\",\n\t\t\t\t\t\".$this->isDisabled.\",\n\t\t\t\t\t\".$this->everEnabled.\",\n\t\t\t\t\t\".$this->isClosed.\",\n\t\t\t\t\t\".$this->isDeleted.\",\n\t\t\t\t\t\".$this->threadID.\",\n\t\t\t\t\t\".TIME_NOW.\",\n\t\t\t\t\t\".$this->deleteTime.\",\n\t\t\t\t\t'\".escapeString($this->deletedBy).\"',\n\t\t\t\t\t\".$this->deletedByID.\",\n\t\t\t\t\t'\".escapeString($this->deleteReason).\"')\";\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "public function testCreate()\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n //test creation as admin\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with admin');\n\n //test creation as user\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with user');\n\n\n\n }", "function create_post2($title,$body,$category,$keywords='',$fields)\n {\n $title = htmlentities($title,ENT_NOQUOTES,'UTF-8');\n //$keywords = htmlentities($keywords,ENT_NOQUOTES,'UTF-8');\n $content = array(\n 'post_title' => $title,\n 'post_content' => $body,\n 'post_status' => 'publish',\n //'post_type' => 'post' ,\n 'custom_fields' => $fields, \n 'terms_names'=>array( \"category\" => $category,\"post_tag\"=>$keywords )\n );\n\n $params = array(0,$this->UserName,$this->PassWord,$content);\n return $this->send_request('wp.newPost',$params);\n }", "public function run()\n\t{\n\t\tModel::unguard();\n\t\t$data = [\n\t\t\t'slug' => 'slug',\n\t\t\t'title' => 'title', \n\t\t\t'subject' => 'subject',\n\t\t\t'body' => 'body',\n\t\t\t'descriptions' => 'descriptions',\n\t\t];\n\n\t\t $this->emailtemplatemanagement->create($data);\n\t}", "function TopicCRUD()\n {\n parent::__construct();\n }", "public function create()\n\t{\n\n\t\t$post = $this->store('create', '/thread/new');\n\n\t\tredirect('/threads?id=' . $post->id);\n\t}", "public function create()\n {\n\n if(!empty($this->data)){\n\n if($this->Blog->save($this->data)){\n $this->Session->setFlash(__('Your blog has been created'), 'success');\n $this->redirect(\"/blogs/edit/{$this->Blog->id}\");\n }else{\n $this->Session->setFlash(__('There was a problem creating your blog'), 'error');\n }\n }\n\n $this->set('syntaxes', $this->Blog->listSyntaxTypes());\n $this->set('postAccesses', $this->Blog->listPostAccess());\n $this->set('title_for_layout', 'Create a Blog');\n\n\n }", "public function create_new()\n\t{\n\t\trequire_once(MODELS . '/Post.php');\n\t\t$model = new Post();\n\t\t$result = $model->create_new();\n\t\tif ($result){\n\t\t\theader('Location:/home');\n\t\t\tuser_msg('Post created successfully'); // <-- this doesn't work, why?\n\t\t}\n\t}", "public function create()\n {\n // handled by client\n }", "public function createAction(){\n \n $this->_form->customSubmitBtn = $this->xhr;\n $this->_form->build( $this->uri,\n $this->consumer_id,\n $this->user_id,\n $this->id);\n \n \n \n $this->result = Main_Forms_Handler::onPost($this->_form ,\n $this->post,\n $this->_model,\n \"createNote\",\n $this->params,\n $this->_helper,\n $this->indexAction . $this->consumer_id,\n \"Note created.\",\n $this->xhr); \n \n $this->_onSubmit();\n\n }", "public function testChannelsSetTopic()\n {\n }", "public function create()\n {\n\n $email_id = date('Y-m-d_H-i-s') . '.' . $this->template;\n $email_data = [\n 'title' => $this->template, \n 'data' => serialize($this->data), \n 'email' => $this->to,\n 'id' => $email_id,\n 'date' => date('Y-m-d H:i:s')\n ];\n\n Storage::putYAML('statamify/emails/' . $email_id, $email_data);\n\n }", "private function create() {\n $sql = \"INSERT INTO %s (\n version_time, version_author_id, version_message, topic_change_level,\n topic_id, topic_modified, topic_weight, topic_changefreq, topic_priority,\n meta_useparent, box_useparent, topic_mainlanguage, linktype_id, topic_protocol\n )\n SELECT\n '%d', '%s', '%s', '%d',\n topic_id, topic_modified, topic_weight, topic_changefreq, topic_priority,\n meta_useparent, box_useparent, topic_mainlanguage, linktype_id, topic_protocol\n FROM %s\n WHERE topic_id = '%d'\";\n $parameters = array(\n $this->databaseGetTableName($this->_tableName),\n isset($this->created) ? $this->created : time(),\n $this->owner,\n $this->message,\n isset($this->level) ? $this->level : -1,\n $this->databaseGetTableName(PapayaContentTables::PAGES),\n $this->pageId\n );\n if ($this->databaseQueryFmtWrite($sql, $parameters)) {\n $newId = $this->databaseLastInsertId(\n $this->databaseGetTableName($this->_tableName), 'version_id'\n );\n $sql = \"INSERT INTO %s (\n version_id, lng_id, version_published,\n topic_id, topic_title, topic_content, author_id,\n view_id, meta_title, meta_keywords, meta_descr\n )\n SELECT '%d', tt.lng_id, 0, tt.topic_id, tt.topic_title,\n tt.topic_content, tt.author_id,\n tt.view_id, tt.meta_title, tt.meta_keywords, tt.meta_descr\n FROM %s tt\n WHERE tt.topic_id = %d\";\n $parameters = array(\n $this->databaseGetTableName(PapayaContentTables::PAGE_VERSION_TRANSLATIONS),\n $newId,\n $this->databaseGetTableName(PapayaContentTables::PAGE_TRANSLATIONS),\n $this->pageId\n );\n $this->databaseQueryFmtWrite($sql, $parameters);\n return $newId;\n }\n return FALSE;\n }", "function Admin_Messages_admin_create($args)\n{\n // Get parameters from whatever input we need. All arguments to this\n // function should be obtained from pnVarCleanFromInput(), getting them\n // from other places such as the environment is not allowed, as that makes\n // assumptions that will not hold in future versions of PostNuke\n list($title,\n $content,\n $language,\n $active,\n $expire,\n $whocanview) = pnVarCleanFromInput('title',\n 'content',\n\t\t\t 'language',\n 'active',\n 'expire',\n 'whocanview');\n\n // Admin functions of this type can be called by other modules. If this\n // happens then the calling module will be able to pass in arguments to\n // this function through the $args parameter. Hence we extract these\n // arguments *after* we have obtained any form-based input through\n // pnVarCleanFromInput().\n extract($args);\n\n // Confirm authorisation code. This checks that the form had a valid\n // authorisation code attached to it. If it did not then the function will\n // proceed no further as it is possible that this is an attempt at sending\n // in false data to the system\n if (!pnSecConfirmAuthKey()) {\n pnSessionSetVar('errormsg', _BADAUTHKEY);\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n return true;\n }\n\n // Notable by its absence there is no security check here. This is because\n // the security check is carried out within the API function and as such we\n // do not duplicate the work here\n\n // The API function is called. Note that the name of the API function and\n // the name of this function are identical, this helps a lot when\n // programming more complex modules. The arguments to the function are\n // passed in as their own arguments array\n $mid = pnModAPIFunc('Admin_Messages',\n 'admin',\n 'create',\n array('title' => $title,\n 'content' => $content,\n\t\t\t 'language' => $language,\n\t\t\t 'active' => $active,\n\t\t\t 'expire' => $expire,\n\t\t\t 'whocanview' => $whocanview));\n\n // The return value of the function is checked here, and if the function\n // suceeded then an appropriate message is posted. Note that if the\n // function did not succeed then the API function should have already\n // posted a failure message so no action is required\n if ($mid != false) {\n // Success\n pnSessionSetVar('statusmsg', _ADMINMESSAGESCREATED);\n }\n\n // This function generated no output, and so now it is complete we redirect\n // the user to an appropriate page for them to carry on their work\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n\n // Return\n return true;\n}", "public function create($id1, $id2)\n {\n $topic = Topic::find($id1);\n $subtopic = Subtopic::find($id2);\n $action = 'create';\n return view('message', compact('topic','subtopic', 'action'));\n }", "public function postCreationSuccessful() {\n $this->setDisplayMessage(\"Posted new message.\");\n $this->redirect();\n die();\n }", "public function creating(Knowledgebase $article)\n {\n $article->slug = slugify(strtolower($article->subject));\n }", "public function vxTopicCreateInsert($board_id, $user_id, $tpc_title, $tpc_description, $tpc_content, $expense_amount) {\n\t\tif (get_magic_quotes_gpc()) {\n\t\t\t$tpc_title = stripslashes($tpc_title);\n\t\t\t$tpc_title = mysql_real_escape_string($tpc_title);\n\t\t\t\n\t\t\t$tpc_description = stripslashes($tpc_description);\n\t\t\t$tpc_description = mysql_real_escape_string($tpc_description);\n\t\t\t\n\t\t\t$tpc_content = stripslashes($tpc_content);\n\t\t\t$tpc_content = mysql_real_escape_string($tpc_content);\n\t\t} else {\n\t\t\t$tpc_title = mysql_real_escape_string($tpc_title);\n\t\t\t$tpc_description = mysql_real_escape_string($tpc_description);\n\t\t\t$tpc_content = mysql_real_escape_string($tpc_content);\n\t\t}\n\t\t$sql = \"INSERT INTO babel_topic(tpc_pid, tpc_uid, tpc_title, tpc_description, tpc_content, tpc_created, tpc_lastupdated, tpc_lasttouched) VALUES({$board_id}, {$user_id}, '{$tpc_title}', '{$tpc_description}', '{$tpc_content}', \" . time() . \", \" . time() . ', ' . time() . ')';\n\t\tmysql_query($sql, $this->db);\n\t\tif (mysql_affected_rows($this->db) == 1) {\n\t\t\treturn $this->User->vxPay($this->User->usr_id, $expense_amount, 2);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function processNewTopicForm($forumID, $data) {\n\t\tglobal $DB, $menuvar, $safs_config;\n\t\t\n\t\t// Dont escape since this method does that, double escape isn't fun\n\t\t// Insert Topic\n\t\t$insertArray = array('forum_id' => $forumID, 'user_id' => $_SESSION['userid'], 'topicicon_id' => $data['icon'], 'title' => $data['title'], 'datetimestamp' => time());\n\t\tif ($_SESSION['user_level'] == SYSTEM_ADMIN || $_SESSION['user_level'] == BOARD_ADMIN) $insertArray['type'] = $data['type'];\n\t\t\n\t\t$topicID = $DB->query_insert(\"topics\", $insertArray);\n\n\t\tif ($topicID) {\n\t\t\t// Insert Post\n\t\t\t$result = $DB->query_insert(\"posts\", array('topic_id' => $topicID, 'user_id' => $_SESSION['userid'], 'text' => $data['message'], 'datetimestamp' => time()));\n\t\n\t\t\t// Update forum post count\n\t\t\t$sql2 = \"UPDATE `\" . DBTABLEPREFIX . \"forums` SET posts = posts + 1 WHERE id = '\" . $forumID . \"'\";\n\t\t\t$result2 = $DB->query($sql2);\n\t\n\t\t\t// Update user post count\n\t\t\t$sql2 = \"UPDATE `\" . DBTABLEPREFIX . \"users` SET posts = posts + 1 WHERE id = '\" . $_SESSION['userid'] . \"'\";\n\t\t\t$result2 = $DB->query($sql2);\n\t\t}\n\t\t\n\t\t$returnVar = \"\n\t\t\t\t\t\t\t\t\t\t\t<h2 class=\\\"processFormTitle\\\">New Topic</h2>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\\\"processFormBlock \" . (($topicID) ? \"processFormSuccess\" : \"processFormFailed\") . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t\t\" . (($topicID) ? \"Your topic has been posted and you're being redirected to the thread.\" : \"There was an error posting your topic, you're being redirected to the thread.\") . \"\n\t\t\t\t\t\t\t\t\t\t\t\t<meta http-equiv=\\\"refresh\\\" content=\\\"3;url=\" . $menuvar['VIEWTOPIC'] . \"&id=\" . $topicID . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t</div>\";\n\t\t\n\t\t// Return the HTML\n\t\treturn $returnVar;\n\t}", "public function create()\n {\n $categories = Category::get()->toTree();\n\n return view('account.topics.create', ['categories' => $categories]);\n }", "public function createPost()\n {\n if ($this->issetPostSperglobal('title') &&\n $this->issetPostSperglobal('description') &&\n $this->issetPostSperglobal('content') &&\n $this->issetPostSperglobal('categorie') &&\n $this->issetPostSperglobal('publish'))\n {\n $empty_field = 0;\n foreach ($_POST as $key => $post) {\n if ($key !== 'publish' && empty(trim($post))) {\n $empty_field++;\n }\n }\n if ($empty_field === 0) {\n $User = $this->session->read('User');\n $this->posts_manager->create($_POST, $User->getIdUser());\n $this->session->writeFlash('success', \"L'article a été créé avec succès.\");\n $this->redirect('dashboard');\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont vides.\");\n }\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont manquants.\");\n }\n $_post = $this->getSpecificPost($_POST);\n $categories = $this->categories_manager->listAll();\n $this->render('admin_post', ['head'=>['title'=>'Création d\\'un article', 'meta_description'=>''], 'categories'=>$categories, '_post'=>isset($_post) ? $_post : ''], 'admin');\n }", "function add_topic($array, $redirect_to_topic = false) {\n global $db;\n if ($array == NULL)\n $array = $_POST;\n\n if (is_array($_FILES))\n $array = array_merge($array, $_FILES);\n\n $fields = $this->load_add_topic_form_fields($array);\n validate_cb_form($fields, $array);\n\n $user = userid();\n\n $gp_details = $this->get_group_details($array['group_id']);\n\n\n //Checking for weather user is allowed to post topics or not\n if (!$this->validate_posting_previlige($gp_details))\n return false;\n\n if (!error()) {\n foreach ($fields as $field) {\n $name = formObj::rmBrackets($field['name']);\n $val = $array[$name];\n\n if ($field['use_func_val'])\n $val = $field['validate_function']($val);\n\n\n if (!empty($field['db_field']))\n $query_field[] = $field['db_field'];\n\n if (is_array($val)) {\n $new_val = '';\n foreach ($val as $v) {\n $new_val .= \"#\" . $v . \"# \";\n }\n $val = $new_val;\n }\n\n if (!$field['clean_func'] || (!apply_func($field['clean_func'], $val) && !is_array($field['clean_func'])))\n $val = $val;\n else\n $val = apply_func($field['clean_func'], sql_free($val));\n\n if (empty($val) && !empty($field['default_value']))\n $val = $field['default_value'];\n\n if (!empty($field['db_field']))\n $query_val[] = $val;\n }\n }\n\n\n\n if (!error()) {\n //Adding Topic icon\n $query_field[] = \"topic_icon\";\n $query_val[] = $array['topic_icon'];\n //UID\n $query_field[] = \"userid\";\n $query_val[] = $user;\n //DATE ADDED\n $query_field[] = \"date_added\";\n $query_val[] = now();\n\n $query_field[] = \"last_post_time\";\n $query_val[] = now();\n\n //GID\n $query_field[] = \"group_id\";\n $query_val[] = $array['group_id'];\n\n //Checking If posting requires approval or not\n $query_field[] = \"approved\";\n if ($gp_details['post_type'] == 1)\n $query_val[] = \"no\";\n else\n $query_val[] = \"yes\";\n\n //Inserting IN Database now\n $db->insert(tbl($this->gp_topic_tbl), $query_field, $query_val);\n $insert_id = $db->insert_id();\n\n //Increasing Group Topic Counts\n $count_topics = $this->count_group_topics($array['group_id']);\n $db->update(tbl($this->gp_tbl), array(\"total_topics\"), array($count_topics), \" group_id='\" . $array['group_id'] . \"'\");\n\n //leaving msg\n e(lang(\"grp_tpc_msg\"), \"m\");\n\n //Redirecting to topic\n if ($redirect_to_topic) {\n $grp_details = $this->get_details($insert_id);\n redirect_to(group_link($grp_details));\n }\n\n return $insert_id;\n }\n }", "public function create($code, $topic_id)\n {\n return view('posts/post_create', ['code' => $code, 'topic_id' => $topic_id]);\n }", "public function create()\n {\n $title = 'Create Subscriber';\n $topics = Auth::user()->topics;\n return view('subscriber.create', compact('title','topics'));\n }", "function create_new_topic_index() {\n\t// Add new taxonomy\n $types = array('post','page','attachment','nav_menu_item', 'learning_resource');\n register_taxonomy('asn_topic_index', $types, array(\n 'hierarchical' => true,\n 'labels' => array(\n 'name' => _x( 'ASN Topic Index', 'taxonomy general name' ),\n 'singular_name' => _x( 'Topic', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Topics' ),\n 'all_items' => __( 'All Topics' ),\n 'parent_item' => __( 'Parent Topic' ),\n 'parent_item_colon' => __( 'Parent Topic:' ),\n 'edit_item' => __( 'Edit Topic' ),\n 'update_item' => __( 'Update Topic' ),\n 'add_new_item' => __( 'Add New Topic' ),\n 'new_item_name' => __( 'New Topic Name' ),\n 'menu_name' => __( 'Topic Index' ),\n ),\n //Slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'topic_index', \n 'with_front' => false,\n 'hierarchical' => true \n ),\n ));\n}", "function webnotik_register_topics_settings() {\n\tregister_setting( 'webnotik-topics-group', 'webnotik_main_topics' );\n}", "public function create()\n\t{\n\t\tlog::info('inside create method of user-notifications controller');\n\t}", "public function create()\n \t{\n \t\t$topicTitle = TopicOfTheDayTitle::all();\n \t\t$t = Tag::all();\n $tags = array();\n foreach($t as $tag)\n {\n $ts['text'] = '#'.$tag->name;\n $tags[] = $ts;\n }\n\n return response()->json(['tags' => $tags, 'topicTitle' => $topicTitle]);\n \t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "function create_post()\n {\n //Create the post with information submitted\n if(isset($_POST['note-text']) && !($_POST['note-text'] == \"\"))\n {\n $query = $this->pdo->prepare('INSERT INTO note (title, description, created_at, updated_at) VALUES(:title,:description, NOW(), NOW())');\n $query->execute(array(\n ':title' => $_POST['note-title'],\n ':description' => $_POST['note-text']\n ));\n }\n }", "public function testTopic() {\n\n $this->installEntitySchema('ebms_board');\n $this->installEntitySchema('taxonomy_term');\n $this->installEntitySchema('ebms_topic');\n $this->installEntitySchema('user');\n $this->installSchema('system', ['sequences']);\n $entity_type_manager = $this->container->get('entity_type.manager');\n $topics = $entity_type_manager->getStorage('ebms_topic')->loadMultiple();\n $this->assertEmpty($topics);\n $name = 'Toenail Cancer';\n $board = Board::create(['name' => 'Test Board']);\n $board->save();\n $group_id = 135;\n $group_name = 'Lower Extremities';\n $topic_group = Term::create([\n 'tid' => $group_id,\n 'vid' => 'topic_groups',\n 'name' => $group_name,\n ]);\n $topic_group->save();\n $nci_reviewer = $this->createUser();\n $topic = Topic::create([\n 'name' => $name,\n 'board' => $board->id(),\n 'nci_reviewer' => $nci_reviewer,\n 'topic_group' => $topic_group->id(),\n 'active' => TRUE,\n ]);\n $topic->save();\n $topics = $entity_type_manager->getStorage('ebms_topic')->loadMultiple();\n $this->assertNotEmpty($topics);\n $this->assertCount(1, $topics);\n foreach ($topics as $topic) {\n $this->assertEquals($topic->getName(), $name);\n $this->assertEquals(TRUE, $topic->get('active')->value);\n $this->assertEquals($board->id(), $topic->get('board')->target_id);\n $this->assertEquals($nci_reviewer->id(), $topic->get('nci_reviewer')->target_id);\n $this->assertEquals($group_id, $topic->get('topic_group')->target_id);\n }\n }", "function target_add_topic_subscription($sub)\n{\n\tif ($sub['user_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$sub['user_id'] = $GLOBALS['hack_id'];\n\t}\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread_notify (user_id, thread_id) VALUES('. (int)$sub['user_id'] .', '. (int)$sub['topic_id'] .')');\n}", "public function create()\n\t{\n\t\t\n\t\t//\n\t}", "public function CreateBoard() {\n\t\t\n\t\t$data = array(\n\t\t 'Board' => $this->getBoard(),\n\t\t 'Description' => $this->getDescription(),\n\t\t 'type' => $this->getType(),\n\t\t 'Category' => $this->getCategory(),\n\t\t 'Smiles' => $this->getSmiles(),\n\t\t 'BBcode' => $this->getBbCode(),\n\t\t 'Post_Increment' => $this->getPostIncrement(),\n\t\t 'Image' => $this->getImage(),\n\t\t 'B_Order' => $this->getMaxBOrder($this->getCategory())\n\t\t);\n\n\t\t#add new topic.\n\t\t$this->db->insert('ebb_boards', $data);\n\t\t\n\t\t//get board id\n\t\treturn $this->db->insert_id();\n\t}", "public function forumCreate($topic_id)\n {\n return view('posts/post_create', ['topic_id' => $topic_id, 'isForum' => 1]);\n }", "public function createFromTopicRequest(TopicRequest $req): Topic\n {\n $topic = new Topic();\n $topic->setName($req->name)\n ->setAlias($req->alias)\n ->setStatus($req->status)\n ->setUser($req->user)\n ->setCategory($req->category)\n ->setContent($req->content)\n ->setImage($req->image)\n ->setSummary($req->summary)\n ->setWritingDate($req->writingDate);\n\n return $topic;\n }", "public function create() {\n\t\t\t//\n\t\t}", "function CloneTopic()\n{\n\tglobal $txt, $board, $topic, $user_info, $context, $language, $scripturl, $settings, $smcFunc, $modSettings;\n\n\tif (empty($topic))\n\t\tfatal_lang_error('no_access', false);\n\n\t$request = $smcFunc['db_query']('', '\n\t\tSELECT t.id_member_started, ms.subject, t.approved\n\t\tFROM {db_prefix}topics AS t\n\t\t\tINNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)\n\t\tWHERE t.id_topic = {int:current_topic}\n\t\tLIMIT 1',\n\t\tarray(\n\t\t\t'current_topic' => $topic,\n\t\t)\n\t);\n\tlist ($id_member_started, $context['subject'], $context['is_approved']) = $smcFunc['db_fetch_row']($request);\n\t$smcFunc['db_free_result']($request);\n\n\t// Can they see it - if not approved?\n\tif ($modSettings['postmod_active'] && !$context['is_approved'])\n\t\tisAllowedTo('approve_posts');\n\n\t// Permission check!\n\t// !!!\n\tif (!allowedTo('clone_any'))\n\t{\n\t\tif ($id_member_started == $user_info['id'])\n\t\t\tisAllowedTo('clone_own');\n\t\telse\n\t\t\tisAllowedTo('clone_any');\n\t}\n\n\tloadTemplate('CloneTopic');\n\n\t// Get a list of boards this moderator can move to.\n\t$request = $smcFunc['db_query']('order_by_board_order', '\n\t\tSELECT b.id_board, b.name, b.child_level, c.name AS cat_name, c.id_cat\n\t\tFROM {db_prefix}boards AS b\n\t\t\tLEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)\n\t\tWHERE {query_see_board}\n\t\t\tAND b.redirect = {string:blank_redirect}\n\t\t\tAND b.id_board != {int:current_board}',\n\t\tarray(\n\t\t\t'blank_redirect' => '',\n\t\t\t'current_board' => $board,\n\t\t)\n\t);\n\t$context['boards'] = array();\n\twhile ($row = $smcFunc['db_fetch_assoc']($request))\n\t{\n\t\tif (!isset($context['categories'][$row['id_cat']]))\n\t\t\t$context['categories'][$row['id_cat']] = array (\n\t\t\t\t'name' => strip_tags($row['cat_name']),\n\t\t\t\t'boards' => array(),\n\t\t\t);\n\n\t\t$context['categories'][$row['id_cat']]['boards'][] = array(\n\t\t\t'id' => $row['id_board'],\n\t\t\t'name' => strip_tags($row['name']),\n\t\t\t'category' => strip_tags($row['cat_name']),\n\t\t\t'child_level' => $row['child_level'],\n\t\t\t'selected' => !empty($_SESSION['move_to_topic']) && $_SESSION['move_to_topic'] == $row['id_board'] && $row['id_board'] != $board,\n\t\t);\n\t}\n\t$smcFunc['db_free_result']($request);\n\n\tif (empty($context['categories']))\n\t\tfatal_lang_error('moveto_noboards', false);\n\n\t$context['page_title'] = $txt['clone_topic'];\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?topic=' . $topic . '.0',\n\t\t'name' => $context['subject'],\n\t\t'extra_before' => $settings['linktree_inline'] ? $txt['topic'] . ': ' : '',\n\t);\n\n\t$context['linktree'][] = array(\n\t\t'name' => $txt['clone_topic'],\n\t);\n\n\t$context['back_to_topic'] = isset($_REQUEST['goback']);\n\n\t// Register this form and get a sequence number in $context.\n\tcheckSubmitOnce('register');\n\n\t$context['topic_clones'] = false;\n\n\t// Get current clones\n\t$request = $smcFunc['db_query']('', '\n\t\tSELECT c.id_board AS id, b.name\n\t\tFROM {db_prefix}topic_clones AS c\n\t\t\tLEFT JOIN {db_prefix}boards AS b ON (b.id_board = c.id_board)\n\t\tWHERE c.id_topic = {int:current_topic}',\n\t\tarray('current_topic' => $topic)\n\t);\n\twhile ($row = $smcFunc['db_fetch_assoc']($request)) {\n\t\t$context['topic_clones'][$row['id']] = array(\n\t\t\t'id' => $row['id'],\n\t\t\t'name' => $row['name']\n\t\t);\n\t}\n\t$smcFunc['db_free_result']($request);\n}", "public function create() {\n\t \n }", "public function __construct($topic, $push_message, $title, $data, $user, $settings, $type)\n\t{\n\t\t$this->topic = $topic;\n\t\t$this->push_message = $push_message;\n\t\t$this->title = $title;\n\t\t$this->data = $data;\n\t\t$this->user = $user;\n\t\t$this->settings = $settings;\n\t\t$this->type = $type;\n\t}", "public function create()\n\t{ \n \n\t}", "public function create()\n {\n // if it's a GET request display a blank form for creating a new product\n // else it's a POST so add to the database and redirect to readAll action\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n show_view('views/admin/bodyparts/create.php');\n } else {\n $part = filter_input(INPUT_POST, 'part', FILTER_SANITIZE_SPECIAL_CHARS);\n BodyPart::create($part);\n redirect('body_parts', 'readAll');\n }\n }", "protected function getNotification_Type_TopicService()\n {\n $instance = new \\phpbb\\notification\\type\\topic(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['language']) ? $this->services['language'] : $this->getLanguageService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \\phpbb\\auth\\auth())) && false ?: '_'}, './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader(${($_ = isset($this->services['user_loader']) ? $this->services['user_loader'] : $this->getUserLoaderService()) && false ?: '_'});\n $instance->set_config(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'});\n\n return $instance;\n }", "function ccontent_create()\n\t{\n\t\tlusers_require('content/create');\n\n\t\t$post_data = linput_post();\n\t\t$post_data['time'] = date('Y-m-d', strtotime($post_data['date'])) . ' ' . date('H:i:s', strtotime($post_data['time']));\n\n\t\tif (hform_validate(array('name', 'link', 'body')))\n\t\t{\n\t\t\t$content_created = mcontent_create($post_data);\n\t\t\t$cat_created = mcategories_create($post_data);\n\n\t\t\tif ($content_created && $cat_created)\n\t\t\t{\n\t\t\t\tlimage_upload_many(lconf_get('content', 'images'), $post_data['link']);\n\t\t\t\tlcache_delete_all();\n\t\t\t\thmessage_set(l('Content successfully created.'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($content_created) mcontent_delete($post_data['link']);\n\t\t\t\tif ($cat_created) mcategories_delete($post_data['link']);\n\t\t\t\thmessage_set(l('Content create error.') . ' ' . l('Link already in use.'));\n\t\t\t}\n\n\t\t\tluri_redirect('main/user/admin/content');\n\t\t}\n\t\telse luri_redirect('main/user/admin/content_create', l('All fields marked with * are required.'));\n\t}" ]
[ "0.6828663", "0.68250346", "0.6725831", "0.66038287", "0.6531424", "0.6470523", "0.6449085", "0.64423406", "0.6397481", "0.63533056", "0.6300511", "0.6279599", "0.62673575", "0.62354296", "0.6209599", "0.62063545", "0.6178266", "0.6175403", "0.6158153", "0.61051166", "0.6100871", "0.6092085", "0.6082312", "0.60724556", "0.60674655", "0.6057229", "0.6056739", "0.605358", "0.6017008", "0.5972307", "0.5928679", "0.5926914", "0.59244096", "0.59140414", "0.5867776", "0.58644855", "0.5857687", "0.58522993", "0.58460444", "0.584433", "0.58412546", "0.5810352", "0.57938284", "0.5791286", "0.57881594", "0.5785093", "0.5784997", "0.5773306", "0.57492054", "0.573042", "0.5724826", "0.56980246", "0.5678395", "0.5664897", "0.5661091", "0.5647234", "0.56399035", "0.5630807", "0.5628849", "0.56152976", "0.56091684", "0.56056744", "0.55976105", "0.55925924", "0.5578051", "0.55776083", "0.5564621", "0.5560567", "0.5556179", "0.55455184", "0.55434734", "0.55429596", "0.5542295", "0.5540619", "0.5540619", "0.5540619", "0.5540619", "0.5540619", "0.5540619", "0.5540619", "0.5540619", "0.5540619", "0.5540619", "0.5540619", "0.5540619", "0.5513852", "0.55125237", "0.55120736", "0.55053735", "0.550281", "0.54982936", "0.54956335", "0.5494328", "0.5493035", "0.548674", "0.5483454", "0.54724824", "0.54698646", "0.54673016", "0.5465006" ]
0.56690097
53
Handler for bbPress 2.x topic removal.
public function notify_forum_remove_topic( $topic_id ) { $this->notify_forum_topic_payload( 'remove-topic', $topic_id ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delTopic()\n{\n global $xoopsDB, $xoopsModule;\n if (!isset($_POST['ok'])) {\n xoops_cp_header();\n echo \"<h4>\" . _AM_CONFIG . \"</h4>\";\n $xt = new XoopsTopic( $xoopsDB->prefix(\"topics\"), intval($_GET['topic_id']));\n xoops_confirm(array( 'op' => 'delTopic', 'topic_id' => intval($_GET['topic_id']), 'ok' => 1), 'index.php', _AM_WAYSYWTDTTAL . '<br />' . $xt->topic_title('S'));\n } else {\n $xt = new XoopsTopic($xoopsDB->prefix(\"topics\"), intval($_POST['topic_id']));\n // get all subtopics under the specified topic\n $topic_arr = $xt->getAllChildTopics();\n array_push( $topic_arr, $xt );\n foreach( $topic_arr as $eachtopic ) {\n // get all stories in each topic\n $story_arr = NewsStory :: getByTopic( $eachtopic -> topic_id() );\n foreach( $story_arr as $eachstory ) {\n if (false != $eachstory->delete()) {\n xoops_comment_delete( $xoopsModule -> getVar( 'mid' ), $eachstory -> storyid() );\n xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'story', $eachstory->storyid());\n }\n }\n // all stories for each topic is deleted, now delete the topic data\n $eachtopic -> delete();\n // Delete also the notifications and permissions\n xoops_notification_deletebyitem( $xoopsModule -> getVar( 'mid' ), 'category', $eachtopic -> topic_id );\n\t\t\txoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'news_approve', $eachtopic -> topic_id);\n\t\t\txoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'news_submit', $eachtopic -> topic_id);\n\t\t\txoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'news_view', $eachtopic -> topic_id);\n }\n updateCache();\n redirect_header( 'index.php?op=topicsmanager', 1, _AM_DBUPDATED );\n exit();\n }\n}", "public function unregister(Topic $topic);", "private function deleteGroupTopic()\n {\n try\n {\n $request = $_REQUEST;\n\n if(!isset($request['topic_id']) || $request['topic_id']==\"\" )\n throw_error_msg('provide topic id');\n else if(!is_numeric($request['topic_id'])) \n throw_error_msg('invalid topic id'); \n else\n $tid = (int)$request['topic_id'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $cbgroup->delete_topic($tid);\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'group topic deleted', \"data\" => array());\n $this->response($this->json($data));\n }\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function hard_delete()\n\t{\n\t\tif (!$this->topic->topic_posts)\n\t\t{\n\t\t\tif (!$this->topic->load($this->topic_id))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Update the postcount for the topic\n\t\t$this->update_topic_postcount(true);\n\n\t\t// Set the visibility appropriately if no posts are visibile to the public/authors\n\t\t$flags = count::get_flags(access::PUBLIC_LEVEL);\n\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t{\n\t\t\t// There are no posts visible to the public, change it to authors level access\n\t\t\t$this->topic->topic_access = access::AUTHOR_LEVEL;\n\n\t\t\t$flags = count::get_flags(access::AUTHOR_LEVEL);\n\t\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t\t{\n\t\t\t\t// There are no posts visible to authors, change it to teams level access\n\t\t\t\t$this->topic->topic_access = access::TEAM_LEVEL;\n\t\t\t}\n\t\t}\n\n\t\t// Sync the first topic post if required\n\t\tif ($this->post_id == $this->topic->topic_first_post_id)\n\t\t{\n\t\t\t$this->topic->sync_first_post($this->post_id);\n\t\t}\n\n\t\t// Sync the last topic post if required\n\t\tif ($this->post_id == $this->topic->topic_last_post_id)\n\t\t{\n\t\t\t$this->topic->sync_last_post($this->post_id);\n\t\t}\n\n\t\t// Submit the topic to store the updated information\n\t\t$this->topic->submit();\n\n\t\t// Remove from the search index\n\t\t$this->search_manager->delete($this->post_type, $this->post_id);\n\n\t\t// @todo remove attachments and other things\n\n\t\t// Remove any attention items\n\t\t$sql = 'DELETE FROM ' . TITANIA_ATTENTION_TABLE . '\n\t\t\tWHERE attention_object_type = ' . ext::TITANIA_POST . '\n\t\t\t\tAND attention_object_id = ' . $this->post_id;\n\t\tphpbb::$db->sql_query($sql);\n\n\t\t// Decrement the user's postcount if we must\n\t\tif (!$this->post_deleted && $this->post_approved && in_array($this->post_type, titania::$config->increment_postcount))\n\t\t{\n\t\t\tphpbb::update_user_postcount($this->post_user_id, '-');\n\t\t}\n\n\t\t$this->forum_queue_hard_delete();\n\n\t\t// Initiate self-destruct mode\n\t\tparent::delete();\n\n\t\t// Update topics posted table\n\t\t$this->topic->update_posted_status('remove', $this->post_user_id);\n\n\t\t// Check if the topic is empty\n\t\t$flags = count::get_flags(access::TEAM_LEVEL, true, true);\n\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t{\n\t\t\t$this->topic->delete();\n\t\t}\n\t}", "function MaintainRemoveOldPosts()\n{\n\t// Actually do what we're told!\n\tloadSource('RemoveTopic');\n\tRemoveOldTopics2();\n}", "public function destroy(Topic $topic)\n {\n //\n }", "public function destroy(Topic $topic)\n {\n //\n }", "function delete_topic($tid) {\n global $db;\n $topic = $this->get_topic_details($tid);\n $group = $this->get_group_details($topic['group_id']);\n if (!$topic)\n e(lang(\"grp_tpc_err4\"));\n elseif (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $topic['userid'] && userid() != $group['userid'])\n e(lang(\"you_cant_del_topic\"));\n else {\n $db->delete(tbl($this->gp_topic_tbl), array(\"topic_id\", \"group_id\"), array($tid, $topic['group_id']));\n //Deleting Topic Posts\n $this->delete_comments($tid);\n\n //Counting Total Topics\n $count_topics = $this->count_topics($topic['group_id']);\n\n //Updating Total Number\n $db->update(tbl($this->gp_tbl), array('total_topics'), array($count_topics), \" group_id = '\" . $topic['group_id'] . \"'\");\n\n e(lang(\"grp_tpc_msg1\"), \"m\");\n }\n }", "function undelete_topics()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->undelete['t']))\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'topic_deleted'\t\t\t=> 0,\r\n\t\t\t\t'topic_deleted_time'\t=> 0,\r\n\t\t\t);\r\n\r\n\t\t\t$to_update = array();\r\n\t\t\tforeach ($this->undelete['t'] as $id)\r\n\t\t\t{\r\n\t\t\t\tif (array_key_exists($id, $this->shadow_topic_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$to_update[] = $this->shadow_topic_ids[$id];\r\n\t\t\t\t\t$this->topic_data[$this->shadow_topic_ids[$id]] = array_merge($this->topic_data[$this->shadow_topic_ids[$id]], $sql_data);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$to_update[] = $id;\r\n\t\t\t\t$this->topic_data[$id] = array_merge($this->topic_data[$id], $sql_data);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\t\tWHERE ' . $db->sql_in_set('topic_id', $to_update);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\tforeach ($to_update as $id)\r\n\t\t\t{\r\n\t\t\t\t$this->update_first_post_topic($id);\r\n\t\t\t\t$this->update_last_post_topic($id);\r\n\r\n\t\t\t\t// If the topic is a global announcement, do not attempt to do any updates to forums\r\n\t\t\t\tif ($this->topic_data[$id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->forum_data[$this->topic_data[$id]['forum_id']]['forum_deleted_topic_count'] > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\t\tSET forum_deleted_topic_count = forum_deleted_topic_count - 1\r\n\t\t\t\t\t\t\t\tWHERE forum_id = ' . intval($this->topic_data[$id]['forum_id']);\r\n\t\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t\t$this->forum_data[$this->topic_data[$id]['forum_id']]['forum_deleted_topic_count']--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->update_board_stats();\r\n\t\t$this->update_user_stats();\r\n\t}", "function deleteThemengebietes() {\n\t\t$status = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_topic_detail', 'uid='.intval(t3lib_div::_POST('uid')));\n\t\treturn $status;\n\t}", "function processDeleteTopic($topicID) {\n\t\tglobal $DB, $menuvar, $safs_config;\n\t\t$numOfPosts = 0;\n\t\t$forumID = getForumIDByTopicID($topicID);\n\t\t\n\t\t// Pull the posts in this topic, delete them and update our counts\n\t\t$sql = \"SELECT id, user_id FROM `\" . DBTABLEPREFIX . \"posts` WHERE topic_id = '\" . $topicID . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\tif ($result && $DB->num_rows() > 0) {\n\t\t\twhile ($row = $DB->fetch_array($result)) {\n\t\t\t\t// Delete the post\n\t\t\t\t$sql2 = \"DELETE FROM `\" . DBTABLEPREFIX . \"posts` WHERE id = '\" . $row['id'] . \"'\";\n\t\t\t\t$result2 = $DB->query($sql2);\n\t\t\t\t\n\t\t\t\t// Update user post count\n\t\t\t\t$sql2 = \"UPDATE `\" . USERSDBTABLEPREFIX . \"users` SET posts = posts - 1 WHERE id = '\" . $row['user_id'] . \"'\";\n\t\t\t\t$result2 = $DB->query($sql2);\n\t\t\t\t\n\t\t\t\t$numOfPosts++;\n\t\t\t}\t\t\n\t\t\t$DB->free_result($result);\n\t\t}\n\t\t\n\t\t// Update forum post count\n\t\t$sql = \"UPDATE `\" . DBTABLEPREFIX . \"forums` SET posts = posts - \" . $numOfPosts . \" WHERE id = '\" . $forumID . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t// Delete the topic\n\t\t$sql = \"DELETE FROM `\" . DBTABLEPREFIX . \"topics` WHERE id = '\" . $topicID . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t$returnVar = \"\n\t\t\t\t\t\t\t\t\t\t\t<h2 class=\\\"processFormTitle\\\">Delete Topic</h2>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\\\"processFormBlock \" . (($result) ? \"processFormSuccess\" : \"processFormFailed\") . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t\t\" . (($result) ? \"Your topic has been deleted and you're being redirected to the forum.\" : \"There was an error deleting your topic, you're being redirected to the forum.\") . \"\n\t\t\t\t\t\t\t\t\t\t\t\t<meta http-equiv=\\\"refresh\\\" content=\\\"3;url=\" . $menuvar['VIEWFORUM'] . \"&id=\" . $forumID . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t</div>\";\n\t\t\n\t\t// Return the HTML\n\t\treturn $returnVar;\n\t}", "static function deleteTopic($topicID)\n {\n $connection = new Connection();\n $connection->prepareQuery(\n \"DELETE FROM TOPICS WHERE Id = $topicID\");\n $result = $connection->executeQueryDML();\n $connection = NULL;\n }", "function soft_delete_topics()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->soft_delete['t']))\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'topic_deleted'\t\t\t=> $user->data['user_id'],\r\n\t\t\t\t'topic_deleted_time'\t=> time(),\r\n\t\t\t);\r\n\r\n\t\t\t$to_update = array();\r\n\t\t\tforeach ($this->soft_delete['t'] as $id)\r\n\t\t\t{\r\n\t\t\t\tif (array_key_exists($id, $this->shadow_topic_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$to_update[] = $this->shadow_topic_ids[$id];\r\n\t\t\t\t\t$this->topic_data[$this->shadow_topic_ids[$id]] = array_merge($this->topic_data[$this->shadow_topic_ids[$id]], $sql_data);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$to_update[] = $id;\r\n\t\t\t\t$this->topic_data[$id] = array_merge($this->topic_data[$id], $sql_data);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\t\tWHERE ' . $db->sql_in_set('topic_id', $to_update);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\tforeach ($to_update as $id)\r\n\t\t\t{\r\n\t\t\t\t// If the topic is a global announcement, do not attempt to do any updates to forums\r\n\t\t\t\tif ($this->topic_data[$id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\tSET forum_deleted_topic_count = forum_deleted_topic_count + 1\r\n\t\t\t\t\t\t\tWHERE forum_id = ' . intval($this->topic_data[$id]['forum_id']);\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t$this->forum_data[$this->topic_data[$id]['forum_id']]['forum_deleted_topic_count']++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->update_board_stats();\r\n\t\t$this->update_user_stats();\r\n\t}", "public static function delete_topic( $id ) {\n\n\t\t\tglobal $wpdb;\n\n\n\n\t\t\t$wpdb->update(\n\n\t\t\t\t\"{$wpdb->prefix}js_topics\",\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'is_active' => false\n\n\t\t\t\t),\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'topic_id' => $id\n\n\t\t\t\t)\n\n\t\t\t);\n\n\n\n\t\t\t$wpdb->delete(\n\n\t\t\t\t\"{$wpdb->prefix}js_topic_subjects\",\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'topic_id' => $id\n\n\t\t\t\t) \n\n\t\t\t);\n\n\t\t}", "public function delete_topic($topic_id) {\n\n $topic = Topic::find($topic_id);\n $topic->delete();\n //delete all the messages assigend to this topic\n Message::where('topic_id', $topic_id)->delete();\n\n return response()->json('Topic Deleted', 200);\n }", "public function deleteTopic(Request $request){\n if($user = Auth::user()) {\n // check if user is admin\n $is_admin = Auth::user()->is_admin;\n \n if ( $is_admin == 1 ){\n\n if ( $request->topic_id != 0){\n\n $topicID = $request->topic_id;\n if(Topic::where('id', $topicID)->exists()) {\n $topic = Topic::find($topicID);\n $topic->delete();\n \n return response()->json([\n \"message\" => \"topic deleted\"\n ], 202);\n } else {\n return response()->json([\n \"message\" => \"Topic not found\"\n ], 404);\n }\n\n }\n }else{\n return response()->json([\n \"message\" => \"you dont have permissions\"\n ], 400);\n }\n }else{\n return response()->json([\n \"message\" => \"you dont have permissions\"\n ], 400);\n }\n }", "function UnreadTopics()\n{\n\tglobal $board, $txt, $scripturl, $db_prefix, $sourcedir;\n\tglobal $ID_MEMBER, $user_info, $context, $modSettings;\n\n\t// Guests can't have unread things, we don't know anything about them.\n\tis_not_guest();\n\n\t$context['sub_template'] = $_REQUEST['action'] == 'unread' ? 'unread' : 'replies';\n\t$context['showing_all_topics'] = isset($_GET['all']);\n\tif ($_REQUEST['action'] == 'unread')\n\t\t$context['page_title'] = $context['showing_all_topics'] ? $txt['unread_topics_all'] : $txt['unread_topics_visit'];\n\telse\n\t\t$context['page_title'] = $txt['unread_replies'];\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?action=' . $_REQUEST['action'] . ($context['showing_all_topics'] ? ';all' : ''),\n\t\t'name' => $context['page_title']\n\t);\n\n\tloadTemplate('Recent');\n\n\t$is_topics = $_REQUEST['action'] == 'unread';\n\n\t// Are we specifying any specific board?\n\tif (!empty($board))\n\t\t$query_this_board = 'b.ID_BOARD = ' . $board;\n\telse\n\t{\n\t\t$query_this_board = $user_info['query_see_board'];\n\n\t\t// Don't bother to show deleted posts!\n\t\tif (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)\n\t\t\t$query_this_board .= '\n\t\t\t\tAND b.ID_BOARD != ' . $modSettings['recycle_board'];\n\t}\n\n\t// This part is the same for each query.\n\t$select_clause = '\n\t\t\t\tms.subject AS firstSubject, ms.posterTime AS firstPosterTime, ms.ID_TOPIC, t.ID_BOARD, b.name AS bname,\n\t\t\t\tt.numReplies, t.numViews, ms.ID_MEMBER AS ID_FIRST_MEMBER, ml.ID_MEMBER AS ID_LAST_MEMBER,\n\t\t\t\tml.posterTime AS lastPosterTime, IFNULL(mems.realName, ms.posterName) AS firstPosterName,\n\t\t\t\tIFNULL(meml.realName, ml.posterName) AS lastPosterName, ml.subject AS lastSubject,\n\t\t\t\tml.icon AS lastIcon, ms.icon AS firstIcon, t.ID_POLL, t.isSticky, t.locked, ml.modifiedTime AS lastModifiedTime,\n\t\t\t\tIFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) AS isRead, LEFT(ml.body, 384) AS lastBody, LEFT(ms.body, 384) AS firstBody,\n\t\t\t\tml.smileysEnabled AS lastSmileys, ms.smileysEnabled AS firstSmileys, t.ID_FIRST_MSG, t.ID_LAST_MSG';\n\n\tif ($context['showing_all_topics'] || !$is_topics)\n\t{\n\t\tif (!empty($board))\n\t\t{\n\t\t\t$request = db_query(\"\n\t\t\t\tSELECT MIN(logTime)\n\t\t\t\tFROM {$db_prefix}log_mark_read\n\t\t\t\tWHERE ID_MEMBER = $ID_MEMBER\n\t\t\t\t\tAND ID_BOARD = $board\", __FILE__, __LINE__);\n\t\t\tlist ($earliest_time) = mysql_fetch_row($request);\n\t\t\tmysql_free_result($request);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$request = db_query(\"\n\t\t\t\tSELECT MIN(lmr.logTime)\n\t\t\t\tFROM {$db_prefix}boards AS b\n\t\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_MEMBER = $ID_MEMBER AND lmr.ID_BOARD = b.ID_BOARD)\n\t\t\t\tWHERE $user_info[query_see_board]\", __FILE__, __LINE__);\n\t\t\tlist ($earliest_time) = mysql_fetch_row($request);\n\t\t\tmysql_free_result($request);\n\t\t}\n\n\t\t$request = db_query(\"\n\t\t\tSELECT MIN(logTime)\n\t\t\tFROM {$db_prefix}log_topics\n\t\t\tWHERE ID_MEMBER = $ID_MEMBER\", __FILE__, __LINE__);\n\t\tlist ($earliest_time2) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\tif ($earliest_time2 < $earliest_time)\n\t\t\t$earliest_time = (int) $earliest_time2;\n\t\telse\n\t\t\t$earliest_time = (int) $earliest_time;\n\t}\n\n\tif ($is_topics)\n\t{\n\t\t$request = db_query(\"\n\t\t\tSELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)\n\t\t\tFROM {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\" . ($context['showing_all_topics'] ? \"\n\t\t\t\tAND ml.posterTime >= $earliest_time\" : \"\n\t\t\t\tAND t.ID_LAST_MSG > $_SESSION[ID_MSG_LAST_VISIT]\") . \"\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\", __FILE__, __LINE__);\n\t\tlist ($num_topics, $min_message) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\t// Make sure the starting place makes sense and construct the page index.\n\t\t$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'] . ($context['showing_all_topics'] ? ';all' : ''), $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);\n\t\t$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];\n\n\t\tif ($num_topics == 0)\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t\t$min_message = (int) $min_message;\n\n\t\t$request = db_query(\"\n\t\t\tSELECT $select_clause\n\t\t\tFROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}members AS mems ON (mems.ID_MEMBER = ms.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_TOPIC = ms.ID_TOPIC\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND ms.ID_MSG = t.ID_FIRST_MSG\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND t.ID_LAST_MSG >= $min_message\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT $_REQUEST[start], $modSettings[defaultMaxTopics]\", __FILE__, __LINE__);\n\t}\n\telse\n\t{\n\t\t$request = db_query(\"\n\t\t\tSELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)\n\t\t\tFROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_MEMBER_UPDATED != $ID_MEMBER\n\t\t\t\tAND m.ID_TOPIC = t.ID_TOPIC\n\t\t\t\tAND m.ID_MEMBER = $ID_MEMBER\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND ml.posterTime >= $earliest_time\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\", __FILE__, __LINE__);\n\t\tlist ($num_topics, $min_message) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\t// Make sure the starting place makes sense and construct the page index.\n\t\t$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'], $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);\n\t\t$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];\n\n\t\tif ($num_topics == 0)\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t\t$min_message = (int) $min_message;\n\n\t\t$request = db_query(\"\n\t\t\tSELECT DISTINCT t.ID_TOPIC\n\t\t\tFROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE ml.ID_MEMBER != $ID_MEMBER\n\t\t\t\tAND m.ID_TOPIC = t.ID_TOPIC\n\t\t\t\tAND m.ID_MEMBER = $ID_MEMBER\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND t.ID_LAST_MSG >= $min_message\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT $_REQUEST[start], $modSettings[defaultMaxTopics]\", __FILE__, __LINE__);\n\t\t$topics = array();\n\t\twhile ($row = mysql_fetch_assoc($request))\n\t\t\t$topics[] = $row['ID_TOPIC'];\n\t\tmysql_free_result($request);\n\n\t\t// Sanity... where have you gone?\n\t\tif (empty($topics))\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\n\t\t$request = db_query(\"\n\t\t\tSELECT $select_clause\n\t\t\tFROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}members AS mems ON (mems.ID_MEMBER = ms.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_TOPIC IN (\" . implode(', ', $topics) . \")\n\t\t\t\tAND t.ID_TOPIC = ms.ID_TOPIC\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND ms.ID_MSG = t.ID_FIRST_MSG\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT \" . count($topics), __FILE__, __LINE__);\n\t}\n\n\t$context['topics'] = array();\n\t$topic_ids = array();\n\twhile ($row = mysql_fetch_assoc($request))\n\t{\n\t\tif ($row['ID_POLL'] > 0 && $modSettings['pollMode'] == '0')\n\t\t\tcontinue;\n\n\t\t$topic_ids[] = $row['ID_TOPIC'];\n\n\t\t// Clip the strings first because censoring is slow :/. (for some reason?)\n\t\t$row['firstBody'] = strip_tags(strtr(doUBBC($row['firstBody'], $row['firstSmileys']), array('<br />' => '&#10;')));\n\t\tif (strlen($row['firstBody']) > 128)\n\t\t\t$row['firstBody'] = substr($row['firstBody'], 0, 128) . '...';\n\t\t$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));\n\t\tif (strlen($row['lastBody']) > 128)\n\t\t\t$row['lastBody'] = substr($row['lastBody'], 0, 128) . '...';\n\n\t\t// Do a bit of censoring...\n\t\tcensorText($row['firstSubject']);\n\t\tcensorText($row['firstBody']);\n\n\t\t// But don't do it twice, it can be a slow ordeal!\n\t\tif ($row['ID_FIRST_MSG'] == $row['ID_LAST_MSG'])\n\t\t{\n\t\t\t$row['lastSubject'] = $row['firstSubject'];\n\t\t\t$row['lastBody'] = $row['firstBody'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcensorText($row['lastSubject']);\n\t\t\tcensorText($row['lastBody']);\n\t\t}\n\n\t\t// Decide how many pages the topic should have.\n\t\t$topic_length = $row['numReplies'] + 1;\n\t\tif ($topic_length > $modSettings['defaultMaxMessages'])\n\t\t{\n\t\t\t$tmppages = array();\n\t\t\t$tmpa = 1;\n\t\t\tfor ($tmpb = 0; $tmpb < $topic_length; $tmpb += $modSettings['defaultMaxMessages'])\n\t\t\t{\n\t\t\t\t$tmppages[] = '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.' . $tmpb . ';topicseen\">' . $tmpa . '</a>';\n\t\t\t\t$tmpa++;\n\t\t\t}\n\t\t\t// Show links to all the pages?\n\t\t\tif (count($tmppages) <= 5)\n\t\t\t\t$pages = '&#171; ' . implode(' ', $tmppages);\n\t\t\t// Or skip a few?\n\t\t\telse\n\t\t\t\t$pages = '&#171; ' . $tmppages[0] . ' ' . $tmppages[1] . ' ... ' . $tmppages[count($tmppages) - 2] . ' ' . $tmppages[count($tmppages) - 1];\n\n\t\t\tif (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages'])\n\t\t\t\t$pages .= ' &nbsp;<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;all\">' . $txt[190] . '</a>';\n\t\t\t$pages .= ' &#187;';\n\t\t}\n\t\telse\n\t\t\t$pages = '';\n\n\t\t// And build the array.\n\t\t$context['topics'][$row['ID_TOPIC']] = array(\n\t\t\t'id' => $row['ID_TOPIC'],\n\t\t\t'first_post' => array(\n\t\t\t\t'member' => array(\n\t\t\t\t\t'name' => $row['firstPosterName'],\n\t\t\t\t\t'id' => $row['ID_FIRST_MEMBER'],\n\t\t\t\t\t'href' => $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'],\n\t\t\t\t\t'link' => !empty($row['ID_FIRST_MEMBER']) ? '<a href=\"' . $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'] . '\" title=\"' . $txt[92] . ' ' . $row['firstPosterName'] . '\">' . $row['firstPosterName'] . '</a>' : $row['firstPosterName']\n\t\t\t\t),\n\t\t\t\t'time' => timeformat($row['firstPosterTime']),\n\t\t\t\t'timestamp' => $row['firstPosterTime'],\n\t\t\t\t'subject' => $row['firstSubject'],\n\t\t\t\t'preview' => $row['firstBody'],\n\t\t\t\t'icon' => $row['firstIcon'],\n\t\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;topicseen',\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;topicseen\">' . $row['firstSubject'] . '</a>'\n\t\t\t),\n\t\t\t'last_post' => array(\n\t\t\t\t'member' => array(\n\t\t\t\t\t'name' => $row['lastPosterName'],\n\t\t\t\t\t'id' => $row['ID_LAST_MEMBER'],\n\t\t\t\t\t'href' => $scripturl . '?action=profile;u=' . $row['ID_LAST_MEMBER'],\n\t\t\t\t\t'link' => !empty($row['ID_LAST_MEMBER']) ? '<a href=\"' . $scripturl . '?action=profile;u=' . $row['ID_LAST_MEMBER'] . '\">' . $row['lastPosterName'] . '</a>' : $row['lastPosterName']\n\t\t\t\t),\n\t\t\t\t'time' => timeformat($row['lastPosterTime']),\n\t\t\t\t'timestamp' => $row['lastPosterTime'],\n\t\t\t\t'subject' => $row['lastSubject'],\n\t\t\t\t'preview' => $row['lastBody'],\n\t\t\t\t'icon' => $row['lastIcon'],\n\t\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['ID_LAST_MSG']) . ';topicseen#msg' . $row['ID_LAST_MSG'],\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['ID_LAST_MSG']) . ';topicseen#msg' . $row['ID_LAST_MSG'] . '\">' . $row['lastSubject'] . '</a>'\n\t\t\t),\n\t\t\t'newtime' => $row['isRead'],\n\t\t\t'new_href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.from' . $row['isRead'] . ';topicseen#new',\n\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.from' . $row['isRead']) . ';topicseen#new',\n\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.from' . $row['isRead']) . ';topicseen#new\">' . $row['firstSubject'] . '</a>',\n\t\t\t'is_sticky' => !empty($modSettings['enableStickyTopics']) && !empty($row['isSticky']),\n\t\t\t'is_locked' => !empty($row['locked']),\n\t\t\t'is_poll' => $modSettings['pollMode'] == '1' && $row['ID_POLL'] > 0,\n\t\t\t'is_hot' => $row['numReplies'] >= $modSettings['hotTopicPosts'],\n\t\t\t'is_very_hot' => $row['numReplies'] >= $modSettings['hotTopicVeryPosts'],\n\t\t\t'is_posted_in' => false,\n\t\t\t'icon' => $row['firstIcon'],\n\t\t\t'subject' => $row['firstSubject'],\n\t\t\t'pages' => $pages,\n\t\t\t'replies' => $row['numReplies'],\n\t\t\t'views' => $row['numViews'],\n\t\t\t'board' => array(\n\t\t\t\t'id' => $row['ID_BOARD'],\n\t\t\t\t'name' => $row['bname'],\n\t\t\t\t'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0\">' . $row['bname'] . '</a>'\n\t\t\t)\n\t\t);\n\n\t\tdetermineTopicClass($context['topics'][$row['ID_TOPIC']]);\n\t}\n\tmysql_free_result($request);\n\n\tif ($is_topics && !empty($modSettings['enableParticipation']) && !empty($topic_ids))\n\t{\n\t\t$result = db_query(\"\n\t\t\tSELECT ID_TOPIC\n\t\t\tFROM {$db_prefix}messages\n\t\t\tWHERE ID_TOPIC IN (\" . implode(', ', $topic_ids) . \")\n\t\t\t\tAND ID_MEMBER = $ID_MEMBER\", __FILE__, __LINE__);\n\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t{\n\t\t\tif (empty($context['topics'][$row['ID_TOPIC']]['is_posted_in']))\n\t\t\t{\n\t\t\t\t$context['topics'][$row['ID_TOPIC']]['is_posted_in'] = true;\n\t\t\t\t$context['topics'][$row['ID_TOPIC']]['class'] = 'my_' . $context['topics'][$row['ID_TOPIC']]['class'];\n\t\t\t}\n\t\t}\n\t\tmysql_free_result($result);\n\t}\n\n\t$context['topics_to_mark'] = implode('-', $topic_ids);\n}", "public function decForumTopicCount()\n {\n $dataMap = $this->forumNode()->dataMap();\n $decTopic = (int) $dataMap['topic_count']->content();\n $decTopic--;\n $dataMap['topic_count']->fromString( $decTopic );\n $dataMap['topic_count']->store();\n }", "public function deleteSubject($topic_code) {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\n\t\t\t$topic_code = mysql_real_escape_string($topic_code, $sql->Link_ID); // Sanitise topic code\n\n\n\t\t\t// Get Subject Name from Subject Topic Code\n\t\t\t$query = \"SELECT Description FROM tblsubject where ID = '$topic_code'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$subject_name = $sql->Record['Description'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Delete subject\n\t\t\t// Courses and Occurrences are deleted automatically when subject deleted - due to relational table structure\n\t\t\t$query = \"DELETE FROM tblsubject WHERE ID = '$topic_code'\";\n\t\t\t$sql->query($query, $this->debug);\n\n\t\t\t// Sanitize subject name\n\t\t\t$subject_name = mysql_real_escape_string($subject_name, $sql->Link_ID); // sanitise subject name\n\n\t\t\t// Find page id of this subject page\n\t\t\t$page_id = '';\n\t\t\t$query = \"SELECT page_id FROM webmatrix_user_pages WHERE template = \".$this->subject_tpl_id.\" AND title = '$subject_name'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() == 1) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$page_id = $sql->Record['page_id'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Delete page\n\t\t\tif ($page_id != '') {\n\t\t\t\t$query = \"DELETE FROM webmatrix_user_pages WHERE template = \".$this->subject_tpl_id.\" AND title = '$subject_name' AND page_id = $page_id\";\n\t\t\t\t$sql->query($query, $this->debug);\n\t\t\t}\n\n\t\t\t/* delete page assignment and news & event assignments */\n\t\t\t$query = \"DELETE FROM webmatrix_extra_checkboxgroup WHERE text = '$topic_code'\";\n\t\t\t$sql->query($query, $this->debug);\n\n\n\t\t}", "public function destroy($id)\n {\n $topic = HelpCenterTopic::find($id);\n if ( $topic->delete() ) {\n die(\n json_encode(\n array(\n 'status' => 'success'\n )\n )\n );\n }\n }", "public function onUnSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)\n {\n }", "public function unsubscribe(Topic $topic, Connection $connection);", "public function delete($slug)\n {\n \t$record = Language::where('slug', '=', $slug)->first();\n /**\n * Check if the record is set to current default language\n * If so do not delete the record and send the appropriate message\n */\n\n if($record->is_default)\n {\n //Topics exists with the selected, so done delete the subject\n $response['status'] = 0;\n $response['message'] = LanguageHelper::getPhrase('it_is_set_to_default_language');\n return json_encode($response);\n }\n else {\n if(!env('DEMO_MODE')) {\n $record->delete();\n }\n $response['status'] = 1;\n $response['message'] = LanguageHelper::getPhrase('record_deleted_successfully');\n return json_encode($response);\n }\n }", "function delete_user_topics($uid, $gid) {\n global $db;\n $group = $this->get_group_details($gid);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $group['userid'] && userid() != $uid && !has_access('admin_access', true))\n e(lang(\"you_cant_del_user_topics\"));\n else {\n $usr_topics = $this->get_topics(array('group' => $gid, 'user' => $uid));\n if (is_array($usr_topics))\n foreach ($usr_topics as $topic)\n $this->delete_topic($topic['topic_id']);\n e(lang(\"topics_deleted\"), \"m\");\n }\n }", "function removeFromForums()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete category assignments\r\n $db->query( \"DELETE FROM eZForum_ForumCategoryLink WHERE ForumID='$this->ID'\" );\r\n }", "function _fix_links_callback_topic($m)\n\t{\n\t\treturn 'index.php?page=topicview&id='.strval(import_id_remap_get('topic',strval($m[2]),true));\n\t}", "public static function mjj_bbp_unsubscribe_notice(){\n\n\t\tglobal $post;\n\n\t\t$topic_id = ( isset( $_GET['tid'] ) && !empty($_GET['tid'] ) ? $_GET['tid'] : '' );\n\t\t$user_id = ( isset( $_GET['uid'] ) && !empty($_GET['uid'] ) ? $_GET['uid'] : '' );\n\t\t$to_check = ( isset( $_GET['nn'] ) && !empty($_GET['nn'] ) ? $_GET['nn'] : '' );\n\t\t$check = self::not_a_nonce( $user_id, $topic_id );\n\n\t\t$current_user = is_user_logged_in() ? wp_get_current_user() : false;\n\n\t\t//are there any of the query vars? If not, return\n\t\tif( !$topic_id && !$user_id && !$to_check ){\n\t\t\treturn;\n\t\t}\n\t\t//if you fail the check, it doesn't work. Also it has to be on the right topic.\n\t\telseif( ! hash_equals( $check, $to_check ) || (int)$post->ID !== (int)$topic_id ){\n\t\t\t$admin_email = get_bloginfo( 'admin_email' );\n\t\t\t$message = \"Something has gone wrong. You can manage your subscriptions from your profile. If you need assistance,\n\t\t\t\tplease email <a href='mailto:{$admin_email}'>{$admin_email}</a>\";\n\t\t}\n\t\t//if you are logged in and using someone else's link, it won't work for you (or unsubscribe them) so you get a link to your subscriptions page\n\t\telseif( is_user_logged_in() && (int)$current_user->ID !== (int)$user_id ){\n\n\t\t\t$subscriptions_link = bbp_get_user_profile_url( $current_user->ID ) . 'subscriptions/';\n\t\t\t$message = \"Unsubscribe links are unique to each user of the forum.<br />This link can&rsquo;t be used for you to unsubscribe, but you can manage all your subscriptions <a href='{$subscriptions_link}'>here</a>\";\n\n\t\t}\n\t\t//what else haven't I thought about? add anything I've forgotten here. If you are not logged in, you can still unsubscribe. That's ok. Better accidental unsubscriptions than people not being able to unsubscribe.\n\t\telse{\n\n\t\t\tbbp_remove_user_subscription( (int)$user_id, (int)$topic_id );\n\t\t\t$message = 'You have been unsubscribed from this topic.';\n\n\t\t}\n\n\t\techo '<div class=\"notice good\">';\n\t\techo $message;\n\t\techo '</div>';\n\n\t\treturn;\n\n\t}", "public function executeDeleteTopic(sfWebRequest $request)\n {\n $this->forward404Unless($fa_qs = Doctrine::getTable('ForumTopics')->find(array($request->getParameter('id'))), sprintf('Object Forum Topic does not exist (%s).', $request->getParameter('id')));\n //$fa_qs->delete();\n $oForumTopics = new ForumTopics();\n // $oForumTopics->changeTopicStatus($request->getParameter('id'),sfConfig::get(\"app_Status_Deleted\"));\n\n $this->getUser()->setFlash('errMsg', \"Deletion successful.\");\n\n\t\t// Start delete time set the forums data \n\t\t$lastTopicData = ForumTopicsTable::getLastTopicOfForums($fa_qs->getForumId());\n\t\t$topicId = ($lastTopicData[0][\"Id\"])? $lastTopicData[0][\"Id\"] : 0;\n\t\t$userId = ($lastTopicData[0][\"UserId\"])? $lastTopicData[0][\"UserId\"] : 0;\n\t\t\n\t\t$objectForums = new Forums();\n\t\t$objectForums->deleteTimeUpdateForumsData($topicId,$userId,$fa_qs->getForumId());\n\t\t//End delete time set the forums data \n\n\t\tif($request->hasParameter('flagForumsId'))\n\t\t\tif($request->getParameter('flagForumsId'))\n\t\t\t\t$this->redirect(\"Forums/topicList?flagForumsId=\".$request->getParameter('flagForumsId'));\n\n $this->redirect(\"Forums/topicList\");\n }", "public function destroy(Topic $topic)\n {\n $topic->delete();\n }", "public function testDelete(): void\n {\n $this->createInstance();\n $this->createAndLogin();\n\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $res2 = $this->fConnector->getDiscussionManagement()->deleteTopic($res->id)->wait();\n $this->assertTrue($res2, 'Test delete of a topic');\n $res3 = $this->fConnector->getDiscussionManagement()->getDiscussions($this->configTest['testTagName'])->wait();\n $found = false;\n foreach($res3 as $discussion){\n if($discussion->id === $res->id){\n $found = true;\n break;\n }\n }\n $this->assertFalse($found, 'Test delete of a topic, search for deleted topic');\n\n }", "function delete_group_topics($gid) {\n global $db;\n $group = $this->get_group_details($gid);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $group['userid'] && !has_access('admin_access', true))\n e(lang(\"you_cant_delete_grp_topics\"));\n else {\n $topics = $this->get_topics(array('group' => $gid));\n if (is_array($topics))\n foreach ($topics as $topic)\n $this->delete_topic($topic['topic_id']);\n e(lang(\"deleted\"), \"m\");\n }\n }", "function threadRemove(){\n\n\t$threadId\t\t\t \t= strip_tags($_GET['ThreadId']);\t\t\t\t #int - primaryKey\n\n\t$db = pdo(); # pdo() creates and returns a PDO object\n\t#dumpDie($_POST);\n\n\t$sql = \"DELETE FROM ma_Threads WHERE `ThreadID` = :ThreadID\";\n\n\t$stmt = $db->prepare($sql);\n\t//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);\n\t$stmt->bindValue(':ThreadID', $threadId, PDO::PARAM_INT);\n\n\ttry {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\t#feedback success or failure of update\n\n\tif ($stmt->rowCount() > 0)\n\t{//success! provide feedback, chance to change another!\n\t\tfeedback(\"Thread Removed Successfully From Timeline!\",\"success\");\n\t}else{//Problem! Provide feedback!\n\t\tfeedback(\"Thread Not Removed!\",\"warning\");\n\t}\n\tmyRedirect(THIS_PAGE);\n}", "public function onUnSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request): void\n {\n $topic->broadcast(['msg' => $connection->resourceId.' has left '.$topic->getId()]);\n }", "public function getTopic() {}", "public function soft_delete($reason = '')\n\t{\n\t\tif ($this->post_deleted)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->post_deleted = titania::$time;\n\t\t$this->post_delete_user = phpbb::$user->data['user_id'];\n\t\t$this->post_edit_reason = $reason;\n\n\t\t// Update the postcount for the topic\n\t\t$this->update_topic_postcount();\n\n\t\t// Set the visibility appropriately if no posts are visibile to the public/authors\n\t\t$flags = count::get_flags(access::PUBLIC_LEVEL);\n\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t{\n\t\t\t// There are no posts visible to the public, change it to authors level access\n\t\t\t$this->topic->topic_access = access::AUTHOR_LEVEL;\n\n\t\t\t$flags = count::get_flags(access::AUTHOR_LEVEL);\n\t\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t\t{\n\t\t\t\t// There are no posts visible to authors, change it to teams level access\n\t\t\t\t$this->topic->topic_access = access::TEAM_LEVEL;\n\t\t\t}\n\t\t}\n\n\t\t// Sync the first topic post if required\n\t\tif ($this->post_id == $this->topic->topic_first_post_id)\n\t\t{\n\t\t\t$this->topic->sync_first_post($this->post_id);\n\t\t}\n\n\t\t// Sync the last topic post if required\n\t\tif ($this->post_id == $this->topic->topic_last_post_id)\n\t\t{\n\t\t\t$this->topic->sync_last_post($this->post_id);\n\t\t}\n\n\t\t// Submit the topic to store the updated information\n\t\t$this->topic->submit();\n\n\t\tparent::submit();\n\n\t\t// Update topics posted table\n\t\t$this->topic->update_posted_status('remove', $this->post_user_id);\n\n\t\t// Decrement the user's postcount if we must\n\t\tif ($this->post_approved && in_array($this->post_type, titania::$config->increment_postcount))\n\t\t{\n\t\t\tphpbb::update_user_postcount($this->post_user_id, '-');\n\t\t}\n\t}", "public function onUnSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)\n {\n //this will broadcast the message to ALL subscribers of this topic.\n // $topic->broadcast(['msg' => $connection->resourceId . \" has left \" . $topic->getId()]);\n }", "public function destroy(Topic $topic)\n {\n $this->authorize($topic);\n\n $topic->delete();\n\n return redirect()->route('boards.show', ['board' => $topic->board]);\n }", "public function clearTopics()\n {\n $this->collTopics = null; // important to set this to NULL since that means it is uninitialized\n }", "public function delete_help_selling_data_topic(Request $request, $tid){\n Session::put('menu_item_parent', 'help');\n Session::put('menu_item_child', 'selling_data');\n Session::put('menu_item_child_child', 'selling_topics');\n HelpTopic::where('helpTopicIdx', $tid)->delete();\n Session::flash('flash_success', 'Help Selling Data has been deleted successfully');\n return \"success\";\n }", "function processMoveTopic($topicID, $data) {\n\t\tglobal $DB, $menuvar, $safs_config;\n\t\t$numOfPosts = 0;\n\t\t$forumID = getForumIDByTopicID($topicID);\n\t\t$newForumID = $data['forum_id'];\n\t\t\n\t\t// Pull the posts in this topic, delete them and update our counts\n\t\t$sql = \"SELECT COUNT(id) AS numRows FROM `\" . DBTABLEPREFIX . \"posts` WHERE topic_id = '\" . $topicID . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\tif ($result && $DB->num_rows() > 0) {\n\t\t\t$row = $DB->fetch_array($result);\n\t\t\t$numOfPosts = $row['numRows'];\n\t\t\t\n\t\t\t$DB->free_result($result);\n\t\t}\n\t\t\n\t\t// Update the current forum post count\n\t\t$sql = \"UPDATE `\" . DBTABLEPREFIX . \"forums` SET posts = posts - \" . $numOfPosts . \" WHERE id = '\" . $forumID . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t// Update the new forum post count\n\t\t$sql = \"UPDATE `\" . DBTABLEPREFIX . \"forums` SET posts = posts + \" . $numOfPosts . \" WHERE id = '\" . keepsafe($newForumID) . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t// Move the topic\n\t\t// Dont escape since this method does that, double escape isn't fun\n\t\t$result = $DB->query_update(\"topics\", array('forum_id' => $newForumID), \"id = '\" . $topicID . \"'\");\n\t\t\n\t\t$returnVar = \"\n\t\t\t\t\t\t\t\t\t\t\t<h2 class=\\\"processFormTitle\\\">Move Topic</h2>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\\\"processFormBlock \" . (($result) ? \"processFormSuccess\" : \"processFormFailed\") . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t\t\" . (($result) ? \"Your topic has been moved and you're being redirected to the thread.\" : \"There was an error moving your topic, you're being redirected to the thread.\") . \"\n\t\t\t\t\t\t\t\t\t\t\t\t<meta http-equiv=\\\"refresh\\\" content=\\\"3;url=\" . $menuvar['VIEWTOPIC'] . \"&id=\" . $topicID . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t</div>\";\n\t\t\n\t\t// Return the HTML\n\t\treturn $returnVar;\n\t}", "function sf_clean_topic_subs()\n{\n\tglobal $wpdb;\n\n\t# build list of topics with subscriptions\n\t$topics = $wpdb->get_results(\"SELECT topic_id, topic_subs FROM \".SFTOPICS.\" WHERE topic_subs IS NOT NULL;\");\n\tif(!$topics) return;\n\n\tforeach($topics as $topic)\n\t{\n\t\t$nvalues = array();\n\t\t$cvalues = explode('@', $topic->topic_subs);\n\t\t$nvalues[0] = $cvalues[0];\n\t\tforeach($cvalues as $cvalue)\n\t\t{\n\t\t\t$notfound = true;\n\t\t\tforeach($nvalues as $nvalue)\n\t\t\t{\n\t\t\t\tif($nvalue == $cvalue) $notfound = false;\n\t\t\t}\n\t\t\tif($notfound) $nvalues[]=$cvalue;\n\t\t}\n\t\t$nvaluelist = implode('@', $nvalues);\n\t\t$wpdb->query(\"UPDATE \".SFTOPICS.\" SET topic_subs='\".$nvaluelist.\"' WHERE topic_id=\".$topic->topic_id);\n\t}\n\treturn;\n}", "public function remove( $args, $assoc_args ) {\n\t\t$user = $this->get_user_id_from_identifier( $assoc_args['user-id'] );\n\n\t\t// Check if topic exists.\n\t\t$topic_id = $assoc_args['topic-id'];\n\t\tif ( ! bbp_is_topic( $topic_id ) ) {\n\t\t\t\\WP_CLI::error( 'No topic found by that ID.' );\n\t\t}\n\n\t\t\\WP_CLI::confirm( 'Are you sure you want to remove this topic from the user\\'s favorite list?', $assoc_args );\n\n\t\t// True if removed.\n\t\tif ( bbp_remove_user_favorite( $user->ID, $topic_id ) ) {\n\t\t\t\\WP_CLI::success( 'Favorite successfully removed.' );\n\t\t} else {\n\t\t\t\\WP_CLI::error( 'Could not remove favorite.' );\n\t\t}\n\t}", "public static function delete_tag_links($topic_id) {\n try {\n $db = ADODB::connect();\n \n //Subtract topic_count for each tag\n $query = \"\n UPDATE tbl_tag_item SET topic_count = topic_count - 1 WHERE tag_id IN (\n SELECT tag_id FROM tbl_tag_link WHERE topic_id = $topic_id\n )\n \";\n $rs = $db->Execute($query);\n \n //Delete all badge links for this topic\n $query = \"DELETE FROM tbl_tag_link WHERE topic_id=$topic_id\";\n $rs = $db->Execute($query);\n\n } catch (exception $e) {\n Info::exception_handler($e, __file__, get_class($this), __FUNCTION__, __LINE__);\n }\n }", "public function onUnSubscribe(ConnectionInterface $conn, $topic)\n {\n $conn->close();\n }", "public function clearTopicSubscriptions()\n {\n $this->topicSubscriptions->clear();\n }", "public function delete_help_buying_data_topic(Request $request, $tid){\n Session::put('menu_item_parent', 'help');\n Session::put('menu_item_child', 'buying_data');\n Session::put('menu_item_child_child', 'buying_topics');\n HelpTopic::where('helpTopicIdx', $tid)->delete();\n Session::flash('flash_success', 'Buying Help Topic has been deleted successfully');\n return \"success\";\n }", "public function removeNote($messageId) {\n return $this->_post(\n '/inbox/deletenote/',\n array(\n 'id' => $messageId\n )\n );\n\t}", "public function onUnSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)\n {\n // This will broadcast the message to ALL subscribers of this topic.\n //$topic->broadcast(['msg' => $connection->resourceId.' has left '.$topic->getId()]);\n }", "public function onUnSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)\n {\n //this will broadcast the message to ALL subscribers of this topic.\n $topic->broadcast(['msg' => $connection->resourceId . \" has left \" . $topic->getId()]);\n }", "public function onRemove();", "function rssmi_delete_feed_post_admin()\n{\n rssmi_delete_posts_admin();\n}", "function undelete_posts()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->undelete['p']))\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'post_deleted'\t\t\t=> 0,\r\n\t\t\t\t'post_deleted_time'\t\t=> 0,\r\n\t\t\t);\r\n\t\t\t$sql = 'UPDATE ' . POSTS_TABLE . '\r\n\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\t\tWHERE ' . $db->sql_in_set('post_id', $this->undelete['p']);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\t// Add the post info to the search index since we are undeleting it\r\n\t\t\t$this->update_search_index($this->undelete['p'], false);\r\n\r\n\t\t\tforeach ($this->undelete['p'] as $id)\r\n\t\t\t{\r\n\t\t\t\t$topic_id = intval($this->post_data[$id]['topic_id']);\r\n\t\t\t\t$forum_id = intval($this->post_data[$id]['forum_id']);\r\n\r\n\t\t\t\t// Update the first/last topic info if we must\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_deleted'] != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Since the topic was deleted, undelete it\r\n\t\t\t\t\t$this->undelete['t'][] = $topic_id;\r\n\r\n\t\t\t\t\tif ($this->topic_data[$topic_id]['topic_poster'] != $user->data['user_id'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tadd_log('mod', $forum_id, $topic_id, 'LOG_UNDELETE_TOPIC', $this->topic_data[$topic_id]['topic_title']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->post_data[$id]['poster_id'] != $user->data['user_id'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tadd_log('mod', $forum_id, $topic_id, 'LOG_UNDELETE_POST', $this->post_data[$id]['post_subject']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_first_post_id'] > $id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->update_first_post_topic($topic_id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_last_post_id'] < $id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->update_last_post_topic($topic_id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\t\tSET topic_deleted_reply_count = topic_deleted_reply_count - 1\r\n\t\t\t\t\t\tWHERE topic_id = ' . $topic_id;\r\n\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t$this->topic_data[$topic_id]['topic_deleted_reply_count']--;\r\n\r\n\t\t\t\t// If there is a shadow topic, we will update it too.\r\n\t\t\t\tif (array_key_exists($topic_id, $this->shadow_topic_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\t\t\tSET topic_deleted_reply_count = topic_deleted_reply_count - 1\r\n\t\t\t\t\t\t\tWHERE topic_id = ' . intval($this->shadow_topic_ids[$topic_id]);\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\t\t\t$this->topic_data[$this->shadow_topic_ids[$topic_id]]['topic_deleted_reply_count']--;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If the topic is a global announcement, do not attempt to do any updates to forums\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Update the last post info for the forum if we must\r\n\t\t\t\t\tif ($this->forum_data[$forum_id]['forum_last_post_id'] < $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->update_last_post_forum($forum_id);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (array_key_exists($topic_id, $this->shadow_topic_ids))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($this->forum_data[$this->topic_data[$this->shadow_topic_ids[$topic_id]]['forum_id']]['forum_last_post_id'] == $id)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->update_last_post_forum($this->topic_data[$this->shadow_topic_ids[$topic_id]]['forum_id']);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\tSET forum_deleted_reply_count = forum_deleted_reply_count - 1\r\n\t\t\t\t\t\t\tWHERE forum_id = ' . $forum_id;\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t$this->forum_data[$forum_id]['forum_deleted_reply_count']--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Undelete the topics\r\n\t\t\t$this->undelete_topics();\r\n\t\t}\r\n\t}", "function addTopic()\n{\n\tglobal $xoopsDB, $xoopsModule, $xoopsModuleConfig;\n $topicpid = isset($_POST['topic_pid']) ? intval($_POST['topic_pid']) : 0;\n $xt = new NewsTopic();\n if (!$xt->topicExists($topicpid, $_POST['topic_title'])) {\n $xt->setTopicPid($topicpid);\n if (empty($_POST['topic_title']) || xoops_trim($_POST['topic_title'])=='') {\n redirect_header( \"index.php?op=topicsmanager\", 2, _AM_ERRORTOPICNAME );\n }\n $xt->setTopicTitle($_POST['topic_title']);\n //$xt->Settopic_rssurl($_POST['topic_rssfeed']);\n $xt->setTopic_color($_POST['topic_color']);\n if (isset($_POST['topic_imgurl'] ) && $_POST['topic_imgurl'] != \"\") {\n $xt->setTopicImgurl($_POST['topic_imgurl'] );\n }\n\t\t$xt->setMenu(intval($_POST['submenu']));\n\t\t$xt->setTopicFrontpage(intval($_POST['topic_frontpage']));\n\t\tif(isset($_POST['xoops_upload_file'])) {\n\t\t\t$fldname = $_FILES[$_POST['xoops_upload_file'][0]];\n\t\t\t$fldname = (get_magic_quotes_gpc()) ? stripslashes($fldname['name']) : $fldname['name'];\n\t\t\tif(xoops_trim($fldname!='')) {\n\t\t\t\t$sfiles = new sFiles();\n\t\t\t\t$dstpath = XOOPS_ROOT_PATH . \"/modules/\" . $xoopsModule -> dirname() . '/images/topics';\n\t\t\t\t$destname=$sfiles->createUploadName($dstpath ,$fldname, true);\n\t\t\t\t$permittedtypes=array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');\n\t\t\t\t$uploader = new XoopsMediaUploader($dstpath, $permittedtypes, $xoopsModuleConfig['maxuploadsize']);\n\t\t\t\t$uploader->setTargetFileName($destname);\n\t\t\t\tif ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {\n\t\t\t\t\tif ($uploader->upload()) {\n\t\t\t\t\t\t$xt->setTopicImgurl(basename($destname));\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo _AM_UPLOAD_ERROR . ' ' . $uploader->getErrors();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $uploader->getErrors();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$xt->setTopicDescription($_POST['topic_description']);\n\t\t$xt->store();\n\t\tupdateCache();\n\n $notification_handler = & xoops_gethandler('notification');\n $tags = array();\n $tags['TOPIC_NAME'] = $_POST['topic_title'];\n $notification_handler->triggerEvent( 'global', 0, 'new_category', $tags);\n redirect_header('index.php?op=topicsmanager', 1, _AM_DBUPDATED);\n } else {\n redirect_header('index.php?op=topicsmanager', 2, _AM_ADD_TOPIC_ERROR);\n }\n exit();\n}", "public function onMqUnsubscribe($server, int $fd, $fromId, $data)\n {\n echo \"取消订阅\";\n\n $payload = [];\n foreach ($data['topics'] as $K => $v){\n if (is_numeric($v) && $v < 3 ){\n $payload[] = chr($v);\n }else{\n $payload[] = chr(0x80);\n }\n }\n $server->send(\n $fd,\n MQTT::getAck(\n [\n 'cmd' => 11,\n 'message_id' => $data['message_id'] ??'',\n 'payload' => $payload\n ]\n )\n );\n\n }", "function _sba_social_action_delete_twitter_message_entity() {\n $fields = array(\n 'field_sba_twitter_message',\n 'field_sba_twitter_editable',\n 'field_sba_show_additional',\n 'field_sba_target_options',\n 'field_sba_prepend_target_name'\n );\n foreach ($fields as $field_name) {\n $field = field_info_instance('node', $field_name, 'sba_social_action_twitter_message');\n field_delete_instance($field);\n field_delete_field($field_name);\n }\n field_purge_batch('50') ;\n\n drupal_set_message('Sba Social Action twitter fields deleted.');\n field_group_field_attach_delete_bundle('sba_message','sba_social_action_twitter_message');\n $twit = sba_message_type_load('sba_social_action_twitter_message');\n if($twit) {\n sba_message_type_delete($twit);\n }\n}", "function Admin_Messages_admin_delete($args)\n{\n // Get parameters from whatever input we need. All arguments to this\n // function should be obtained from pnVarCleanFromInput(), getting them\n // from other places such as the environment is not allowed, as that makes\n // assumptions that will not hold in future versions of PostNuke\n list($mid,\n $objectid,\n $confirmation) = pnVarCleanFromInput('mid',\n 'objectid',\n 'confirmation');\n\n\n // User functions of this type can be called by other modules. If this\n // happens then the calling module will be able to pass in arguments to\n // this function through the $args parameter. Hence we extract these\n // arguments *after* we have obtained any form-based input through\n // pnVarCleanFromInput().\n extract($args);\n\n // At this stage we check to see if we have been passed $objecmid, the\n // generic item identifier. This could have been passed in by a hook or\n // through some other function calling this as part of a larger module, but\n // if it exists it overrides $mid\n //\n // Note that this module couuld just use $objecmid everywhere to avoid all\n // of this munging of variables, but then the resultant code is less\n // descriptive, especially where multiple objects are being used. The\n // decision of which of these ways to go is up to the module developer\n if (!empty($objectid)) {\n $mid = $objectid;\n } \n\n // The user API function is called. This takes the item ID which we\n // obtained from the input and gets us the information on the appropriate\n // item. If the item does not exist we post an appropriate message and\n // return\n $item = pnModAPIFunc('Admin_Messages',\n 'user',\n 'get',\n array('mid' => $mid));\n\n if ($item == false) {\n return pnVarPrepHTMLDisplay(_ADMINMESSAGESNOSUCHITEM);\n }\n\n // Security check - important to do this as early as possible to avoid\n // potential security holes or just too much wasted processing. However,\n // in this case we had to wait until we could obtain the item name to\n // complete the instance information so this is the first chance we get to\n // do the check\n if (!pnSecAuthAction(0, 'Admin_Messages::', \"$item[title]::$mid\", ACCESS_DELETE)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n\n // Check for confirmation. \n if (empty($confirmation)) {\n // No confirmation yet - display a suitable form to obtain confirmation\n // of this action from the user\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n \t$pnRender =& new pnRender('Admin_Messages');\n\n\t // As Admin output changes often, we do not want caching.\n \t$pnRender->caching = false;\n\n // Add the message id\n\t\t$pnRender->assign('mid', $mid);\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('admin_messages_admin_delete.htm');\n }\n\n // If we get here it means that the user has confirmed the action\n\n // Confirm authorisation code. This checks that the form had a valid\n // authorisation code attached to it. If it did not then the function will\n // proceed no further as it is possible that this is an attempt at sending\n // in false data to the system\n if (!pnSecConfirmAuthKey()) {\n pnSessionSetVar('errormsg', _BADAUTHKEY);\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n return true;\n }\n\n // The API function is called. Note that the name of the API function and\n // the name of this function are identical, this helps a lot when\n // programming more complex modules. The arguments to the function are\n // passed in as their own arguments array.\n //\n // The return value of the function is checked here, and if the function\n // suceeded then an appropriate message is posted. Note that if the\n // function did not succeed then the API function should have already\n // posted a failure message so no action is required\n if (pnModAPIFunc('Admin_Messages',\n 'admin',\n 'delete',\n array('mid' => $mid))) {\n // Success\n pnSessionSetVar('statusmsg', _ADMINMESSAGESDELETED);\n }\n\n // This function generated no output, and so now it is complete we redirect\n // the user to an appropriate page for them to carry on their work\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n \n // Return\n return true;\n}", "public function rss_topic()\n\t{\n\t\tif (!$this->id)\n\t\t{\n\t\t\tDisplay::message('not_allowed');\n\t\t}\n\n\t\t// Liste des messages\n\t\t$sql = 'SELECT p.p_id, p.p_text, p.p_time, p.u_id, p.p_nickname, p.p_map, t.t_title, t.t_description, t.f_id, t.t_id, u.u_activate_email, u.u_email, u.u_auth\n\t\t\t\tFROM ' . SQL_PREFIX . 'posts p\n\t\t\t\tINNER JOIN ' . SQL_PREFIX . 'topics t\n\t\t\t\t\tON p.t_id = t.t_id\n\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'users u\n\t\t\t\t\tON u.u_id = p.u_id\n\t\t\t\tWHERE t.t_id = ' . $this->id . '\n\t\t\t\t\tAND p.p_approve = 0\n\t\t\t\tORDER BY p.p_time DESC';\n\t\t$result = Fsb::$db->query($sql);\n\t\tif ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\tif (!Fsb::$session->is_authorized($row['f_id'], 'ga_read') || !Fsb::$session->is_authorized($row['f_id'], 'ga_view') || !Fsb::$session->is_authorized($row['f_id'], 'ga_view_topics'))\n\t\t\t{\n\t\t\t\tDisplay::message('not_allowed');\n\t\t\t}\n\n\t\t\t$parser = new Parser();\n\t\t\t$parser->parse_html = (Fsb::$cfg->get('activate_html') && $row['u_auth'] >= MODOSUP) ? true : false;\n\n\t\t\t$this->rss->open(\n\t\t\t\tParser::title($row['t_title']),\n\t\t\t\thtmlspecialchars(($row['t_description']) ? $row['t_description'] : $parser->mapped_message($row['p_text'], $row['p_map'])),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=topic&amp;id=' . $this->id),\n\t\t\t\t$row['p_time']\n\t\t\t);\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\t// Informations passees au parseur de message\n\t\t\t\t$parser_info = array(\n\t\t\t\t\t'u_id' =>\t\t\t$row['u_id'],\n\t\t\t\t\t'p_nickname' =>\t\t$row['p_nickname'],\n\t\t\t\t\t'u_auth' =>\t\t\t$row['u_auth'],\n\t\t\t\t\t'f_id' =>\t\t\t$row['f_id'],\n\t\t\t\t\t't_id' =>\t\t\t$row['t_id'],\n\t\t\t\t);\n\t\t\t\t$parser->parse_html = (Fsb::$cfg->get('activate_html') && $row['u_auth'] >= MODOSUP) ? true : false;\n\n\t\t\t\t$this->rss->add_entry(\n\t\t\t\t\tParser::title($row['t_title']),\n\t\t\t\t\thtmlspecialchars($parser->mapped_message($row['p_text'], $row['p_map'], $parser_info)),\n\t\t\t\t\t(($row['u_activate_email'] & 2) ? 'mailto:' . $row['u_email'] : Fsb::$cfg->get('forum_mail')) . ' ' . htmlspecialchars($row['p_nickname']),\n\t\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=topic&p_id=' . $row['p_id'] . '#p' . $row['p_id']),\n\t\t\t\t\t$row['p_time']\n\t\t\t\t);\n\t\t\t}\n\t\t\twhile ($row = Fsb::$db->row($result));\n\t\t}\n\t\t// Aucun message, on pioche donc directement les informations dans le sujet\n\t\telse \n\t\t{\n\t\t\t$sql = 'SELECT t_id, t_title, t_description, t_time\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'topics\n\t\t\t\t\tWHERE t_id = ' . $this->id;\n\t\t\t$row = Fsb::$db->request($sql);\n\t\t\t$this->rss->open(\n\t\t\t\tParser::title($row['t_title']),\n\t\t\t\thtmlspecialchars($row['t_description']),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=topic&amp;id=' . $this->id),\n\t\t\t\t$row['t_time']\n\t\t\t);\n\t\t}\n\t}", "public function unsubscribe($delete = FALSE);", "private function unsubscribe()\n {\n $this->botman->hears('unsubscribe', function(BotMan $bot) {\n $userId = $bot->getUser()->getId();\n Subscriber::where('telegram_user_id', $userId)->delete();\n $bot->reply('You have just unsubscribed from our updates!');\n });\n }", "public function setTopic($topic);", "public function unSubscribe()\n {\n }", "public function getTopic();", "public function getTopic();", "protected function _fix_links_callback_topic($m)\n {\n return 'index.php?topic=' . strval(import_id_remap_get('topic', strval($m[2]), true));\n }", "function AddTopic()\n{\n global $context, $txt, $mbname, $db_prefix;\n\n // Check permission\n $a_add = allowedTo('smftags_add');\n\n if ($a_add == false)\n fatal_error($txt['cannot_smftags_add'],false);\n\n // get query results to build array of all tags\n $query = db_query(\"\n SELECT t.tag AS tag, t.ID_TAG AS ID_TAG, COUNT(l.ID_TAG) AS quantity, t.approved AS approved\n FROM {$db_prefix}tags AS t\n LEFT JOIN {$db_prefix}tags_log AS l ON t.ID_TAG = l.ID_TAG\n GROUP BY t.ID_TAG\n ORDER BY t.tag ASC\",\n __FILE__, __LINE__);\n\n $context['tags'] = array();\n while ($row = mysql_fetch_assoc($query))\n {\n $context['tags'][] = array(\n 'ID_TAG' => $row['ID_TAG'],\n 'tag' => $row['tag'],\n 'quantity' => $row['quantity'],\n 'approved' => $row['approved'],\n 'tagged' => 0,\n );\n }\n // don't load the subtemplate\n}", "public function removeTopic(Topic $topic)\n {\n if ($this->getTopics()->contains($topic)) {\n $biblioTopic = new BiblioTopic();\n $biblioTopic->setTopic($topic);\n if ($topic->isBibliosLoaded()) {\n //remove the back reference if available\n $topic->getBiblios()->removeObject($this);\n }\n\n $biblioTopic->setBiblio($this);\n $this->removeBiblioTopic(clone $biblioTopic);\n $biblioTopic->clear();\n\n $this->collTopics->remove($this->collTopics->search($topic));\n\n if (null === $this->topicsScheduledForDeletion) {\n $this->topicsScheduledForDeletion = clone $this->collTopics;\n $this->topicsScheduledForDeletion->clear();\n }\n\n $this->topicsScheduledForDeletion->push($topic);\n }\n\n\n return $this;\n }", "public function doRemove() {\r\n\t\t$host = xn(\"host\");\r\n\t\t\r\n\t\t$ret = $this->_mongo->selectDB(\"admin\")->command(array(\r\n\t\t\t\"removeshard\" => $host\r\n\t\t));\r\n\t\t\r\n\t\t$this->ret = $this->_highlight($ret, \"json\");\r\n\t\t\r\n\t\t$this->display();\r\n\t}", "function remove_message($db, $id)\n{\n\t$sql = \"DELETE from messages where id = :id\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':id'=>$id));\n\treturn;\n}", "public function deleteAction() {\n\t\t$redirect_url = Minz_Request::param('r', false, true);\n\t\tif (!$redirect_url) {\n\t\t\t$redirect_url = array('c' => 'subscription', 'a' => 'index');\n\t\t}\n\t\tif (!Minz_Request::isPost()) {\n\t\t\tMinz_Request::forward($redirect_url, true);\n\t\t}\n\n\t\t$id = Minz_Request::param('id');\n\n\t\tif (self::deleteFeed($id)) {\n\t\t\tMinz_Request::good(_t('feedback.sub.feed.deleted'), $redirect_url);\n\t\t} else {\n\t\t\tMinz_Request::bad(_t('feedback.sub.feed.error'), $redirect_url);\n\t\t}\n\t}", "public function destroy(Topic $topic)\n {\n $topic->delete();\n return $this->redirectRoutes('admin.topics.index', 'topic deleted successfully');\n }", "public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }", "function delSubs($command,$subscriber,$keyword){\n\t$sql_del=\"update subscriptions set active = 0 where msisdn like '%$subscriber%' and dateUnsubscribed=now() limit 1\";\n\t$result = mysql_query($sql_del);\n\t#logging\n\tif(!$result){\n\t\t$dbErr=\"SQL Error: \".mysql_error().\"SQL CODE: \".$sqlKW;\n\t\tflog($dbErr, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t}else{\n\t\t$subsLogs = \"Successfully unsubscribed \".$subscriber .\" to $keyword alerts\";\n\t\tlogSubs($subsLogs, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t}\n\t\n}", "function remove_single_post() {\n remove_action('thematic_singlepost', 'thematic_single_post');\n}", "public function cleanupDelete(KCommandContext $context)\n\t{\n\t\t$rows = $context->result;\n\t\t$table = $this->getService('com://site/ninjaboard.database.table.posts');\n\n\t\t// make sure we are not a row\n\t\tif ($rows instanceof KDatabaseRowDefault) $rows = array($rows);\n\t\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\t$topic\t= $this->getService('com://site/ninjaboard.model.topics')->id($row->ninjaboard_topic_id)->getItem();\n\t\t\t$query = $this->getService('koowa:database.adapter.mysqli')->getQuery()->where('ninjaboard_topic_id', '=', $topic->id);\n\t\t\t$posts = $table->count($query);\n\n\t\t\tif($posts)\n\t\t\t{\n\t\t\t\t//Replies does not count the first post, thus we subtract by 1\n\t\t\t\t$topic->replies = $posts - 1;\n\t\t\t\t\n\t\t\t\t// @TODO merge into one query\n\t\t\t\t$query = $this->getService('koowa:database.adapter.mysqli')->getQuery()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->select('ninjaboard_post_id')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('ninjaboard_topic_id', '=', $topic->id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->order('created_time', 'desc');\n\t\t\t\t$topic->last_post_id = $table->select($query, KDatabase::FETCH_FIELD);\n\t\t\t\t\n\t\t\t\t$query = $this->getService('koowa:database.adapter.mysqli')->getQuery()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->select('created_time')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('ninjaboard_topic_id', '=', $topic->id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->order('created_time', 'desc');\n\t\t\t\t$topic->last_post_on = $table->select($query, KDatabase::FETCH_FIELD);\n\t\t\t\t\n\t\t\t\t$query = $this->getService('koowa:database.adapter.mysqli')->getQuery()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->select('created_user_id')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('ninjaboard_topic_id', '=', $topic->id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->order('created_time', 'desc');\n\t\t\t\t$topic->last_post_by = $table->select($query, KDatabase::FETCH_FIELD);\n\n\t\t\t\t$topic->save();\n\t\t\t}\n\t\t\t\n\t\t\tif($topic->first_post_id == $row->id)\n\t\t\t{\n\t\t\t\t//If this is the last post, and only post in the topic, delete the topic.\n\t\t\t\t//If not, then don't delete it\n\t\t\t\tif(!$posts) $topic->delete();\n\t\t\t\telse return false;\n\t\t\t}\n\n\t\t\t//Update the forums' topics and posts count, and correct the last_post_id column\n\t\t\t$forums\t= $this->getService('com://site/ninjaboard.model.forums')->limit(0)->id($topic->forum_id)->getListWithParents();\n\t\t\t$forums->recount();\n\n\t\t\tif($row->created_by)\n\t\t\t{\n\t\t\t\t$user\t= $this->getService('com://site/ninjaboard.model.people')->id($row->created_by)->getItem();\n\t\t\t\tif(!$user->guest)\n\t\t\t\t{\n\t\t\t\t\t$query = $this->getService('koowa:database.adapter.mysqli')->getQuery()->where('created_user_id', '=', $user->id);\n\t\t\t\t\t$user->posts = $table->count($query);\n\n\t\t\t\t\t$user->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function delete($pid)\r\n\t{\r\n\t\t$db = GLOBALDB();\r\n\t\t$sql = sprintf('DELETE user publish where id = %d',$pid);\r\n\t\t$result = $db->query($sql);\r\n\t\treturn $result; \r\n\t}", "function unpublish() { \n\t\t$adsdetail = JRequest::get('POST');\n\t\t$model = $this->getModel('showads');\n\t\t$model->statusChange($adsdetail);\n\t}", "public function destroy($id)\n {\n $topic = Topic::findOrFail($id);\n// $this->authorize('delete', $topic);\n $topic = Topic::destroy($id);\n Cache::forget('topics');\n return response(\"Successfully Deleted\", 200);\n }", "public function remove() {\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\r\n\t\t$post\t= JRequest::get('post');\r\n\t\t$cid \t= JRequest::getVar( 'checkboxid', array(), 'post', 'array' );\r\n\t\tJArrayHelper::toInteger($cid);\r\n\t\t\r\n\t\t$model = $this->getModel('languages');\r\n\t\t\r\n\t\tif ($model->remove($cid, $post)) {\r\n\t\t\t$msg = JText::_( 'LANGUAGES_REMOVED' );\r\n\t\t} else {\r\n\t\t\t$msg = JText::_( 'ERROR_DELETING_LANGUAGES' );\r\n\t\t}\r\n\r\n\t\t// Check the table in so it can be edited.... we are done with it anyway\r\n\t\t$link = 'index.php?option=com_joomfish&task=languages.show';\r\n\t\t$this->setRedirect($link, $msg);\r\n\t}", "abstract public function deleteMessage($messageNo, $mailboxPath=null);", "public function clearBiblioTopics()\n {\n $this->collBiblioTopics = null; // important to set this to NULL since that means it is uninitialized\n }", "public function ambassade_single_topic(&$event) {\n global $user;\n // IF IS AMBASSADE\n if($event[\"row\"][\"forum_id\"] == 29 && !$this->topic_ambassade_set_up) {\n $guild = new \\scfr\\main\\ambassade\\Guild($this->db);\n $first_reply = $event[\"topic_data\"][\"topic_first_post_id\"];\n $guild->__topic_init($event[\"row\"][\"topic_id\"]);\n\n //var_dump();\n\n $templates[\"GUILD_JSON\"] = json_encode(false);\n if($guild->is_registerd) {\n $templates[\"TOPIC_IS_REGISTERED_GUILD\"] = true;\n foreach($guild->RSI as $name => $val)\n $templates[\"GUILD_\".strtoupper($name)] = $val;\n\n $templates[\"GUILD_JSON\"] = json_encode($guild->RSI);\n }\n\n\n if($templates['GUILD_BACKGROUND']) $templates['CUSTOM_BACKGROUND'] = $templates['GUILD_BACKGROUND'];\n\n\n $templates[\"TOPIC_IS_GUILD\"] = true;\n $templates[\"GUILD_TOPIC_ID\"] = $event[\"topic_data\"][\"topic_id\"];\n\n $templates[\"S_REQUIRE_ANGULAR\"] = true;\n $this->template->assign_vars($templates);\n $this->topic_set_up = true;\n }\n }", "function hard_delete_posts()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->hard_delete['p']))\r\n\t\t{\r\n\t\t\t$sql = 'DELETE FROM ' . POSTS_TABLE . '\r\n\t\t\t\tWHERE ' . $db->sql_in_set('post_id', $this->hard_delete['p']);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\tforeach ($this->hard_delete['p'] as $id)\r\n\t\t\t{\r\n\t\t\t\t$topic_id = intval($this->post_data[$id]['topic_id']);\r\n\t\t\t\t$forum_id = intval($this->post_data[$id]['forum_id']);\r\n\t\t\t\t$sql_data = $sql_data1 = '';\r\n\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_deleted'] != 0 && (($this->topic_data[$topic_id]['topic_first_post_id'] == $id && $this->topic_data[$topic_id]['topic_last_post_id'] == $id) || ($this->topic_data[$topic_id]['topic_deleted_reply_count'] == 1 && $this->topic_data[$topic_id]['topic_replies_real'] == 0)))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->hard_delete['t'][] = $topic_id;\r\n\t\t\t\t\tadd_log('mod', $forum_id, $topic_id, 'LOG_HARD_DELETE_TOPIC', $this->topic_data[$topic_id]['topic_title']);\r\n\r\n\t\t\t\t\tif (array_key_exists($topic_id, $this->shadow_topic_ids))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->hard_delete['t'][] = $this->shadow_topic_ids[$topic_id];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ($this->topic_data[$topic_id]['topic_type'] != POST_GLOBAL && $this->forum_data[$forum_id]['forum_deleted_topic_count'] > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sql_data1 .= 'forum_deleted_topic_count = forum_deleted_topic_count - 1, ';\r\n\t\t\t\t\t\t$this->forum_data[$forum_id]['forum_deleted_topic_count']--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tadd_log('mod', $forum_id, $topic_id, 'LOG_HARD_DELETE_POST', $this->post_data[$id]['post_subject']);\r\n\r\n\t\t\t\t\tif ($this->topic_data[$topic_id]['topic_replies'] > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sql_data .= 'topic_replies = topic_replies - 1, ';\r\n\t\t\t\t\t\t$this->topic_data[$topic_id]['topic_replies']--;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ($this->topic_data[$topic_id]['topic_replies_real'] > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sql_data .= 'topic_replies_real = topic_replies_real - 1, ';\r\n\t\t\t\t\t\t$this->topic_data[$topic_id]['topic_replies_real']--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_deleted_reply_count'] > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql_data .= 'topic_deleted_reply_count = topic_deleted_reply_count - 1, ';\r\n\t\t\t\t\t$this->topic_data[$topic_id]['topic_deleted_reply_count']--;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_type'] != POST_GLOBAL && $this->forum_data[$forum_id]['forum_deleted_reply_count'] > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql_data1 .= 'forum_deleted_reply_count = forum_deleted_reply_count - 1, ';\r\n\t\t\t\t\t$this->forum_data[$forum_id]['forum_deleted_reply_count']--;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_type'] != POST_GLOBAL && $this->forum_data[$forum_id]['forum_posts'] > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql_data1 .= 'forum_posts = forum_posts - 1, ';\r\n\t\t\t\t\t$this->forum_data[$forum_id]['forum_posts']--;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($sql_data != '')\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\t\t\tSET ' . $sql_data;\r\n\t\t\t\t\t$sql = substr($sql, 0, -2);\r\n\t\t\t\t\t$sql .= ' WHERE topic_id = ' . $topic_id;\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t}\r\n\t\t\t\tif ($sql_data1 != '' && $this->topic_data[$topic_id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\tSET ' . $sql_data1;\r\n\t\t\t\t\t\t$sql = substr($sql, 0, -2);\r\n\t\t\t\t\t\t$sql .= ' WHERE forum_id = ' . $forum_id;\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$this->delete_attachment_data();\r\n\r\n\t\t\t$sql = 'DELETE FROM ' . TERMMAP_TABLE . '\r\n\t\t\t\tWHERE topic_id = ' . (int) $topic_id;\r\n\t\t\t$db->sql_query($sql);\r\n\t\t\t\r\n\t\t\t$this->hard_delete_topics();\r\n\t\t}\r\n\t}", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Gou_Service_ForumReply::getForumReply($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$ret = Gou_Service_ForumReply::deleteForumReply($id);\n\t\tif (!$ret) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "function deleteMessages($messageId){\n\t\t\t//load data from persistence object\n\t\t\t$storageType \t\t= $this->configManager->getStorageType();\n\t\t\n\t\t\t\t\t\t\t\t\n\t\t\tif(strtolower($storageType) == 'file'){\n\t\t\t\t$fileName = $this->configManager->getDataDir().'/'.$this->configManager->getMessageFileName();\n\t\t\t\t$this->persistenceManager->setStorageType('file');\n\t\t\t\t$this->persistenceManager->setMessageFile($fileName);\n\t\t\t}elseif(strtolower($storageType) == 'mysql'){\n\t\t\t\tdie(\"MySQL storage type, not implemented yet!\");\n\t\t\t}else{\n\t\t\t\tdie(\"Unknown storage type!\");\n\t\t\t}\n\t\t\t\n\t\t\t$this->persistenceManager->deleteMessage($messageId);\n\t\t\t\n\t\t}", "function apoc_get_group_topic_info() {\n\n\tglobal $bp;\n\t$slug = $bp->action_variables[1];\n\t\n\t\n\tglobal $wpdb;\n\t$topic = $wpdb->get_row( \n\t\t$wpdb->prepare( \n\t\t\t\"SELECT post_title AS title, post_name AS url\n\t\t\tFROM $wpdb->posts \n\t\t\tWHERE post_name = %s\",\n\t\t\t$slug )\n\t\t);\n\t\t\n\treturn $topic;\n}", "public function onBeforeUnpublish()\n {\n\t\t$context = [\n PublishingEngine::CONTEXT_ACTION => PublishingEngine::CONTEXT_ACTION_UNPUBLISH\n\t\t];\n\t\t$this->collectChanges($context);\n\t}", "public function delete() {\n\t\t$message = $this->discussion->message(['id' => $this->request->id]);\n\n\t\tif ($this->discussion->pull_message($message)) {\n\t\t\treturn $this->render(['head' => true, 'status' => 204]);\n\t\t}\n\n\t\treturn $this->render(['head' => true, 'status' => 400]);\n\t}", "protected function removeRecipient()\n\t{\n\t\t$arrChannels = $this->Input->post('channels');\n\t\t$arrChannels = array_intersect($arrChannels, $this->nl_channels); // see #3240\n\n\t\t// Check the selection\n\t\tif (!is_array($arrChannels) || count($arrChannels) < 1)\n\t\t{\n\t\t\t$_SESSION['UNSUBSCRIBE_ERROR'] = $GLOBALS['TL_LANG']['ERR']['noChannels'];\n\t\t\t$this->reload();\n\t\t}\n\n\t\t$arrSubscriptions = array();\n\t\t\n\t\t$email = \\Idna::encodeEmail($this->Input->post('email', true));\n\t\t\n\t\t$subscriber = new Subscriber($email);\n\n\t\t// Get active subscriptions\n\t\t$objSubscription = $this->Database->prepare(\"SELECT pid FROM tl_newsletter_recipients WHERE email=? AND active=1\")\n\t\t\t\t\t\t\t\t\t\t ->execute($email);\n\n\t\tif ($objSubscription->numRows)\n\t\t{\n\t\t\t$arrSubscriptions = $objSubscription->fetchEach('pid');\n\t\t}\n\n\t\t$arrRemove = array_intersect($arrChannels, $arrSubscriptions);\n\n\t\t// Return if there are no subscriptions to remove\n\t\tif (!is_array($arrRemove) || count($arrRemove) < 1)\n\t\t{\n\t\t\t$_SESSION['UNSUBSCRIBE_ERROR'] = $GLOBALS['TL_LANG']['ERR']['unsubscribed'];\n\t\t\t$this->reload();\n\t\t}\n\n\t\t// check for cleverreach support\n\t\t$objChannel = $this->Database->execute(\"SELECT id FROM tl_newsletter_channel WHERE cleverreach_active = 1 AND id IN(\" . implode(',', array_map('intval', $arrRemove)) . \")\");\n\n\t\t// TODO: multiple channel unsubscription\n\t\t$subscriber->getByChannel($arrRemove[0]);\n\n\t\t// Remove subscriptions\n\t\t$subscriber->remove($arrRemove);\n\t\t\n\t\t// optional Cleverreach Deletion\n\t\tif($objChannel->numRows > 0)\n\t\t{\n\t\t\t$subscriber->removeFromCR($objChannel->fetchEach('id'));\n\t\t}\n\n\t\t// Get channels\n\t\t$objChannels = $this->Database->execute(\"SELECT title FROM tl_newsletter_channel WHERE id IN(\" . implode(',', array_map('intval', $arrRemove)) . \")\");\n\t\t$arrChannels = $objChannels->fetchEach('title');\n\n\t\t// HOOK: post unsubscribe callback\n\t\tif (isset($GLOBALS['TL_HOOKS']['removeRecipient']) && is_array($GLOBALS['TL_HOOKS']['removeRecipient']))\n\t\t{\n\t\t\tforeach ($GLOBALS['TL_HOOKS']['removeRecipient'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$this->{$callback[0]}->{$callback[1]}($varInput, $arrRemove);\n\t\t\t}\n\t\t}\n\n\t\tglobal $objPage;\n\n\t\t// Redirect to jumpTo page\n\t\tif (strlen($this->jumpTo) && $this->jumpTo != $objPage->id)\n\t\t{\n\t\t\t$objNextPage = $this->Database->prepare(\"SELECT id, alias FROM tl_page WHERE id=?\")\n\t\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t\t ->execute($this->jumpTo);\n\n\t\t\tif ($objNextPage->numRows)\n\t\t\t{\n\t\t\t\t$this->redirect($this->generateFrontendUrl($objNextPage->fetchAssoc()));\n\t\t\t}\n\t\t}\n\n\t\tif($subscriber->sendUnSubscribeMail($arrRemove))\n\t\t{\n\t\t\t$this->reload();\n\t\t}\n\t}", "function removeSubscription() {\r\n if(isset($_REQUEST['corp_id'])) {\r\n $arrArg=array(\r\n \"id\"=>$_SESSION['id'],\r\n \"corp_id\"=>$_REQUEST['corp_id']\r\n );\r\n $result=loadModel(\"subscription\",\"removeSubscription\",$arrArg);\r\n if ($result == true) {\r\n echo \"UnSubscribed\";\r\n } else {\r\n echo \"Error! Try later\";\r\n }\r\n }\r\n }", "function offline(ArrayObject $topics, $topic, $id) {\n $this->delTimer($topics, $id);\n $messages = $topics[$id]->messages;\n unset($topics[$id]);\n foreach ($messages as $message) {\n $message->detector->resolve(false);\n }\n $onUnsubscribe = $this->onUnsubscribe;\n if (is_callable($onUnsubscribe)) {\n call_user_func($onUnsubscribe, $topic, $id, $this);\n }\n }", "function caldol_no_replies_bbpress_topics_shortcode() {\n\n\t?>\n\n<!-- html custom-functions -->\n\n<h4 style=\"margin-top: 15px;\">Discussions with No Replies. Be the first to jump in!</h4>\n\n<?php\n\n\n\nif ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'meta_key' => '_bbp_reply_count', 'orderby' => 'post_date', 'meta_value' => '0', 'meta_compare' => '=', 'post_parent' => 'any', 'posts_per_page' => 10 ) ) )\n\nbbp_get_template_part( 'bbpress/loop', 'topics' );\n\n?>\n\n<!-- end -->\n\n<?php }", "public function destroy(Topic $topic)\n {\n $topic->delete();\n return redirect()->route('topics.index')->with('success', 'Topic deleted successfully');\n }", "function remove_attachment_clean_up( $attachment )\n\t{\n\t\t//-----------------------------------------\n\t\t// Check\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! $attachment['attach_id'] )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$this->ipsclass->DB->build_query( array( 'select' => 'p.pid',\n\t\t\t\t\t\t\t\t\t\t\t\t 'from' => array( 'posts' => 'p' ),\n\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 'p.pid='. intval( $attachment['attach_rel_id'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t 'add_join' => array( 0 => array( 'select' => 't.forum_id, t.tid',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => array( 'topics' => 't' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 't.tid=p.topic_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'inner' ) ) ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t$this->ipsclass->DB->exec_query();\n\t\t\n\t\t$topic = $this->ipsclass->DB->fetch_row();\n\t\n\t\tif ( isset( $topic['tid'] ) )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// GET PIDS\n\t\t\t//-----------------------------------------\n\t\t\n\t\t\t$pids = array();\n\t\t\t$count = 0;\n\t\t\n\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'pid',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'posts',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"topic_id=\". $topic['tid'] ) );\n\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\t\t\n\t\t\twhile ( $p = $this->ipsclass->DB->fetch_row() )\n\t\t\t{\n\t\t\t\t$pids[] = $p['pid'];\n\t\t\t}\n\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// GET ATTACHMENT COUNT\n\t\t\t//-----------------------------------------\n\t\t\n\t\t\tif ( count( $pids ) )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->simple_construct( array( \"select\" => 'count(*) as cnt',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'attachments',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"attach_rel_module='post' AND attach_rel_id IN(\".implode(\",\",$pids).\")\") );\n\t\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\t\n\t\t\t\t$cnt = $this->ipsclass->DB->fetch_row();\n\t\t\t\n\t\t\t\t$count = intval( $cnt['cnt'] );\n\t\t\t}\n\t\t\n\t\t\t$this->ipsclass->DB->simple_construct( array( 'update' => 'topics', 'set' => \"topic_hasattach=\". $count , 'where' => \"tid=\".$topic['tid'] ) );\n\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function declareTopic(string $topic): void;", "public function removeSubscribes();", "public function delete()\n {\n parent::delete();\n $this->azure->deleteMessage($this->job);\n }", "function unpublish()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$cid = JRequest::getVar( 'cid', array(), 'post', 'array' );\n\t\tJArrayHelper::toInteger($cid);\n\n\t\tif (count( $cid ) < 1) {\n\t\t\tJError::raiseError(500, JText::_( 'Select an item to unpublish' ) );\n\t\t}\n\n\t\t$model = $this->getModel('weblink');\n\t\tif(!$model->publish($cid, 0)) {\n\t\t\techo \"<script> alert('\".$model->getError(true).\"'); window.history.go(-1); </script>\\n\";\n\t\t}\n\n\t\t$this->setRedirect( 'index.php?option=com_weblinks' );\n\t}", "public function destroy(Topic $topic)\n {\n $topic->delete();\n return redirect()->route('topics.index');\n }", "protected function afterRemoving()\n {\n }", "function remove_forum_tracker()\r\n\t{\r\n\t\tglobal $ibforums, $std;\r\n\r\n\t\tif ($ibforums->input['f'] == 'all')\r\n\t\t{\r\n\t\t\t$ibforums->db->exec(\r\n\t\t\t \"DELETE FROM ibf_forum_tracker\r\n\t\t\t WHERE member_id='\" . $this->member['id'] . \"'\"\r\n );\r\n\t\t} else\r\n\t\t{\r\n\t\t\t$id = intval($ibforums->input['f']);\r\n\r\n\t\t\t$ibforums->db->exec(\r\n\t\t\t \"DELETE FROM ibf_forum_tracker\r\n\t\t\t WHERE member_id='\" . $this->member['id'] . \"'\r\n\t\t\t\tAND forum_id='$id'\"\r\n );\r\n\t\t}\r\n\r\n\t\t$std->boink_it($this->base_url . \"act=UserCP&CODE=50\");\r\n\r\n\t}" ]
[ "0.7078982", "0.6758631", "0.66834825", "0.6506726", "0.64985037", "0.6476011", "0.6476011", "0.6472596", "0.6454901", "0.621463", "0.6197819", "0.6182261", "0.6167564", "0.6079395", "0.60258", "0.5997779", "0.59628636", "0.5890783", "0.5865372", "0.58490914", "0.58103573", "0.58018714", "0.5793481", "0.5783697", "0.5742623", "0.5713383", "0.5704683", "0.5696529", "0.56829435", "0.5634112", "0.56195635", "0.559936", "0.55992913", "0.5566622", "0.55492187", "0.55354255", "0.5524026", "0.55229884", "0.5519041", "0.55092615", "0.55002266", "0.54977506", "0.54928344", "0.5489052", "0.5488501", "0.5482132", "0.5477245", "0.54765326", "0.5470597", "0.5451215", "0.5429086", "0.5425203", "0.5422267", "0.5421371", "0.53969413", "0.5395193", "0.53824884", "0.5364724", "0.53604376", "0.5343234", "0.5339985", "0.5337159", "0.5337159", "0.53320825", "0.53270894", "0.5323735", "0.5320244", "0.5314023", "0.53106403", "0.52992123", "0.5292559", "0.5290073", "0.5289915", "0.5283814", "0.52818733", "0.5273963", "0.52736026", "0.5261774", "0.5250655", "0.52503324", "0.5248689", "0.5248328", "0.52481586", "0.5245192", "0.5244057", "0.52423376", "0.52271605", "0.52271247", "0.5222251", "0.52198946", "0.52113336", "0.52032006", "0.5194834", "0.51941395", "0.51928747", "0.51901275", "0.5189802", "0.51894325", "0.51891106", "0.5186593" ]
0.60632074
14
Handler to actual send replyrelated activity payload.
private function notify_forum_reply_payload( $activity, $reply_id ) { if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { return; } if ( ! bbp_is_site_public() ) { return; } if ( ! in_array( $activity, array( 'create-reply', 'remove-reply' ), true ) ) { return; } if ( 'create-reply' === $activity && ! bbp_is_reply_published( $reply_id ) ) { return; } $url = bbp_get_reply_url( $reply_id ); // Remove moderator flags. $url = remove_query_arg( array( 'view' ), $url ); $args = array( 'action' => 'wporg_handle_activity', 'activity' => $activity, 'source' => 'forum', 'user' => get_user_by( 'id', bbp_get_reply_author_id( $reply_id ) )->user_login, 'post_id' => $reply_id, 'topic_id' => bbp_get_reply_topic_id( $reply_id ), 'forum_id' => bbp_get_reply_forum_id( $reply_id ), 'title' => strip_tags( bbp_get_reply_topic_title( $reply_id ) ), 'url' => $url, 'message' => $this->get_reply_excerpt( $reply_id, 15 ), 'site' => get_bloginfo( 'name' ), 'site_url' => site_url(), ); Profiles\api( $args ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleSendMessage() {\n\t\t$json = file_get_contents(\"php://input\"); //vytánutí všech dat z POST požadavku - data ve formátu JSON\n\t\t$data = Json::decode($json); //prijata zprava dekodovana z JSONu\n\t\t$user = $this->getPresenter()->getUser();\n\t\t$addMessage = $this->addMessage($data, $user);\n\t\tif (!empty($addMessage)) {\n\t\t\t$this->sendRefreshResponse($data->lastid);\n\t\t}\n\t}", "public function reply_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['_id'] = $this->input->get('_id');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\t\t\n\t\t$this->Messages_model->reply($data);\n\t}", "abstract function doSend();", "public function serveRequest()\n {\n $msg = $this->connection->read();\n if (!$msg) return;\n $this->connection->acknowledge($msg);\n \n $replyMsg = $this->act($msg);\n\n // write correlation id\n $replyMsg->setHeader(\"correlation-id\", $msg->getId());\n\n $this->connection->send($msg->getReplyTo(), $replyMsg);\t\t\n }", "protected function send() {}", "public function reply()\n\t{\n\n\t\t$reply = $this->store('reply', '/threads?id=_id_#form-reply');\n\n\t\t(new Thread)->updateTotalReplies($reply->parent_id);\n\n\t\tredirect('/threads?id=' . $reply->parent_id . '#reply-id' . $reply->id);\n\t\n\t}", "public function postHandleCallback() {\n $data = \\Input::all();\n $msg = new Message();\n $msg->text = trim($data['text']);\n $msg->api_id = $data['id'];\n $msg->sender = $data['from'];\n $msg->receiver = $data['to'];\n $msg->save();\n\n //for correct counting\n \\DB::transaction(function() use ($msg) {\n $response = MessageHelper::decode($msg);\n if ($response) {\n $msg->campaign_id = $response->campaign_id;\n $msg->save();\n }\n });\n return 'Hello World';\n }", "public function sendReplyEnd()\n {\n }", "public function discussionController_replies_handler($sender, $args) {\n if (!Gdn::session()->isValid()) {\n return;\n }\n echo '<div class=\"Reply\">';\n\n // Insert new message link which will be addressed to the comment\n // author and has the subject of the discussion.\n if (c('reply.SendPM', true) == true) {\n echo wrap(\n anchor(\n t('Send PM').'<i class=\"icon icon-mail\"> </i>',\n 'messages/add/'.rawurlencode($args['Author']->Name).'/'.$args['Discussion']->Name,\n ['class' => 'ReplyPM']\n ),\n 'span',\n ['class' => 'Reply ReplyPMWrapper']\n );\n }\n\n // Insert link which will insert a @UserName into the comment box.\n if (c('reply.Comment', true) == true) {\n echo wrap(\n anchor(\n t('Reply').'<i class=\"icon icon-reply\"> </i>',\n 'post/comment/'.$args['Discussion']->DiscussionID.'/'.rawurlencode($args['Author']->Name),\n ['class' => 'ReplyComment']\n ),\n 'span',\n ['class' => 'Reply ReplyCommentWrapper']\n );\n }\n echo '</div>';\n }", "public function postAction() {\n\t\t$this->sendMessage();\n\t}", "public abstract function sendMessage();", "public function handle(): int\n {\n NotificationController::sendMessageTelegramNotification();\n\n return 0;\n }", "public function postSend()\n {\n }", "function reply($id, $mobile, $message, $cost = 0);", "public function reply(){\n\n\t\tif($this->request->is(\"post\")){\n\t\t\t$token = $this->request->data['User']['access_token'];\n\n\t\t\t$user_id = $this->_check($token);\n\t\t\tif(is_numeric($user_id));\n\t\t\telse\n\t\t\t\treturn $user_id;\n\n\t\t\t$this->request->data['Reply']['user_id'] = $user_id;\n\t\t\t$response_id = $this->request->data['Reply']['response_id'];\n\t\t\t$output = array();\n\t\t\t$post = $this->Response->findByid($this->request->data['Reply']['response_id'] , array(\"fields\" => \"message_id\"));\n\n\t\t\tif(!$post){\n\t\t\t\t$output['error'] = \"invalid response_id\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$message_id = $post['Response']['message_id'];\n\t\t\t\tif($this->Response->Reply->save($this->request->data)){\n\t\t\t\t\t$reply = $this->Response->Reply->findByid($this->Response->Reply->id);\n\t\t\t\t\t$output['notice'] = \"Your reply has been submitted!\";\n\t\t\t\t\t$this->firebase->push(\"/messages/\" . $message_id . \"/responses/\" . $response_id . \"/replies/\" , $reply);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$temp = $this->generate_new_token($user_id);\n\t\t\t$output['return'] = $temp['return'];\n\n\t\t\treturn $this->render_response($output);\n\t\t}\n\n\t}", "abstract public function handler(string $message);", "protected function sendResponse() {}", "private function handleEvent($event)\n {\n $bot = $this->adapter->bot($event['recipient']['id']);\n\n // If the page is not in our system, not active, or doesn't have a valid access token then do nothing.\n if (! $bot || ! $bot->enabled || is_null($bot->access_token)) {\n return;\n }\n\n if (config('sentry.dsn')) {\n app('sentry')->user_context(['bot_id' => $bot->_id]);\n }\n\n\n // If echo, then do nothing.\n if (array_get($event, 'message.is_echo')) {\n return;\n }\n\n // Get the subscriber who sent the message.\n $subscriber = $this->adapter->subscriber($event['sender']['id'], $bot);\n\n // If it is a delivery notification, then mark messages as delivered.\n if (array_get($event, 'delivery')) {\n if ($subscriber) {\n $this->adapter->markMessagesAsDelivered($subscriber, $event['delivery']['watermark']);\n }\n\n return;\n }\n\n // If it is a read notification, then mark messages as read.\n if (array_get($event, 'read')) {\n if ($subscriber) {\n $this->adapter->markMessagesAsRead($subscriber, $event['read']['watermark']);\n }\n\n return;\n }\n\n // If a text message is received\n if ($text = array_get($event, 'message.text')) {\n\n // Find a matching auto reply rule.\n /** @var AutoReplyRule $rule */\n $rule = $this->adapter->matchingAutoReplyRule($text, $bot);\n\n // If found\n if ($rule) {\n\n // If the auto reply rule is a subscription message, subscribe the user.\n if ($rule->subscribe) {\n $subscriber = $this->adapter->subscribe($bot, $event['sender']['id']);\n }\n\n // Otherwise, send the auto reply message.\n // But before then, if the current message sender is not a subscriber,\n // Subscribe them silently.\n if (! $subscriber) {\n $subscriber = $this->adapter->subscribeSilently($bot, $event['sender']['id']);\n }\n\n // If the auto reply rule is a unsubscription message, send the \"do you want to unsubscribe?\" message .\n if ($rule->unsubscribe) {\n $this->adapter->concludeUnsubscriptionProcess($bot, $subscriber);\n }\n\n $this->adapter->storeIncomingTextMessage($event, $bot, $subscriber);\n if ($rule->template_id) {\n $this->adapter->sendAutoReply($rule, $subscriber, $bot);\n }\n\n return;\n }\n\n // If no matching auto reply rule is found, then send the default reply.\n // But before then, if the current message sender is not a subscriber,\n // or if inactive subscriber, subscribe them silently.\n if (! $subscriber || ! $subscriber->active) {\n $subscriber = $this->adapter->subscribeSilently($bot, $event['sender']['id']);\n }\n $this->adapter->storeIncomingTextMessage($event, $bot, $subscriber);\n $this->adapter->sendDefaultReply($bot, $subscriber);\n\n return;\n }\n\n // Handle postbacks (button clicks).\n if (array_get($event, 'postback')) {\n $this->handlePostbackEvent($bot, $subscriber, $event);\n\n return;\n }\n\n // Handle optin (send to messenger plugin)\n if (array_get($event, 'optin')) {\n $payload = array_get($event, 'optin.ref');\n $subscriber = $this->adapter->subscribeBotUser($payload, $bot, $event['sender']['id']);\n $this->adapter->storeIncomingOptInMessage($event, $bot, $subscriber);\n\n return;\n }\n\n // account_linking\n // referal\n }", "abstract function send();", "function reply()\r\n\t{\r\n\t\t\r\n\t\t//must be logged in\r\n\t\t$this->dx_auth->check_uri_permissions();\r\n\t\t\r\n\t\t//set the data variable\r\n\t\t$data['parent_id'] = $this->uri->segment(3);\r\n\t\t\r\n\t\t//the parent id is the id we are replying to.\r\n\t\t$this->db->where('meaning_id', $data['parent_id']);\r\n\t\t//we have to do this so we can get the song_id from the parent's meaning\r\n\t\t$data['query'] = $this->db->get('meanings');\r\n\t\t\r\n\t\t//load the meanings reply view\r\n\t\t$this->template->write('title', 'Replying to a meaning');\r\n\t\t$this->template->write_view('content', 'meanings/reply', $data, true);\r\n\t\t$this->template->render();\r\n\t}", "function en_send_transdata() {\n\t// Handle sending of data\n}", "public function send() {}", "public function send() {}", "public function send() {}", "public function send() {}", "public function send() {}", "public function ajax_reply() {\n\t\t$action = $_POST['bbp_reply_form_action'];\n\t\tif ( 'bbp-new-reply' == $action ) {\n\t\t\tbbp_new_reply_handler( $action );\n\t\t} elseif ( 'bbp-edit-reply' == $action ) {\n\t\t\tbbp_edit_reply_handler( $action );\n\t\t}\n\t}", "public static function handleReplyReceivedLogEntry(\\Bitrix\\Main\\Event $event)\n\t{\n\t\tglobal $USER, $DB;\n\n\t\t$logEntryId = intval($event->getParameter('entity_id'));\n\t\t$userId = intval($event->getParameter('from'));\n\t\t$message = trim($event->getParameter('content'));\n\t\t$attachments = $event->getParameter('attachments');\n\n\t\t$commentId = false;\n\n\t\tif (\n\t\t\tstrlen($message) <= 0\n\t\t\t&& count($attachments) > 0\n\t\t)\n\t\t{\n\t\t\t$message = Loc::getMessage('SONET_MAILHANDLER_ATTACHMENTS');\n\t\t}\n\n\t\tif (\n\t\t\t$logEntryId <= 0\n\t\t\t|| $userId <= 0\n\t\t\t|| strlen($message) <= 0\n\t\t)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$res = \\CSocNetLog::getList(\n\t\t\tarray(),\n\t\t\tarray(\n\t\t\t\t\"ID\" => $logEntryId\n\t\t\t),\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tarray(\"ID\", \"ENTITY_TYPE\", \"ENTITY_ID\", \"EVENT_ID\", \"USER_ID\", \"SOURCE_ID\")\n\t\t);\n\n\t\tif (!($logEntry = $res->fetch()))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$siteId = \\Bitrix\\Socialnetwork\\Util::getSiteIdByLogId($logEntry[\"ID\"]);\n\t\t$res = \\CSite::GetByID($siteId);\n\t\t$site = $res->fetch();\n\n\t\t$pathToUser = Config\\Option::get(\"main\", \"TOOLTIP_PATH_TO_USER\", false, $siteId);\n\t\t$pathToSmile = Config\\Option::get(\"socialnetwork\", \"smile_page\", false, $siteId);\n\n\t\t$commentEvent = \\CSocNetLogTools::findLogCommentEventByLogEventID($logEntry[\"EVENT_ID\"]);\n\t\tif (is_array($commentEvent))\n\t\t{\n\t\t\tif (\\Bitrix\\Socialnetwork\\ComponentHelper::canAddComment($logEntry, $commentEvent))\n\t\t\t{\n\t\t\t\t$fields = array(\n\t\t\t\t\t\"ENTITY_TYPE\" => $logEntry[\"ENTITY_TYPE\"],\n\t\t\t\t\t\"ENTITY_ID\" => $logEntry[\"ENTITY_ID\"],\n\t\t\t\t\t\"EVENT_ID\" => $commentEvent[\"EVENT_ID\"],\n\t\t\t\t\t\"=LOG_DATE\" => $DB->currentTimeFunction(),\n\t\t\t\t\t\"MESSAGE\" => $message,\n\t\t\t\t\t\"TEXT_MESSAGE\" => $message,\n\t\t\t\t\t\"MODULE_ID\" => false,\n\t\t\t\t\t\"LOG_ID\" => $logEntry[\"ID\"],\n\t\t\t\t\t\"USER_ID\" => $userId\n\t\t\t\t);\n\n\t\t\t\t$ufCode = (\n\t\t\t\t\tModuleManager::isModuleInstalled(\"webdav\")\n\t\t\t\t\t|| ModuleManager::isModuleInstalled(\"disk\")\n\t\t\t\t\t\t? \"UF_SONET_COM_DOC\"\n\t\t\t\t\t\t: \"UF_SONET_COM_FILE\"\n\t\t\t\t);\n\t\t\t\t$fields[$ufCode] = array();\n\n\t\t\t\t$type = false;\n\t\t\t\t$attachmentRelations = array();\n\n\t\t\t\tforeach ($attachments as $key => $attachedFile)\n\t\t\t\t{\n\t\t\t\t\t$resultId = \\CSocNetLogComponent::saveFileToUF($attachedFile, $type, $userId);\n\t\t\t\t\tif ($resultId)\n\t\t\t\t\t{\n\t\t\t\t\t\t$fields[$ufCode][] = $resultId;\n\t\t\t\t\t\t$attachmentRelations[$key] = $resultId;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$fields[\"MESSAGE\"] = preg_replace_callback(\n\t\t\t\t\t\"/\\[ATTACHMENT\\s*=\\s*([^\\]]*)\\]/is\".BX_UTF_PCRE_MODIFIER,\n\t\t\t\t\tfunction ($matches) use ($attachmentRelations)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (isset($attachmentRelations[$matches[1]]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn \"[DISK FILE ID=\".$attachmentRelations[$matches[1]].\"]\";\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t$fields[\"MESSAGE\"]\n\t\t\t\t);\n\n\t\t\t\t$commentId = \\CSocNetLogComments::add($fields, true, false);\n\n\t\t\t\tif ($commentId)\n\t\t\t\t{\n\t\t\t\t\tforeach (EventManager::getInstance()->findEventHandlers('socialnetwork', 'OnAfterSocNetLogEntryCommentAdd') as $handler)\n\t\t\t\t\t{\n\t\t\t\t\t\tExecuteModuleEventEx($handler, array($logEntry, array(\n\t\t\t\t\t\t\t\"SITE_ID\" => $siteId,\n\t\t\t\t\t\t\t\"COMMENT_ID\" => $commentId\n\t\t\t\t\t\t)));\n\t\t\t\t\t}\n\n\t\t\t\t\t$skipCounterIncrement = false;\n\t\t\t\t\tforeach (EventManager::getInstance()->findEventHandlers('socialnetwork', 'OnBeforeSocNetLogCommentCounterIncrement') as $handler)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (ExecuteModuleEventEx($handler, array($logEntry)) === false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$skipCounterIncrement = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!$skipCounterIncrement)\n\t\t\t\t\t{\n\t\t\t\t\t\t\\CSocNetLog::counterIncrement(\n\t\t\t\t\t\t\t$commentId,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\"LC\",\n\t\t\t\t\t\t\t\\CSocNetLogRights::checkForUserAll($logEntry[\"ID\"])\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($comment = \\CSocNetLogComments::getByID($commentId))\n\t\t\t\t\t{\n\t\t\t\t\t\t\\Bitrix\\Socialnetwork\\ComponentHelper::addLiveComment(\n\t\t\t\t\t\t\t$comment,\n\t\t\t\t\t\t\t$logEntry,\n\t\t\t\t\t\t\t$commentEvent,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"ACTION\" => 'ADD',\n\t\t\t\t\t\t\t\t\"SOURCE_ID\" => 0,\n\t\t\t\t\t\t\t\t\"TIME_FORMAT\" => \\CSite::getTimeFormat(),\n\t\t\t\t\t\t\t\t\"PATH_TO_USER\" => $pathToUser,\n\t\t\t\t\t\t\t\t\"NAME_TEMPLATE\" => \\CSite::getNameFormat(null, $site[\"ID\"]),\n\t\t\t\t\t\t\t\t\"SHOW_LOGIN\" => \"N\",\n\t\t\t\t\t\t\t\t\"AVATAR_SIZE\" => 39,\n\t\t\t\t\t\t\t\t\"PATH_TO_SMILE\" => $pathToSmile,\n\t\t\t\t\t\t\t\t\"LANGUAGE_ID\" => $site[\"LANGUAGE_ID\"],\n\t\t\t\t\t\t\t\t\"SITE_ID\" => $site[\"ID\"],\n\t\t\t\t\t\t\t\t\"PULL\" => \"Y\"\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $commentId;\n\t}", "final public function execute() {\r\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\r\n Trace::debug('post: '.serialize($postStr));\r\n\r\n $echostr = MRequest::get('echostr');\r\n if (!empty($echostr)) {\r\n Trace::debug('echostr '.$echostr);\r\n echo $echostr;\r\n return;\r\n }\r\n//*\r\n if (!$this->checkSignature()) {\r\n $this->signatureFailed();\r\n return;\r\n }\r\n//*/\r\n //extract post data\r\n if (empty($postStr)){\r\n Trace::debug('empty poststr');\r\n $this->errorOccured();\r\n return;\r\n }\r\n\r\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\r\n\r\n $this->fromUser = $postObj->FromUserName;\r\n $this->toUser = $postObj->ToUserName;\r\n\r\n $this->xmlObj = $postObj;\r\n\r\n $msgtype = strval($postObj->MsgType);\r\n\r\n if ('text' === $msgtype) {\r\n $text = strval($postObj->Content);\r\n $this->receivedText($postObj, $text);\r\n } elseif ('event' === $msgtype) {\r\n $event = strval($postObj->Event);\r\n $eventKey = strval($postObj->EventKey);\r\n $this->receivedEvent($postObj, $event, $eventKey);\r\n } else {\r\n $this->receivedUnknown($postObj);\r\n }\r\n\r\n }", "function sendReply ($msg) {\n global $sender_id, $page_access_token;\n $arr = array ();\n if (is_string($msg)) {\n $arr = array(\n \"recipient\" => array(\"id\" => $sender_id),\n \"message\" => array(\"text\" => $msg)\n );\n\n } elseif (is_assoc($msg) && (!empty($msg['template_type']))) {\n $arr = array(\n \"recipient\" => array(\"id\" => $sender_id),\n \"message\" => array(\n \"attachment\" => array (\n \"type\" => \"template\",\n \"payload\" => $msg\n )\n )\n );\n\n } elseif (is_assoc($msg) && (!empty($msg['quick_replies']))) {\n $arr = array(\n \"recipient\" => array(\"id\" => $sender_id),\n \"message\" => $msg\n );\n\n } elseif (is_assoc($msg) && (!empty($msg['payload']['url']))) {\n $arr = array(\n \"recipient\" => array(\"id\" => $sender_id),\n \"message\" => array(\n \"attachment\" => $msg\n )\n );\n }\n\n if (empty($arr)) {\n error_log(\"Not a valid reply message!\");\n return;\n }\n\n $url = \"https://graph.facebook.com/v2.6/me/messages?access_token=\" . $page_access_token;\n $content = json_encode($arr);\n error_log($url);\n error_log($content);\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER,\n array(\"Content-type:application/json\")\n );\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n $resp = curl_exec($ch);\n $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n error_log($status . \" \" . $resp);\n }", "private function send_msg() {\r\n }", "public function handleSendEvent(object $message): void;", "function msgsrv_send ($target, $cmd, $content, $link) {}", "public function sendPayload() { \n \n \n /* Check and add last-second data that may have been changed by public methods */\n $this->createProxyData();\n $this->createCustomDimensions();\n if(!$this->payload['cn']) $this->createCampaignParameters(); /* ie, check $_GET array for them if still unset */\n \n foreach($this->payload as $i => $v) {\n if(strlen($v) > 0) {\n $params[] = urlencode($i) . '=' . urlencode($v) ;\n }\n }\n \n \n $url = ( ( $this->testing) ? ( $this->test_url ) : ( $this->base_url ) ) . \n '?' . implode('&', $params);\n \n// $url = ( ( $this->testing) ? ( $this->test_url ) : ( $this->base_url ) ) . \n// '?' . http_build_query($this->payload, \"&\");\n\n \n switch($this->output) {\n case 'silent':\n $this->sendCurl($url);\n break;\n case 'noscript':\n /* outputs only a noscript element containing the pixel for Non-Java Operation */\n $this->displayNoScriptPixel($url);\n break;\n case 'pixel':\n echo \"<img height='1' width='1' style='border-style:none;' alt='' src='https://$url&method=NAKED_PIXEL' />\";\n break;\n case 'javascript':\n /* TODO build dynamic javascript version */\n $this->displayJavascript();\n break;\n case 'auto':\n $this->displayJavascript();\n $this->displayNoScriptPixel($url);\n break;\n case 'test':\n $this->displayTestPixel($url);\n break;\n case 'iframe':\n $this->displayIframe($url);\n \n break;\n \n } \n \n \n \n\n \n \n $this->payload_is_sent = TRUE ;\n $this->writeLog($url); \n }", "public function processMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n \t//extract post data\n \t$logfile = fopen(\"./log/request_log\", \"a\");\n \tfwrite($logfile, $postStr);\n \tfclose($logfile);\n\t\tif (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n $parseObj = new RequestParse();\n $requestData = $parseObj->parse($postStr);\n $processObj = new RequestProcess();\n $responseData = $processObj->process($requestData);\n $responseObj = new RequestResponse();\n //echo $responseObj->response($responseData);\n\t\t $response = $responseObj->response($responseData);\n\t\t echo $response;\n\t\t $logfile = fopen(\"./log/response_log\", \"a\");\n\t\t fwrite($logfile, $response);\n\t\t fclose($logfile);\n }else {\n \techo \"\";\n \texit;\n }\n }", "public function getReplyPost();", "public function sendMessage(){\n\n\n }", "public function sendMessageToAction()\n {\n $error = '';\n if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_SESSION['user_id']))\n {\n $manager = MessageManager::getInstance();\n if ($manager->checkSendMessageTo($_POST))\n {\n \n $manager->sendMessageTo($_POST);\n $messages=$manager->getAllMessagesUserId($_POST['id-receiver']);\n echo json_encode(['messages' => $messages ]);\n exit(0);\n }\n else {\n echo json_encode(['error' => \"empty\" ]);\n exit(0);\n }\n }\n }", "abstract public function send($data);", "public function testDirectReply()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }", "public function handleDataSubmission() {}", "protected abstract function receive();", "public function actionSendMessage() {\n\n // get data, sent by client\n $data = Yii::app()->request->getPost('chat', array());\n\n // try to store message\n $model = new Chat();\n $result = $model->storeMessage($data);\n\n // prepare return array, set status\n $response = array(\n 'status' => (bool)$result\n );\n\n // encode return array\n echo json_encode($response);\n\n // force app to end\n Yii::app()->end();\n\t}", "public function replyAction()\n\t{\n\t\tZend_Layout::getMvcInstance()->disableLayout();\n\t\t/* $language = $this->getRequest()->getParam('lang');\n\t\t$decorator = new Zenfox_DecoratorForm();\n\t\t$form = new Player_TicketReplyForm();\n\t\t$form->getElement('reply_msg')->setDecorators($decorator->openingUlTagDecorator);\n\t\t$form->getElement('ticket_status')->setDecorators($decorator->changeUlTagDecorator);\n\t\t$form->getElement('submit')->setDecorators($decorator->closingUlButtonTagDecorator); */\n\t\t$session = new Zend_Auth_Storage_Session();\n\t\t$store = $session->read();\n\t\t$userType = $store['roleName'];\n\t\t$playerId = $store['id'];\n\t\t$ticketId = $this->getRequest()->ticket_id;\n\t\t$replyMessage = $this->getRequest()->replyMsg;\n\t\t$subject = $this->getRequest()->subject;\n\t\t$ticket = new Tickets($playerId, $userType);\n\t\tif(isset($replyMessage))\n\t\t{\n\t\t\t$data['ticket_status'] = 'OPEN';\n\t\t\t$data['reply_msg'] = $replyMessage;\n\t\t\t$ticket->replyTicket($data,$ticketId);\n\t\t\techo $ticketId;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = $ticket->showTicket($ticketId);\n\t\t\t//Zenfox_Debug::dump($message, 'message');\n\t\t\t\n\t\t\t$sender = \"\";\n\t\t\t$messages = \"\";\n\t\t\t$time = \"\";\n\t\t\tforeach($message as $msg)\n\t\t\t{\n\t\t\t\tif($msg['sent_by'] == 'CSR')\n\t\t\t\t{\n\t\t\t\t\t$csr = new CsrIds();\n\t\t\t\t\t$sender .= $csr->getCsrName($msg['owner']) . \"|\";\n\t\t\t\t}\n\t\t\t\tif($msg['sent_by'] == 'PLAYER')\n\t\t\t\t{\n\t\t\t\t\t$player = new CsrIds();\n\t\t\t\t\t$sender .= $player->getPlayerLogin($msg['user_id']) . \"|\";\n\t\t\t\t}\n\t\t\t\t$messages .= $msg['reply_msg'] . \"|\";\n\t\t\t\t$time .= $msg['time'] . \"|\";\n\t\t\t}\n\t\t\techo $sender . \"&\" . $messages . \"&\" . $ticketId . \"&\" . $subject . \"&\" . $time;\n\t\t}\n\t\t/*\n\t\t* Taking the value from the database and set into form\n\t\t*/\n\t\t/*\n\t\t$this->view->sender = $fromName;\n\t\t$this->view->messages = $message;\n\t\t//$this->_helper->FlashMessenger(array('notice' => $this->view->translate($message)));\n\t\tforeach($message as $ticketData)\n\t\t{\n\t\t\t$lastTicketStatus = $ticketData['ticket_status'];\n\t\t}\n\t\t$form->ticket_status->setValue($lastTicketStatus);\n\t\t$this->view->form = $form; */\n\t\t/* if($this->getRequest()->isPost())\n\t\t{\n\t\t\tif($form->isValid($_POST))\n\t\t\t{\n\t\t\t\t$data = $form->getValues();\n\t\t\t\t$ticket->replyTicket($data,$this->getRequest()->ticket_id);\n\t\t\t\t$this->_redirect($language . '/ticket/view');\n//\t\t\t\t$form = new Player_TicketReplyForm();\n//\t\t\t\t$this->view->form = $form;\n//\t\t\t\t$this->view->message = $this->view->translate('The message has been sent');\n\t\t\t}\n\t\t} */\n\t}", "abstract protected function _postHandle();", "public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n \t//extract post data\n\t\tif (!empty($postStr))\n { \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $msgType = $postObj->MsgType;\n \n $time = time();\n \n $textTpl = \"<xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n <FuncFlag>0</FuncFlag>\n </xml>\";\n \n if($msgType == \"text\")\n {\n \t/*\n $keyword = trim($postObj->Content);\n\t\t\t\t\n\t\t\t\t\n $msgType = \"text\";\n \n $contentStr = $keyword;\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n\t\t\t\t * \n\t\t\t\t */\n }\n else if($msgType == \"event\")\n {\n $event = $postObj->Event;\n if($event == \"subscribe\")\n {\n $msgType = \"text\";\n \n $contentStr = \"你好,欢迎你的关注!\";\n \n \n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }\n\t\t\t\telse if($event == \"CLICK\")\n\t\t\t\t{\n\t\t\t\t\t$eventKey = $postObj->EventKey;\n\t\t\t\t\t\n\t\t\t\t\tif($eventKey == \"VK_RECENT\")\n\t { \n\t \n\t $query = \"select `id`, `post_title`, `post_content`\n\t from `wp_posts`\n\t where `post_status` like 'publish' and `post_type` like 'post'\n\t order by `post_date` desc\n\t limit 0, 5\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t$sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"近期文章:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= '「<a href=\"'. SITE . '/?p=' . $row['id'] . '\">';\n\t\t $strTitle .= $row['post_title'];\n\t\t $strTitle .= \"</a>」\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\n\t \n\t }\n\t else if($eventKey == \"VK_DATE\")\n\t {\n\t $query = \"select year(`post_date`), month(`post_date`), extract(year_month from(`post_date`)), count(extract(year_month from(`post_date`))) \n\t from `wp_posts`\n\t where `post_status` like 'publish' and `post_type` like 'post' \n\t group by extract(year_month from(`post_date`))\n\t order by extract(year_month from(`post_date`)) desc\";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"文章归档:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?m=' . $row['extract(year_month from(`post_date`))'] . '\">';\n\t\t $strTitle .= $row['year(`post_date`)'] . \"年\".\n\t\t chineseMonth($row['month(`post_date`)']) . \"月\";\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count(extract(year_month from(`post_date`)))']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t \t}\n\t \n\t }\n\t else if($eventKey == \"VK_CATEGORY\")\n\t {\n\t \t$query = \"select `wp_terms`.`term_id`, `wp_terms`.`name`, `wp_term_taxonomy`.`count`\n\t from `wp_terms`, `wp_term_taxonomy`\n\t where `wp_term_taxonomy`.`taxonomy` like 'category' and `wp_term_taxonomy`.`count` != 0\n\t and `wp_terms`.`term_id` = `wp_term_taxonomy`.`term_id`\";\n\t \n\t \n\t $sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"分类目录:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?cat=' . $row['term_id'] . '\">';\n\t\t $strTitle .= $row['name'];\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t} \n\t }\n\t else if($eventKey == \"VK_TAG\")\n\t {\n\t $query = \"select `wp_terms`.`slug`, `wp_terms`.`name`, `wp_term_taxonomy`.`count`\n\t from `wp_terms`, `wp_term_taxonomy`\n\t where `wp_term_taxonomy`.`taxonomy` like 'post_tag' and `wp_term_taxonomy`.`count` != 0\n\t and `wp_terms`.`term_id` = `wp_term_taxonomy`.`term_id`\";\n\t \n\t \n\t $sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"标签列表:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?tag=' . $row['slug'] . '\">';\n\t\t $strTitle .= $row['name'];\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t }\t\t\t\t\t\n\t\t\t\t}\n }\n\n }\n else\n {\n \techo \"\";\n \texit;\n }\n }", "public function mail_sending_mechanism() {\n add_action( 'publish_post', [ $this, 'mail_handler' ], 10, 2 );\n }", "function sendGenericMessage($recipientId) {\n}", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function sendResponse(Payload $payload): void;", "function ts3client_requestSendServerTextMsg($serverConnectionHandlerID, $message) {}", "public function api_entry_sendnotification() {\n parent::validateParams(array('sender', 'receiver', 'subject'));\n\n if(!$this->Mdl_Users->get($_POST['sender'])) parent::returnWithErr(\"Sender is not valid\");\n if(!$this->Mdl_Users->get($_POST['receiver'])) parent::returnWithErr(\"Receiver is not valid\");\n\n $sender = $this->Mdl_Users->get($_POST['sender']);\n $receiver = $this->Mdl_Users->get($_POST['receiver']);\n\n unset($sender->password);\n unset($receiver->password);\n\n if ($_POST['subject'] == \"ipray_sendinvitation\") {\n $msg = $sender->username . \" has invited you.\";\n }\n else if ($_POST['subject'] == \"ipray_acceptinvitation\") {\n $msg = $sender->username . \" has accepted your invitation.\";\n\n // sender ---> receiver \n $this->Mdl_Users->makeFriends($_POST[\"sender\"], $_POST[\"receiver\"]);\n }\n else if ($_POST['subject'] == \"ipray_rejectinvitation\") {\n $msg = $sender->username . \" has rejected your invitation.\";\n }\n else if ($_POST['subject'] == 'ipray_sendprayrequest') {\n parent::validateParams(array('request'));\n }\n else if ($_POST['subject'] == 'ipray_acceptprayrequest') {\n parent::validateParams(array('request'));\n }\n else if ($_POST['subject'] == 'ipray_rejectprayrequest') {\n parent::validateParams(array('request'));\n }\n else {\n parent::returnWithErr(\"Unknown subject is requested.\");\n }\n\n if (!isset($receiver->devicetoken) || $receiver->devicetoken == \"\")\n parent::returnWithErr(\"User is not available at this moment. Please try again later.\");\n\n $payload = array(\n 'sound' => \"default\",\n 'subject' => $_POST['subject'],\n 'alert' => $msg,\n 'sender' => $sender,\n 'receiver' => $receiver\n );\n\n if (($failedCnt = $this->qbhelper->sendPN($receiver->devicetoken, json_encode($payload))) == 0) {\n $this->load->model('Mdl_Notifications');\n $this->Mdl_Notifications->create(array(\n 'subject' => $_POST['subject'],\n 'message' => $msg,\n 'sender' => $sender->id,\n 'receiver' => $receiver->id\n ));\n\n parent::returnWithoutErr(\"Contact request has been sent successfully.\");\n }\n else {\n parent::returnWithErr($failedCnt . \" requests have not been sent.\");\n }\n \n }", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n \n //extract post data\n if (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $msgType = $postObj->MsgType;//消息类型\n $event = $postObj->Event;//时间类型,subscribe(订阅)、unsubscribe(取消订阅)\n $textTpl = \"<xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n <FuncFlag>0</FuncFlag>\n </xml>\"; \n \n switch($msgType){\n case \"event\":\n if($event==\"subscribe\"){\n $contentStr = \"最新更新说明:\".\"\\n\".\"A:优化二维码搜索功能,搜索更精准\".\"\\n\".\"B:微信群二维码采集源更新:\".\"\\n\".\"1、百度贴吧\".\"\\n\".\"2、新浪微博\".\"\\n\".\"3、兴趣部落\".\"\\n\".\"4、700+陌陌群\".\"\\n\".\"5、3500+个微信群\".\"\\n\".\"6、1300+个QQ群\".\"\\n\".\"C:支持支付方式:\".\"\\n\".\"1、微信支付\".\"\\n\".\"2、支付宝(敬请期待)\";\n } \n break;\n case \"text\":\n /*switch($keyword){\n case \"1\":\n $contentStr = \"店铺地址:\".\"\\n\".\"杭州市江干艮山西路233号新东升市场地下室第一排.\"; \n break;\n case \"2\":\n $contentStr = \"商品种类:\".\"\\n\".\"杯子、碗、棉签、水桶、垃圾桶、洗碗巾(刷)、拖把、扫把、\"\n .\"衣架、粘钩、牙签、垃圾袋、保鲜袋(膜)、剪刀、水果刀、饭盒等.\";\n break;\n default:\n $contentStr = \"对不起,你的内容我会稍后回复\";\n }*/\n $contentStr = \"对不起,你的内容我会稍后回复\";\n break;\n }\n $msgType = \"text\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else {\n echo \"post str is null\";\n exit;\n }\n }", "private function sendMessage()\n {\n try\n {\n $request = $_POST;\n\n $uid = userid();\n\n if (!$uid)\n throw_error_msg( lang(\"you_not_logged_in\") ) ;\n\n if( !isset($request['username']) || $request['username']==\"\" )\n throw_error_msg(\"username not provided\");\n\n if( !isset($request['subject']) || $request['subject']==\"\" )\n throw_error_msg(\"subject not provided\");\n\n if( !isset($request['content']) || $request['content']==\"\" )\n throw_error_msg(\"content not provided\");\n\n $array['is_pm'] = true;\n $array['from'] = $uid;\n $array['to'] = $request['username'];\n $array['subj'] = mysql_clean($request['subject']);\n $array['content'] = mysql_clean($request['content']);\n\n global $cbpm;\n $rs = $cbpm->send_pm($array);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"message sent successfully\", \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n } \n\n }", "function send_reply($chatid, $msgid, $text){\r\n global $debug;\r\n $data = array(\r\n 'chat_id' => $chatid,\r\n 'text' => $text,\r\n 'parse_mode' => 'Markdown'\r\n //'reply_to_message_id' => $msgid // <---- biar ada reply nya balasannya, opsional, bisa dihapus baris ini\r\n );\r\n //Memproses pesan response dari server lokal agar bisa di kirim ke bot\r\n // mengubah \r\n $options = array(\r\n 'http' => array(\r\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\r\n 'method' => 'POST',\r\n // 'ignore_errors' => true,\r\n 'content' => http_build_query($data),\r\n ),\r\n );\r\n $context = stream_context_create($options); \r\n $result = file_get_contents(request_url('sendMessage'), false, $context);\r\n\r\n if ($debug) \r\n print_r($result);\r\n}", "function _sendMessageReply($chatId, $messageId, $text){\n\n $data = [\n 'chat_id' => $chatId,\n 'reply_to_message_id'=>$messageId,\n 'parse_mode'=>'HTML',\n 'disable_web_page_preview'=>true, \n 'text' => $text\n ];\n \n return Request('sendMessage', $data);\n}", "function reply_request($request_id) {\n $response = array('error' => '', 'result' => 'failed');\n \n //check if data is valid or not\n $this->form_validation->set_rules($this->orequest->validation_rules['reply']);\n if ($this->form_validation->run() === true) {\n $this->orequest->model_data = $this->input->post(array('sender_id', 'message'));\n $this->orequest->model_data['request_id'] = $request_id;\n $this->orequest->model_data['message_status'] = 'unread';\n $this->orequest->model_data['conversation_type'] = 'reply';\n\n $request = $this->orequest->get_request_data($request_id);\n $reply_id = $this->orequest->reply_request($request_id);\n\n if ($request_id) {\n $message_row = array();\n $message_row['id'] = $request->id;\n $message_row['senderId'] = $request->uid;\n $message_row['name'] = $request->name;\n $message_row['email'] = $request->email;\n $message_row['message'] = $this->input->post('message');\n $message_row['profilePic'] = $this->media->get_thumbnail($request->profile_pic, PROFILE_PICS, $request->email);\n\n $response['result'] = 'success';\n $response['message_row'] = $message_row;\n\n $agents = $this->orequest->get_request_agents($request);\n foreach ($agents as $agent) {\n // insertin notification in database.\n $notification_data = array();\n $notification_data['notification_type'] = 'offline_reply';\n $notification_data['request_id'] = $request->id;\n $notification_data['receiver_id'] = $agent->sender_id;\n $notification_data['message'] = $this->input->post('message');\n $notification_data['display_message'] = $request->name . \" replied you.\";\n $notification_data['sender_id'] = $request->uid;\n $notification_data['notification_status'] = 'unread';\n $this->chat_request->insert_notification($notification_data);\n \n // sending push notification\n $message = array();\n $notifications = $this->user->get_notifications($agent->sender_id);\n $message['notificationsCounter'] = count($notifications);\n $message['unreadSession'] = $this->chat_session->get_running_session($agent->sender_id);\n\n $message['type'] = 'offline_reply';\n $message['senderId'] = $request->uid;\n $message['name'] = $request->name;\n $message['email'] = $request->email;\n $message['profilePic'] = $this->media->get_thumbnail($request->profile_pic, PROFILE_PICS, $request->email, '404');\n $message['message'] = $this->input->post('message');\n $message['displayMessage'] = $request->name . $this->lang->line('request_reply');\n $message['requestID'] = $request->id;\n $message['replyID'] = $reply_id;\n\n push_notification($agent->sender_id, $message, 1);\n }\n } else {\n $response['error'] = $this->lang->line('process_error');\n }\n } else {\n $response['error'] = validation_errors();\n }\n\n return $this->output->set_content_type('application/json')->set_output($this->return_json($response));\n }", "public function handle($postData){\r\n\t\t\r\n\t}", "public function webhookHandler()\n {\n // Get Update\n $update = $this->telegram->commandsHandler(true);\n\n // Get Message\n $message = $update->getMessage();\n\n // Edge Case?\n if ($message === null) {\n return 'Ok';\n }\n\n // Track Data\n $this->logChatroom($message);\n\n // Okie Doke\n return 'Ok';\n }", "public function proceed(): void\n {\n try {\n if ($this->isOrderCanceled()) {\n $this->handleOrderCancel();\n }\n\n if (array_key_exists('oID', $_POST) && $this->_isProcessable($_POST['oID'])) {\n $this->_handleOrderLines();\n }\n\n parent::proceed();\n } catch (Exception $exception) {\n $messageDesc = 'mollie.payment.integration.event.notification.order_line_changed_error.description';\n $this->pushMessage('error', $messageDesc, $exception);\n }\n }", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }", "public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n if (!empty($postStr)){\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch ($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->receiveText1($postObj);\n break;\n case \"event\":\n $resultStr = $this->receiveEvent($postObj);\n break;\n default:\n $resultStr = \"\";\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n // \t//extract post data\n\t\t// if (!empty($postStr)){\n // /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n // the best way is to check the validity of xml by yourself */\n // libxml_disable_entity_loader(true);\n // \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n // $fromUsername = $postObj->FromUserName;\n // $toUsername = $postObj->ToUserName;\n // $keyword = trim($postObj->Content);\n // $time = time();\n // $textTpl = \"<xml>\n\t\t// \t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t// \t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t// \t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t// \t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t// \t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t// \t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t// \t\t\t\t\t</xml>\"; \n\t\t// \t\tif(!empty( $keyword ))\n // {\n // \t\t$msgType = \"text\";\n // \t$contentStr = \"Welcome to wechat world!\";\n // \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n // \techo $resultStr;\n // }else{\n // \techo \"Input something...\";\n // }\n\n // }else {\n // \techo \"\";\n // \texit;\n // }\n }", "public function send()\n {\n }", "protected function beforeSending()\n {\n }", "public function onMessage($sw, $frame)\n {\n if (!$frame->finish)\n return;\n\n $_POST = \\json_decode($frame->data, true);\n if ($_POST && $uri = &$_POST['m']) {\n\n $this->callRequest($uri, $frame);\n \\Swoolet\\log($uri, $frame->fd);\n\n $this->response($frame->fd, self::$msg);\n }\n }", "private function _processAction(& $ship, & $msg) {\r\n\r\n\t\t$fromId = $msg->fromId();\r\n\t\t$command = mb_strtolower($msg->command()); \r\n\t\t$params = $msg->params();\r\n\r\n\t\t$this->CI->commander->{$command}( $msg, $ship, $params );\r\n\r\n\t}", "public function handle()\n\t{\n\t\t\n\t\techo '通知淘宝发货',PHP_EOL;\n\t\techo json_encode($this->getData(),JSON_UNESCAPED_UNICODE),PHP_EOL;\n\t}", "abstract public function handler() : void;", "function send($response)\n {\n }", "public function send()\n {\n }", "public function send()\n {\n }", "public function send()\n {\n }", "function replyMessage ($message) {\n /*\n * Instantiate Recast.AI SDK, just for connect service\n */\n $request = Client::Request($_ENV[\"REQUEST_TOKEN\"]);\n\n /*\n * Get text from message received\n */\n $text = $message->content;\n\n /*\n * Get senderId to catch unique conversation_token\n */\n $senderId = $message->senderId;\n\n /*\n * Call Recast.AI SDK, through /converse route\n */\n $response = $request->converseText($text, [ 'conversation_token' => $senderId ]);\n\n /*\n * Here, you can add your own process.\n * Ex: You can call any external API\n * Or: Update your DB\n * etc...\n */\n $server = \"localhost\";\n$dbusername = \"root\";\n$dbpassword = \"root\";\n$dbname = \"phplms\";\nif ($response->action->slug == 'greetings') {\n // Do your code\necho \"Greetings User!\";\n\n\n$usernametext = \"sid\";\n$passwordtext = \"sid\";\n//array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n\n$conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\n// Check connection\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n} \nelse{\n$sql = \"SELECT * from register where username = 'sid' and password = 'sid';\";\n$result = $conn->query($sql);\n\n//if ($result->num_rows > 0) {\nif($result!=null){\n //array_push($response->replies, \"Inside rows > 0\");\n // output data of each row\n while($row = $result->fetch_assoc()) {\n //array_push($response->replies, \"Inside While\");\n //echo \"id: \" . $row[\"id\"]. \" - Name: \" . $row[\"firstname\"]. \" \" . $row[\"lastname\"]. \"<br>\";\n if($usernametext==$row[\"username\"]){\n if($passwordtext==$row[\"password\"]){\n //session_start();\n echo \"User found! Username = \".$row['username'].\"\\n\";\n echo \"Password = \".$row['password'].\"\\n\";\n //array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n //$_SESSION['username']=$usernametext;\n //$_SESSION['name']=$row[\"name\"];\n //header('Location: Auth.php');\n $conn->close();\n //exit;\n }\n }\n }\n}\nelse{\n echo \"0 results\";\n $conn->close();\n}\n}\n}\n\nif ($response->action->slug == 'online-test-marks') {\n $sql = \"\";\n $test_number = $response->memory->number->scalar;\n $username = $response->memory->username->value;\n if($username==null){\n array_push($response->replies, \"Code : Username is missing\");\n }\n //array_push($response->replies, \"Test number = \".$test_number);\n else if($test_number==null){\n //array_push($response->replies, \"Test number null\");\n\n \n }else{\n $sql = \"select * from onlinetest\".$test_number.\" where username = '\".$username.\"';\";\n $conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n} \nelse{\n$result = $conn->query($sql);\n\n//if ($result->num_rows > 0) {\nif($result!=null){\n array_push($response->replies, \"Your onlinetest\".$test_number.\" marks :\");\n // output data of each row\n while($row = $result->fetch_assoc()) {\n //echo \"id: \" . $row[\"id\"]. \" - Name: \" . $row[\"firstname\"]. \" \" . $row[\"lastname\"]. \"<br>\";\n array_push($response->replies, $row[\"cname\"].\" - \".$row[\"marks\"]);\n }\n }\n}\n}\n}\n\nif ($response->action->slug == 'login-1') {\n\n\n$usernametext = $response->memory->username->value;\n$passwordtext = $response->memory->password->value;\narray_push($response->replies, \"Username :\".$usernametext.\"END Password :\".$passwordtext.\"END\");\n//array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n//$result = null;\n$conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\n// Check connection\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n}\nelse{\n$sql = \"SELECT * from register where username = '.$usernametext.' and password = '.$passwordtext.';\";\n$result = $conn->query($sql);\narray_push($response->replies, \"No. of rows : \".mysqli_num_rows($result));\n//if ($result->num_rows > 0) {\nif($result!=null){\n//if(mysqli_num_rows($result)>0){\n array_push($response->replies, \"Code : Successfully logged in as \".$usernametext);\n array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n $conn->close();\n}\nelse{\n array_push($response->replies, \"Code : Username or password is wrong! Please log in again.\");\n $conn->close();\n}\n}\n}\n\nif ($response->action->slug == 'my-details') {\n $usernametext = $response->memory->username->value;\n $passwordtext = $response->memory->password->value;\n array_push($response->replies, \"Username : \".$usernametext.\" Password : \".$passwordtext);\n }\n /*\n * Add each replies received from API to replies stack\n */\n foreach ($response->replies as $reply) {\n $message->addReply([(object)['type' => 'text', 'content' => $reply]]);\n }\n\n $message->reply();\n}", "function jx_pnh_fran_resendreply()\r\n\t{\r\n\t\t$reply_for = $this->input->post('resend_reply_for');\r\n\t\t$output = array();\r\n\t\tif($this->db->query(\"select sender from pnh_sms_log where id = ?\",$reply_for)->num_rows())\r\n\t\t{\r\n\t\t\t$sender = $this->db->query(\"select sender from pnh_sms_log where id = ?\",$reply_for)->row()->sender;\r\n\t\t\t$msg_det = $this->db->query(\"select franchise_id,msg from pnh_sms_log where reply_for = ?\",$reply_for)->row_array();\r\n\t\t\t$this->erpm->pnh_sendsms($sender,$msg_det['msg'],$msg_det['franchise_id']);\r\n\t\t\t$output['message'] = 'Reply message sent';\r\n\t\t}else\r\n\t\t{\r\n\t\t\t$output['message'] = 'No SMS found';\r\n\t\t}\r\n\t\t\r\n\t\techo json_encode($output);\r\n\t}", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function reply()\n\t{\n\t\tif($this->return){\n\t\t\t$this->_reply(200, 'Ok', $this->return);\n\t\t}else{\n\t\t\t$this->_reply(200, 'Ok', $this->return);\n\t\t}\n\t\texit();\n\t}", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }", "protected function setReplyTo() {}", "public function process()\n {\n Phpfox::isUser(true);\n /**\n * LOCK this feature\n *\n if($iId = $this->request()->get('id'))\n {\n $aInvite = Phpfox::getService('customprofiles')->getInviteAnonymousMessage($iId);\n if(isset($aInvite['invite_id']) && Phpfox::getUserId() == $aInvite['invite_user_id'])\n {\n if (Phpfox::isModule('notification'))\n {\n $type_id = 'customprofiles_anonymousconfirm';\n Phpfox::getService('customprofiles.process')->addNotification($type_id, $aInvite['feed_id'], $aInvite['invite_user_id'],$aInvite['user_id']); \n Phpfox::getService('customprofiles.process')->removeInviteAnonymousMessage($iId); \n }\n }\n } \n **/\n \n $this->url()->send('');\n }", "public function process()\n\t{\n\t\t$aValidation = array(\n\t\t\t'message' => Phpfox::getPhrase('mail.add_reply')\n\t\t);\t\t\t\t\n\n\t\t$oValid = Phpfox::getLib('validator')->set(array(\n\t\t\t\t'sFormName' => 'js_form', \n\t\t\t\t'aParams' => $aValidation\n\t\t\t)\n\t\t);\t\t\t\t\n\t\n\t\t$aMail = Phpfox::getService('mail')->getMail($this->request()->getInt('id'));\t\n\t\t\n\t\tif (!isset($aMail['mail_id']))\n\t\t{\n\t\t\treturn Phpfox_Error::display(Phpfox::getPhrase('mail.invalid_message'));\n\t\t}\n\t\t\n\t\t$bCanView = false;\n\t\tif (($aMail['viewer_user_id'] == Phpfox::getUserId()) || ($aMail['owner_user_id'] == Phpfox::getUserId()))\n\t\t{\n\t\t\t$bCanView = true;\t\t\t\n\t\t}\n\t\t\n\t\tif ($bCanView === false)\n\t\t{\n\t\t\treturn Phpfox_Error::display(Phpfox::getPhrase('mail.invalid_message'));\n\t\t}\n\t\t\n\t\tif ($aVals = $this->request()->getArray('val'))\n\t\t{\t\t\t\n\t\t\tif ($oValid->isValid($aVals))\n\t\t\t{\n\t\t\t\t$aVals['to'] = $aMail['owner_user_id'];\n\t\t\t\t\n\t\t\t\tif (($iNewId = Phpfox::getService('mail.process')->add($aVals)))\n\t\t\t\t{\n\t\t\t\t\t$this->url()->send('mail.view', array('id' => $iNewId));\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\t\n\t\tif ($aMail['viewer_user_id'] == Phpfox::getUserId())\n\t\t{\n\t\t\tPhpfox::getService('mail.process')->toggleView($aMail['mail_id'], false);\n\t\t}\n\t\t\n\t\t$this->template()->assign(array(\n\t\t\t\t'bMobileInboxIsActive' => true,\n\t\t\t\t'aMail' => $aMail\n\t\t\t)\n\t\t);\n\t}", "public abstract function receive();", "private function send(): void\n {\n $data = [\n 'code' => $this->status,\n 'message' => $this->message,\n 'datetime' => Carbon::now()\n ];\n\n $config = config(\"tebot.$this->channelConfig\");\n\n $data['title'] = $this->title . ' ' . $config['name'];\n\n if (!empty($this->detail)) $data['detail'] = json_encode($this->detail);\n\n Http::withHeaders(['x-api-key' => $config['key']])->post($config['url'] . '/api/message', $data);\n }", "abstract public function handle_request();", "private function onAnswer()\n {\n if (!$this->checkAuth()) {\n return;\n }\n\n $payload = $this->clientEvent->getPayload();\n\n $checkAnswer = $this->getService('quest.quest_manager')->checkAnswer(\n $this->getUserId(),\n $payload['chapterId'] ?? null,\n $payload['answer'] ?? null\n );\n\n $this->send(new AnswerEvent($this->clientEvent, $checkAnswer));\n\n if ($checkAnswer) {\n $newData = $this\n ->getService('quest.quest_manager')\n ->getNewData($payload['chapterId'], $this->getUserId(), true);\n\n if ($newData) {\n $this->send(\n new NewContentEvent($newData)\n );\n }\n\n }\n }", "abstract protected function processNotification($responseObject);", "public function sendContent();", "public function handle()\n {\n $notificationsSent = 0;\n $sql = \"SELECT l.*, TIMESTAMPDIFF(MINUTE, created_at, time_end) as duration\n FROM call_log as l\n JOIN (\n SELECT phone_from, MIN(id) AS id\n FROM call_log GROUP BY phone_from\n ) AS t USING (id)\n WHERE l.sms_sent = :state\n AND TIMESTAMPDIFF(MINUTE, created_at, NOW()) >= :timeout\n \";\n\n $results = DB::select($sql, ['state' => 0, 'timeout' => 18]);\n foreach($results as $item) {\n try {\n // sending SMS message\n $message = $this->getMessage($item->duration);\n Twilio::from($item->phone_to)->sendSMS($item->phone_from, $message);\n\n // update sms notification state\n $model = CallLog::find($item->id);\n $model->sms_sent = 1;\n $model->save();\n\n $notificationsSent++;\n } catch(\\Exception $e) {\n Log::error($e->getMessage());\n }\n }\n\n $this->comment(PHP_EOL . \"Notifications sent: {$notificationsSent}\" . PHP_EOL);\n }", "public function chat_exec()\r\n {\r\n if(isset($_POST['method']) === true && empty($_POST['method']) === false){\r\n $method = trim($_POST['method']);\r\n if($method === 'fetch'){\r\n $messages = $this->Ajax->fetchMessages();\r\n if(empty($messages) === true){\r\n echo 'There are currently no messages in the chat';\r\n } else {\r\n foreach ($messages as $message){?>\r\n <div class=\"message\"><?php\r\n if(strlen($message['user_id']) === 10){?>\r\n <a href=\"#\"><?=Sessions::get('user')?></a> says:<?php\r\n }else{ ?>\r\n <a href=\"#\"><?=$message['username']?></a> says:<?php\r\n }?>\r\n <p><?=nl2br($message['message'])?></p>\r\n </div><?php \r\n }\r\n }\r\n }else if($method === 'throw' && isset($_POST['message']) === true){\r\n $message = trim($_POST['message']);\r\n if(empty($message) === false){\r\n $arrData = array('user' => $_SESSION['user_id'], 'message' => $message);\r\n $this->Ajax->throwMessage($arrData);\r\n }\r\n }\r\n }\r\n }", "public function story_response()\n {\n $user_id = $this->_require_login();\n $this->_require_register();\n\n $post_data = $this->input->post(NULL, TRUE);\n $story_id = $post_data['story_id'];\n $story = $this->story_model->get($story_id);\n\n if($this->_is_user_bottle($story_id) == 0 && $story[0]['story_user_id'] != $user_id){\n redirect('/pick');\n }else{\n\n $reply_to_id = $story[0]['story_user_id'];\n\n $reply_data = array(\n 'reply_sender_id' => $user_id,\n 'reply_story_id' => $story_id,\n 'reply_to_id' => $post_data['reply_to_id'],\n 'reply_text' => $post_data['response_content'],\n 'reply_time' => date(\"Y-m-d H:i:s\")\n );\n\n $reply_id = $this->reply_model->insert($reply_data);\n redirect('/bottles/'.$story_id);\n }\n }", "public function process_gateway_notification() {\r\n\t\t$order_id = self::get_post_var( 'OrderID' );\r\n\t\t$message = self::get_post_var( 'Message' );\r\n\t\t$status_code = self::get_post_var( 'StatusCode' );\r\n\t\t$prev_status_code = self::get_post_var( 'PreviousStatusCode' );\r\n\t\t$session_id = explode( ' ', self::get_post_var( 'OrderDescription' ) );\r\n\r\n\t\tif ( is_numeric( $status_code ) ) {\r\n\t\t\t$processed = WPSC_Purchase_Log::INCOMPLETE_SALE;\r\n\t\t\tswitch ( $status_code ) {\r\n\t\t\t\tcase PS_TRX_RESULT_SUCCESS:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::ACCEPTED_PAYMENT;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_REFERRED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_DECLINED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_DUPLICATE:\r\n\t\t\t\t\t$processed = ( PS_TRX_RESULT_SUCCESS === $prev_status_code )\r\n\t\t\t\t\t\t? WPSC_Purchase_Log::ACCEPTED_PAYMENT\r\n\t\t\t\t\t\t: WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_FAILED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::INCOMPLETE_SALE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\twp_die( 'Unsupported StatusCode. Please contact support.',\r\n\t\t\t\t\t\t'Unsupported StatusCode',\r\n\t\t\t\t\t\tarray( 'response' => 400 )\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t$data = array(\r\n\t\t\t\t'processed' => $processed,\r\n\t\t\t\t'transactid' => $order_id,\r\n\t\t\t\t'notes' => $message,\r\n\t\t\t\t'date' => time(),\r\n\t\t\t);\r\n\t\t\twpsc_update_purchase_log_details( $session_id[4], $data, 'sessionid' );\r\n\r\n\t\t\tswitch ( $processed ) {\r\n\t\t\t\tcase WPSC_Purchase_Log::ACCEPTED_PAYMENT:\r\n\t\t\t\t\ttransaction_results( $session_id, false, $order_id );\r\n\t\t\t\t\t// Thank you for purchasing.\r\n\t\t\t\t\t$this->go_to_transaction_results( $session_id[4] );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase WPSC_Purchase_Log::PAYMENT_DECLINED:\r\n\t\t\t\t\t// Sorry, your transaction was not accepted.\r\n\t\t\t\t\t$this->go_to_transaction_results( null );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t// Thank you, your purchase is pending.\r\n\t\t\t\t\t$this->go_to_transaction_results( $session_id[4] );\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twp_die( 'Unexpected response from the payment gateway. Please contact support.',\r\n\t\t\t\t'Unexpected response from the payment gateway',\r\n\t\t\t\tarray( 'response' => 400 )\r\n\t\t\t);\r\n\t\t}\r\n\t}" ]
[ "0.6169334", "0.59198314", "0.58171904", "0.5810356", "0.57903534", "0.57624507", "0.5705407", "0.5593771", "0.55916256", "0.5579155", "0.5577242", "0.55150706", "0.5488588", "0.54560393", "0.54274815", "0.54251635", "0.5414153", "0.5409192", "0.54054177", "0.53943425", "0.5362021", "0.53579473", "0.53579473", "0.53579473", "0.53579473", "0.53579473", "0.53440213", "0.53191143", "0.53157246", "0.5286981", "0.5242949", "0.5241975", "0.5223949", "0.52189106", "0.5195513", "0.5191309", "0.5162781", "0.5157827", "0.5146277", "0.5145306", "0.51287204", "0.5116033", "0.511115", "0.5109217", "0.51040435", "0.5103676", "0.5100802", "0.5097775", "0.5087734", "0.5087734", "0.5087734", "0.5087734", "0.5087734", "0.5087734", "0.5087734", "0.5087734", "0.5087734", "0.5087734", "0.5087734", "0.508599", "0.50689524", "0.5060692", "0.50530744", "0.5051949", "0.50493187", "0.504739", "0.5046875", "0.5035587", "0.50329536", "0.50272053", "0.50195634", "0.5018642", "0.50118434", "0.5010836", "0.50093", "0.5009255", "0.5007006", "0.50035316", "0.499637", "0.4991241", "0.4991241", "0.4991241", "0.49886394", "0.49801257", "0.4977141", "0.49734282", "0.49697813", "0.49684787", "0.49590588", "0.49588633", "0.49399602", "0.4937973", "0.49306262", "0.49190497", "0.49154663", "0.49151218", "0.490914", "0.49032208", "0.48981354", "0.48940772" ]
0.5424185
16
Handler for bbPress 2.x topic reply creation.
public function notify_forum_new_reply( $reply_id ) { $this->notify_forum_reply_payload( 'create-reply', $reply_id ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function post_new_reply() {\n\tglobal $core, $document, $user, $boards, $threads, $posts, $db;\n\n\tif (!isset($_POST['thread_id']) || !isset($_POST['board_id']) || !isset($_POST['post_name']) || !isset($_POST['post_message'])) {\n\t\tfatal_error(\"Some or all of the information needed to post a new message are missing. Please try again\");\n\t}\n\n\t//Make fields safe\n\t$boardid = make_safe(\"int\",$_POST['board_id']);\n\t$threadid = make_safe(\"int\",$_POST['thread_id']);\n\t$postname = make_safe(\"text\",$_POST['post_name']);\n\t$postmessage = make_safe(\"text\",$_POST['post_message']);\n\n\t//Sanity check fields\n\tif (strlen($postname) < 2 || strlen($postmessage) < 10) { \n\t\tfatal_error(\"Your message title or message text is too short. Please try again\");\n\t}\n\tif (!$boards->get_board($boardid)) {\n\t\tfatal_error(\"Invalid board specified. Please try again\");\n\t} \n\tif (!$threads->get_thread($threadid)) {\n\t\tfatal_error(\"Invalid thread specified. Please try again\");\n\t}\n\n\t//Now post the message\n\t$posts->new_post($user->get(\"user_id\"),$boardid,$threadid,$postname,$postmessage);\n\n\t//Now go back to the forum\n\t$core->do_redirect(\"forumdisplay.php?f=$boardid\");\t\t\n}", "public function reply_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['_id'] = $this->input->get('_id');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\t\t\n\t\t$this->Messages_model->reply($data);\n\t}", "public function __construct(CommunityTopicReply $reply)\n {\n //\n $this->reply = $reply;\n }", "public function create_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['to'] = $this->input->get('to');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\n\t\t$this->Messages_model->create($data);\n\t}", "public static function createReply($creationData)\n {\n // Since PDO only sanitizes for sql, sanitize using before passing to pdo\n $articleId = isset($creationData['article_id']) ? intval($creationData['article_id']) : NULL;\n $replyId = isset($creationData['reply_id']) ? intval($creationData['reply_id']) : NULL;\n $accountId = isset($creationData['account_id']) ? intval($creationData['account_id']) : NULL;\n $message = isset($creationData['message']) ? $creationData['message'] : '';\n\n if (\n $articleId === NULL ||\n $accountId === NULL ||\n $message === ''\n ) {\n // error, required fields not given\n exit();\n }\n\n\n $sql = \"\n INSERT INTO reply (\n id, \n article_id, \n reply_id, \n account_id, \n content, \n created_date, \n score\n ) VALUES (\n NULL,\n :article_id,\n :reply_id,\n :account_id,\n :content,\n DATE_FORMAT(NOW(), '%y-%m-%d %H:%i'),\n 0\n )\";\n $statement = Database::establishConnection()->prepare($sql);\n\n $statement->bindParam(':article_id', $articleId, PDO::PARAM_INT);\n $statement->bindParam(':reply_id', $replyId, PDO::PARAM_INT);\n $statement->bindParam(':account_id', $accountId, PDO::PARAM_INT);\n $statement->bindParam(':content', $message, PDO::PARAM_STR);\n\n if ( $statement->execute() === false ) {\n // log error, the creation of replies should be done through ajax in my opinion as the displaying of errors to the client is direct and doesn't require going to another page. \n }\n\n header(\"Location: \" . $_SERVER['HTTP_REFERER']);\n exit();\n }", "public function createAnswer()\n {\n $this->is_answer = true;\n $this->topic->is_answered = true;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n //\n $this->message->sendMessage();\n }", "function ld_add_reply_title ( $post_id )\r\n{\r\n\tglobal $bbdb;\r\n\r\n\tif ( !trim( $_POST['msgtitle'] ) && !trim( $_POST['topic'] ) )\r\n\t{\r\n\t\t$bb_ttl = \"(No Title)\";\r\n\t}\r\n\telse if ( !trim( $_POST['msgtitle'] ) && trim( $_POST['topic'] ) )\r\n\t{\r\n\t\t$bb_ttl = apply_filters('pre_topic_title', trim( $_POST['topic'] ), false);\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$bb_ttl = apply_filters('pre_topic_title', trim( $_POST['msgtitle'] ), false);\r\n\t}\r\n\r\n\tif ( $bb_ttl && $post_id ) {\r\n\t\t$bbdb->query(\"UPDATE $bbdb->posts SET post_title='$bb_ttl' WHERE post_id='$post_id'\");\r\n\t\treturn $post_id;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "public function createAction()\n {\n if ($this->getRequest()->isPost())\t\t\t//avoids direct access without having an ID pass\n {\n $this->view->title = ' - Thema';\n\n $this->view->topicID = $_POST[\"topicID\"];\t\t//sends topicID to view\n $this->view->topicName = $_POST[\"topicName\"];\t//sends topicName to view\n }\n else\n {\n $this->_redirect('/');\t\t\t\t//goes to mainpage\n }\n }", "function create_reply($reply, $user_id, $comment_id, $today){\n global $db;\n $query = 'INSERT INTO replies\n (reply, user_id, comment_id, created)\n VALUES\n (:reply, :user_id, :comment_id, :created)';\n $statement = $db->prepare($query);\n $statement->bindValue(':reply', $reply);\n $statement->bindValue(':user_id', $user_id);\n $statement->bindValue(':comment_id', $comment_id);\n $statement->bindValue(':created', $today);\n $statement->execute();\n $statement->closeCursor();\n }", "function createTopic($name)\n\t{\n\t\tif(trim($name) == \"\")return $this->message(FORUM_URES_MEZO);\n\t\tif($this->isHavePriv(FORUM_PRIV_TOPIC_CREATE))\n\t\t\treturn mysql_query(\t\"INSERT INTO `\".$this->prefix.\"topic`(`topic_name`,`topic_cat`,`topic_created_by`,`topic_created_time`) \".\n\t\t\t\t\t\t\t\"VALUES('\".specChars($name,\"forum::createTopic\").\"',\".$this->cat_id.\",\".$this->akt_user.\",\".time().\")\");\n\t\telse return $this->message(FORUM_MESSAGE_PRIV_ERROR);\n\t}", "function create_CPTs ()\n\t{\n\t\t\n\t\t\n\t\t$naming = getTopicNaming();\t\t\n\t\t$singular = $naming[0];\n\t\t$plural = pluralize($singular);\n\t\n\t\t//Topics\n\t\t$labels = array(\n\t\t\t'name' => $plural,\n\t\t\t'singular_name' => $singular,\n\t\t\t'menu_name' => $plural,\n\t\t\t'name_admin_bar' => $plural,\n\t\t\t'add_new' => 'Add New '.$singular,\n\t\t\t'add_new_item' => 'Add New '.$singular,\n\t\t\t'new_item' => 'New '.$singular,\n\t\t\t'edit_item' => 'Edit '.$singular,\n\t\t\t'view_item' => 'View '.$plural,\n\t\t\t'all_items' => 'All '.$plural,\n\t\t\t'search_items' => 'Search '.$plural,\n\t\t\t'parent_item_colon' => '',\n\t\t\t'not_found' => 'No '.$plural.' found.',\n\t\t\t'not_found_in_trash' => 'No '.$plural.' found in Trash.'\n\t\t);\n\t\n\t\t$args = array(\n\t\t\t'menu_icon' => 'dashicons-portfolio',\t\t\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_nav_menus'\t => false,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array( 'slug' => 'topics' ),\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => true,\n\t\t\t'hierarchical' => true,\n\t\t\t'menu_position' => 21,\n\t\t\t'supports' => array( 'title', 'editor', 'revisions', 'thumbnail' )\n\t\t\t\n\t\t);\n\t\t\n\t\t\n\t\t\n\t\tregister_post_type( 'imperial_topic', $args );\n\t\t//remove_post_type_support('term-session', 'editor');\t\n\t\t\n\t}", "public function create()\n {\n return view('admin.topic.create');\n }", "function quick_reply($topic_id, $forum_id, &$topic_data)\r\n{\r\n\tglobal $template, $user, $auth, $db;\r\n\tglobal $phpbb_root_path, $phpEx, $config;\r\n\r\n\t// Some little config for the quick reply, allows the admin to change these default values through the database.\r\n\t$qr_config = array(\r\n\t\t'enabled'\t\t\t=> true, \t// Disable it easily\r\n\t\t'display_subject'\t=> true,\t// Do you want the subject line to be displayed\r\n\t\t'hide_box'\t\t\t=> false,\t// Shall the box be hidden on pageload?\r\n\t\t'resize'\t\t\t=> false,\t// Display the buttons to resize the textarea?\r\n\t);\r\n\r\n\t// do evil_qr_ prefixed of the config values exist in $config\r\n\t// /me slaps highway of life\r\n\tforeach (array_keys($qr_config) as $key)\r\n\t{\r\n\t\tif (isset($config['evil_qr_' . $key]))\r\n\t\t{\r\n\t\t\t$qr_config[$key] = $config['evil_qr_' . $key];\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if user has reply permissions for this forum or the topic is locked (thanks damnian)\r\n\tif (!$auth->acl_get('f_reply', $forum_id) || ($topic_data['topic_status'] == ITEM_LOCKED && !$auth->acl_get('m_lock', $forum_id)) || !$qr_config['enabled'])\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\r\n\t// Hidden fields\r\n\t$s_hidden_fields = array(\r\n\t\t't'\t\t\t=> $topic_id,\r\n\t\t'f'\t\t\t=> $forum_id,\r\n\t\t'mode'\t\t=> 'reply',\r\n\t\t'lastclick'\t=> time(),\r\n\t\t'icon'\t\t=> 0,\r\n\t);\r\n\r\n\t// Set preferences such as allow smilies, bbcode, attachsig\r\n\t$reply_prefs = array(\r\n\t\t'disable_bbcode'\t=> ($config['allow_bbcode'] && $user->optionget('bbcode')) ? false : true,\r\n\t\t'disable_smilies'\t=> ($config['allow_smilies'] && $user->optionget('smilies')) ? false : true,\r\n\t\t'disable_magic_url'\t=> false,\r\n\t\t'attach_sig'\t\t=> ($config['allow_sig'] && $user->optionget('attachsig')) ? true: false,\r\n\t\t'notify'\t\t\t=> ($config['allow_topic_notify'] && ($user->data['user_notify'] || isset($topic_data['notify_status']))) ? true : false,\r\n\t\t'lock_topic'\t\t=> ($topic_data['topic_status'] == ITEM_LOCKED && $auth->acl_get('m_lock', $forum_id)) ? true : false,\r\n\t);\r\n\r\n\tforeach ($reply_prefs as $name => $value)\r\n\t{\r\n\t\tif ($value)\r\n\t\t{\r\n\t\t\t$s_hidden_fields[$name] = 1;\r\n\t\t}\r\n\t}\r\n\r\n\t$subject = ((strpos($topic_data['topic_title'], 'Re: ') !== 0) ? 'Re: ' : '') . censor_text($topic_data['topic_title']);\r\n\r\n\tif (!$qr_config['display_subject'])\r\n\t{\r\n\t\t// /me is a show-off\r\n\t\tlist($s_hidden_fields['subject'], $subject) = array($subject, '');\r\n\t}\r\n\r\n\t// Confirmation code handling (stolen from posting.php)\r\n\tif ($config['enable_post_confirm'] && !$user->data['is_registered'])\r\n\t{\r\n\t\t// Show confirm image\r\n\t\t$sql = 'DELETE FROM ' . CONFIRM_TABLE . \"\r\n\t\t\tWHERE session_id = '\" . $db->sql_escape($user->session_id) . \"'\r\n\t\t\t\tAND confirm_type = \" . CONFIRM_POST;\r\n\t\t$db->sql_query($sql);\r\n\r\n\t\t// Generate code\r\n\t\t$code = gen_rand_string(mt_rand(5, 8));\r\n\t\t$confirm_id = md5(unique_id($user->ip));\r\n\t\t$seed = hexdec(substr(unique_id(), 4, 10));\r\n\r\n\t\t// compute $seed % 0x7fffffff\r\n\t\t$seed -= 0x7fffffff * floor($seed / 0x7fffffff);\r\n\r\n\t\t$sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(\r\n\t\t\t'confirm_id'\t=> (string) $confirm_id,\r\n\t\t\t'session_id'\t=> (string) $user->session_id,\r\n\t\t\t'confirm_type'\t=> (int) CONFIRM_POST,\r\n\t\t\t'code'\t\t\t=> (string) $code,\r\n\t\t\t'seed'\t\t\t=> (int) $seed,\r\n\t\t));\r\n\r\n\t\t$db->sql_query($sql);\r\n\r\n\t\t$template->assign_vars(array(\r\n\t\t\t'S_CONFIRM_CODE'\t=> true,\r\n\t\t\t'CONFIRM_ID'\t\t=> $confirm_id,\r\n\t\t\t'CONFIRM_IMAGE'\t\t=> '<img src=\"' . append_sid(\"{$phpbb_root_path}ucp.$phpEx\", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_POST) . '\" alt=\"\" title=\"\" />',\r\n\t\t));\r\n\t}\r\n\r\n\t// new RC6/RC7 stuff\r\n\tadd_form_key('posting');\r\n\r\n\t// Page title & action URL, include session_id for security purpose\r\n\t$s_action = append_sid(\"{$phpbb_root_path}posting.$phpEx\", false, true, $user->session_id);\r\n\r\n\t// Assign template variables\r\n\t$template->assign_vars(array(\r\n\t\t'QR_SUBJECT'\t\t\t=> $subject,\r\n\r\n\t\t'S_QR_HIDDEN_FIELDS'\t=> build_hidden_fields($s_hidden_fields),\r\n\t\t'S_QR_POST_ACTION'\t\t=> $s_action,\r\n\r\n\t\t'S_QR_ENABLED'\t\t\t=> $qr_config['enabled'], // this is true anyway :P\r\n\t\t'S_QR_SUBJECT'\t\t\t=> $qr_config['display_subject'],\r\n\t\t'S_QR_HIDE_BOX'\t\t\t=> $qr_config['hide_box'],\r\n\t\t'S_QR_RESIZE'\t\t\t=> $qr_config['resize'],\r\n\t));\r\n}", "function ticketCreate($creator, $cat, $topic, $text)\r\n{\r\n\tglobal $db, $_cfg;\r\n\tif (!is_array($creator))\r\n\t{\r\n\t\t$usr = opReadUser($creator);\r\n\t\tif (!$usr)\r\n\t\t\treturn 'user_not_found';\r\n\t\t$creator = array('uID' => $creator, 'Name' => $usr['aName'], 'Mail' => $usr['uMail']);\r\n\t}\r\n//\tif (!validMail($frommail))\r\n//\t\treturn 'mail_wrong';\r\n\tif (!$topic)\r\n\t\treturn 'topic_empty';\r\n\tif (!$text)\r\n\t\treturn 'text_empty';\r\n\t$tid = $db->insert('Tickets', array(\r\n\t\t'tuID' => $creator['uID'],\r\n\t\t'tTS' => timeToStamp(),\r\n//\t\t'tTID' => ???,\r\n\t\t'tName' => $creator['Name'],\r\n\t\t'tMail' => $creator['Mail'],\r\n\t\t'tCat' => $cat,\r\n\t\t'tTopic' => $topic,\r\n\t\t'tText' => $text,\r\n\t\t'tPriority' => 1,\r\n\t\t'tState' => 1,\r\n\t\t'tLTS' => timeToStamp()\r\n\t));\r\n\t$creator['id'] = $tid;\r\n\t$creator['topic'] = $topic;\r\n\t$creator['text'] = $text;\r\n\t$creator['url'] = fullURL(moduleToLink('tickets/admin/ticket'));\r\n\tsendMailToAdmin('NewTicket', $creator);\r\n\treturn $tid;\r\n}", "public function make_post_forum_topic($forum_name, $topic_identifier, $member, $post_title, $_post, $content_title, $topic_identifier_encapsulation_prefix, $content_url = null, $time = null, $ip = null, $validated = null, $topic_validated = 1, $skip_post_checks = false, $poster_name_if_guest = '', $parent_id = null, $staff_only = false)\n {\n $__post = comcode_to_tempcode($_post);\n $post = $__post->evaluate();\n\n if (is_null($time)) {\n $time = time();\n }\n if (is_null($ip)) {\n $ip = get_ip_address();\n }\n $forum_id = $this->forum_id_from_name($forum_name);\n if (is_null($forum_id)) {\n warn_exit(do_lang_tempcode('MISSING_FORUM', escape_html($forum_name)));\n }\n\n $username = $this->_get_username($member);//needed for the mybb_theads DB table\n\n $test = $this->connection->query_select('forums', array('*'), null, '', 1);\n $fm = array_key_exists('status', $test[0]);\n\n $topic_id = $this->find_topic_id_for_topic_identifier($forum_name, $topic_identifier);\n\n $ip_address = $ip;\n $long_ip_address = $this->_phpbb_ip($ip);\n $local_ip_address = '127.0.0.1'; //$this->_phpbb_ip('127.0.0.1');\n\n $is_new = is_null($topic_id);\n if ($is_new) {\n $topic_id = $this->connection->query_insert('threads', array('fid' => $forum_id, 'subject' => $content_title . ', ' . $topic_identifier_encapsulation_prefix . ': #' . $topic_identifier, 'username' => $username, 'uid' => $member, 'lastposter' => $username, 'lastposteruid' => $member, 'visible' => 1, 'dateline' => $time, 'lastpost' => $time), true);\n $home_link = hyperlink($content_url, $content_title, false, true);\n $this->connection->query_insert('posts', array('fid' => $forum_id, 'tid' => $topic_id, 'username' => do_lang('SYSTEM', '', '', '', get_site_default_lang()), 'uid' => $member, 'message' => do_lang('SPACER_POST', $home_link->evaluate(), '', '', get_site_default_lang()), 'subject' => '', 'dateline' => $time, 'visible' => 1, 'ipaddress' => $ip_address, 'longipaddress' => $long_ip_address));\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'forums SET posts=(posts+1), threads=(threads+1) WHERE fid=' . (string)intval($forum_id), 1);\n }\n\n $GLOBALS['LAST_TOPIC_ID'] = $topic_id;\n $GLOBALS['LAST_TOPIC_IS_NEW'] = $is_new;\n\n if ($post == '') {\n return array($topic_id, false);\n }\n\n $this->connection->query_insert('posts', array('fid' => $forum_id, 'tid' => $topic_id, 'username' => $username, 'uid' => $member, 'message' => $post, 'subject' => $post_title, 'dateline' => $time, 'visible' => 1, 'ipaddress' => $ip_address, 'longipaddress' => $long_ip_address));\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'forums SET posts=(posts+1), lastpost=' . strval($time) . ', lastposter=\\'' . db_escape_string($username) . '\\' WHERE fid=' . (string)intval($forum_id), 1);\n $this->connection->query('UPDATE ' . $this->connection->get_table_prefix() . 'threads SET lastpost=' . strval($time) . ', lastposter=\\'' . db_escape_string($username) . '\\', lastposteruid=' . strval($member) . ', replies=(replies+1) WHERE tid=' . (string)intval($topic_id), 1);\n\n return array($topic_id, false);\n }", "function postDiscussionReply()\n\t{\n\t\t//init variable\n\t\t$mainframe = JFactory::getApplication();\n\t\t$log_user = $this->plugin->get('user')->id;\n\t\t// Load the discussion\n\t\t$discuss_id \t= $mainframe->input->get('discussion_id',0,'INT');\n\t\t$groupId \t= $mainframe->input->get('group_id',0,'INT');\n\t\t$content \t= $mainframe->input->get('content','','RAW');\n\t\t\n\t\t$content = str_replace('<p>','',$content);\n\t\t$content = str_replace('</p>','',$content);\n\t\t$content = str_replace('<','[',$content);\n\t\t$content = str_replace('>',']',$content);\n\t\t\n\t\t$wres = new stdClass;\n\t\t\n\t\t$discussion = FD::table( 'Discussion' );\n\t\t$discussion->load( $discuss_id );\n\t\t\n\t\t// Get the current logged in user.\n\t\t$my\t\t= FD::user($log_user);\n\n\t\t// Get the group\n\t\t$group\t\t= FD::group( $groupId );\n\t\t\n\t\t$reply \t\t\t\t= FD::table( 'Discussion' );\n\t\t$reply->uid \t\t= $discussion->uid;\n\t\t$reply->type \t\t= $discussion->type;\n\t\t$reply->content \t= $content;\n\t\t$reply->created_by \t= $log_user;\n\t\t$reply->parent_id \t= $discussion->id;\n\t\t$reply->state \t\t= SOCIAL_STATE_PUBLISHED;\n\n\t\t// Save the reply.\n\t\t$state = $reply->store();\n\t\t\n\t\tif($state)\n\t\t{\t\n\t\t\t$this->createStream($discussion,$group,$reply,$log_user);\n\t\t\t$wres->id = $discussion->id;\n\t\t\t$wres->message[] = JText::_( 'PLG_API_EASYSOCIAL_DISCUSSION_REPLY_MESSAGE' );\n\t\t\treturn $wres;\n\t\t}\n\t}", "function Admin_Messages_admin_create($args)\n{\n // Get parameters from whatever input we need. All arguments to this\n // function should be obtained from pnVarCleanFromInput(), getting them\n // from other places such as the environment is not allowed, as that makes\n // assumptions that will not hold in future versions of PostNuke\n list($title,\n $content,\n $language,\n $active,\n $expire,\n $whocanview) = pnVarCleanFromInput('title',\n 'content',\n\t\t\t 'language',\n 'active',\n 'expire',\n 'whocanview');\n\n // Admin functions of this type can be called by other modules. If this\n // happens then the calling module will be able to pass in arguments to\n // this function through the $args parameter. Hence we extract these\n // arguments *after* we have obtained any form-based input through\n // pnVarCleanFromInput().\n extract($args);\n\n // Confirm authorisation code. This checks that the form had a valid\n // authorisation code attached to it. If it did not then the function will\n // proceed no further as it is possible that this is an attempt at sending\n // in false data to the system\n if (!pnSecConfirmAuthKey()) {\n pnSessionSetVar('errormsg', _BADAUTHKEY);\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n return true;\n }\n\n // Notable by its absence there is no security check here. This is because\n // the security check is carried out within the API function and as such we\n // do not duplicate the work here\n\n // The API function is called. Note that the name of the API function and\n // the name of this function are identical, this helps a lot when\n // programming more complex modules. The arguments to the function are\n // passed in as their own arguments array\n $mid = pnModAPIFunc('Admin_Messages',\n 'admin',\n 'create',\n array('title' => $title,\n 'content' => $content,\n\t\t\t 'language' => $language,\n\t\t\t 'active' => $active,\n\t\t\t 'expire' => $expire,\n\t\t\t 'whocanview' => $whocanview));\n\n // The return value of the function is checked here, and if the function\n // suceeded then an appropriate message is posted. Note that if the\n // function did not succeed then the API function should have already\n // posted a failure message so no action is required\n if ($mid != false) {\n // Success\n pnSessionSetVar('statusmsg', _ADMINMESSAGESCREATED);\n }\n\n // This function generated no output, and so now it is complete we redirect\n // the user to an appropriate page for them to carry on their work\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n\n // Return\n return true;\n}", "function AddTopic()\n{\n global $context, $txt, $mbname, $db_prefix;\n\n // Check permission\n $a_add = allowedTo('smftags_add');\n\n if ($a_add == false)\n fatal_error($txt['cannot_smftags_add'],false);\n\n // get query results to build array of all tags\n $query = db_query(\"\n SELECT t.tag AS tag, t.ID_TAG AS ID_TAG, COUNT(l.ID_TAG) AS quantity, t.approved AS approved\n FROM {$db_prefix}tags AS t\n LEFT JOIN {$db_prefix}tags_log AS l ON t.ID_TAG = l.ID_TAG\n GROUP BY t.ID_TAG\n ORDER BY t.tag ASC\",\n __FILE__, __LINE__);\n\n $context['tags'] = array();\n while ($row = mysql_fetch_assoc($query))\n {\n $context['tags'][] = array(\n 'ID_TAG' => $row['ID_TAG'],\n 'tag' => $row['tag'],\n 'quantity' => $row['quantity'],\n 'approved' => $row['approved'],\n 'tagged' => 0,\n );\n }\n // don't load the subtemplate\n}", "public function create()\n {\n $this->viewData['create'] = [\n 'parents' => Topic::where('contents.key', 'discussion-topic')->get(),\n ];\n\n return parent::contentCreate();\n }", "function reply()\r\n\t{\r\n\t\t\r\n\t\t//must be logged in\r\n\t\t$this->dx_auth->check_uri_permissions();\r\n\t\t\r\n\t\t//set the data variable\r\n\t\t$data['parent_id'] = $this->uri->segment(3);\r\n\t\t\r\n\t\t//the parent id is the id we are replying to.\r\n\t\t$this->db->where('meaning_id', $data['parent_id']);\r\n\t\t//we have to do this so we can get the song_id from the parent's meaning\r\n\t\t$data['query'] = $this->db->get('meanings');\r\n\t\t\r\n\t\t//load the meanings reply view\r\n\t\t$this->template->write('title', 'Replying to a meaning');\r\n\t\t$this->template->write_view('content', 'meanings/reply', $data, true);\r\n\t\t$this->template->render();\r\n\t}", "public function create()\n {\n return view('backend.topics.create');\n }", "public function create()\n {\n return view('topic.create');\n }", "public function postCreationSuccessful() {\n $this->setDisplayMessage(\"Posted new message.\");\n $this->redirect();\n die();\n }", "public function getReplyPost();", "public function createLink() {\n\t\t$sql = \"INSERT INTO\twbb\".WBB_N.\"_thread\n\t\t\t\t\t(boardID, languageID, prefix, topic, time, userID, username, lastPostTime, \n\t\t\t\t\tlastPosterID, lastPoster, replies, views, ratings, rating, attachments,\n\t\t\t\t\tpolls, isAnnouncement, isSticky, isDisabled, everEnabled, isClosed, isDeleted,\n\t\t\t\t\tmovedThreadID, movedTime, deleteTime, deletedBy, deletedByID, deleteReason)\n\t\t\tVALUES\t\t(\".$this->boardID.\",\n\t\t\t\t\t\".$this->languageID.\",\n\t\t\t\t\t'\".escapeString($this->prefix).\"',\n\t\t\t\t\t'\".escapeString($this->topic).\"',\n\t\t\t\t\t\".$this->time.\",\n\t\t\t\t\t\".$this->userID.\",\n\t\t\t\t\t'\".escapeString($this->username).\"',\n\t\t\t\t\t\".$this->lastPostTime.\",\n\t\t\t\t\t\".$this->lastPosterID.\",\n\t\t\t\t\t'\".escapeString($this->lastPoster).\"',\n\t\t\t\t\t\".$this->replies.\",\n\t\t\t\t\t\".$this->views.\",\n\t\t\t\t\t\".$this->ratings.\",\n\t\t\t\t\t\".$this->rating.\",\n\t\t\t\t\t\".$this->attachments.\",\n\t\t\t\t\t\".$this->polls.\",\n\t\t\t\t\t\".$this->isAnnouncement.\",\n\t\t\t\t\t\".$this->isSticky.\",\n\t\t\t\t\t\".$this->isDisabled.\",\n\t\t\t\t\t\".$this->everEnabled.\",\n\t\t\t\t\t\".$this->isClosed.\",\n\t\t\t\t\t\".$this->isDeleted.\",\n\t\t\t\t\t\".$this->threadID.\",\n\t\t\t\t\t\".TIME_NOW.\",\n\t\t\t\t\t\".$this->deleteTime.\",\n\t\t\t\t\t'\".escapeString($this->deletedBy).\"',\n\t\t\t\t\t\".$this->deletedByID.\",\n\t\t\t\t\t'\".escapeString($this->deleteReason).\"')\";\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "public function executeTopicNew(sfWebRequest $request)\n {\n\t\t$this->flagForumsId = '';\n\t\tif($request->hasParameter('flagForumsId'))\n\t\t\tif($request->getParameter('flagForumsId'))\n\t\t\t\t$this->flagForumsId = $request->getParameter('flagForumsId');\n\t\t\t\t\n $this->form = new ForumTopicsForm();\n }", "function setReply($key,$content,$isNews=false){\n\t$mysql=new MySQL();\n\t$mysql->table(REPLY_TABLE)->where(\"`key`='$key'\")->delete();\n\tif($isNews==false){\t\t//it's a text\n\t\t$mysql->data(array('key'=>$key,'type'=>'text','content'=>$content))->table(REPLY_TABLE)->add();\n\t}else{\n\t\t$mysql->data(array('key'=>$key,'type'=>'news','content'=>$content))->table(REPLY_TABLE)->add();\n\t\t//News message do not content description or now\n\t\t//We can resepon just one NewsMessage now\n\t}\n\t\n\n}", "public function forum_create() {\n\n if ( ! in('slug') ) ferror(-50020, 'category_nicename(Forum ID) is not provided');\n if ( ! in('category_description') ) wp_send_json_error(['code'=>-50021,'message'=>'category_description is not provided']);\n if ( ! in('cat_name') ) wp_send_json_error(['code'=>-50022,'message'=>'cat_name(Forum Name) is not provided']);\n\n /**\n * Put category parent ID\n */\n if ( ! $category_parent = in('category_parent') ) {\n $category_parent = get_category_by_slug( FORUM_CATEGORY_SLUG )->term_id;\n }\n $catarr = array(\n 'cat_name' =>in('cat_name'),\n 'category_description' => in('category_description'),\n 'category_nicename' => in('slug'),\n 'category_parent' => $category_parent\n );\n\n $term_ID = $this->createOrUpdate( $catarr );\n\n if ( is_wp_error( $term_ID ) ) {\n wp_send_json_error( ['code'=>-4100, 'message'=>$term_ID->get_error_message()] );\n }\n\n $this->updateMeta( $term_ID );\n $this->response();\n }", "function CloneTopic()\n{\n\tglobal $txt, $board, $topic, $user_info, $context, $language, $scripturl, $settings, $smcFunc, $modSettings;\n\n\tif (empty($topic))\n\t\tfatal_lang_error('no_access', false);\n\n\t$request = $smcFunc['db_query']('', '\n\t\tSELECT t.id_member_started, ms.subject, t.approved\n\t\tFROM {db_prefix}topics AS t\n\t\t\tINNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)\n\t\tWHERE t.id_topic = {int:current_topic}\n\t\tLIMIT 1',\n\t\tarray(\n\t\t\t'current_topic' => $topic,\n\t\t)\n\t);\n\tlist ($id_member_started, $context['subject'], $context['is_approved']) = $smcFunc['db_fetch_row']($request);\n\t$smcFunc['db_free_result']($request);\n\n\t// Can they see it - if not approved?\n\tif ($modSettings['postmod_active'] && !$context['is_approved'])\n\t\tisAllowedTo('approve_posts');\n\n\t// Permission check!\n\t// !!!\n\tif (!allowedTo('clone_any'))\n\t{\n\t\tif ($id_member_started == $user_info['id'])\n\t\t\tisAllowedTo('clone_own');\n\t\telse\n\t\t\tisAllowedTo('clone_any');\n\t}\n\n\tloadTemplate('CloneTopic');\n\n\t// Get a list of boards this moderator can move to.\n\t$request = $smcFunc['db_query']('order_by_board_order', '\n\t\tSELECT b.id_board, b.name, b.child_level, c.name AS cat_name, c.id_cat\n\t\tFROM {db_prefix}boards AS b\n\t\t\tLEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)\n\t\tWHERE {query_see_board}\n\t\t\tAND b.redirect = {string:blank_redirect}\n\t\t\tAND b.id_board != {int:current_board}',\n\t\tarray(\n\t\t\t'blank_redirect' => '',\n\t\t\t'current_board' => $board,\n\t\t)\n\t);\n\t$context['boards'] = array();\n\twhile ($row = $smcFunc['db_fetch_assoc']($request))\n\t{\n\t\tif (!isset($context['categories'][$row['id_cat']]))\n\t\t\t$context['categories'][$row['id_cat']] = array (\n\t\t\t\t'name' => strip_tags($row['cat_name']),\n\t\t\t\t'boards' => array(),\n\t\t\t);\n\n\t\t$context['categories'][$row['id_cat']]['boards'][] = array(\n\t\t\t'id' => $row['id_board'],\n\t\t\t'name' => strip_tags($row['name']),\n\t\t\t'category' => strip_tags($row['cat_name']),\n\t\t\t'child_level' => $row['child_level'],\n\t\t\t'selected' => !empty($_SESSION['move_to_topic']) && $_SESSION['move_to_topic'] == $row['id_board'] && $row['id_board'] != $board,\n\t\t);\n\t}\n\t$smcFunc['db_free_result']($request);\n\n\tif (empty($context['categories']))\n\t\tfatal_lang_error('moveto_noboards', false);\n\n\t$context['page_title'] = $txt['clone_topic'];\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?topic=' . $topic . '.0',\n\t\t'name' => $context['subject'],\n\t\t'extra_before' => $settings['linktree_inline'] ? $txt['topic'] . ': ' : '',\n\t);\n\n\t$context['linktree'][] = array(\n\t\t'name' => $txt['clone_topic'],\n\t);\n\n\t$context['back_to_topic'] = isset($_REQUEST['goback']);\n\n\t// Register this form and get a sequence number in $context.\n\tcheckSubmitOnce('register');\n\n\t$context['topic_clones'] = false;\n\n\t// Get current clones\n\t$request = $smcFunc['db_query']('', '\n\t\tSELECT c.id_board AS id, b.name\n\t\tFROM {db_prefix}topic_clones AS c\n\t\t\tLEFT JOIN {db_prefix}boards AS b ON (b.id_board = c.id_board)\n\t\tWHERE c.id_topic = {int:current_topic}',\n\t\tarray('current_topic' => $topic)\n\t);\n\twhile ($row = $smcFunc['db_fetch_assoc']($request)) {\n\t\t$context['topic_clones'][$row['id']] = array(\n\t\t\t'id' => $row['id'],\n\t\t\t'name' => $row['name']\n\t\t);\n\t}\n\t$smcFunc['db_free_result']($request);\n}", "public function create($id1, $id2)\n {\n $topic = Topic::find($id1);\n $subtopic = Subtopic::find($id2);\n $action = 'create';\n return view('message', compact('topic','subtopic', 'action'));\n }", "public function createReply($replyMessage, $replyFrom, $replyTo, $postID) {\n $sqlQuery = \"INSERT INTO laf873.replies(replyMessage, replyDate, replyFrom, replyTo, postID) VALUES (?,NOW(),?,?,?)\";\n\n $statement = $this->_dbHandle->prepare($sqlQuery);\n $statement->execute([$replyMessage, $replyFrom, $replyTo, $postID]);\n }", "function CreateNewsletter()\n\t{\n\t\t$newsletterapi = $this->GetApi();\n\n\t\t$GLOBALS['Action'] = 'Create&SubAction=Step2';\n\t\t$GLOBALS['CancelButton'] = GetLang('CreateNewsletterCancelButton');\n\t\t$GLOBALS['Heading'] = GetLang('CreateNewsletter');\n\t\t$GLOBALS['Intro'] = GetLang('CreateNewsletterIntro');\n\t\t$GLOBALS['NewsletterDetails'] = GetLang('CreateNewsletterHeading');\n\n\t\t$GLOBALS['FormatList'] = '';\n\t\t$allformats = $newsletterapi->GetAllFormats();\n\t\tforeach ($allformats as $id => $name) {\n\t\t\tif ($name == 'TextAndHTML') {\n\t\t\t\t$recommended = ' ' . GetLang('Recommended');\n\t\t\t} else {\n\t\t\t\t$recommended = '';\n\t\t\t}\n\t\t\t$GLOBALS['FormatList'] .= '<option value=\"' . $id . '\">' . GetLang('Format_' . $name) . $recommended .'</option>';\n\t\t}\n\n\t\t$templateselects = $this->GetTemplateList();\n\t\t$GLOBALS['TemplateList'] = $templateselects;\n\n\t\t$this->ParseTemplate('Newsletter_Form_Step1');\n\t}", "function ld_reply_link( $id = 0, $reply = 0, $page = 1 ) {\r\n\techo apply_filters( 'topic_link', ld_get_reply_link($id, $reply), $id );\r\n}", "public function run()\n {\n $reply_1 = [\n 'user_id' => 1,\n 'discussion_id' => 1,\n 'content' => 'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium'\n ];\n\n $reply_2 = [\n 'user_id' => 1,\n 'discussion_id' => 2,\n 'content' => 'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium'\n ];\n\n $reply_3 = [\n 'user_id' => 2,\n 'discussion_id' => 3,\n 'content' => 'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium'\n ];\n\n Reply::create($reply_1);\n Reply::create($reply_2);\n Reply::create($reply_3);\n }", "public function executeTopicCreate(sfWebRequest $request)\n {\n $this->forward404Unless($request->isMethod(sfRequest::POST));\n\n $this->form = new ForumTopicsForm();\n\n $flagForumsId = '';\n\t\t$flagForumsId = $request->getPostParameter('flagForumsId');\n\t\t$this->flagForumsId = $flagForumsId;\n $this->processTopicForm($request, $this->form, $flagForumsId);\n\n //$this->processTopicForm($request, $this->form);\n $this->setTemplate('topicNew');\n }", "function target_add_topic($topic)\n{\n\t// if ($GLOBALS['VERBOSE']) pf('...'. $topic['id']);\n\n\tif (!isset($topic['orderexpiry'])) {\n\t\t$topic['orderexpiry'] = 0;\n\t}\n\n\t// Set orderexpiry for announcement and sticky topics.\n\tif (($topic['thread_opt'] & 2) || ($topic['thread_opt'] & 4)) {\n\t\t$topic['orderexpiry'] = 1000000000;\n\t}\n\n\t// Skip topics that doesn't belong to a forum.\n\tif (!isset($GLOBALS['forum_map'][ (int)$topic['forum_id'] ])) {\n\t\tpf('WARNING: Skip topic #'. $topic['id'] .'. Probably an announcement or orphaned message!');\n\t\treturn;\n\t}\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread (\n\t\tid, forum_id, root_msg_id, views, replies, thread_opt, orderexpiry\n\t\t) VALUES(\n\t\t\t'. (int)$topic['id'] .',\n\t\t\t'. $GLOBALS['forum_map'][ (int)$topic['forum_id'] ] .',\n\t\t\t'. (int)$topic['root_msg_id'] .',\n\t\t\t'. (int)$topic['views'] .',\n\t\t\t'. (int)$topic['replies'] .',\n\t\t\t'. (int)$topic['thread_opt'] .',\n\t\t\t'. (int)$topic['orderexpiry'] .')\n\t');\n}", "public function create()\n\t{\n\n\t\t$post = $this->store('create', '/thread/new');\n\n\t\tredirect('/threads?id=' . $post->id);\n\t}", "function caldol_no_replies_bbpress_topics_shortcode() {\n\n\t?>\n\n<!-- html custom-functions -->\n\n<h4 style=\"margin-top: 15px;\">Discussions with No Replies. Be the first to jump in!</h4>\n\n<?php\n\n\n\nif ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'meta_key' => '_bbp_reply_count', 'orderby' => 'post_date', 'meta_value' => '0', 'meta_compare' => '=', 'post_parent' => 'any', 'posts_per_page' => 10 ) ) )\n\nbbp_get_template_part( 'bbpress/loop', 'topics' );\n\n?>\n\n<!-- end -->\n\n<?php }", "static public function appendEmailReplyToMessages() {\n\n /**\n * Watch for new comments on discussions and append a reply to from email option\n * We needed to register this separate handler for new discussion posts since elgg doesn't trigger notify:entity:message\n */\n elgg_register_plugin_hook_handler('notify:annotation:message', 'group_topic_post',\n function ($hook, $type, $message, $params) {\n\n $reply = $params['annotation'];\n $topic = $reply->getEntity();\n\n $reply_action = 'create.generic_comment';\n\n // Group discussions get a different action since they do not truly utilize elgg's generic comment system\n if (get_input('action') == \"groups/addpost\"\n || get_input('action') == \"groups/addtopic\"\n || get_input('action') == \"discussion/reply/save\"\n || get_input('action') == 'discussion/save'\n ) {\n $reply_action = 'create.group_topic_post';\n }\n\n $email_text = elgg_view(\"jettmail/email/address/generate\", array(\n 'action' => $reply_action,\n 'guid' => $topic->guid,\n 'to_email' => $params['to_entity']->email,\n 'text' => 'email a reply',\n 'subject' => $topic->title\n ));\n\n // Append the special email onto the message body\n return $message . $email_text;\n\n }, 1000);\n\n /**\n * Watch for certain generic message notifications and append an email reply onto the message\n * This gets called last in the hook stack\n */\n elgg_register_plugin_hook_handler('notify:entity:message', 'object',\n function ($hook, $type, $message, $params) {\n\n global $CONFIG;\n\n $reply_action = 'create.generic_comment';\n\n // Group discussions get a different action since they do not truly utilize elgg's generic comment system\n if (get_input('action') == \"groups/addpost\"\n || get_input('action') == \"groups/addtopic\"\n || get_input('action') == \"discussion/reply/save\"\n || get_input('action') == 'discussion/save'\n ) {\n $reply_action = 'create.group_topic_post';\n }\n\n $entity = $params['entity'];\n $to_entity = $params['to_entity'];\n $method = $params['method'];\n\n $subtype = $entity->getSubtype();\n\n // Append an email reply text if these are blog or page notifications\n if (in_array($subtype, array(\"blog\", \"page_top\", \"page\", \"groupforumtopic\", \"file\", \"album\"))) {\n\n $email_text = elgg_view(\"jettmail/email/address/generate\", array(\n 'action' => $reply_action,\n 'guid' => $entity->guid,\n 'to_email' => $params['to_entity']->email,\n 'text' => 'email a reply',\n 'subject' => $entity->title\n ));\n\n // Append the special email onto the message body\n return $message . $email_text;\n }\n\n return NULL;\n\n }, 1000);\n\n }", "function new_reply_window($postid = 0) {\n\tglobal $core, $document, $user, $boards, $threads, $db, $posts;\n\n\t//Check if we are quoting a post\n\tif (isset($_GET['p'])) {\n\t\t$post = make_safe(\"int\",$_GET['p']);\n\t\t$quote = $posts->get_post($post);\n\t\t$_GET['t'] = $quote['thread_id'];\n\t\tif (!$quote) { fatal_error(\"Invalid post to quote\"); }\n\t\t$quotemsg = $quote['post_message'];\n\t\t$quoteauthor = $quote['user_name'];\n\t} else {\n\t\t$quotemsg = \"\";\n\t\t$quoteauthor = \"\";\n\t}\n\n\t//Post a new reply\n\tif ($postid == 0) { \n\t\tif(!isset($_GET['t'])) { fatal_error(\"No thread specified\"); }\n\t\t$threadid = make_safe(\"int\",$_GET['t']);\n\t//Edit a previous post\n\t} else {\n\t\tif(!isset($_GET['p'])) { fatal_error(\"No post specified\"); }\n\t\t$post = $posts->get_post($postid);\n\t\t$user_post=$post['user_id'];\n\t\tif (!$post) { fatal_error(\"Invalid post specified\"); }\n\t\t$threadid = $post['thread_id'];\t\t\n\t}\n\n\t//Get the board\n\t$thread = $threads->get_thread($threadid);\n\t$threadname = $thread['thread_name'];\n\t$boardid = $thread['board_id'];\n\t$board = $boards->get_board($boardid);\n\t$boardname = $board['board_name'];\n\t\n\t//Build breadcrumb\n\t$window['breadcrumb'] = '<p><img src=\"$siteurl/resources/images/$style/folder.gif\"></img>&nbsp;';\n\t$window['breadcrumb'] .= '<a href=\"$siteurl/forums.php\" title=\"Home\">$title</a> / ';\n\t$window['breadcrumb'] .= '<a href=\"$siteurl/forumdisplay.php?f=' . $boardid . '\">' . $boardname . '</a> / ';\n\t$window['breadcrumb'] .= '<a href=\"$siteurl/showthread.php?t=' . $threadid . '\">' . $threadname . '</a> / ';\n\n\t//New post\n\tif ($postid == 0) {\n\t\t$window['breadcrumb'] .= 'Post Reply</p>';\n\t\t$window['heading'] = \"Post New Reply\";\n\t\t$window['description'] = \"Fill in all the details required below to post a new reply to the forum\";\n\t\t$form = new_reply_form($boardid,$threadid,\"RE: $threadname\",$quotemsg,$quoteauthor); \n\t//Edit\n\t} else {\n\t\tif($user->is_admin() || $user_post==$user->get('user_id')){#check if the user is the admin or is the one who posted the original post\n\t\t\t$subject = $post['post_name'];\n\t\t\t$message = $post['post_message'];\n\t\t\t$window['breadcrumb'] .= 'Edit Post</p>';\n\t\t\t$window['heading'] = \"Edit Post\";\n\t\t\t$window['description'] = \"Fill in all the details required below to edit this post\";\n\t\t\t$form = edit_reply_form($boardid,$threadid,$postid,$subject,$message);\n\t\t}\n\t\telse{\n\t\t\tfatal_user_error(\"You don't have authorisation to post here\");\n\t\t}\n\t}\n\n\t$window['content'] = $form;\n\t$document->append_template(\"forum_form\",$window);\n}", "public function create()\n {\n return view('admin.topics.create');\n }", "public function ReplyMessages(){\n\n\t\t$message_id = $this->uri->segment(3);\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/reply_message';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Reply Message',\n\t\t\t'student' => $this->setting_model->Get_All('students'),\n\t\t\t'londontec_users' => $this->setting_model->Get_All('londontec_users'),\n\t\t\t'messages' => $this->setting_model->Get_Single('message','message_id',$message_id)\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function create_post($msgOptions = array(), $topicOptions = array(), $posterOptions = array())\n {\n return $this->call_method(\"create/post\",\n array('msgOptions' => serialize($msgOptions),\n 'topicOptions' => serialize($topicOptions),\n 'posterOptions' => serialize($posterOptions),\n )\n );\n }", "function phorum_mod_topic_poll_posting_custom_action($message)\n{\n global $PHORUM;\n\n // Module installation:\n // Load the module installation code if this was not yet done.\n // The installation code will take care of automatically adding\n // the custom profile field that is needed for this module.\n if (! isset($PHORUM[\"mod_topic_poll_installed\"]) ||\n ! $PHORUM[\"mod_topic_poll_installed\"]) {\n include(\"./mods/topic_poll/install.php\");\n }\n\n // Keep track if we want to display the poll editor screen.\n $show_poll_editor = false;\n\n // Polls can only be in thread starting messages.\n if ($message[\"parent_id\"]) return $message;\n\n // ADD A POLL\n if (! isset($message[\"meta\"][\"mod_topic_poll\"]) &&\n isset($_POST[\"topic_poll:add\"]) &&\n check_topic_poll_permission(TOPIC_POLL_ADD, $message)) {\n\n // Initialize a new poll.\n $message[\"meta\"][\"mod_topic_poll\"] = array (\n \"question\" => \"\",\n \"answers\" => array( 0 => \"\", 1 => \"\" ),\n \"votes\" => array(),\n \"total_votes\" => 0,\n \"votingtime\" => 0, // in days, 0 for unlimited\n \"permission\" => \"user\",\n \"active\" => 1,\n \"cache_id\" => 0,\n );\n\n $PHORUM[\"DATA\"][\"OKMSG\"] =\n $PHORUM[\"DATA\"][\"LANG\"][\"mod_topic_poll\"][\"PollAdded\"];\n\n $show_poll_editor = 1;\n }\n\n // ADD ANSWER FIELD\n if (isset($message[\"meta\"][\"mod_topic_poll\"]) &&\n isset($_POST[\"topic_poll:add_answer\"]) &&\n check_topic_poll_permission(TOPIC_POLL_EDIT, $message)) {\n\n $message[\"meta\"][\"mod_topic_poll\"][\"answers\"][] = \"\";\n\n $show_poll_editor = 2;\n }\n\n // DELETE ANSWER FIELD\n // Make sure that at least two answers are kept for voting.\n if (isset($message[\"meta\"][\"mod_topic_poll\"]) &&\n check_topic_poll_permission(TOPIC_POLL_EDIT, $message)) {\n foreach ($message[\"meta\"][\"mod_topic_poll\"][\"answers\"] as $id => $answer) {\n if (isset($_POST[\"topic_poll:delete_answer:$id\"]) &&\n\n count($message[\"meta\"][\"mod_topic_poll\"][\"answers\"]) > 2) {\n unset($message[\"meta\"][\"mod_topic_poll\"][\"answers\"][$id]);\n unset($message[\"meta\"][\"mod_topic_poll\"][\"votes\"][$id]);\n $show_poll_editor = 3;\n }\n }\n }\n\n // DELETE THE POLL\n if (isset($message[\"meta\"][\"mod_topic_poll\"]) &&\n isset($_POST[\"topic_poll:delete\"]) &&\n check_topic_poll_permission(TOPIC_POLL_DELETE, $message)) {\n\n unset($message[\"meta\"][\"mod_topic_poll\"]);\n\n $PHORUM[\"DATA\"][\"OKMSG\"] =\n $PHORUM[\"DATA\"][\"LANG\"][\"mod_topic_poll\"][\"PollDeleted\"];\n }\n\n // CHANGE POLL STATUS\n if (isset($message[\"meta\"][\"mod_topic_poll\"]) &&\n (isset($_POST[\"topic_poll:activate\"]) ||\n isset($_POST[\"topic_poll:deactivate\"])) &&\n check_topic_poll_permission(TOPIC_POLL_SETSTATUS, $message)) {\n\n if (isset($_POST[\"topic_poll:activate\"])) {\n $message[\"meta\"][\"mod_topic_poll\"][\"active\"] = 1;\n } else {\n $message[\"meta\"][\"mod_topic_poll\"][\"active\"] = 0;\n }\n }\n\n // CONFIGURATION CHANGE\n if (isset($message[\"meta\"][\"mod_topic_poll\"]) &&\n check_topic_poll_permission(TOPIC_POLL_EDIT, $message)) {\n\n // Set the question.\n if (isset($_POST[\"topic_poll:question\"])) {\n $message[\"meta\"][\"mod_topic_poll\"][\"question\"] =\n trim($_POST[\"topic_poll:question\"]);\n }\n\n // Set the answers.\n foreach ($message[\"meta\"][\"mod_topic_poll\"][\"answers\"] as $id => $answer) {\n if (isset($_POST[\"topic_poll:answer:$id\"])) {\n $message[\"meta\"][\"mod_topic_poll\"][\"answers\"][$id] =\n trim($_POST[\"topic_poll:answer:$id\"]);\n }\n }\n\n // Set the votingtime.\n if (isset($_POST[\"topic_poll:votingtime\"])) {\n $message[\"meta\"][\"mod_topic_poll\"][\"votingtime\"] =\n abs((int) $_POST[\"topic_poll:votingtime\"]);\n }\n\n // Set the permission.\n if (isset($_POST[\"topic_poll:permission\"])) {\n $p = $_POST[\"topic_poll:permission\"];\n if ($p == 'user' || $p == 'anonymous')\n $message[\"meta\"][\"mod_topic_poll\"][\"permission\"] = $p;\n }\n\n // Set the no vote no read option.\n if (isset($_POST[\"topic_poll:novotenoread\"])) {\n $message[\"meta\"][\"mod_topic_poll\"][\"novotenoread\"] =\n empty($_POST[\"topic_poll:novotenoread\"]) ? 0 : 1;\n }\n\n // Set the poll position.\n if (isset($_POST[\"topic_poll:position\"])) {\n $p = $_POST[\"topic_poll:position\"];\n if ($p == 'before' || $p == 'after')\n $message[\"meta\"][\"mod_topic_poll\"][\"position\"] = $p;\n }\n }\n\n // Request to edit the poll. This is only used to switch to the\n // poll editor screen.\n if (isset($_POST[\"topic_poll:edit\"]) &&\n check_topic_poll_permission(TOPIC_POLL_EDIT, $message)) {\n $show_poll_editor = 4;\n }\n\n // Request to go back to the posting editor. We check the\n // integrity of the posting data here, so we can stay at\n // the poll editor when there are problems with it.\n if (isset($_POST[\"topic_poll:back_to_message\"]) &&\n check_topic_poll_permission(TOPIC_POLL_EDIT, $message)) {\n list ($message, $error) =\n phorum_mod_topic_poll_check_post(array($message, NULL));\n if ($error == NULL) {\n $PHORUM[\"DATA\"][\"OKMSG\"] =\n $PHORUM[\"DATA\"][\"LANG\"][\"mod_topic_poll\"][\"BackToMessageHelp\"];\n } else {\n $PHORUM[\"DATA\"][\"ERROR\"] = $error;\n $show_poll_editor = 5;\n }\n }\n\n if ($show_poll_editor)\n {\n // The changed meta data must be stored in $_POST, so it will\n // be put in the form. Also sign it, to make Phorum accept it.\n $meta = base64_encode(serialize($message[\"meta\"]));\n $_POST[\"meta\"] = $meta;\n $_POST[\"meta:signature\"] = phorum_generate_data_signature($meta);\n\n // Setup data for the templates.\n $poll = $message[\"meta\"][\"mod_topic_poll\"];\n phorum_mod_topic_poll_setup_templatedata($poll, TRUE);\n\n // Create post data for remembering the editor state.\n $post_data = \"\";\n foreach ($_POST as $key => $val) {\n if ($key == \"add_topic_poll\") continue;\n if (substr($key, 0, 11) == \"topic_poll:\") continue;\n $post_data .= '<input type=\"hidden\" ' .\n 'name=\"' . htmlspecialchars($key) . '\" ' .\n 'value=\"' . htmlspecialchars($val) . \"\\\" />\\n\";\n }\n $PHORUM[\"DATA\"][\"POST_VARS\"] = $post_data;\n\n $PHORUM[\"DATA\"][\"POLL\"][\"CAN_DELETE\"] =\n check_topic_poll_permission(TOPIC_POLL_DELETE, $message);\n\n $GLOBALS[\"PHORUM\"][\"posting_template\"] = 'topic_poll::editor';\n }\n\n return $message;\n}", "public function created(Reply $observed)\n {\n $this->createAction('reply added', $observed);\n\n if ($observed->agent) {\n $this->sendNotification(\n $observed,\n 'ticket.user',\n 'agentReplied'\n );\n }\n\n if (isset($observed->ticket->user->email)) {\n if (!in_array($observed->ticket->user->email, config('helpdesk.ignored'))) {\n if ($observed->user) {\n $this->sendNotification(\n $observed,\n 'ticket.assignment.assignee',\n 'userReplied'\n );\n }\n }\n }\n }", "function create_post2($title,$body,$category,$keywords='',$fields)\n {\n $title = htmlentities($title,ENT_NOQUOTES,'UTF-8');\n //$keywords = htmlentities($keywords,ENT_NOQUOTES,'UTF-8');\n $content = array(\n 'post_title' => $title,\n 'post_content' => $body,\n 'post_status' => 'publish',\n //'post_type' => 'post' ,\n 'custom_fields' => $fields, \n 'terms_names'=>array( \"category\" => $category,\"post_tag\"=>$keywords )\n );\n\n $params = array(0,$this->UserName,$this->PassWord,$content);\n return $this->send_request('wp.newPost',$params);\n }", "public function createTopic(Topic $topic, TopicBind ...$binds): Promise\n {\n return $this->transport->createTopic($topic, ...$binds);\n }", "function apoc_get_group_reply_info() {\n\n\tglobal $bp;\n\t$slug = $bp->action_variables[1];\n\t\n\tglobal $wpdb;\n\t$topic = $wpdb->get_row( \n\t\t$wpdb->prepare( \n\t\t\t\"SELECT post_title AS title, post_name AS url\n\t\t\tFROM $wpdb->posts \n\t\t\tWHERE ID = ( \n\t\t\t\tSELECT post_parent\n\t\t\t\tFROM $wpdb->posts\n\t\t\t\tWHERE post_name = %s )\",\n\t\t\t$slug )\n\t\t);\n\t\t\n\treturn( $topic );\n}", "public function ajax_reply() {\n\t\t$action = $_POST['bbp_reply_form_action'];\n\t\tif ( 'bbp-new-reply' == $action ) {\n\t\t\tbbp_new_reply_handler( $action );\n\t\t} elseif ( 'bbp-edit-reply' == $action ) {\n\t\t\tbbp_edit_reply_handler( $action );\n\t\t}\n\t}", "public function create_topic() {\n $this->validate($this->request, [\n 'title' => 'required|string|max:255',\n 'is_guardian_blocked' => 'integer|min:0|max:1',\n 'status' => 'integer|min:0|max:1',\n 'is_featured' => 'integer|min:0|max:1',\n 'content' => 'string'\n ]);\n\n $is_guardian_blocked = 0;\n $is_featured = 0;\n $status = 0;\n\n $topic = new Topic;\n $topic->franchise_id = $this->franchise_id;\n $topic->club_id = $this->club_id;\n $topic->title = $this->request['title'];\n\n if( isset($this->request['is_guardian_blocked']) && !empty($this->request['is_guardian_blocked']) ) {\n $is_guardian_blocked = $this->request['is_guardian_blocked'];\n }\n\n if( isset($this->request['status']) && !empty($this->request['status']) ) {\n $status = $this->request['status'];\n }\n\n if( isset($this->request['is_featured']) && !empty($this->request['is_featured']) ) {\n $is_featured = $this->request['is_featured'];\n }\n\n if( isset($this->request['content']) && !empty($this->request['content']) ) {\n $topic->content = $this->request['content'];\n }\n\n $topic->is_guardian_blocked = $is_guardian_blocked;\n $topic->is_featured = $is_featured;\n $topic->created_by = $this->user_id;\n $topic->status = $status;\n\n $topic->save();\n\n return response()->json($topic, 200);\n }", "public function getTopic() {}", "function addTopic()\n{\n\tglobal $xoopsDB, $xoopsModule, $xoopsModuleConfig;\n $topicpid = isset($_POST['topic_pid']) ? intval($_POST['topic_pid']) : 0;\n $xt = new NewsTopic();\n if (!$xt->topicExists($topicpid, $_POST['topic_title'])) {\n $xt->setTopicPid($topicpid);\n if (empty($_POST['topic_title']) || xoops_trim($_POST['topic_title'])=='') {\n redirect_header( \"index.php?op=topicsmanager\", 2, _AM_ERRORTOPICNAME );\n }\n $xt->setTopicTitle($_POST['topic_title']);\n //$xt->Settopic_rssurl($_POST['topic_rssfeed']);\n $xt->setTopic_color($_POST['topic_color']);\n if (isset($_POST['topic_imgurl'] ) && $_POST['topic_imgurl'] != \"\") {\n $xt->setTopicImgurl($_POST['topic_imgurl'] );\n }\n\t\t$xt->setMenu(intval($_POST['submenu']));\n\t\t$xt->setTopicFrontpage(intval($_POST['topic_frontpage']));\n\t\tif(isset($_POST['xoops_upload_file'])) {\n\t\t\t$fldname = $_FILES[$_POST['xoops_upload_file'][0]];\n\t\t\t$fldname = (get_magic_quotes_gpc()) ? stripslashes($fldname['name']) : $fldname['name'];\n\t\t\tif(xoops_trim($fldname!='')) {\n\t\t\t\t$sfiles = new sFiles();\n\t\t\t\t$dstpath = XOOPS_ROOT_PATH . \"/modules/\" . $xoopsModule -> dirname() . '/images/topics';\n\t\t\t\t$destname=$sfiles->createUploadName($dstpath ,$fldname, true);\n\t\t\t\t$permittedtypes=array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');\n\t\t\t\t$uploader = new XoopsMediaUploader($dstpath, $permittedtypes, $xoopsModuleConfig['maxuploadsize']);\n\t\t\t\t$uploader->setTargetFileName($destname);\n\t\t\t\tif ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {\n\t\t\t\t\tif ($uploader->upload()) {\n\t\t\t\t\t\t$xt->setTopicImgurl(basename($destname));\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo _AM_UPLOAD_ERROR . ' ' . $uploader->getErrors();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $uploader->getErrors();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$xt->setTopicDescription($_POST['topic_description']);\n\t\t$xt->store();\n\t\tupdateCache();\n\n $notification_handler = & xoops_gethandler('notification');\n $tags = array();\n $tags['TOPIC_NAME'] = $_POST['topic_title'];\n $notification_handler->triggerEvent( 'global', 0, 'new_category', $tags);\n redirect_header('index.php?op=topicsmanager', 1, _AM_DBUPDATED);\n } else {\n redirect_header('index.php?op=topicsmanager', 2, _AM_ADD_TOPIC_ERROR);\n }\n exit();\n}", "function post_reply_link($args = array(), $post = \\null)\n {\n }", "public static function create($boardID, $languageID, $prefix, $subject, $text, $userID, $username, $sticky = 0, $announcement = 0, $closed = 0, $options = array(), $subscription = 0, $attachments = null, $poll = null, $disabled = 0) {\n\t\t$attachmentsAmount = $attachments != null ? count($attachments->getAttachments()) : 0;\n\t\t$polls = ($poll != null && $poll->pollID) ? 1 : 0;\n\t\t\n\t\t// insert thread\n\t\t$threadID = self::insert($subject, $boardID, array(\n\t\t\t'languageID' => $languageID,\n\t\t\t'userID' => $userID,\n\t\t\t'username' => $username,\n\t\t\t'prefix' => $prefix,\n\t\t\t'time' => TIME_NOW,\n\t\t\t'lastPostTime' => TIME_NOW,\n\t\t\t'lastPosterID' => $userID,\n\t\t\t'lastPoster' => $username,\n\t\t\t'attachments' => $attachmentsAmount,\n\t\t\t'polls' => $polls,\n\t\t\t'isSticky' => $sticky,\n\t\t\t'isAnnouncement' => $announcement,\n\t\t\t'isClosed' => $closed,\n\t\t\t'isDisabled' => $disabled,\n\t\t\t'everEnabled' => ($disabled ? 0 : 1)\n\t\t));\n\t\t\n\t\t// create post\n\t\t$post = PostEditor::create($threadID, $subject, $text, $userID, $username, $options, $attachments, $poll, null, $disabled, true);\n\t\t\n\t\t// update first post id\n\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\tSET\tfirstPostID = \".$post->postID.\"\n\t\t\tWHERE\tthreadID = \".$threadID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t\t\n\t\t// update first post preview\n\t\tPostEditor::updateFirstPostPreview($threadID, $post->postID, $text, $options);\n\t\t\n\t\t// get thread object\n\t\t$thread = new ThreadEditor($threadID);\n\t\t\n\t\t// update subscription\n\t\t$thread->setSubscription($subscription);\n\t\t\n\t\t// get similar threads\n\t\tself::updateSimilarThreads($threadID, $subject, $boardID);\n\t\t\n\t\treturn $thread;\n\t}", "public function create()\n\t{\n\t\t$breadcrumbs = ['Home', 'Manage Forum', 'Topic', 'Create'];\n\t\t$sections = Section::all();\n\t\treturn View::make('admin.forum.topic.create')\n\t\t\t\t\t->withSections($sections)\n\t\t\t\t\t->withBreadcrumbs($breadcrumbs);\n\t}", "public function create()\n {\n return redirect()->route('topic.index');\n }", "public function ambassade_single_topic(&$event) {\n global $user;\n // IF IS AMBASSADE\n if($event[\"row\"][\"forum_id\"] == 29 && !$this->topic_ambassade_set_up) {\n $guild = new \\scfr\\main\\ambassade\\Guild($this->db);\n $first_reply = $event[\"topic_data\"][\"topic_first_post_id\"];\n $guild->__topic_init($event[\"row\"][\"topic_id\"]);\n\n //var_dump();\n\n $templates[\"GUILD_JSON\"] = json_encode(false);\n if($guild->is_registerd) {\n $templates[\"TOPIC_IS_REGISTERED_GUILD\"] = true;\n foreach($guild->RSI as $name => $val)\n $templates[\"GUILD_\".strtoupper($name)] = $val;\n\n $templates[\"GUILD_JSON\"] = json_encode($guild->RSI);\n }\n\n\n if($templates['GUILD_BACKGROUND']) $templates['CUSTOM_BACKGROUND'] = $templates['GUILD_BACKGROUND'];\n\n\n $templates[\"TOPIC_IS_GUILD\"] = true;\n $templates[\"GUILD_TOPIC_ID\"] = $event[\"topic_data\"][\"topic_id\"];\n\n $templates[\"S_REQUIRE_ANGULAR\"] = true;\n $this->template->assign_vars($templates);\n $this->topic_set_up = true;\n }\n }", "public function actionCreate()\r\n\t{\r\n\r\n $groupId = Yii::app()->request->getParam('groupId');\r\n\r\n $model=new GroupTopic;\r\n $model->group_id = $groupId ;\r\n $model->creator_id = user()->getId() ;\r\n\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['GroupTopic']))\r\n\t\t{\r\n\t\t\t$model->attributes=$_POST['GroupTopic'];\r\n\r\n $model->created = time() ;\r\n\r\n\t\t\tif($model->save())\r\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\r\n\t\t}\r\n\r\n\t\t$this->render('create',array(\r\n\t\t\t'model'=>$model,\r\n\t\t));\r\n\t}", "private function addGroupTopic()\n {\n try\n {\n $request = $_POST;\n\n if(!isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg('provide group id');\n else if(!is_numeric($request['group_id'])) \n throw_error_msg('invalid group id'); \n else\n $gid = (int)$request['group_id'];\n\n if(!isset($request['topic_title']) || $request['topic_title']==\"\" )\n throw_error_msg('provide topic title');\n\n if(!isset($request['topic_post']) || $request['topic_post']==\"\" )\n throw_error_msg('provide topic post');\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $cbgroup->add_topic($request);\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'group topic added', \"data\" => array());\n $this->response($this->json($data));\n }\n\n if( error() )\n {\n throw_error(error('single')); \n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function do_store_post_reply($post_id) {\r\n // echo '<pre>'; print_r($_POST); die();\r\n foreach(array(\"description\",\"replied_by\") as $i)\r\n\t\t\t$$i=$this->input->post($i);\r\n $replied_on = time();$status=1;\r\n $this->db->query(\"insert into m_stream_post_reply(description,post_id,replied_by,replied_on,status) values(?,?,?,?,?)\",array($this->prep($description),$post_id,$replied_by,$replied_on,$status));\r\n }", "public function create() {\n\t\t$user = $this->current_user();\n\t\t$message = $this->discussion->create_message($this->message_data() + ['creator' => ['id' => $user->_id, 'name' => $user->name]]);\n\n\t\tif ($this->discussion->push_message($message)) {\n\t\t\treturn $this->redirect(['Discussions::show', 'id' => $this->discussion->_id, 'project_id' => $this->discussion->project_id]);\n\t\t}\n\n\t\treturn compact('message');\n\t}", "public function postHandleCallback() {\n $data = \\Input::all();\n $msg = new Message();\n $msg->text = trim($data['text']);\n $msg->api_id = $data['id'];\n $msg->sender = $data['from'];\n $msg->receiver = $data['to'];\n $msg->save();\n\n //for correct counting\n \\DB::transaction(function() use ($msg) {\n $response = MessageHelper::decode($msg);\n if ($response) {\n $msg->campaign_id = $response->campaign_id;\n $msg->save();\n }\n });\n return 'Hello World';\n }", "public function actionCreate()\n {\n $type = Yii::$app->request->get('reply_type');\n $model = new WechatAutoReply();\n $keywords = new WechatAutoKeyWords();\n if ($request = Yii::$app->request->post()) {\n $model->wid = $this->getWechat()->id;\n $model->reply_type = $request['reply_type'];\n if ($request['reply_type'] == 'image') {\n $url = $this->fileupload($_FILES);\n $model->comment = json_encode($url);\n } elseif ($request['reply_type'] == 'news') {\n $url = $this->fileUpload($_FILES);\n $result = [];\n foreach ($request['data'] as $key => $data) {\n $result[$key]['comment'] = $data;\n $result[$key]['url'] = $url[$key];\n $result[$key]['title'] = $request['title'][$key];\n $result[$key]['link'] = $request['link'][$key];\n //$result[]['link']= $link[$key];\n }\n $model->comment = json_encode($result);\n } else {\n $model->comment = json_encode($request['data'][0]);\n }\n if ($model->save()) {\n if ($request['key_words'] == null) {\n if ($type == 'invalid') {\n //$model->key_words = 'invalid';\n $keywords->key_words = 'invalid';\n } elseif ($type == 'onSubscribe') {\n //$model->key_words = 'onSubscribe';\n $keywords->key_words = 'onSubscribe';\n } else {\n //$model->key_words = $request['key_words'][0];\n $keywords->key_words = $request['key_words'][0];\n }\n $keywords->aid = $model->id;\n $keywords->save();\n } else {\n foreach ($request['key_words'] as $key => $key_words) {\n if ($keywords->id !== null) {\n $keywords = new WechatAutoKeyWords();\n }\n $keywords->key_words = $key_words;\n $keywords->aid = $model->id;\n $keywords->save();\n }\n }\n return $this->redirect('index');\n }\n }\n return $this->render('create', [\n 'model' => $model,\n 'keywords' => $keywords,\n 'type' => $type,\n ]);\n }", "public function InsertTopic($fromArticle=false,$useArticleDescr=false,\n $useArticleText=false,$link2article=false)\n {\n global $DB, $categoryid, $sdlanguage, $sdurl, $userinfo, $usersystem;\n\n //SD351: create topic from article\n $fromArticle = (defined('IN_ADMIN') && !empty($fromArticle));\n if($fromArticle && empty($useArticleDescr) && empty($useArticleText))\n {\n return false;\n }\n\n // SD313: security check against spam/bot submissions\n if(empty($fromArticle))\n {\n if(!CheckFormToken(FORUM_TOKEN, false))\n {\n $this->conf->RedirectPageDefault('<strong>'.$sdlanguage['error_invalid_token'].'</strong><br />',true);\n return false;\n }\n if(empty($this->conf->forum_arr['forum_id']) || ($this->conf->forum_arr['forum_id']<1))\n {\n $this->conf->RedirectPageDefault('<strong>'.$this->conf->plugin_phrases_arr['err_invalid_forum_id'] . '</strong>',true);\n return false;\n }\n }\n\n $errors_arr = array();\n\n if(empty($fromArticle))\n {\n $topic_title = trim(GetVar('forum_topic_title', '', 'string', true, false));\n $post_text = trim(GetVar('forum_post', '', 'string', true, false));\n\n if(!($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator) ||\n !empty($userinfo['require_vvc'])) //SD340: require_vvc\n {\n if(!CaptchaIsValid('amihuman'))\n {\n $errors_arr[] = $sdlanguage['captcha_not_valid'];\n }\n }\n\n //SD343: combined blacklist check\n if($this->conf->IsUserBlacklisted())\n {\n WatchDog('Forum','<b>Forum spam topic: '.$userinfo['username'].\n '</b>, IP: </b><span class=\"ipaddress\">'.USERIP.'</span></b><br />'.\n 'in TopicID: '.$this->conf->topic_arr['topic_id'].', PostID: '.$post_id,\n WATCHDOG_ERROR);\n $this->DisplayTopic(true,$sdlanguage['ip_listed_on_blacklist'].' '.USERIP);\n return false;\n }\n\n //SD342: censor non-admin text if enabled\n if($this->conf->censor_posts)\n {\n $topic_title = sd_censor($topic_title);\n $post_text = sd_censor($post_text);\n }\n }\n else\n {\n // #################################################################\n // SD351: post article as forum topic\n // #################################################################\n $topic_title = trim(GetVar('title', '', 'html', true, false));\n $topic_title = htmlspecialchars(strip_alltags($topic_title));\n\n $post_text = '';\n if(!empty($useArticleDescr))\n {\n $article_descr = trim(GetVar('description', '', 'html', true, false));\n if(sd_strlen($article_descr))\n {\n $post_text = trim(sd_ConvertHtmlToBBCode($article_descr));\n if(sd_strlen($post_text))\n {\n $post_text .= \"\\r\\n\\r\\n\";\n }\n }\n }\n if(!empty($useArticleText))\n {\n $article_text = trim(GetVar('article', '', 'html', true, false));\n $article_text = sd_ConvertHtmlToBBCode($article_text);\n if(sd_strlen($article_text))\n {\n $post_text2 = trim($article_text);\n if(sd_strlen($post_text2))\n {\n $post_text .= \"\\r\\n\\r\\n\".$post_text2;\n }\n }\n }\n if(!empty($link2article) && ($link2article!==false))\n {\n $post_text .= $link2article;\n }\n unset($article_descr,$article_text,$post_text2,$useArticleDescr);\n }\n\n $sticky = 0;\n $open = 1;\n $moderated = GetVar('moderate_topic', false, 'bool', true, false)?1:0;\n if($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator)\n {\n $open = GetVar('lock_topic', 0, 'bool', true, false)?0:1; //SD351\n $sticky = GetVar('stick_topic', false, 'bool', true, false)?1:0;\n }\n else\n {\n if(!empty($this->conf->forum_arr['moderated']))\n {\n $moderated = SDForumConfig::UsergroupsModerated($userinfo['usergroupids'],\n $this->conf->forum_arr['moderated'])?1:0;\n }\n }\n\n //SD343: content filter for moderated posts\n if(empty($errors_arr) && $moderated &&\n !$this->conf->IsSiteAdmin && !$this->conf->IsAdmin && !$this->conf->IsModerator)\n {\n //SD343: up to x posts within y minutes if moderated\n if($this->conf->mod_post_limit && $this->conf->mod_time_limit)\n {\n $trigger = $DB->query_first('SELECT COUNT(post_id) postcount FROM {p_forum_posts}'.\n \" WHERE ((user_id = %d) OR (ip_address = '%s')) AND (`date` > %d) AND (moderated = 1)\",\n $userinfo['userid'], USERIP, (TIME_NOW - ($this->conf->mod_time_limit*60)));\n if(!empty($trigger['postcount']) && ($trigger['postcount'] >= $this->conf->mod_post_limit))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['message_too_many_moderated'];\n }\n }\n\n if(empty($errors_arr))\n {\n $topic_title = htmlspecialchars(strip_alltags(sd_htmlawed(unhtmlspecialchars($topic_title))));\n $post_text = htmlspecialchars(sd_htmlawed(unhtmlspecialchars($post_text)));\n }\n }\n\n //SD343: min. topic/post length checks\n $topic_title = trim($topic_title);\n $post_text = trim($post_text);\n $plen = strlen($topic_title);\n\n if(empty($fromArticle))\n {\n if(($plen < 3) || ($plen < $this->conf->plugin_settings_arr['minimum_topic_title_length']))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['err_topic_no_title'];\n }\n\n $plen = strlen($post_text);\n if(($plen < 2) || ($plen < $this->conf->plugin_settings_arr['minimum_post_text_length']))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['post_too_short'];\n }\n }\n\n if(empty($errors_arr))\n {\n $DB->result_type = MYSQL_ASSOC;\n if($topic_exists_arr = $DB->query_first('SELECT ft.topic_id FROM {p_forum_topics} ft'.\n ' INNER JOIN {p_forum_forums} ff ON ft.forum_id = ff.forum_id'.\n ' WHERE ff.forum_id = %d'.\n ($this->conf->IsSiteAdmin ? '' : ' AND ff.online = 1').\n \" AND trim(ft.title) = '%s' AND ft.post_user_id = %d\",\n $this->conf->forum_arr['forum_id'],\n $DB->escape_string($topic_title),\n $userinfo['userid']))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['err_topic_no_repeat'];\n }\n }\n\n if(count($errors_arr))\n {\n DisplayMessage('<strong>'.implode('<br />', $errors_arr). '</strong>', true);\n if(empty($fromArticle))\n {\n $this->DisplayTopicForm();\n }\n return false;\n }\n\n // all is good, insert new topic\n $DB->query('INSERT INTO {p_forum_topics}'.\n ' (forum_id, date, post_count, views, open, post_user_id,'.\n ' post_username, title, last_post_date, last_post_username, sticky, moderated)'.\n ' VALUES (%d, %d, 1, 0, %d, ' . $userinfo['userid'] .\n \", '%s', '%s', %d, '%s', $sticky, $moderated)\",\n $this->conf->forum_id, TIME_NOW, $open,\n $DB->escape_string($userinfo['username']),\n $DB->escape_string($topic_title),\n TIME_NOW,\n $DB->escape_string($userinfo['username']));\n\n if($topic_id = $DB->insert_id())\n {\n $DB->query('INSERT INTO {p_forum_posts}'.\n ' (topic_id, username, user_id, date, post, ip_address, moderated) VALUES'.\n \" (%d, '%s', %d, %d, '%s', '%s', %d)\",\n $topic_id, $DB->escape_string($userinfo['username']),\n $userinfo['userid'], TIME_NOW,\n $DB->escape_string($post_text), IPADDRESS, $moderated);\n\n if($post_id = $DB->insert_id())\n {\n //SD351: set config's settings\n $this->conf->topic_id = $topic_id;\n $this->conf->topic_arr = array();\n $this->conf->topic_arr['topic_id'] = (int)$topic_id;\n $this->conf->topic_arr['forum_id'] = (int)$this->conf->forum_arr['forum_id'];\n $this->conf->topic_arr['title'] = $topic_title;\n $this->conf->topic_arr['sticky'] = $sticky;\n $this->conf->topic_arr['moderated'] = $moderated;\n $this->conf->topic_arr['open'] = $open;\n $this->conf->topic_arr['post_user_id'] = (int)$userinfo['userid'];\n $this->conf->topic_arr['post_username'] = $userinfo['username'];\n $this->conf->topic_arr['first_post_id'] = (int)$post_id;\n $this->conf->topic_arr['last_post_id'] = (int)$post_id;\n $this->conf->topic_arr['last_post_date'] = TIME_NOW;\n $this->conf->topic_arr['last_post_username'] = $userinfo['username'];\n\n $DB->query(\"UPDATE {p_forum_topics} SET first_post_id = $post_id, last_post_id = $post_id\n WHERE topic_id = $topic_id LIMIT 1\");\n\n if(!$moderated)\n {\n $DB->query(\"UPDATE {p_forum_forums} SET last_topic_title = '\".$DB->escape_string(trim($topic_title)).\"',\n topic_count = (IFNULL(topic_count,0) + 1),\n post_count = (IFNULL(post_count,0) + 1),\n last_post_date = \" . TIME_NOW . \",\n last_post_username = '\" . $DB->escape_string($userinfo['username']) . \"',\n last_topic_id = $topic_id,\n last_post_id = $post_id\n WHERE forum_id = \" . $this->conf->forum_arr['forum_id'] . '\n LIMIT 1');\n\n //SD322: update user's thread count\n //SD332: update to \"user_post_count\" was missing till now\n if($this->conf->is_sd_users) //SD342\n $DB->query('UPDATE {users} SET user_thread_count = (IFNULL(user_thread_count,0) + 1),'.\n ' user_post_count = (IFNULL(user_post_count,0) + 1) WHERE userid = %d', $userinfo['userid']);\n\n //SD351: update user title\n SDUserCache::UpdateUserTitle($userinfo['userid']);\n }\n\n if(empty($fromArticle))\n {\n //SD343: check selected prefix (if present) against tags table, based on sub-forum/usergroup\n if($prefix_id = Is_Valid_Number(GetVar('prefix_id', 0, 'whole_number', true, false),0,1,999999999))\n {\n $tconf = array(\n 'chk_ugroups' => !$this->conf->IsSiteAdmin,\n 'pluginid' => $this->conf->plugin_id,\n 'objectid' => 0,\n 'tagtype' => 2,\n 'ref_id' => 0,\n 'allowed_id' => $this->conf->forum_arr['forum_id'],\n );\n require_once(SD_INCLUDE_PATH.'class_sd_tags.php');\n $prefixes = SD_Tags::GetPluginTagsAsArray($tconf);\n if(($prefixes !== false) && isset($prefixes[$prefix_id]))\n {\n SD_Tags::StorePluginTags($this->conf->plugin_id, $topic_id, $prefixes[$prefix_id], 2, $prefix_id, true);\n }\n }\n\n //SD343: add topic tags if allowed for usergroup\n $tag_ug = sd_ConvertStrToArray($this->conf->plugin_settings_arr['tag_submit_permissions'],'|');\n if($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ||\n (!empty($tag_ug) && @array_intersect($userinfo['usergroupids'], $tag_ug)))\n {\n require_once(SD_INCLUDE_PATH.'class_sd_tags.php');\n $tags = GetVar('tags', '', 'string', true, false);\n SD_Tags::StorePluginTags($this->conf->plugin_id, $topic_id, $tags, 0, 0, true);\n }\n\n // insert attachment\n if($this->conf->attach_path_ok && isset($_FILES['attachment']) && !empty($_FILES['attachment']['name']) &&\n ($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ||\n (!empty($userinfo['plugindownloadids']) &&\n @in_array($this->conf->plugin_id,$userinfo['plugindownloadids']) &&\n !empty($this->conf->plugin_settings_arr['valid_attachment_types']))))\n {\n $attachment_arr = $_FILES['attachment'];\n // if an attachment was uploaded, then it will be inserted after the ticket is created\n $attachment_uploaded = false;\n // check if attachment was uploaded\n if($attachment_arr['error'] != 4)\n {\n list($attachment_uploaded, $attachment_stored_filename, $error) = $this->UploadAttachment($attachment_arr);\n if(!$attachment_uploaded)\n {\n if($error !== false)\n $errors_arr[] = $error;\n }\n else\n {\n $DB->query(\"INSERT INTO {p_forum_attachments}\n (attachment_id, post_id, attachment_name, filename, filesize, filetype, user_id, username, uploaded_date)\n VALUES (NULL, %d, '%s', '%s', %d, '%s', %d, '%s', \" . TIME_NOW . \")\",\n $post_id,\n $DB->escape_string($attachment_arr['name']),\n $DB->escape_string($attachment_stored_filename),\n $attachment_arr['size'],\n $DB->escape_string($attachment_arr['type']),\n $userinfo['userid'],\n $DB->escape_string($userinfo['username']));\n $DB->query('UPDATE {p_forum_posts}'.\n ' SET attachment_count = (IFNULL(attachment_count,0)+1)'.\n ' WHERE post_id = %d', $post_id);\n }\n }\n }\n } //$fromArticle\n\n }\n }\n\n //SD351: if from article then return topic_id\n if(!empty($fromArticle))\n {\n return empty($topic_id)?false:(int)$topic_id;\n }\n\n //SD342: send email notifications for subscriptions\n if(empty($errors_arr))\n {\n if($sub = new SDSubscription($userinfo['userid'],$this->conf->plugin_id,\n $this->conf->forum_arr['forum_id'],'forum',$categoryid))\n {\n $sub->SendNotifications();\n }\n unset($sub);\n\n global $SDCache;\n if(!empty($SDCache) && $SDCache->IsActive()) $SDCache->delete_cacheid(FORUM_CACHE_FORUMS);\n\n $link = $this->conf->RewritePostLink($topic_id,$topic_title,$post_id);\n RedirectFrontPage($link, $this->conf->plugin_phrases_arr[$moderated ?\n 'message_topic_awaits_approval' : 'message_topic_created']);\n\n return true;\n }\n $this->conf->RedirectPageDefault('Error!');\n return false;\n }", "function submitNew($Category, $Name, $Subject, $Message, $numLow, $numHigh, $SplitThis, $TopicsPerPage) {\n \n\t//Create File Name according to readable format\n\t$TimePart \t= time();\n\n\t$SubjectPart \t= str_replace(\" \", \"-\", $Subject);\n\t$NamePart \t= str_replace(\" \", \"-\", $Name);\n\t\n\t//Put it all Together\n\t$filename \t= $TimePart.\"_\".$NamePart.\"_\".$SubjectPart.\".txt\";\n\n\t//Get the Current date from Server\n\t$Today \t\t= (date (\"l dS of F Y ( h:i:s A )\",time()));\n\n\t//Put the Contents of the Post Together\n\t$Input \t\t= \"Thread=Subject: <b>$Subject</b><br>Name: <b>$Name</b><br>Comments: $Message<br><i><font size=\\\"-1\\\">Date: $Today</font></i><br>$SplitThis\";\n\n\t//Path to File\n\t$pathToFile \t= $Category.\"/\".$filename;\n\n\t//Write to a New Text File - Category indicates Directory to place file\n\t$fp = fopen( $pathToFile,\"w\"); \n\tfwrite($fp, $Input, 4000); \n\tfclose( $fp ); \n\n\t//Change the Permissions of the file we just created\n\tchmod ($pathToFile, 0666);\n\n\tprint \"&Status=Your file has been added&\";\n\treadDirectory($Category, $numLow, $numHigh, $SplitThis, $TopicsPerPage);\n\tloadNewReply($pathToFile);\n}", "public function create_new()\n\t{\n\t\trequire_once(MODELS . '/Post.php');\n\t\t$model = new Post();\n\t\t$result = $model->create_new();\n\t\tif ($result){\n\t\t\theader('Location:/home');\n\t\t\tuser_msg('Post created successfully'); // <-- this doesn't work, why?\n\t\t}\n\t}", "public function createAction(){\n \n $this->_form->customSubmitBtn = $this->xhr;\n $this->_form->build( $this->uri,\n $this->consumer_id,\n $this->user_id,\n $this->id);\n \n \n \n $this->result = Main_Forms_Handler::onPost($this->_form ,\n $this->post,\n $this->_model,\n \"createNote\",\n $this->params,\n $this->_helper,\n $this->indexAction . $this->consumer_id,\n \"Note created.\",\n $this->xhr); \n \n $this->_onSubmit();\n\n }", "public function reply()\n\t{\n\n\t\t$reply = $this->store('reply', '/threads?id=_id_#form-reply');\n\n\t\t(new Thread)->updateTotalReplies($reply->parent_id);\n\n\t\tredirect('/threads?id=' . $reply->parent_id . '#reply-id' . $reply->id);\n\t\n\t}", "function newMessage($type)\r\n{\r\n\tglobal $dbConnection, $dtSQL, $msgname;\r\n\r\n\t$record = array();\r\n\t$record['name'] = $_GET['msgname'];\r\n\t$record['subject'] = $_GET['subject'];\r\n\t$record['sender'] = $_GET['from'];\r\n\t$msgname = addslashes($_GET['msgname']);\r\n\t$subject = addslashes($_GET['subject']);\r\n\t$sender = addslashes($_GET['from']);\r\n\tif ($type == 'newsletter')\r\n\t\t$template = $_GET['tp'];\r\n\telse\r\n\t\t$template = 'null';\r\n\t\r\n\t$sql = \"SELECT * FROM templates WHERE id=$template\";\r\n\t$result = mysqli_query($dbConnection, $sql)\r\n\t\tor die (\"SQL error \" . mysqli_error($dbConnection));\r\n\t$tpRecord = mysqli_fetch_array($result);\r\n\t$htmltext = $tpRecord['htmlText'];\r\n\t$record['htmltext'] = $htmltext;\r\n\t\r\n\tmysqli_free_result($result);\r\n\r\n\t$sql = \"INSERT INTO mailmessages (name, subject, sender, created, htmltext, template) \"\r\n\t\t. \"VALUES ('$msgname', '$subject', '$sender', '$dtSQL', '\" \r\n\t\t. addslashes($htmltext) . \"', $template)\";\r\n\tmysqli_query($dbConnection, $sql)\r\n\t\tor die (\"SQL error \" . mysqli_error($dbConnection) . $sql);\r\n\t$record['id'] = mysqli_insert_id($dbConnection);\t\t// Get the id of the new message\r\n//\techo \"<br>New id $msgId\";\r\n\r\n\treturn $record;\r\n}", "public function actionCreateReply($id)\n {\n $model = $this->findModel($id);\n $replyModel = new KursComment([\n 'user_id' => user()->id,\n 'reply_id' => $model->id,\n 'scenario' => 'text_required',\n\n ]);\n\n if ($this->isAjax) {\n\n $this->formatJson;\n\n if ($replyModel->load(Yii::$app->request->post()) && $replyModel->save()) {\n return ['forceClose' => true, 'forceReload' => '#crud-datatable-pjax'];\n }\n return [\n\n 'title' => 'Javob yozish',\n 'content' => $this->renderAjax('reply', [\n 'model' => $model,\n 'replyModel' => $replyModel,\n ]),\n 'footer' => Yii::$app->help->modalFooter,\n\n ];\n\n\n } else {\n if ($replyModel->load(Yii::$app->request->post()) && $replyModel->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('reply', [\n 'model' => $model,\n 'replyModel' => $replyModel,\n ]);\n }\n\n\n }", "public function processEdit(ProcessHook $hook)\n {\n $data = $this->view->getRequest()->request->get('dizkus', null);\n $createTopic = isset($data['createTopic']) ? true : false;\n if ($createTopic) {\n $hookconfig = $this->getHookConfig($hook);\n $topic = $this->_em->getRepository('Zikula\\Module\\DizkusModule\\Entity\\TopicEntity')->getHookedTopic($hook);\n // use Meta class to create topic data\n $topicMetaInstance = $this->getClassInstance($hook);\n if (!isset($topic)) {\n // create the new topic\n $newManagedTopic = new TopicManager();\n // format data for topic creation\n $data = array(\n 'forum_id' => $hookconfig[$hook->getAreaId()]['forum'],\n 'title' => $topicMetaInstance->getTitle(),\n 'message' => $topicMetaInstance->getContent(),\n 'subscribe_topic' => false,\n 'attachSignature' => false);\n $newManagedTopic->prepare($data);\n // add hook data to topic\n $newManagedTopic->setHookData($hook);\n // store new topic\n $newManagedTopic->create();\n } else {\n // create new post\n $managedPost = new PostManager();\n $data = array(\n 'topic_id' => $topic->getTopic_id(),\n 'post_text' => $topicMetaInstance->getContent(),\n 'attachSignature' => false);\n // create the post in the existing topic\n $managedPost->create($data);\n // store the post\n $managedPost->persist();\n }\n // cannot notify hooks in non-controller\n // notify topic & forum subscribers\n// ModUtil::apiFunc(self::MODULENAME, 'notify', 'emailSubscribers', array(\n// 'post' => $newManagedTopic->getFirstPost()));\n $this->view->getRequest()->getSession()->getFlashBag()->add('status', $this->__('Dizkus: Hooked discussion topic created.', $this->domain));\n }\n\n return true;\n }", "public function create()\n {\n $topic = new Topic;\n return view('topics.create')->with(compact('topic'));\n }", "public function addReply()\r\n{\r\n $query_string = \"INSERT INTO replies \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"replycontent = :replycontent, \";\r\n $query_string .= \"replytopic = :replytopic, \";\r\n $query_string .= \"replyauthor = :replyauthor\";\r\n\r\n return $query_string;\r\n}", "function createMessage($object) {\n\tglobal $USER;\n\t\n\t$message = new \\core\\message\\message();\n\t$message->component = 'local_littlehelpers';\n\t$message->name = 'paragraph52notification';\n\t$message->userfrom = $USER;\n\t\n\t// Get user\n\t$message->userto = core_user::get_user($object->useridto);\n\t\n\t// force email sending\n\t$message->userto->emailstop = 0;\n\t\n\t$message->subject = $object->subject;\n\t$message->fullmessage = $object->fullmessage;\n\t$message->fullmessageformat = FORMAT_MARKDOWN;\n\t$message->fullmessagehtml = $object->fullmessagehtml;\n\t$message->smallmessage = $object->smallmessage;\n\t$message->notification = '0';\n\t\n\t$message->contexturl = 'https://moodle.tu-darmstadt.de/local/littlehelpers/paragraph52';\n\t$message->contexturlname = 'Paragraph52';\n\t$message->replyto = \"[email protected]\";\n\n\treturn $message;\n}", "function processNewTopicForm($forumID, $data) {\n\t\tglobal $DB, $menuvar, $safs_config;\n\t\t\n\t\t// Dont escape since this method does that, double escape isn't fun\n\t\t// Insert Topic\n\t\t$insertArray = array('forum_id' => $forumID, 'user_id' => $_SESSION['userid'], 'topicicon_id' => $data['icon'], 'title' => $data['title'], 'datetimestamp' => time());\n\t\tif ($_SESSION['user_level'] == SYSTEM_ADMIN || $_SESSION['user_level'] == BOARD_ADMIN) $insertArray['type'] = $data['type'];\n\t\t\n\t\t$topicID = $DB->query_insert(\"topics\", $insertArray);\n\n\t\tif ($topicID) {\n\t\t\t// Insert Post\n\t\t\t$result = $DB->query_insert(\"posts\", array('topic_id' => $topicID, 'user_id' => $_SESSION['userid'], 'text' => $data['message'], 'datetimestamp' => time()));\n\t\n\t\t\t// Update forum post count\n\t\t\t$sql2 = \"UPDATE `\" . DBTABLEPREFIX . \"forums` SET posts = posts + 1 WHERE id = '\" . $forumID . \"'\";\n\t\t\t$result2 = $DB->query($sql2);\n\t\n\t\t\t// Update user post count\n\t\t\t$sql2 = \"UPDATE `\" . DBTABLEPREFIX . \"users` SET posts = posts + 1 WHERE id = '\" . $_SESSION['userid'] . \"'\";\n\t\t\t$result2 = $DB->query($sql2);\n\t\t}\n\t\t\n\t\t$returnVar = \"\n\t\t\t\t\t\t\t\t\t\t\t<h2 class=\\\"processFormTitle\\\">New Topic</h2>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\\\"processFormBlock \" . (($topicID) ? \"processFormSuccess\" : \"processFormFailed\") . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t\t\" . (($topicID) ? \"Your topic has been posted and you're being redirected to the thread.\" : \"There was an error posting your topic, you're being redirected to the thread.\") . \"\n\t\t\t\t\t\t\t\t\t\t\t\t<meta http-equiv=\\\"refresh\\\" content=\\\"3;url=\" . $menuvar['VIEWTOPIC'] . \"&id=\" . $topicID . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t</div>\";\n\t\t\n\t\t// Return the HTML\n\t\treturn $returnVar;\n\t}", "public function reply($topic_id, $quote_post_id = false)\n\t{\n\t\tif (!phpbb::$auth->acl_get('u_titania_post'))\n\t\t{\n\t\t\ttitania::needs_auth();\n\t\t}\n\n\t\t// Load the stuff we need\n\t\t$topic = $this->load_topic($topic_id);\n\n\t\t$post_object = new titania_post($topic->topic_type, $topic);\n\n\t\t// Check permissions\n\t\tif (!$post_object->acl_get('reply'))\n\t\t{\n\t\t\ttitania::needs_auth();\n\t\t}\n\n\t\t// Quoting?\n\t\tif ($quote_post_id !== false && $post_object->post_text == '')\n\t\t{\n\t\t\t$quote = $this->load_post($quote_post_id);\n\n\t\t\t// Permission check\n\t\t\tif (titania::$access_level <= min($quote->post_access, $quote->topic->topic_access) && (phpbb::$auth->acl_get('u_titania_mod_post_mod') || ($quote->post_approved && (!$quote->post_deleted || $quote->post_deleted == phpbb::$user->data['user_id']))))\n\t\t\t{\n\t\t\t\t$for_edit = $quote->generate_text_for_edit();\n\n\t\t\t\t$post_object->post_text = '[quote=\"' . users_overlord::get_user($quote->post_user_id, '_username', true) . '\"]' . $for_edit['text'] . '[/quote]';\n\t\t\t}\n\t\t}\n\n\t\t// Load the message object\n\t\t$message_object = new titania_message($post_object);\n\t\t$message_object->set_auth(array(\n\t\t\t'bbcode'\t\t=> phpbb::$auth->acl_get('u_titania_bbcode'),\n\t\t\t'smilies'\t\t=> phpbb::$auth->acl_get('u_titania_smilies'),\n\t\t\t'lock_topic'\t=> (phpbb::$auth->acl_get('u_titania_mod_post_mod') || (phpbb::$auth->acl_get('u_titania_post_mod_own') && is_object(titania::$contrib) && titania::$contrib->contrib_id == $post_object->topic->parent_id && titania::$contrib->is_author || titania::$contrib->is_active_coauthor)) ? true : false,\n\t\t\t'attachments'\t=> phpbb::$auth->acl_get('u_titania_post_attach'),\n\t\t));\n\t\t$message_object->set_settings(array(\n\t\t\t'display_captcha'\t\t\t=> (!phpbb::$user->data['is_registered']) ? true : false,\n\t\t\t'subject_default_override'\t=> 'Re: ' . $post_object->topic->topic_subject,\n\t\t));\n\n\t\t// Call our common posting handler\n\t\t$this->common_post('reply', $post_object, $message_object);\n\n\n\t\t// Setup the sort tool\n\t\t$topic_sort = posts_overlord::build_sort();\n\t\t$topic_sort->set_defaults(false, false, 'd');\n\n\t\t// Display the posts for review\n\t\tposts_overlord::display_topic($post_object->topic, $topic_sort);\n\n\t\t// Common stuff\n\t\tphpbb::$template->assign_vars(array(\n\t\t\t'S_POST_ACTION'\t\t=> $post_object->topic->get_url('reply', titania_url::$current_page_url),\n\t\t\t'L_POST_A'\t\t\t=> phpbb::$user->lang['POST_REPLY'],\n\n\t\t\t'S_DISPLAY_REVIEW'\t=> true,\n\t\t));\n\t\ttitania::page_header('POST_REPLY');\n\t}", "function store($channelId, Thread $thread, CreatePostRequest $form){\n\n\t\t// #54 remove all codes to $form CreatePostForm\n\t\t\n\t\t// if(Gate::denies('create', new Reply)){\n\t\t// \treturn response(\n\t\t// \t\t'Та дахин дахин нийтлэл оруулж байна, Түр хүлээнэ үү! :)', 429);\n\t\t// } \n\t\t// request()->validate(['body' => 'required|spamfree']);\n\t\t\n\t\treturn $thread->addReply([\t\n\t\t\t'body' => request('body'), \t\t\t\t\n\t\t\t'user_id' => auth()->id()\t\t\t\n\t\t])->load('owner');\n\n\t}", "private function setTemplateReplacements($topicDatum, $notifyDatum, $id, $type = 'reply', $area = 'topic')\n\t{\n\t\tglobal $scripturl, $txt;\n\n\t\t$mailPreparse = new PreparseMail();\n\n\t\t// Set the replacement values for the template\n\t\t$replacements = [\n\t\t\t'TOPICSUBJECT' => $mailPreparse->preparseSubject($topicDatum['subject']),\n\t\t\t'POSTERNAME' => un_htmlspecialchars($topicDatum['name']),\n\t\t\t'SIGNATURE' => $mailPreparse->preparseSignature($topicDatum['signature']),\n\t\t\t'BOARDNAME' => $notifyDatum['board_name'],\n\t\t\t'SUBSCRIPTION' => $txt['topic'],\n\t\t];\n\n\t\t// Notification due to a board or topic subscription, we provide a proper no más correo no deseado link\n\t\tif ($area === 'board')\n\t\t{\n\t\t\t$replacements['SUBSCRIPTION'] = $txt['board'];\n\t\t\t$replacements['UNSUBSCRIBELINK'] = replaceBasicActionUrl('{script_url}?action=notify;sa=unsubscribe;token=' .\n\t\t\t\tgetNotifierToken($notifyDatum['id_member'], $notifyDatum['email_address'], $notifyDatum['password_salt'], 'board', $topicDatum['board']));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$replacements['UNSUBSCRIBELINK'] = replaceBasicActionUrl('{script_url}?action=notify;sa=unsubscribe;token=' .\n\t\t\t\tgetNotifierToken($notifyDatum['id_member'], $notifyDatum['email_address'], $notifyDatum['password_salt'], 'topic', $notifyDatum['id_topic']));\n\t\t}\n\n\t\t// New topic or a reply\n\t\tif (!empty($topicDatum['last_id']))\n\t\t{\n\t\t\t$replacements['TOPICLINK'] = $scripturl . '?topic=' . $id . '.msg' . $topicDatum['last_id'] . '#msg' . $topicDatum['last_id'];\n\t\t\t$replacements['TOPICLINKNEW'] = $scripturl . '?topic=' . $id . '.new;topicseen#new';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$replacements['TOPICLINK'] = $scripturl . '?topic=' . $id . '.new#new';\n\t\t\t$replacements['TOPICLINKNEW'] = $scripturl . '?topic=' . $id . '.new#new';\n\t\t}\n\n\t\t// If removed, no sense in sending links that point to nothing\n\t\tif ($type === 'remove')\n\t\t{\n\t\t\tunset($replacements['TOPICLINK'], $replacements['UNSUBSCRIBELINK']);\n\t\t}\n\n\t\t// Do they want the body of the message sent too?\n\t\tif ($type === self::NOTIFY_REPLY && $this->canSendPostBody($notifyDatum))\n\t\t{\n\t\t\t$body = $topicDatum['body'];\n\n\t\t\t// Any attachments? if so lets make a big deal about them!\n\t\t\tif (!empty($topicDatum['attachments']))\n\t\t\t{\n\t\t\t\t$body .= \"\\n\\n\" . sprintf($txt['message_attachments'], $topicDatum['attachments'], $replacements['TOPICLINK']);\n\t\t\t}\n\n\t\t\t$replacements['MESSAGE'] = $mailPreparse->preparseHtml($body);\n\t\t}\n\n\t\treturn $replacements;\n\t}", "function get_createlink() {\n\treturn BASE . 'discussion' . DS . 'create';\n}", "public function create()\n {\n // die('here');\n return view('message.create');\n }", "public function create()\n {\n $topics = Topics::whereIn('status',['1',1])->get();\n $status = Constant::$status;\n return View::make('admin.subtopics.create',compact('status','topics'));\n }", "private function create() {\n $sql = \"INSERT INTO %s (\n version_time, version_author_id, version_message, topic_change_level,\n topic_id, topic_modified, topic_weight, topic_changefreq, topic_priority,\n meta_useparent, box_useparent, topic_mainlanguage, linktype_id, topic_protocol\n )\n SELECT\n '%d', '%s', '%s', '%d',\n topic_id, topic_modified, topic_weight, topic_changefreq, topic_priority,\n meta_useparent, box_useparent, topic_mainlanguage, linktype_id, topic_protocol\n FROM %s\n WHERE topic_id = '%d'\";\n $parameters = array(\n $this->databaseGetTableName($this->_tableName),\n isset($this->created) ? $this->created : time(),\n $this->owner,\n $this->message,\n isset($this->level) ? $this->level : -1,\n $this->databaseGetTableName(PapayaContentTables::PAGES),\n $this->pageId\n );\n if ($this->databaseQueryFmtWrite($sql, $parameters)) {\n $newId = $this->databaseLastInsertId(\n $this->databaseGetTableName($this->_tableName), 'version_id'\n );\n $sql = \"INSERT INTO %s (\n version_id, lng_id, version_published,\n topic_id, topic_title, topic_content, author_id,\n view_id, meta_title, meta_keywords, meta_descr\n )\n SELECT '%d', tt.lng_id, 0, tt.topic_id, tt.topic_title,\n tt.topic_content, tt.author_id,\n tt.view_id, tt.meta_title, tt.meta_keywords, tt.meta_descr\n FROM %s tt\n WHERE tt.topic_id = %d\";\n $parameters = array(\n $this->databaseGetTableName(PapayaContentTables::PAGE_VERSION_TRANSLATIONS),\n $newId,\n $this->databaseGetTableName(PapayaContentTables::PAGE_TRANSLATIONS),\n $this->pageId\n );\n $this->databaseQueryFmtWrite($sql, $parameters);\n return $newId;\n }\n return FALSE;\n }", "function createThread(&$dbparams, &$contentitem, $forumid, &$status)\n\t{\n\t\ttry {\n\t\t\t//setup some variables\n\t\t\t$userid = $this->getThreadAuthor($dbparams, $contentitem);\n\t\t\t$db = JFusionFactory::getDatabase($this->getJname());\n\t\t\t$subject = trim(strip_tags($contentitem->title));\n\n\t\t\t//prepare the content body\n\t\t\t$text = $this->prepareFirstPostBody($dbparams, $contentitem);\n\n\t\t\t//the user information\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->select('username, username_clean, user_colour, user_permissions')\n\t\t\t\t->from('#__users')\n\t\t\t\t->where('user_id = ' . (int) $userid);\n\n\t\t\t$db->setQuery($query);\n\t\t\t$user = $db->loadObject();\n\n\t\t\tif ($dbparams->get('use_content_created_date', false)) {\n\t\t\t\t$timezone = JFusionFactory::getConfig()->get('offset');\n\t\t\t\t$timestamp = strtotime($contentitem->created);\n\t\t\t\t//undo Joomla timezone offset\n\t\t\t\t$timestamp += ($timezone * 3600);\n\t\t\t} else {\n\t\t\t\t$timestamp = time();\n\t\t\t}\n\n\t\t\t$topic = new stdClass();\n\t\t\t$topic->topic_poster = (int) $userid;\n\t\t\t$topic->topic_time = $timestamp;\n\t\t\t$topic->forum_id = $forumid;\n\t\t\t$topic->icon_id = false;\n\t\t\t$topic->topic_visibility = 1;\n\t\t\t$topic->topic_title = $subject;\n\t\t\t$topic->topic_first_poster_name\t= $user->username;\n\t\t\t$topic->topic_first_poster_colour = $user->user_colour;\n\t\t\t$topic->topic_type = 0;\n\t\t\t$topic->topic_time_limit = 0;\n\t\t\t$topic->topic_attachment = 0;\n\n\t\t\t$db->insertObject('#__topics', $topic, 'topic_id' );\n\n\t\t\t$bbcode = $this->helper->bbcode_parser($text);\n\n\t\t\t$post = new stdClass();\n\t\t\t$post->forum_id\t\t\t= (int) $forumid;\n\t\t\t$post->topic_id \t\t= (int) $topic->topic_id;\n\t\t\t$post->poster_id\t\t= (int) $userid;\n\t\t\t$post->icon_id\t\t\t= 0;\n\t\t\t$post->poster_ip\t\t= $_SERVER['REMOTE_ADDR'];\n\t\t\t$post->post_time\t\t= (int) $timestamp;\n\t\t\t$post->post_visibility\t= 1;\n\t\t\t$post->enable_bbcode\t= 1;\n\t\t\t$post->enable_smilies\t= 1;\n\t\t\t$post->enable_magic_url\t= 1;\n\t\t\t$post->enable_sig\t\t= 1;\n\t\t\t$post->post_username\t= $user->username;\n\t\t\t$post->post_subject\t\t= $subject;\n\t\t\t$post->post_text\t\t= $bbcode->text;\n\t\t\t$post->post_checksum\t= md5($bbcode->text);\n\t\t\t$post->post_attachment\t= 0;\n\t\t\t$post->bbcode_bitfield\t= $bbcode->bbcode_bitfield;\n\t\t\t$post->bbcode_uid\t\t= $bbcode->bbcode_uid;\n\t\t\t$post->post_postcount\t= 1;\n\t\t\t$post->post_edit_locked\t= 0;\n\n\t\t\t$db->insertObject('#__posts', $post, 'post_id');\n\n\t\t\t$topic->topic_first_post_id\t\t\t= $post->post_id;\n\t\t\t$topic->topic_last_post_id\t\t\t= $post->post_id;\n\t\t\t$topic->topic_last_post_time\t\t= (int) $timestamp;\n\t\t\t$topic->topic_last_poster_id\t\t= (int) $userid;\n\t\t\t$topic->topic_last_poster_name\t\t= $user->username;\n\t\t\t$topic->topic_last_poster_colour\t= $user->user_colour;\n\t\t\t$topic->topic_last_post_subject\t\t= (string) $subject;\n\t\t\t$topic->topic_posts_approved = 1;\n\n\t\t\t$db->updateObject('#__topics', $topic, 'topic_id' );\n\n\t\t\tif ($dbparams->get('use_content_created_date', false)) {\n\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t->select('forum_last_post_time')\n\t\t\t\t\t->from('#__forums')\n\t\t\t\t\t->where('forum_id = ' . (int) $forumid);\n\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$forum_last_post_time = $db->loadResult();\n\n\t\t\t\t//only update the last post for the topic if it really is newer\n\t\t\t\t$updateLastPost = ($timestamp > $forum_last_post_time) ? true : false;\n\t\t\t} else {\n\t\t\t\t$updateLastPost = true;\n\t\t\t}\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__forums');\n\n\t\t\tif($updateLastPost) {\n\t\t\t\t$query->set('forum_last_post_id = ' . $db->quote($post->post_id))\n\t\t\t\t\t->set('forum_last_post_subject = ' . $db->quote($subject))\n\t\t\t\t\t->set('forum_last_post_time = ' . (int) $timestamp)\n\t\t\t\t\t->set('forum_last_poster_id = ' . (int) $userid)\n\t\t\t\t\t->set('forum_last_poster_name = ' . $db->quote($user->username))\n\t\t\t\t\t->set('forum_last_poster_colour = ' . $db->quote($user->user_colour));\n\t\t\t}\n\n\t\t\t//update some stats\n\t\t\t$query->set('forum_posts_approved = forum_posts_approved + 1')\n\t\t\t\t->set('forum_topics_approved = forum_topics_approved + 1')\n\t\t\t\t->where('forum_id = ' . $db->quote($forumid));\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\t//update some stats\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__users')\n\t\t\t\t->set('user_posts = user_posts + 1')\n\t\t\t\t->where('user_id = ' . (int) $userid);\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->update('#__config')\n\t\t\t\t->set('config_value = config_value + 1')\n\t\t\t\t->where('config_name = ' . $db->quote('num_topics'));\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\n\t\t\tif(!empty($topic->topic_id) && !empty($post->post_id)) {\n\t\t\t\t//add information to update forum lookup\n\t\t\t\t$status['threadinfo']->forumid = $forumid;\n\t\t\t\t$status['threadinfo']->threadid = $topic->topic_id;\n\t\t\t\t$status['threadinfo']->postid = $post->post_id;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t$status['error'] = $e->getMessage();\n\t\t}\n\t}", "protected static function replyAction($ajax) {\n\t\tglobal $db, $user;\n\t\tif(isset($_POST['markdown']) && ($markdown = trim($_POST['markdown'])) && isset($_POST['discussion']) && ($discussion = +$_POST['discussion']))\n\t\t\tif($ins = $db->prepare('insert into forum_replies (discussion, posted, user, name, contacturl, html, markdown) values (?, ?, ?, ?, ?, ?, ?)')) {\n\t\t\t\t$posted = time();\n\t\t\t\t$userid = $user->IsLoggedIn() ? $user->ID : null;\n\t\t\t\t$name = $user->IsLoggedIn() ? '' : (isset($_POST['authorname']) && trim($_POST['authorname']) ? trim($_POST['authorname']) : 'random internet person');\n\t\t\t\t$contact = $user->IsLoggedIn() || !isset($_POST['authorcontact']) ? '' : t7format::Link(trim($_POST['authorcontact']));\n\t\t\t\t$html = t7format::Markdown($markdown);\n\t\t\t\tif($ins->bind_param('iiissss', $discussion, $posted, $userid, $name, $contact, $html, $markdown))\n\t\t\t\t\tif($ins->execute()) {\n\t\t\t\t\t\t$id = +$ins->insert_id;\n\t\t\t\t\t\t$ajax->Data->reply = [\n\t\t\t\t\t\t\t'id' => $id,\n\t\t\t\t\t\t\t'posted' => t7format::TimeTag(t7format::DATE_LONG, $posted),\n\t\t\t\t\t\t\t'canchange' => $user->IsLoggedIn(),\n\t\t\t\t\t\t\t'username' => $user->IsLoggedIn() ? $user->Username : null,\n\t\t\t\t\t\t\t'displayname' => $user->IsLoggedIn() ? $user->DisplayName : null,\n\t\t\t\t\t\t\t'avatar' => $user->IsLoggedIn() ? $user->Avatar : null,\n\t\t\t\t\t\t\t'level' => $user->IsLoggedIn() ? $user->GetLevelName() : null,\n\t\t\t\t\t\t\t'friend' => null,\n\t\t\t\t\t\t\t'name' => $name,\n\t\t\t\t\t\t\t'contacturl' => $contact,\n\t\t\t\t\t\t\t'markdown' => $markdown,\n\t\t\t\t\t\t\t'html' => $html\n\t\t\t\t\t\t];\n\t\t\t\t\t\tif($user->IsLoggedIn())\n\t\t\t\t\t\t\t$db->real_query('update users_stats as u set u.replies=(select count(1) from forum_replies where user=u.id) where u.id=\\'' . +$user->ID . '\\'');\n\t\t\t\t\t\tif($title = $db->query('select d.title from forum_replies as r left join forum_discussions as d on d.id=r.discussion where r.id=' . $id))\n\t\t\t\t\t\t\tif($title = $title->fetch_object())\n\t\t\t\t\t\t\t\tt7send::Tweet(($user->IsLoggedIn() ? $user->DisplayName : $name) . ' discussed ' . $title->title, t7format::FullUrl('/forum/' . $discussion . '#r' . $id));\n\t\t\t\t\t} else\n\t\t\t\t\t\t$ajax->Fail('error executing query to add reply', $ins->errno . ' ' . $ins->error);\n\t\t\t\telse\n\t\t\t\t\t$ajax->Fail('error binding parameters to add reply', $ins->errno . ' ' . $ins->error);\n\t\t\t} else\n\t\t\t\t$ajax->Fail('error preparing to add reply', $db->errno . ' ' . $db->error);\n\t\telse\n\t\t\t$ajax->Fail('discussion and markdown are required.');\n\t}", "function Admin_Messages_admin_new()\n{\n // Security check - important to do this as early as possible to avoid\n // potential security holes or just too much wasted processing\n if (!pnSecAuthAction(0, 'Admin_Messages::', '::', ACCESS_ADD)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n\t$pnRender =& new pnRender('Admin_Messages');\n\n\t// As Admin output changes often, we do not want caching.\n\t$pnRender->caching = false;\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('admin_messages_admin_new.htm');\n}", "public function testCreate()\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n //test creation as admin\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with admin');\n\n //test creation as user\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with user');\n\n\n\n }", "public function new_topic( $topic_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_topic', 'new_group_forum_topic' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_topic', $topic_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_topic',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_topic']['creds'],\n\t\t\t\t$this->prefs['new_topic']['log'],\n\t\t\t\t$topic_id,\n\t\t\t\t'bp_ftopic',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}", "public function view() \n {\n check_login_session('user_session');\n $session = $_SESSION['user_session'];\n $user_id = $session['user_id'];\n\n $encrypted_topic_id = Param::get('topic_id');\n $topic_id = base64_decode($encrypted_topic_id);\n $topic = Topic::get($topic_id);\n\n $user = new User();\n $infos = $user->getUpdatedProfile($user_id);\n $username = $infos->username; \n \n if ($infos->grade_level < $topic->grade_level) {\n ReplyController::$placeholder = \"You are not allowed to reply on this Topic\";\n ReplyController::$disabled = \"disabled\";\n }\n\n // start paginated replies \n $total_rows = Reply::count($topic_id);\n $page = Pagination::pageValidator($total_rows);\n $replies = Reply::getRepliesByTopicId($page, $topic_id);\n $paged = new Pagination(\n $total_rows, \n $page, \n array(\"topic_id=$encrypted_topic_id\"));\n // end paginated replies \n\n $reply = new Reply();\n $page = Param::get('page_next', 'view');\n switch ($page) {\n case 'view';\n break;\n case 'write_end';\n $reply->user_id = $user_id;\n $reply->username = Param::get('username');\n $reply->body = Param::get('body');\n try {\n $reply->write($topic_id);\n redirect(url('reply/view', array('topic_id' => $encrypted_topic_id)));\n } catch (ValidationException $e) {\n $page = 'view';\n }\n break;\n default:\n throw new NotFoundException(\"{$page} is not found\");\n break;\n }\n $this->set(get_defined_vars());\n }", "public function create($code, $topic_id)\n {\n return view('posts/post_create', ['code' => $code, 'topic_id' => $topic_id]);\n }", "public function addTopic($name,$desc,$enable,$options)\n {\n $desc=StringFilter::textareaInput($desc);\n $enable=$enable==\"t\"?\"1\":\"0\";\n $id=$this->dal->addTopic($name,$desc,$enable);\n $this->addOption($id,$options);\n return $id;\n }", "function cns_render_post_buttons($topic_info, $_postdetails, $may_reply, $rendering_context = 'cns')\n{\n $may_reply_private_post = array_key_exists('may_reply_private_post', $topic_info);\n\n require_lang('cns');\n require_code('cns_members2');\n\n $buttons = new Tempcode();\n\n if ((array_key_exists('may_validate_posts', $topic_info)) && (addon_installed('unvalidated')) && ((($topic_info['validated'] == 0) && ($_postdetails['id'] == $topic_info['first_post_id'])) || ($_postdetails['validated'] == 0))) {\n $map = array('page' => 'topics', 'type' => 'validate_post', 'id' => $_postdetails['id']);\n $test = get_param_string('kfs' . (is_null($topic_info['forum_id']) ? '' : strval($topic_info['forum_id'])), null, true);\n if (($test !== null) && ($test !== '0')) {\n $map['kfs' . (is_null($topic_info['forum_id']) ? '' : strval($topic_info['forum_id']))] = $test;\n }\n $test_threaded = get_param_integer('threaded', null);\n if ($test_threaded !== null) {\n $map['threaded'] = $test_threaded;\n }\n $action_url = build_url($map, get_module_zone('topics'));\n $_title = do_lang_tempcode('VALIDATE_POST');\n $_title_full = new Tempcode();\n $_title_full->attach($_title);\n $_title_full->attach(do_lang_tempcode('ID_NUM', strval($_postdetails['id'])));\n $buttons->attach(do_template('BUTTON_SCREEN_ITEM', array('_GUID' => '712fdaee35f378e37b007f3a73246690', 'REL' => 'validate nofollow', 'IMMEDIATE' => true, 'IMG' => 'menu__adminzone__audit__unvalidated', 'TITLE' => $_title, 'FULL_TITLE' => $_title_full, 'URL' => $action_url)));\n }\n\n if (($may_reply) && (is_null(get_bot_type()))) {\n $map = array('page' => 'topics', 'type' => 'new_post', 'id' => $_postdetails['topic_id'], 'parent_id' => $_postdetails['id']);\n if ($topic_info['is_threaded'] == 0) {\n $map['quote'] = $_postdetails['id'];\n }\n if (array_key_exists('intended_solely_for', $_postdetails)) {\n $map['intended_solely_for'] = $_postdetails['poster'];\n }\n $test = get_param_string('kfs' . (is_null($topic_info['forum_id']) ? '' : strval($topic_info['forum_id'])), null, true);\n if (($test !== null) && ($test !== '0')) {\n $map['kfs' . (is_null($topic_info['forum_id']) ? '' : strval($topic_info['forum_id']))] = $test;\n }\n $test_threaded = get_param_integer('threaded', null);\n if ($test_threaded !== null) {\n $map['threaded'] = $test_threaded;\n }\n $action_url = build_url($map, get_module_zone('topics'));\n $javascript = null;\n $javascript_explicit_quote = null;\n\n if ((array_key_exists('message_comcode', $_postdetails)) && (!is_null($_postdetails['message_comcode'])) && (strlen($_postdetails['message_comcode']) < 1024 * 10/*10kb limit, for reasonable performance*/) && (array_key_exists('may_use_quick_reply', $topic_info)) && (!array_key_exists('intended_solely_for', $map))) {\n require_code('comcode_cleanup');\n $replying_to_post = str_replace(\"\\n\", '\\n', addslashes(comcode_censored_raw_code_access($_postdetails['message_comcode'])));\n $replying_to_post_plain = str_replace(\"\\n\", '\\n', addslashes(($topic_info['is_threaded'] == 0) ? '' : strip_comcode($_postdetails['message_comcode'])));\n $javascript = 'return topic_reply(' . ($topic_info['is_threaded'] ? 'true' : 'false') . ',this,\\'' . strval($_postdetails['id']) . '\\',\\'' . addslashes($_postdetails['poster_username']) . '\\',\\'' . $replying_to_post . '\\',\\'' . $replying_to_post_plain . '\\');';\n $javascript_explicit_quote = 'return topic_reply(false,this,\\'' . strval($_postdetails['id']) . '\\',\\'' . addslashes($_postdetails['poster_username']) . '\\',\\'' . $replying_to_post . '\\',\\'' . $replying_to_post_plain . '\\',true);';\n }\n $_title = do_lang_tempcode(($topic_info['is_threaded'] == 1) ? '_REPLY' : '_QUOTE_POST');\n $_title_full = new Tempcode();\n $_title_full->attach(do_lang_tempcode(($topic_info['is_threaded'] == 1) ? 'REPLY' : 'QUOTE_POST'));\n $_title_full->attach(do_lang_tempcode('ID_NUM', strval($_postdetails['id'])));\n $buttons->attach(do_template('BUTTON_SCREEN_ITEM', array('_GUID' => 'fc13d12cfe58324d78befec29a663b4f', 'REL' => 'add reply nofollow', 'IMMEDIATE' => false, 'IMG' => ($topic_info['is_threaded'] == 1) ? 'buttons__new_reply' : 'buttons__new_quote', 'TITLE' => $_title, 'FULL_TITLE' => $_title_full, 'URL' => $action_url, 'JAVASCRIPT' => $javascript)));\n\n if ($topic_info['is_threaded'] == 1) { // Second button for replying with explicit quote\n $_title = do_lang_tempcode('_QUOTE_POST');\n $_title_full = new Tempcode();\n $_title_full->attach($_title);\n $_title_full->attach(do_lang_tempcode('ID_NUM', strval($_postdetails['id'])));\n $buttons->attach(do_template('BUTTON_SCREEN_ITEM', array('_GUID' => 'fc13d12cfe58324d78befec29a663b4f', 'REL' => 'add reply nofollow', 'IMMEDIATE' => false, 'IMG' => 'buttons__new_quote', 'TITLE' => $_title, 'FULL_TITLE' => $_title_full, 'URL' => $action_url, 'JAVASCRIPT' => $javascript_explicit_quote)));\n }\n }\n\n if ($rendering_context == 'tickets') {\n if ((array_key_exists('message_comcode', $_postdetails)) && (!is_null($_postdetails['message_comcode']))) {\n $ticket_id = get_param_string('id', null);\n if (!is_null($ticket_id)) {\n require_lang('tickets');\n require_code('tickets');\n $ticket_owner = check_ticket_access($ticket_id);\n\n if (($ticket_owner == get_member()) || (has_privilege(get_member(), 'support_operator'))) {\n $_title = do_lang_tempcode('QUOTE_TO_NEW_TICKET');\n $_title_full = new Tempcode();\n $_title_full->attach($_title);\n $_title_full->attach(do_lang_tempcode('ID_NUM', strval($_postdetails['id'])));\n\n $action_url = build_url(array('page' => 'tickets', 'type' => 'ticket', 'post_as' => ($ticket_owner == get_member()) ? null : $ticket_owner), get_module_zone('tickets'));\n\n $ticket_url = build_url(array('page' => 'tickets', 'type' => 'ticket', 'id' => $ticket_id), get_module_zone('tickets'));\n $quote_to_new_post = do_lang('POSTING_TICKET_AS', $GLOBALS['FORUM_DRIVER']->get_username(get_member()), $ticket_url->evaluate(), $_postdetails['message_comcode']);\n $hidden = form_input_hidden('post', $quote_to_new_post);\n\n $buttons->attach(do_template('BUTTON_SCREEN_ITEM', array('_GUID' => '927d758415a3358d6b69e1587cab1e8d', 'IMMEDIATE' => true, 'HIDDEN' => $hidden, 'IMG' => 'buttons__new_quote', 'TITLE' => $_title, 'FULL_TITLE' => $_title_full, 'URL' => $action_url, 'TARGET' => '_blank')));\n }\n }\n }\n }\n\n if ((array_key_exists('may_pt_members', $topic_info)) && ($may_reply_private_post) && ($_postdetails['poster'] != get_member()) && ($_postdetails['poster'] != $GLOBALS['CNS_DRIVER']->get_guest_id()) && (cns_may_whisper($_postdetails['poster'])) && (get_option('overt_whisper_suggestion') == '1')) {\n $whisper_type = (get_option('inline_pp_advertise') == '0') ? 'new_pt' : 'whisper';\n $action_url = build_url(array('page' => 'topics', 'type' => $whisper_type, 'id' => $_postdetails['topic_id'], 'quote' => $_postdetails['id'], 'intended_solely_for' => $_postdetails['poster']), get_module_zone('topics'));\n $_title = do_lang_tempcode('WHISPER');\n $_title_full = new Tempcode();\n $_title_full->attach($_title);\n $_title_full->attach(do_lang_tempcode('ID_NUM', strval($_postdetails['id'])));\n $buttons->attach(do_template('BUTTON_SCREEN_ITEM', array('_GUID' => 'fb1c74bae9c553dc160ade85adf289b5', 'REL' => 'add reply contact nofollow', 'IMMEDIATE' => false, 'IMG' => (get_option('inline_pp_advertise') == '0') ? 'buttons__send' : 'buttons__whisper', 'TITLE' => $_title, 'FULL_TITLE' => $_title_full, 'URL' => $action_url)));\n }\n\n if (array_key_exists('may_edit', $_postdetails)) {\n $map = array('page' => 'topics', 'type' => 'edit_post', 'id' => $_postdetails['id']);\n if ($rendering_context == 'tickets') {\n $map['redirect'] = static_evaluate_tempcode(build_url(array('page' => 'tickets', 'type' => 'ticket', 'id' => get_param_string('id')), get_module_zone('tickets'), null, false, false, false, '_top'));\n } else {\n $map['redirect'] = get_self_url(true);\n }\n $test = get_param_string('kfs' . (is_null($topic_info['forum_id']) ? '' : strval($topic_info['forum_id'])), null, true);\n if (($test !== null) && ($test !== '0')) {\n $map['kfs' . (is_null($topic_info['forum_id']) ? '' : strval($topic_info['forum_id']))] = $test;\n }\n $test_threaded = get_param_integer('threaded', null);\n if ($test_threaded !== null) {\n $map['threaded'] = $test_threaded;\n }\n $edit_url = build_url($map, get_module_zone('topics'));\n $_title = do_lang_tempcode('EDIT');\n $_title_full = do_lang_tempcode('EDIT_POST');\n $_title_full->attach($_title);\n $_title_full->attach(do_lang_tempcode('ID_NUM', strval($_postdetails['id'])));\n $buttons->attach(do_template('BUTTON_SCREEN_ITEM', array('_GUID' => 'f341cfc94b3d705437d43e89f572bff6', 'REL' => 'edit nofollow', 'IMMEDIATE' => false, 'IMG' => 'buttons__edit', 'TITLE' => $_title, 'FULL_TITLE' => $_title_full, 'URL' => $edit_url)));\n }\n\n if (array_key_exists('may_delete', $_postdetails)) {\n $map = array('page' => 'topics', 'type' => 'delete_post', 'id' => $_postdetails['id']);\n if ($rendering_context == 'tickets') {\n $map['redirect'] = static_evaluate_tempcode(build_url(array('page' => 'tickets', 'type' => 'ticket', 'id' => get_param_string('id')), get_module_zone('tickets'), null, false, false, false, '_top'));\n } else {\n $map['redirect'] = get_self_url(true);\n }\n $test = get_param_string('kfs' . (is_null($topic_info['forum_id']) ? '' : strval($topic_info['forum_id'])), null, true);\n if (($test !== null) && ($test !== '0')) {\n $map['kfs' . (is_null($topic_info['forum_id']) ? '' : strval($topic_info['forum_id']))] = $test;\n }\n $test_threaded = get_param_integer('threaded', null);\n if ($test_threaded !== null) {\n $map['threaded'] = $test_threaded;\n }\n $delete_url = build_url($map, get_module_zone('topics'));\n $_title = do_lang_tempcode('DELETE');\n $_title_full = new Tempcode();\n $_title_full->attach(do_lang_tempcode('DELETE_POST'));\n $_title_full->attach(do_lang_tempcode('ID_NUM', strval($_postdetails['id'])));\n $buttons->attach(do_template('BUTTON_SCREEN_ITEM', array('_GUID' => '8bf6d098ddc217eef75718464dc03d41', 'REL' => 'delete nofollow', 'IMMEDIATE' => false, 'IMG' => 'menu___generic_admin__delete', 'TITLE' => $_title, 'FULL_TITLE' => $_title_full, 'URL' => $delete_url)));\n }\n\n if ($rendering_context != 'tickets') {\n if ((array_key_exists('may_report_posts', $topic_info)) && (addon_installed('cns_reported_posts')) && (is_null(get_bot_type()))) {\n $action_url = build_url(array('page' => 'topics', 'type' => 'report_post', 'id' => $_postdetails['id']), get_module_zone('topics'));\n $_title = do_lang_tempcode('_REPORT_POST');\n $_title_full = new Tempcode();\n $_title_full->attach(do_lang_tempcode('REPORT_POST'));\n $_title_full->attach(do_lang_tempcode('ID_NUM', strval($_postdetails['id'])));\n $buttons->attach(do_template('BUTTON_SCREEN_ITEM', array('_GUID' => 'f81cbe84f524b4ed9e089c6e89a7c717', 'REL' => 'report nofollow', 'IMMEDIATE' => false, 'IMG' => 'buttons__report', 'TITLE' => $_title, 'FULL_TITLE' => $_title_full, 'URL' => $action_url, 'JAVASCRIPT' => 'return open_link_as_overlay(this,null,\\'100%\\');')));\n }\n\n if ((array_key_exists('may_warn_members', $topic_info)) && ($_postdetails['poster'] != $GLOBALS['CNS_DRIVER']->get_guest_id()) && (addon_installed('cns_warnings'))) {\n $redir_url = get_self_url(true);\n $redir_url .= '#post_' . strval($_postdetails['id']);\n $action_url = build_url(array('page' => 'warnings', 'type' => 'add', 'member_id' => $_postdetails['poster'], 'post_id' => $_postdetails['id'], 'redirect' => $redir_url), get_module_zone('warnings'));\n $_title = do_lang_tempcode('__WARN_MEMBER');\n $_title_full = do_lang_tempcode('WARN_MEMBER');\n $_title_full->attach(do_lang_tempcode('ID_NUM', strval($_postdetails['id'])));\n $buttons->attach(do_template('BUTTON_SCREEN_ITEM', array('_GUID' => '2698c51b06a72773ac7135bbfe791318', 'JAVASCRIPT_MOUSEDOWN' => 'if (event.which==2) this.href+=\\'&spam=1\\';', 'REL' => 'nofollow', 'IMMEDIATE' => false, 'IMG' => 'buttons__warn', 'TITLE' => $_title, 'FULL_TITLE' => $_title_full, 'URL' => $action_url)));\n }\n }\n\n if ($_postdetails['has_revisions']) {\n $action_url = build_url(array('page' => 'admin_revisions', 'type' => 'browse', 'resource_types' => 'post', 'resource_id' => $_postdetails['id']), get_module_zone('admin_revisions'));\n $_title = do_lang_tempcode('actionlog:REVISIONS');\n $_title_full = new Tempcode();\n $_title_full->attach($_title);\n $_title_full->attach(do_lang_tempcode('ID_NUM', strval($_postdetails['id'])));\n $buttons->attach(do_template('BUTTON_SCREEN_ITEM', array('_GUID' => '6086b2ae226bf2a69d1e34641d22ae21', 'REL' => 'history nofollow', 'IMMEDIATE' => false, 'IMG' => 'buttons__revisions', 'TITLE' => $_title, 'FULL_TITLE' => $_title_full, 'URL' => $action_url)));\n }\n\n if ($rendering_context != 'tickets') {\n if ((addon_installed('points')) && (!is_guest()) && (!is_guest($_postdetails['poster'])) && (has_privilege($_postdetails['poster'], 'use_points'))) {\n require_css('points');\n $action_url = build_url(array('page' => 'points', 'type' => 'member', 'id' => $_postdetails['poster']), get_module_zone('points'));\n $_title = do_lang_tempcode('__POINTS_THANKS');\n $_title_full = do_lang_tempcode('POINTS_THANKS');\n $buttons->attach(do_template('BUTTON_SCREEN_ITEM', array('_GUID' => 'a66f98cb4d56bd0d64e9ecc44d357141', 'IMMEDIATE' => false, 'IMG' => 'buttons__points', 'TITLE' => $_title, 'FULL_TITLE' => $_title_full, 'URL' => $action_url)));\n }\n }\n\n return $buttons;\n}", "public function replyAction()\n\t{\n\t\tZend_Layout::getMvcInstance()->disableLayout();\n\t\t/* $language = $this->getRequest()->getParam('lang');\n\t\t$decorator = new Zenfox_DecoratorForm();\n\t\t$form = new Player_TicketReplyForm();\n\t\t$form->getElement('reply_msg')->setDecorators($decorator->openingUlTagDecorator);\n\t\t$form->getElement('ticket_status')->setDecorators($decorator->changeUlTagDecorator);\n\t\t$form->getElement('submit')->setDecorators($decorator->closingUlButtonTagDecorator); */\n\t\t$session = new Zend_Auth_Storage_Session();\n\t\t$store = $session->read();\n\t\t$userType = $store['roleName'];\n\t\t$playerId = $store['id'];\n\t\t$ticketId = $this->getRequest()->ticket_id;\n\t\t$replyMessage = $this->getRequest()->replyMsg;\n\t\t$subject = $this->getRequest()->subject;\n\t\t$ticket = new Tickets($playerId, $userType);\n\t\tif(isset($replyMessage))\n\t\t{\n\t\t\t$data['ticket_status'] = 'OPEN';\n\t\t\t$data['reply_msg'] = $replyMessage;\n\t\t\t$ticket->replyTicket($data,$ticketId);\n\t\t\techo $ticketId;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = $ticket->showTicket($ticketId);\n\t\t\t//Zenfox_Debug::dump($message, 'message');\n\t\t\t\n\t\t\t$sender = \"\";\n\t\t\t$messages = \"\";\n\t\t\t$time = \"\";\n\t\t\tforeach($message as $msg)\n\t\t\t{\n\t\t\t\tif($msg['sent_by'] == 'CSR')\n\t\t\t\t{\n\t\t\t\t\t$csr = new CsrIds();\n\t\t\t\t\t$sender .= $csr->getCsrName($msg['owner']) . \"|\";\n\t\t\t\t}\n\t\t\t\tif($msg['sent_by'] == 'PLAYER')\n\t\t\t\t{\n\t\t\t\t\t$player = new CsrIds();\n\t\t\t\t\t$sender .= $player->getPlayerLogin($msg['user_id']) . \"|\";\n\t\t\t\t}\n\t\t\t\t$messages .= $msg['reply_msg'] . \"|\";\n\t\t\t\t$time .= $msg['time'] . \"|\";\n\t\t\t}\n\t\t\techo $sender . \"&\" . $messages . \"&\" . $ticketId . \"&\" . $subject . \"&\" . $time;\n\t\t}\n\t\t/*\n\t\t* Taking the value from the database and set into form\n\t\t*/\n\t\t/*\n\t\t$this->view->sender = $fromName;\n\t\t$this->view->messages = $message;\n\t\t//$this->_helper->FlashMessenger(array('notice' => $this->view->translate($message)));\n\t\tforeach($message as $ticketData)\n\t\t{\n\t\t\t$lastTicketStatus = $ticketData['ticket_status'];\n\t\t}\n\t\t$form->ticket_status->setValue($lastTicketStatus);\n\t\t$this->view->form = $form; */\n\t\t/* if($this->getRequest()->isPost())\n\t\t{\n\t\t\tif($form->isValid($_POST))\n\t\t\t{\n\t\t\t\t$data = $form->getValues();\n\t\t\t\t$ticket->replyTicket($data,$this->getRequest()->ticket_id);\n\t\t\t\t$this->_redirect($language . '/ticket/view');\n//\t\t\t\t$form = new Player_TicketReplyForm();\n//\t\t\t\t$this->view->form = $form;\n//\t\t\t\t$this->view->message = $this->view->translate('The message has been sent');\n\t\t\t}\n\t\t} */\n\t}", "public function add ($request)\n\t{\n\t\t// The topic id that this post belongs to\n\t\t$topic_id = (int) $request->get('topicId');\n\t\t$response = new Response();\n\n\t\t// Should never happen legit but just incase\n\t\tif (!$topic_id)\n\t\t{\n\t $response->setStatusCode(400);\n\t $response->setContent($this->app->trans('UNKNOWN_ERROR'));\n\t return $response;\n\t\t}\n\n\t\t// Get the topic so we can use it later\n\t\t$topic = $this->app['topic']->findById($topic_id);\n\n\t\t$forum = $this->app['forum']->findById($topic['forum']);\n\n\t\tif (!$forum)\n\t\t{\n\t\t\treturn new Response($this->app->trans('UNKNOWN_ERROR'), 500);\n\t\t}\n\n\t\t// get the logged in user\n\t\t// @todo make a wrapper for this\n\t\t$user = $this->app['session']->get('user');\n\n\t\tif (!$user)\n\t\t{\n\t $response->setStatusCode(400);\n\t $response->setContent($this->app->trans('MUST_BE_LOGGED_IN'));\n\t return $response;\n\t\t}\n\n\t\t// Should never happen legit but just incase\n\t\tif (!$topic)\n\t\t{\n\t return new Response($this->app->trans('UNKNOWN_ERROR'), 500);\n\t\t}\n\n\t\t// If the topic is locked and user cannot bypass it\n\t\tif ($topic['locked'] && !\\ASF\\Permissions::hasPermission('BYPASS_RESTRICTIONS'))\n\t\t{\n\t\t\t$response->setStatusCode(400);\n\t $response->setContent($this->app->trans('TOPIC_LOCKED'));\n\t return $response;\n\t\t}\n\n\t\tif (!\\ASF\\Permissions::hasPermission('CREATE_POST')) \n\t\t{\n\t\t\t$response->setStatusCode(400);\n\t $response->setContent($this->app->trans('NO_PERMISSION'));\n\t return $response;\n\t\t}\n\n\t\t$name = $request->get('name');\n\t\t$content = $request->get('reply');\n\n\t\t$attachments = $request->files->get('attachments');\n\n\t\tif ($attachments[0] != null)\n\t\t{\n\t\t\tif (count($attachments) > 5)\n\t\t\t{\n\t\t\t\t$response->setStatusCode(400);\n\t\t\t\t$response->setContent($this->app->trans('TOO_MANY_ATTACHMENTS'));\n\t\t\t\treturn $response;\n\t\t\t}\n\n\t\t\tforeach ($attachments as $attachment)\n\t\t\t{\n\t\t\t\t$attachment_name = $attachment->getClientOriginalName();\n\t\t\t\t$size = $attachment->getClientSize();\n\t\t\t\t$mime = $attachment->getClientMimeType();\n\n\t\t\t\tif ($size >= $this->app['files']['maxSize'])\n\t\t\t\t{\n\t\t\t\t\t$response->setStatusCode(400);\n\t\t\t\t\t$response->setContent($this->app->trans('FILE_TOO_BIG', array($attachment_name, ($this->app['files']['maxSize'] / 1024))));\n\t\t\t\t\treturn $response;\n\t\t\t\t}\n\n\t\t\t\t$ext = pathinfo($attachment_name, PATHINFO_EXTENSION);\n\n\t\t\t\tif (!in_array($ext, $this->app['files']['types']))\n\t\t\t\t{\n\t\t\t\t\t$response->setStatusCode(400);\n\t\t\t\t\t$response->setContent($this->app->trans('INVALID_FILE_EXT', array($ext, implode(', ', $this->app['files']['types']))));\n\t\t\t\t\treturn $response;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$constraints = new Assert\\Collection(array(\n\t\t\t'name' => array(\n\t\t\t\tnew Assert\\NotBlank(array(\n\t\t\t\t\t'message' => 'FILL_ALL_FIELDS'\n\t\t\t\t)),\n\t\t\t\tnew Assert\\Length(array(\n\t\t\t\t\t'min' => 6,\n\t\t\t\t\t'max' => 50,\n\t\t\t\t\t'minMessage' => $this->app->trans('MIN_LENGTH', array('%field%' => 'body', '%min%' => 6)),\n\t\t\t\t\t'maxMessage' => $this->app->trans('MAX_LENGTH', array('%field%' => 'title', '%max%' => 25))\n\t\t\t\t))\n\t\t\t),\n\t\t\t'content' => array(\n\t\t\t\tnew Assert\\NotBlank(array(\n\t\t\t\t\t'message' => 'FILL_ALL_FIELDS'\n\t\t\t\t)),\n\t\t\t\tnew Assert\\Length(array(\n\t\t\t\t\t'min' => 6,\n\t\t\t\t\t'minMessage' => $this->app->trans('MIN_LENGTH', array('%field%' => 'body', '%min%' => 6))\n\t\t\t\t))\n\t\t\t)\n\t\t));\n\n\t\t// Temp variable which removes html to check actual length\n\t\t$content_string_test = strip_tags($content);\n\n\t\t$data = array(\n\t\t\t'name' => $name,\n\t\t\t'content' => $content_string_test\n\t\t);\n\n\t\t$errors = $this->app['validator']->validateValue($data, $constraints);\n\n\t\tif (count($errors) > 0)\n\t\t{\n\t $response->setStatusCode(400);\n\t $response->setContent($this->app->trans($errors[0]->getMessage()));\n\t return $response;\n\t\t}\n\t\t\n\t\t$content = strip_tags($content, implode(',', $this->allowed_html));\n\t\t$content = str_replace('href=', 'target=\"_blank\" rel=\"nofollow\" href=', $content);\n\n\t\t$time = date('Y-m-d H:i:s');\n\n\t\t$last = $this->app['db']->fetchAssoc('SELECT * FROM posts WHERE topic=? ORDER BY added DESC LIMIT 1', array(\n\t\t\t$topic_id\n\t\t));\n\n\t\tif ($last['author'] == $user['id'])\n\t\t{\n\t\t\tif ($this->app['board']['doublePost'] === 'merge')\n\t\t\t{\n\t\t\t\tpreg_match('/<div class=\"update\">(.*)<\\/div>/s', $last['content'], $matches);\n\n\t\t\t\tif (count($matches) > 0)\n\t\t\t\t{\n\t\t\t\t\t$content = preg_replace(\n\t\t\t\t\t\t'/<div class=\"update\">(.*)<\\/div>/s',\n\t\t\t\t\t\t'<div class=\"update\">' . \"\\n\" . '$1' . \"\\n\" . $content . '</div>',\n\t\t\t\t\t\t$last['content']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$content = $last['content'] . '<div class=\"update\"><h2>Update</h2>' . \"\\n\" . $content . '</div>';\n\t\t\t\t}\n\n\t\t\t\t$this->app['db']->update('posts', array(\n\t\t\t\t\t'content' => $content,\n\t\t\t\t\t'updated' => $time\n\t\t\t\t), array('id' => $last['id']));\n\n\t\t\t\t$this->app['db']->update('topics', array(\n\t\t\t\t\t'updated' => $time\n\t\t\t\t), array('id' => $last['topic']));\n\n\t\t\t\t$this->app['db']->update('forums', array(\n\t\t\t\t\t'lastTopicId' => $topic['id'],\n\t\t\t\t\t'lastAuthorId' => $user['id'],\n\t\t\t\t\t'lastPostTime' => $time,\n\t\t\t\t\t'lastPostId' => $last['id']\n\t\t\t\t), array('id' => $last['forum']));\n\n\t\t\t\t$files = [];\n\n\t\t\t\t// Upload attachments\n\t\t\t\tif ($attachments[0] != null)\n\t\t\t\t{\n\t\t\t\t\tforeach ($attachments as $attachment)\n\t\t\t\t\t{\n\t\t\t\t\t\t$attachment_name = $attachment->getClientOriginalName();\n\t\t\t\t\t\t$file_name = time() . '-' . $attachment_name;\n\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$attachment->move($upload_dir, $file_name);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (\\Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$response->setStatusCode(500);\n\t\t\t\t\t\t\t$response->setContent($this->app->trans('COULDNT_UPLOAD_FILE', array($attachment_name)));\n\t\t\t\t\t\t\treturn $response;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->app['db']->insert('attachments', array(\n\t\t\t\t\t\t\t'post_id' => $last['id'],\n\t\t\t\t\t\t\t'name' => $attachment_name,\n\t\t\t\t\t\t\t'file_name' => $file_name,\n\t\t\t\t\t\t\t'size' => $attachment->getClientSize(),\n\t\t\t\t\t\t\t'mime' => $attachment->getClientMimeType(),\n\t\t\t\t\t\t\t'added' => $time\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\t$files[] = array(\n\t\t\t\t\t\t\t'name' => $attachment_name,\n\t\t\t\t\t\t\t'size' => $attachment->getClientSize(),\n\t\t\t\t\t\t\t'mime' => $attachment->getClientMimeType()\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$response->setContent(json_encode(array(\n\t\t\t\t\t'id' => $last['id'],\n\t\t\t\t\t'content' => $content,\n\t\t\t\t\t'updated' => true,\n\t\t\t\t\t'attachments' => json_encode($files)\n\t\t\t\t)));\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t\telse if ($this->app['board']['doublePost'] === 'disallow')\n\t\t\t{\n\t\t\t\t$response->setStatusCode(400);\n\t\t\t\t$response->setContent($this->app->trans('NO_DOUBLE_POST'));\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}\n\n\t\t// Format mentions\n\t\t$mentions = $this->parseMentions($content);\n\n\t\tif ($mentions['has_mentions'])\n\t\t{\n\t\t\t$content = $mentions['content'];\n\t\t}\n\n\t\t$this->app['db']->insert('posts', array(\n\t\t\t'topic' => $topic['id'],\n\t\t\t'forum' => $topic['forum'],\n\t\t\t'name' => $name,\n\t\t\t'content' => $content,\n\t\t\t'author' => $user['id'],\n\t\t\t'added' => $time,\n\t\t\t'updated' => $time\n\t\t));\n\n\t\t$post_id = $this->app['db']->lastInsertId();\n\n\t\t$post_url = '/' . $this->app['board']['base'] . urlencode($forum['name']) . '/' . urlencode($topic['name']) . '-' . $topic['id'] . '/#' . $post_id;\n\n\t\tif ($mentions['has_mentions'])\n\t\t{\n\t\t\t$content = $mentions['content'];\n\n\t\t\tforeach ($mentions['users'] as $mention)\n\t\t\t{\n\t\t\t\t$this->app['notification']->add(new Request([\n\t\t\t\t\t'user_id' => $mention['data']['id'],\n\t\t\t\t\t'notification' => '<a href=\"/' . $this->app['board']['base'] . 'user/' . $user['username'] . '/\" class=\"user-link\">' . $user['username'] . '</a> mentioned you in a <a href=\"' . $post_url . '\">post</a>'\n\t\t\t\t]));\n\t\t\t}\n\t\t}\n\n\t\t// Upload attachments\n\t\tif ($attachments[0] != null)\n\t\t{\n\t\t\t$upload_dir = dirname(dirname(__DIR__)) . '/public/uploads/attachments';\n\n\t\t\tforeach ($attachments as $attachment)\n\t\t\t{\n\t\t\t\t$attachment_name = $attachment->getClientOriginalName();\n\t\t\t\t$file_name = time() . '-' . $attachment_name;\n\n\t\t\t\t$attachment->move($upload_dir, $file_name);\n\n\t\t\t\tif ($attachment->getError())\n\t\t\t\t{\n\t\t\t\t\t// Couldnt upload attachment, delete post\n\t\t\t\t\t$this->app['db']->delete('posts', array('id' => $post_id));\n\t\t\t\t\t\n\t\t\t\t\t$response->setStatusCode(500);\n\t\t\t\t\t$response->setContent($this->app->trans('COULDNT_UPLOAD_FILE', array($attachment_name)));\n\t\t\t\t\treturn $response;\n\t\t\t\t}\n\n\t\t\t\t$this->app['db']->insert('attachments', array(\n\t\t\t\t\t'post_id' => $post_id,\n\t\t\t\t\t'name' => $attachment_name,\n\t\t\t\t\t'file_name' => $file_name,\n\t\t\t\t\t'size' => $attachment->getClientSize(),\n\t\t\t\t\t'mime' => $attachment->getClientMimeType(),\n\t\t\t\t\t'added' => time()\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\t$this->app['db']->update('topics', array(\n\t\t\t'replies' => $topic['replies'] + 1,\n\t\t\t'updated' => $time,\n\t\t\t'lastAuthorId' => $user['id'],\n\t\t\t'lastPostId' => $post_id\n\t\t), array('id' => $topic_id));\n\n\t\t$this->app['db']->executeQuery('UPDATE forums SET posts=posts+1, lastTopicId=?,lastAuthorId=?, lastPostTime=?, lastPostId=? WHERE id=? LIMIT 1', array(\n\t\t\t$topic['id'],\n\t\t\t$user['id'],\n\t\t\t$time,\n\t\t\t$post_id,\n\t\t\t$topic['forum']\n\t\t));\n\n\t\t$post_count = $this->app['db']->fetchColumn('SELECT COUNT(id) FROM posts WHERE topic=?', array(\n\t\t\t$topic_id\n\t\t));\n\n\t\t$this->app['cache']->collection = $this->app['cache']->setCollection($this->app['database']['name'], 'posts');\n\t\t$this->app['cache']->delete_group('topic-post-count-' . $topic_id);\n\t\t$this->app['cache']->delete_group('topic-posts-' . $topic_id);\n\t\t$this->app['cache']->collection = $this->app['cache']->setCollection($this->app['database']['name'], 'forums');\n\t\t$this->app['cache']->delete_group('forum-' . $topic['forum']);\n\t\t$this->app['cache']->collection = $this->app['cache']->setCollection($this->app['database']['name'], 'topics');\n\t\t$this->app['cache']->delete('topic-' . $topic_id);\n\n\t\t$page = (int) ceil($post_count / $this->app['board']['postsPerPage']);\n\n\t\t$this->app['db']->executeQuery('UPDATE users SET posts=posts+1 WHERE id=? LIMIT 1', array(\n\t\t\t$user['id']\n\t\t));\n\n\t\treturn json_encode(array(\n\t\t\t'id' => $post_id,\n\t\t\t'username' => $user['username'],\n\t\t\t'userId' => $user['id'],\n\t\t\t'userGroup' => $user['group']['name'],\n\t\t\t'userPosts' => $user['posts'],\n\t\t\t'page' => $page\n\t\t));\n\t}", "protected function getMessage_Form_TopicService()\n {\n return $this->services['message.form.topic'] = new \\phpbb\\message\\topic_form(${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \\phpbb\\auth\\auth())) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, './../', 'php');\n }", "protected function _createReply($id, $reply)\n {\n $first = substr($reply, 0, 1);\n if ($first != '\"' && $first != \"'\" && $first != '[' && $first != '{') $reply = '\"' . $reply . '\"';\n return '{\"id\": \"' . $id . '\", \"reply\":' . $reply . '}';\n }", "public function store(CreateTopic $request)\n { \n $topic = new Topic();\n $topic->section_id = $request->input('section_id');\n $topic->title = $request->title;\n $topic->save();\n\n $post = new Post();\n $post->user_id = Auth::user()->id;\n $post->topic_id = $topic->id;\n $post->body = $request->input('body');\n $post->save();\n\n return redirect(\"/topic/$topic->id\")->with('success', 'Topic was saved with success');\n }", "function create_post($content, $parent_id, $user, $forum, $thread, $signature) {\n $content = substr($content, 0, 64000);\n $content = mysql_real_escape_string($content);\n $now = time();\n $sig = $signature?1:0;\n $id = BoincPost::insert(\"(thread, user, timestamp, content, parent_post, signature) values ($thread->id, $user->id, $now, '$content', $parent_id, $sig)\");\n if (!$id) return null;\n\n // notify subscribed users\n //\n $subs = BoincSubscription::enum(\"threadid=$thread->id\");\n foreach ($subs as $sub) {\n if ($user->id == $sub->userid) continue;\n $user2 = BoincUser::lookup_id($sub->userid);\n if ($user2) {\n notify_subscriber($thread, $user2);\n }\n }\n $user->prefs->update(\"posts=posts+1\");\n $thread->update(\"replies=replies+1, timestamp=$now\");\n $forum->update(\"posts=posts+1, timestamp=$now\");\n return $id;\n}", "public function create()\n {\n $json = [\n 'status' => false,\n 'message' => 'You cannot create post',\n ];\n\n if($this->isUserAuth()){\n $template = new Template();\n\n $template->data['post_id'] = 0;\n\n $json = [\n 'status' => true,\n 'html' => $template->fetch('add_post_form'),\n ];\n }\n\n $this->jsonAnswer($json);\n }" ]
[ "0.6433204", "0.63981426", "0.62645346", "0.6187317", "0.61816645", "0.5976613", "0.5912857", "0.586522", "0.58437425", "0.58437246", "0.580418", "0.5795628", "0.5735919", "0.5731526", "0.56957704", "0.569095", "0.5679141", "0.5656749", "0.56464195", "0.56070656", "0.5605485", "0.5578448", "0.55559", "0.5552562", "0.55245084", "0.5518834", "0.5515402", "0.54915607", "0.54723656", "0.545444", "0.5454151", "0.5450089", "0.5445815", "0.5432522", "0.54325217", "0.54264575", "0.5421883", "0.542056", "0.5410034", "0.5402409", "0.539044", "0.53836536", "0.53707576", "0.5370549", "0.5370071", "0.5368173", "0.5356218", "0.53560895", "0.5342856", "0.5301729", "0.53004795", "0.5297549", "0.5296409", "0.52958196", "0.529554", "0.52859807", "0.52854437", "0.52847695", "0.52736086", "0.52716273", "0.52687895", "0.52662104", "0.5264758", "0.5258273", "0.52523875", "0.52519476", "0.5234565", "0.5219835", "0.52177125", "0.52112", "0.5210088", "0.52098626", "0.52008045", "0.5193364", "0.5179503", "0.5167064", "0.5162807", "0.5158957", "0.5154411", "0.515275", "0.5151", "0.51501215", "0.5149283", "0.5145056", "0.51369935", "0.5134118", "0.5127259", "0.5122067", "0.51183856", "0.51086485", "0.510766", "0.5104074", "0.50953555", "0.5087174", "0.50642675", "0.5060096", "0.505736", "0.5056558", "0.50487024", "0.50433207" ]
0.53963524
40
Handler for bbPress 2.x topic reply removal.
public function notify_forum_remove_reply( $reply_id ) { $this->notify_forum_reply_payload( 'remove-reply', $reply_id ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Gou_Service_ForumReply::getForumReply($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$ret = Gou_Service_ForumReply::deleteForumReply($id);\n\t\tif (!$ret) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "function delTopic()\n{\n global $xoopsDB, $xoopsModule;\n if (!isset($_POST['ok'])) {\n xoops_cp_header();\n echo \"<h4>\" . _AM_CONFIG . \"</h4>\";\n $xt = new XoopsTopic( $xoopsDB->prefix(\"topics\"), intval($_GET['topic_id']));\n xoops_confirm(array( 'op' => 'delTopic', 'topic_id' => intval($_GET['topic_id']), 'ok' => 1), 'index.php', _AM_WAYSYWTDTTAL . '<br />' . $xt->topic_title('S'));\n } else {\n $xt = new XoopsTopic($xoopsDB->prefix(\"topics\"), intval($_POST['topic_id']));\n // get all subtopics under the specified topic\n $topic_arr = $xt->getAllChildTopics();\n array_push( $topic_arr, $xt );\n foreach( $topic_arr as $eachtopic ) {\n // get all stories in each topic\n $story_arr = NewsStory :: getByTopic( $eachtopic -> topic_id() );\n foreach( $story_arr as $eachstory ) {\n if (false != $eachstory->delete()) {\n xoops_comment_delete( $xoopsModule -> getVar( 'mid' ), $eachstory -> storyid() );\n xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'story', $eachstory->storyid());\n }\n }\n // all stories for each topic is deleted, now delete the topic data\n $eachtopic -> delete();\n // Delete also the notifications and permissions\n xoops_notification_deletebyitem( $xoopsModule -> getVar( 'mid' ), 'category', $eachtopic -> topic_id );\n\t\t\txoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'news_approve', $eachtopic -> topic_id);\n\t\t\txoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'news_submit', $eachtopic -> topic_id);\n\t\t\txoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'news_view', $eachtopic -> topic_id);\n }\n updateCache();\n redirect_header( 'index.php?op=topicsmanager', 1, _AM_DBUPDATED );\n exit();\n }\n}", "function delete_reply($reply_id){\n global $db;\n $query = 'DELETE FROM replies\n WHERE reply_id = :reply_id';\n $statement = $db->prepare($query);\n $statement->bindValue(':reply_id', $reply_id);\n $statement->execute();\n $statement->closeCursor();\n }", "public function removeNote($messageId) {\n return $this->_post(\n '/inbox/deletenote/',\n array(\n 'id' => $messageId\n )\n );\n\t}", "public function hard_delete()\n\t{\n\t\tif (!$this->topic->topic_posts)\n\t\t{\n\t\t\tif (!$this->topic->load($this->topic_id))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Update the postcount for the topic\n\t\t$this->update_topic_postcount(true);\n\n\t\t// Set the visibility appropriately if no posts are visibile to the public/authors\n\t\t$flags = count::get_flags(access::PUBLIC_LEVEL);\n\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t{\n\t\t\t// There are no posts visible to the public, change it to authors level access\n\t\t\t$this->topic->topic_access = access::AUTHOR_LEVEL;\n\n\t\t\t$flags = count::get_flags(access::AUTHOR_LEVEL);\n\t\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t\t{\n\t\t\t\t// There are no posts visible to authors, change it to teams level access\n\t\t\t\t$this->topic->topic_access = access::TEAM_LEVEL;\n\t\t\t}\n\t\t}\n\n\t\t// Sync the first topic post if required\n\t\tif ($this->post_id == $this->topic->topic_first_post_id)\n\t\t{\n\t\t\t$this->topic->sync_first_post($this->post_id);\n\t\t}\n\n\t\t// Sync the last topic post if required\n\t\tif ($this->post_id == $this->topic->topic_last_post_id)\n\t\t{\n\t\t\t$this->topic->sync_last_post($this->post_id);\n\t\t}\n\n\t\t// Submit the topic to store the updated information\n\t\t$this->topic->submit();\n\n\t\t// Remove from the search index\n\t\t$this->search_manager->delete($this->post_type, $this->post_id);\n\n\t\t// @todo remove attachments and other things\n\n\t\t// Remove any attention items\n\t\t$sql = 'DELETE FROM ' . TITANIA_ATTENTION_TABLE . '\n\t\t\tWHERE attention_object_type = ' . ext::TITANIA_POST . '\n\t\t\t\tAND attention_object_id = ' . $this->post_id;\n\t\tphpbb::$db->sql_query($sql);\n\n\t\t// Decrement the user's postcount if we must\n\t\tif (!$this->post_deleted && $this->post_approved && in_array($this->post_type, titania::$config->increment_postcount))\n\t\t{\n\t\t\tphpbb::update_user_postcount($this->post_user_id, '-');\n\t\t}\n\n\t\t$this->forum_queue_hard_delete();\n\n\t\t// Initiate self-destruct mode\n\t\tparent::delete();\n\n\t\t// Update topics posted table\n\t\t$this->topic->update_posted_status('remove', $this->post_user_id);\n\n\t\t// Check if the topic is empty\n\t\t$flags = count::get_flags(access::TEAM_LEVEL, true, true);\n\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t{\n\t\t\t$this->topic->delete();\n\t\t}\n\t}", "private function deleteGroupTopic()\n {\n try\n {\n $request = $_REQUEST;\n\n if(!isset($request['topic_id']) || $request['topic_id']==\"\" )\n throw_error_msg('provide topic id');\n else if(!is_numeric($request['topic_id'])) \n throw_error_msg('invalid topic id'); \n else\n $tid = (int)$request['topic_id'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $cbgroup->delete_topic($tid);\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'group topic deleted', \"data\" => array());\n $this->response($this->json($data));\n }\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function deleteReplies()\r\n{\r\n $query_string = \"DELETE FROM replies \";\r\n $query_string .= \"WHERE replytopic = :replytopic\";\r\n\r\n return $query_string;\r\n}", "public function unregister(Topic $topic);", "public function clearReplyTos()\n {\n }", "function processDeleteTopic($topicID) {\n\t\tglobal $DB, $menuvar, $safs_config;\n\t\t$numOfPosts = 0;\n\t\t$forumID = getForumIDByTopicID($topicID);\n\t\t\n\t\t// Pull the posts in this topic, delete them and update our counts\n\t\t$sql = \"SELECT id, user_id FROM `\" . DBTABLEPREFIX . \"posts` WHERE topic_id = '\" . $topicID . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\tif ($result && $DB->num_rows() > 0) {\n\t\t\twhile ($row = $DB->fetch_array($result)) {\n\t\t\t\t// Delete the post\n\t\t\t\t$sql2 = \"DELETE FROM `\" . DBTABLEPREFIX . \"posts` WHERE id = '\" . $row['id'] . \"'\";\n\t\t\t\t$result2 = $DB->query($sql2);\n\t\t\t\t\n\t\t\t\t// Update user post count\n\t\t\t\t$sql2 = \"UPDATE `\" . USERSDBTABLEPREFIX . \"users` SET posts = posts - 1 WHERE id = '\" . $row['user_id'] . \"'\";\n\t\t\t\t$result2 = $DB->query($sql2);\n\t\t\t\t\n\t\t\t\t$numOfPosts++;\n\t\t\t}\t\t\n\t\t\t$DB->free_result($result);\n\t\t}\n\t\t\n\t\t// Update forum post count\n\t\t$sql = \"UPDATE `\" . DBTABLEPREFIX . \"forums` SET posts = posts - \" . $numOfPosts . \" WHERE id = '\" . $forumID . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t// Delete the topic\n\t\t$sql = \"DELETE FROM `\" . DBTABLEPREFIX . \"topics` WHERE id = '\" . $topicID . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t$returnVar = \"\n\t\t\t\t\t\t\t\t\t\t\t<h2 class=\\\"processFormTitle\\\">Delete Topic</h2>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\\\"processFormBlock \" . (($result) ? \"processFormSuccess\" : \"processFormFailed\") . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t\t\" . (($result) ? \"Your topic has been deleted and you're being redirected to the forum.\" : \"There was an error deleting your topic, you're being redirected to the forum.\") . \"\n\t\t\t\t\t\t\t\t\t\t\t\t<meta http-equiv=\\\"refresh\\\" content=\\\"3;url=\" . $menuvar['VIEWFORUM'] . \"&id=\" . $forumID . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t</div>\";\n\t\t\n\t\t// Return the HTML\n\t\treturn $returnVar;\n\t}", "function caldol_no_replies_bbpress_topics_shortcode() {\n\n\t?>\n\n<!-- html custom-functions -->\n\n<h4 style=\"margin-top: 15px;\">Discussions with No Replies. Be the first to jump in!</h4>\n\n<?php\n\n\n\nif ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'meta_key' => '_bbp_reply_count', 'orderby' => 'post_date', 'meta_value' => '0', 'meta_compare' => '=', 'post_parent' => 'any', 'posts_per_page' => 10 ) ) )\n\nbbp_get_template_part( 'bbpress/loop', 'topics' );\n\n?>\n\n<!-- end -->\n\n<?php }", "public function destroy(Reply $reply)\n {\n //\n }", "public function destroy(Reply $reply)\n {\n //\n }", "function deleteThemengebietes() {\n\t\t$status = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_topic_detail', 'uid='.intval(t3lib_div::_POST('uid')));\n\t\treturn $status;\n\t}", "function UnreadTopics()\n{\n\tglobal $board, $txt, $scripturl, $db_prefix, $sourcedir;\n\tglobal $ID_MEMBER, $user_info, $context, $modSettings;\n\n\t// Guests can't have unread things, we don't know anything about them.\n\tis_not_guest();\n\n\t$context['sub_template'] = $_REQUEST['action'] == 'unread' ? 'unread' : 'replies';\n\t$context['showing_all_topics'] = isset($_GET['all']);\n\tif ($_REQUEST['action'] == 'unread')\n\t\t$context['page_title'] = $context['showing_all_topics'] ? $txt['unread_topics_all'] : $txt['unread_topics_visit'];\n\telse\n\t\t$context['page_title'] = $txt['unread_replies'];\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?action=' . $_REQUEST['action'] . ($context['showing_all_topics'] ? ';all' : ''),\n\t\t'name' => $context['page_title']\n\t);\n\n\tloadTemplate('Recent');\n\n\t$is_topics = $_REQUEST['action'] == 'unread';\n\n\t// Are we specifying any specific board?\n\tif (!empty($board))\n\t\t$query_this_board = 'b.ID_BOARD = ' . $board;\n\telse\n\t{\n\t\t$query_this_board = $user_info['query_see_board'];\n\n\t\t// Don't bother to show deleted posts!\n\t\tif (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)\n\t\t\t$query_this_board .= '\n\t\t\t\tAND b.ID_BOARD != ' . $modSettings['recycle_board'];\n\t}\n\n\t// This part is the same for each query.\n\t$select_clause = '\n\t\t\t\tms.subject AS firstSubject, ms.posterTime AS firstPosterTime, ms.ID_TOPIC, t.ID_BOARD, b.name AS bname,\n\t\t\t\tt.numReplies, t.numViews, ms.ID_MEMBER AS ID_FIRST_MEMBER, ml.ID_MEMBER AS ID_LAST_MEMBER,\n\t\t\t\tml.posterTime AS lastPosterTime, IFNULL(mems.realName, ms.posterName) AS firstPosterName,\n\t\t\t\tIFNULL(meml.realName, ml.posterName) AS lastPosterName, ml.subject AS lastSubject,\n\t\t\t\tml.icon AS lastIcon, ms.icon AS firstIcon, t.ID_POLL, t.isSticky, t.locked, ml.modifiedTime AS lastModifiedTime,\n\t\t\t\tIFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) AS isRead, LEFT(ml.body, 384) AS lastBody, LEFT(ms.body, 384) AS firstBody,\n\t\t\t\tml.smileysEnabled AS lastSmileys, ms.smileysEnabled AS firstSmileys, t.ID_FIRST_MSG, t.ID_LAST_MSG';\n\n\tif ($context['showing_all_topics'] || !$is_topics)\n\t{\n\t\tif (!empty($board))\n\t\t{\n\t\t\t$request = db_query(\"\n\t\t\t\tSELECT MIN(logTime)\n\t\t\t\tFROM {$db_prefix}log_mark_read\n\t\t\t\tWHERE ID_MEMBER = $ID_MEMBER\n\t\t\t\t\tAND ID_BOARD = $board\", __FILE__, __LINE__);\n\t\t\tlist ($earliest_time) = mysql_fetch_row($request);\n\t\t\tmysql_free_result($request);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$request = db_query(\"\n\t\t\t\tSELECT MIN(lmr.logTime)\n\t\t\t\tFROM {$db_prefix}boards AS b\n\t\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_MEMBER = $ID_MEMBER AND lmr.ID_BOARD = b.ID_BOARD)\n\t\t\t\tWHERE $user_info[query_see_board]\", __FILE__, __LINE__);\n\t\t\tlist ($earliest_time) = mysql_fetch_row($request);\n\t\t\tmysql_free_result($request);\n\t\t}\n\n\t\t$request = db_query(\"\n\t\t\tSELECT MIN(logTime)\n\t\t\tFROM {$db_prefix}log_topics\n\t\t\tWHERE ID_MEMBER = $ID_MEMBER\", __FILE__, __LINE__);\n\t\tlist ($earliest_time2) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\tif ($earliest_time2 < $earliest_time)\n\t\t\t$earliest_time = (int) $earliest_time2;\n\t\telse\n\t\t\t$earliest_time = (int) $earliest_time;\n\t}\n\n\tif ($is_topics)\n\t{\n\t\t$request = db_query(\"\n\t\t\tSELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)\n\t\t\tFROM {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\" . ($context['showing_all_topics'] ? \"\n\t\t\t\tAND ml.posterTime >= $earliest_time\" : \"\n\t\t\t\tAND t.ID_LAST_MSG > $_SESSION[ID_MSG_LAST_VISIT]\") . \"\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\", __FILE__, __LINE__);\n\t\tlist ($num_topics, $min_message) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\t// Make sure the starting place makes sense and construct the page index.\n\t\t$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'] . ($context['showing_all_topics'] ? ';all' : ''), $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);\n\t\t$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];\n\n\t\tif ($num_topics == 0)\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t\t$min_message = (int) $min_message;\n\n\t\t$request = db_query(\"\n\t\t\tSELECT $select_clause\n\t\t\tFROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}members AS mems ON (mems.ID_MEMBER = ms.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_TOPIC = ms.ID_TOPIC\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND ms.ID_MSG = t.ID_FIRST_MSG\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND t.ID_LAST_MSG >= $min_message\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT $_REQUEST[start], $modSettings[defaultMaxTopics]\", __FILE__, __LINE__);\n\t}\n\telse\n\t{\n\t\t$request = db_query(\"\n\t\t\tSELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)\n\t\t\tFROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_MEMBER_UPDATED != $ID_MEMBER\n\t\t\t\tAND m.ID_TOPIC = t.ID_TOPIC\n\t\t\t\tAND m.ID_MEMBER = $ID_MEMBER\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND ml.posterTime >= $earliest_time\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\", __FILE__, __LINE__);\n\t\tlist ($num_topics, $min_message) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\t// Make sure the starting place makes sense and construct the page index.\n\t\t$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'], $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);\n\t\t$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];\n\n\t\tif ($num_topics == 0)\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t\t$min_message = (int) $min_message;\n\n\t\t$request = db_query(\"\n\t\t\tSELECT DISTINCT t.ID_TOPIC\n\t\t\tFROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE ml.ID_MEMBER != $ID_MEMBER\n\t\t\t\tAND m.ID_TOPIC = t.ID_TOPIC\n\t\t\t\tAND m.ID_MEMBER = $ID_MEMBER\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND t.ID_LAST_MSG >= $min_message\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT $_REQUEST[start], $modSettings[defaultMaxTopics]\", __FILE__, __LINE__);\n\t\t$topics = array();\n\t\twhile ($row = mysql_fetch_assoc($request))\n\t\t\t$topics[] = $row['ID_TOPIC'];\n\t\tmysql_free_result($request);\n\n\t\t// Sanity... where have you gone?\n\t\tif (empty($topics))\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\n\t\t$request = db_query(\"\n\t\t\tSELECT $select_clause\n\t\t\tFROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}members AS mems ON (mems.ID_MEMBER = ms.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_TOPIC IN (\" . implode(', ', $topics) . \")\n\t\t\t\tAND t.ID_TOPIC = ms.ID_TOPIC\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND ms.ID_MSG = t.ID_FIRST_MSG\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT \" . count($topics), __FILE__, __LINE__);\n\t}\n\n\t$context['topics'] = array();\n\t$topic_ids = array();\n\twhile ($row = mysql_fetch_assoc($request))\n\t{\n\t\tif ($row['ID_POLL'] > 0 && $modSettings['pollMode'] == '0')\n\t\t\tcontinue;\n\n\t\t$topic_ids[] = $row['ID_TOPIC'];\n\n\t\t// Clip the strings first because censoring is slow :/. (for some reason?)\n\t\t$row['firstBody'] = strip_tags(strtr(doUBBC($row['firstBody'], $row['firstSmileys']), array('<br />' => '&#10;')));\n\t\tif (strlen($row['firstBody']) > 128)\n\t\t\t$row['firstBody'] = substr($row['firstBody'], 0, 128) . '...';\n\t\t$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));\n\t\tif (strlen($row['lastBody']) > 128)\n\t\t\t$row['lastBody'] = substr($row['lastBody'], 0, 128) . '...';\n\n\t\t// Do a bit of censoring...\n\t\tcensorText($row['firstSubject']);\n\t\tcensorText($row['firstBody']);\n\n\t\t// But don't do it twice, it can be a slow ordeal!\n\t\tif ($row['ID_FIRST_MSG'] == $row['ID_LAST_MSG'])\n\t\t{\n\t\t\t$row['lastSubject'] = $row['firstSubject'];\n\t\t\t$row['lastBody'] = $row['firstBody'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcensorText($row['lastSubject']);\n\t\t\tcensorText($row['lastBody']);\n\t\t}\n\n\t\t// Decide how many pages the topic should have.\n\t\t$topic_length = $row['numReplies'] + 1;\n\t\tif ($topic_length > $modSettings['defaultMaxMessages'])\n\t\t{\n\t\t\t$tmppages = array();\n\t\t\t$tmpa = 1;\n\t\t\tfor ($tmpb = 0; $tmpb < $topic_length; $tmpb += $modSettings['defaultMaxMessages'])\n\t\t\t{\n\t\t\t\t$tmppages[] = '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.' . $tmpb . ';topicseen\">' . $tmpa . '</a>';\n\t\t\t\t$tmpa++;\n\t\t\t}\n\t\t\t// Show links to all the pages?\n\t\t\tif (count($tmppages) <= 5)\n\t\t\t\t$pages = '&#171; ' . implode(' ', $tmppages);\n\t\t\t// Or skip a few?\n\t\t\telse\n\t\t\t\t$pages = '&#171; ' . $tmppages[0] . ' ' . $tmppages[1] . ' ... ' . $tmppages[count($tmppages) - 2] . ' ' . $tmppages[count($tmppages) - 1];\n\n\t\t\tif (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages'])\n\t\t\t\t$pages .= ' &nbsp;<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;all\">' . $txt[190] . '</a>';\n\t\t\t$pages .= ' &#187;';\n\t\t}\n\t\telse\n\t\t\t$pages = '';\n\n\t\t// And build the array.\n\t\t$context['topics'][$row['ID_TOPIC']] = array(\n\t\t\t'id' => $row['ID_TOPIC'],\n\t\t\t'first_post' => array(\n\t\t\t\t'member' => array(\n\t\t\t\t\t'name' => $row['firstPosterName'],\n\t\t\t\t\t'id' => $row['ID_FIRST_MEMBER'],\n\t\t\t\t\t'href' => $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'],\n\t\t\t\t\t'link' => !empty($row['ID_FIRST_MEMBER']) ? '<a href=\"' . $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'] . '\" title=\"' . $txt[92] . ' ' . $row['firstPosterName'] . '\">' . $row['firstPosterName'] . '</a>' : $row['firstPosterName']\n\t\t\t\t),\n\t\t\t\t'time' => timeformat($row['firstPosterTime']),\n\t\t\t\t'timestamp' => $row['firstPosterTime'],\n\t\t\t\t'subject' => $row['firstSubject'],\n\t\t\t\t'preview' => $row['firstBody'],\n\t\t\t\t'icon' => $row['firstIcon'],\n\t\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;topicseen',\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;topicseen\">' . $row['firstSubject'] . '</a>'\n\t\t\t),\n\t\t\t'last_post' => array(\n\t\t\t\t'member' => array(\n\t\t\t\t\t'name' => $row['lastPosterName'],\n\t\t\t\t\t'id' => $row['ID_LAST_MEMBER'],\n\t\t\t\t\t'href' => $scripturl . '?action=profile;u=' . $row['ID_LAST_MEMBER'],\n\t\t\t\t\t'link' => !empty($row['ID_LAST_MEMBER']) ? '<a href=\"' . $scripturl . '?action=profile;u=' . $row['ID_LAST_MEMBER'] . '\">' . $row['lastPosterName'] . '</a>' : $row['lastPosterName']\n\t\t\t\t),\n\t\t\t\t'time' => timeformat($row['lastPosterTime']),\n\t\t\t\t'timestamp' => $row['lastPosterTime'],\n\t\t\t\t'subject' => $row['lastSubject'],\n\t\t\t\t'preview' => $row['lastBody'],\n\t\t\t\t'icon' => $row['lastIcon'],\n\t\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['ID_LAST_MSG']) . ';topicseen#msg' . $row['ID_LAST_MSG'],\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['ID_LAST_MSG']) . ';topicseen#msg' . $row['ID_LAST_MSG'] . '\">' . $row['lastSubject'] . '</a>'\n\t\t\t),\n\t\t\t'newtime' => $row['isRead'],\n\t\t\t'new_href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.from' . $row['isRead'] . ';topicseen#new',\n\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.from' . $row['isRead']) . ';topicseen#new',\n\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.from' . $row['isRead']) . ';topicseen#new\">' . $row['firstSubject'] . '</a>',\n\t\t\t'is_sticky' => !empty($modSettings['enableStickyTopics']) && !empty($row['isSticky']),\n\t\t\t'is_locked' => !empty($row['locked']),\n\t\t\t'is_poll' => $modSettings['pollMode'] == '1' && $row['ID_POLL'] > 0,\n\t\t\t'is_hot' => $row['numReplies'] >= $modSettings['hotTopicPosts'],\n\t\t\t'is_very_hot' => $row['numReplies'] >= $modSettings['hotTopicVeryPosts'],\n\t\t\t'is_posted_in' => false,\n\t\t\t'icon' => $row['firstIcon'],\n\t\t\t'subject' => $row['firstSubject'],\n\t\t\t'pages' => $pages,\n\t\t\t'replies' => $row['numReplies'],\n\t\t\t'views' => $row['numViews'],\n\t\t\t'board' => array(\n\t\t\t\t'id' => $row['ID_BOARD'],\n\t\t\t\t'name' => $row['bname'],\n\t\t\t\t'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0\">' . $row['bname'] . '</a>'\n\t\t\t)\n\t\t);\n\n\t\tdetermineTopicClass($context['topics'][$row['ID_TOPIC']]);\n\t}\n\tmysql_free_result($request);\n\n\tif ($is_topics && !empty($modSettings['enableParticipation']) && !empty($topic_ids))\n\t{\n\t\t$result = db_query(\"\n\t\t\tSELECT ID_TOPIC\n\t\t\tFROM {$db_prefix}messages\n\t\t\tWHERE ID_TOPIC IN (\" . implode(', ', $topic_ids) . \")\n\t\t\t\tAND ID_MEMBER = $ID_MEMBER\", __FILE__, __LINE__);\n\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t{\n\t\t\tif (empty($context['topics'][$row['ID_TOPIC']]['is_posted_in']))\n\t\t\t{\n\t\t\t\t$context['topics'][$row['ID_TOPIC']]['is_posted_in'] = true;\n\t\t\t\t$context['topics'][$row['ID_TOPIC']]['class'] = 'my_' . $context['topics'][$row['ID_TOPIC']]['class'];\n\t\t\t}\n\t\t}\n\t\tmysql_free_result($result);\n\t}\n\n\t$context['topics_to_mark'] = implode('-', $topic_ids);\n}", "public function delete() {\n\t\t$message = $this->discussion->message(['id' => $this->request->id]);\n\n\t\tif ($this->discussion->pull_message($message)) {\n\t\t\treturn $this->render(['head' => true, 'status' => 204]);\n\t\t}\n\n\t\treturn $this->render(['head' => true, 'status' => 400]);\n\t}", "public function ajaxDeleteReply() {\n if ($this->isAjax()) {\n $newsreply = new NwReplies();\n $newsreply->ID_NEWS = $_POST['pid'];\n $newsreply->ReplyNumber = $_POST['rid'];\n $newsreply = $newsreply->getOne();\n if ($newsreply && $newsreply->deleteReply() == TRUE) {\n $news = new News();\n $result['total'] = $news->getTotalRepliesByPostID($_POST['pid'], $_POST['langID']);\n $result['result'] = TRUE;\n $this->toJSON($result, true);\n } else {\n $this->toJSON(array('result' => FALSE), true);\n }\n }\n }", "public function destroy(Topic $topic)\n {\n //\n }", "public function destroy(Topic $topic)\n {\n //\n }", "function delete_topic($tid) {\n global $db;\n $topic = $this->get_topic_details($tid);\n $group = $this->get_group_details($topic['group_id']);\n if (!$topic)\n e(lang(\"grp_tpc_err4\"));\n elseif (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $topic['userid'] && userid() != $group['userid'])\n e(lang(\"you_cant_del_topic\"));\n else {\n $db->delete(tbl($this->gp_topic_tbl), array(\"topic_id\", \"group_id\"), array($tid, $topic['group_id']));\n //Deleting Topic Posts\n $this->delete_comments($tid);\n\n //Counting Total Topics\n $count_topics = $this->count_topics($topic['group_id']);\n\n //Updating Total Number\n $db->update(tbl($this->gp_tbl), array('total_topics'), array($count_topics), \" group_id = '\" . $topic['group_id'] . \"'\");\n\n e(lang(\"grp_tpc_msg1\"), \"m\");\n }\n }", "function Admin_Messages_admin_delete($args)\n{\n // Get parameters from whatever input we need. All arguments to this\n // function should be obtained from pnVarCleanFromInput(), getting them\n // from other places such as the environment is not allowed, as that makes\n // assumptions that will not hold in future versions of PostNuke\n list($mid,\n $objectid,\n $confirmation) = pnVarCleanFromInput('mid',\n 'objectid',\n 'confirmation');\n\n\n // User functions of this type can be called by other modules. If this\n // happens then the calling module will be able to pass in arguments to\n // this function through the $args parameter. Hence we extract these\n // arguments *after* we have obtained any form-based input through\n // pnVarCleanFromInput().\n extract($args);\n\n // At this stage we check to see if we have been passed $objecmid, the\n // generic item identifier. This could have been passed in by a hook or\n // through some other function calling this as part of a larger module, but\n // if it exists it overrides $mid\n //\n // Note that this module couuld just use $objecmid everywhere to avoid all\n // of this munging of variables, but then the resultant code is less\n // descriptive, especially where multiple objects are being used. The\n // decision of which of these ways to go is up to the module developer\n if (!empty($objectid)) {\n $mid = $objectid;\n } \n\n // The user API function is called. This takes the item ID which we\n // obtained from the input and gets us the information on the appropriate\n // item. If the item does not exist we post an appropriate message and\n // return\n $item = pnModAPIFunc('Admin_Messages',\n 'user',\n 'get',\n array('mid' => $mid));\n\n if ($item == false) {\n return pnVarPrepHTMLDisplay(_ADMINMESSAGESNOSUCHITEM);\n }\n\n // Security check - important to do this as early as possible to avoid\n // potential security holes or just too much wasted processing. However,\n // in this case we had to wait until we could obtain the item name to\n // complete the instance information so this is the first chance we get to\n // do the check\n if (!pnSecAuthAction(0, 'Admin_Messages::', \"$item[title]::$mid\", ACCESS_DELETE)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n\n // Check for confirmation. \n if (empty($confirmation)) {\n // No confirmation yet - display a suitable form to obtain confirmation\n // of this action from the user\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n \t$pnRender =& new pnRender('Admin_Messages');\n\n\t // As Admin output changes often, we do not want caching.\n \t$pnRender->caching = false;\n\n // Add the message id\n\t\t$pnRender->assign('mid', $mid);\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('admin_messages_admin_delete.htm');\n }\n\n // If we get here it means that the user has confirmed the action\n\n // Confirm authorisation code. This checks that the form had a valid\n // authorisation code attached to it. If it did not then the function will\n // proceed no further as it is possible that this is an attempt at sending\n // in false data to the system\n if (!pnSecConfirmAuthKey()) {\n pnSessionSetVar('errormsg', _BADAUTHKEY);\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n return true;\n }\n\n // The API function is called. Note that the name of the API function and\n // the name of this function are identical, this helps a lot when\n // programming more complex modules. The arguments to the function are\n // passed in as their own arguments array.\n //\n // The return value of the function is checked here, and if the function\n // suceeded then an appropriate message is posted. Note that if the\n // function did not succeed then the API function should have already\n // posted a failure message so no action is required\n if (pnModAPIFunc('Admin_Messages',\n 'admin',\n 'delete',\n array('mid' => $mid))) {\n // Success\n pnSessionSetVar('statusmsg', _ADMINMESSAGESDELETED);\n }\n\n // This function generated no output, and so now it is complete we redirect\n // the user to an appropriate page for them to carry on their work\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n \n // Return\n return true;\n}", "function MaintainRemoveOldPosts()\n{\n\t// Actually do what we're told!\n\tloadSource('RemoveTopic');\n\tRemoveOldTopics2();\n}", "public function remove()\n\t{\n\t\n\t\t// get post id from url\n\n\t\t$id = get_int('id', false);\n\n\t\tif(!$id) die('Invalid post id');\n\n\t\t// user must be logged in to perform this action\n\n\t\tif(!is_logged())\n\t\t\tdie('You are not authorized to perform this action');\n\n\t\t// get post details\n\n\t\t$post = Thread::find($id);\n\n\t\t// check if user own this post\n\n\t\tif(!$post || $post->user_id != user()->id )\n\t\t\tdie('You are not authorized to perform this action');\n\n\t\t// remove the post and all it's replies\n\n\t\t// if parent delete all it's replies first\n\n\t\tif(is_null($post->parent_id))\n\t\t\tThread::where('parent_id', $id)->remove();\n\n\t\t// remove post\n\n\t\tThread::where('id', $id)->remove();\n\n\n\n\t\t// if it was a reply update thread's replies count\n\n\t\tif($post->parent_id>0)\n\t\t\t(new Thread)->updateTotalReplies($post->parent_id);\n\n\t\t// if it was a thread return to thread list, else return to thread\n\n\t\tif($post->parent_id>0)\n\t\t\treturn redirect('/threads?id=' . $post->parent_id);\n\n\t\treturn redirect();\n\t\n\t}", "function undelete_topics()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->undelete['t']))\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'topic_deleted'\t\t\t=> 0,\r\n\t\t\t\t'topic_deleted_time'\t=> 0,\r\n\t\t\t);\r\n\r\n\t\t\t$to_update = array();\r\n\t\t\tforeach ($this->undelete['t'] as $id)\r\n\t\t\t{\r\n\t\t\t\tif (array_key_exists($id, $this->shadow_topic_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$to_update[] = $this->shadow_topic_ids[$id];\r\n\t\t\t\t\t$this->topic_data[$this->shadow_topic_ids[$id]] = array_merge($this->topic_data[$this->shadow_topic_ids[$id]], $sql_data);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$to_update[] = $id;\r\n\t\t\t\t$this->topic_data[$id] = array_merge($this->topic_data[$id], $sql_data);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\t\tWHERE ' . $db->sql_in_set('topic_id', $to_update);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\tforeach ($to_update as $id)\r\n\t\t\t{\r\n\t\t\t\t$this->update_first_post_topic($id);\r\n\t\t\t\t$this->update_last_post_topic($id);\r\n\r\n\t\t\t\t// If the topic is a global announcement, do not attempt to do any updates to forums\r\n\t\t\t\tif ($this->topic_data[$id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->forum_data[$this->topic_data[$id]['forum_id']]['forum_deleted_topic_count'] > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\t\tSET forum_deleted_topic_count = forum_deleted_topic_count - 1\r\n\t\t\t\t\t\t\t\tWHERE forum_id = ' . intval($this->topic_data[$id]['forum_id']);\r\n\t\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t\t$this->forum_data[$this->topic_data[$id]['forum_id']]['forum_deleted_topic_count']--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->update_board_stats();\r\n\t\t$this->update_user_stats();\r\n\t}", "abstract public function deleteMessage($messageNo, $mailboxPath=null);", "public function delete_admin_message($reply_id)\n {\n $reply = Reply::find($reply_id);\n $reply->deleted = 1;\n $reply->save();\n\n return redirect()->to('messages');\n }", "function ld_reply_link( $id = 0, $reply = 0, $page = 1 ) {\r\n\techo apply_filters( 'topic_link', ld_get_reply_link($id, $reply), $id );\r\n}", "public function destroy($id)\n {\n $topic = HelpCenterTopic::find($id);\n if ( $topic->delete() ) {\n die(\n json_encode(\n array(\n 'status' => 'success'\n )\n )\n );\n }\n }", "function ppmess_shortcode_delete_commun(){\n\t\n\t$data = array();\n\t$current_user = wp_get_current_user();\n\t\n\t/*----------------- Delete single communication -----------------*/\n\tif(isset($_GET['message_id']) && isset($_GET['post_id']) && $_GET['token_delete_commun']){\n\t\t\t\t\t\n\t\t$delete_token = md5(SALT_DELETE_COMMUN_PPMESS . $_GET['message_id'] . $_GET['post_id'] . $current_user->ID );\n\t\t\n\t\tif($delete_token == $_GET['token_delete_commun']){\n\t\t\t\n\t\t\t$result = ppmess_get_single_commun($_GET['message_id'], $_GET['post_id'], $current_user->ID);\n\t\t\t\n\t\t\tif( ! empty($result) ){\n\t\t\t\t\n\t\t\t\t$user2_id = ppmess_get_user2($result[0]['message_id'], $result[0]['post_id'], $current_user->ID);\n\t\t\t\t$user2 = get_userdata($user2_id);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\treturn array('error' => 'empty_result');\n\t\t\t}\n\t\t}else{\n\t\t\treturn array('error' => 'token_fail');\n\t\t}\n\t}else{\n\t\treturn array('error' => 'isset_fail');\n\t}\n\n\t$post_to_delete = get_post($result[0]['post_id']);\n\t$unread_messages = ppmess_all_unread_messages($result[0]['message_id'], $result[0]['post_id'], $current_user->ID);\n\t\n\t$data = array(\n\t\t'error'\t\t\t\t=>\tFALSE,\n\t\t'user2_login_name'\t=>\t!empty($user2) ? $user2->user_login : '',\n\t\t'user2_id'\t\t\t=>\t!empty($user2_id) ? $user2_id : '', \n\t\t'logged_user'\t\t=>\t!empty($current_user) ? $current_user->user_login : '',\n\t\t'logged_user_id'\t=>\t!empty($current_user) ? $current_user->ID : '',\t\n\t\t'post_title'\t\t=> isset($post_to_delete) ? $post_to_delete->post_title : '',\n\t\t'post_url'\t\t\t=>\tisset($post_to_delete) ? $post_to_delete->guid : '',\n\t\t'post_author_id'\t=> \tisset($post_to_delete) ? $post_to_delete->post_author : '',\n\t\t'post_id'\t\t\t=> isset($post_to_delete) ? $post_to_delete->ID : '',\n\t\t'message_id'\t\t=>\tisset($result[0]['message_id']) ? $result[0]['message_id'] : '',\n\t\t'unread_messages'\t=> isset($unread_messages) ? $unread_messages : 0\n\t);\n\t\n\treturn $data;\n}", "public function removeMessage($id = 1)\n {\n $this->_raw = '';\n }", "public function reply_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['_id'] = $this->input->get('_id');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\t\t\n\t\t$this->Messages_model->reply($data);\n\t}", "function quick_reply($topic_id, $forum_id, &$topic_data)\r\n{\r\n\tglobal $template, $user, $auth, $db;\r\n\tglobal $phpbb_root_path, $phpEx, $config;\r\n\r\n\t// Some little config for the quick reply, allows the admin to change these default values through the database.\r\n\t$qr_config = array(\r\n\t\t'enabled'\t\t\t=> true, \t// Disable it easily\r\n\t\t'display_subject'\t=> true,\t// Do you want the subject line to be displayed\r\n\t\t'hide_box'\t\t\t=> false,\t// Shall the box be hidden on pageload?\r\n\t\t'resize'\t\t\t=> false,\t// Display the buttons to resize the textarea?\r\n\t);\r\n\r\n\t// do evil_qr_ prefixed of the config values exist in $config\r\n\t// /me slaps highway of life\r\n\tforeach (array_keys($qr_config) as $key)\r\n\t{\r\n\t\tif (isset($config['evil_qr_' . $key]))\r\n\t\t{\r\n\t\t\t$qr_config[$key] = $config['evil_qr_' . $key];\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if user has reply permissions for this forum or the topic is locked (thanks damnian)\r\n\tif (!$auth->acl_get('f_reply', $forum_id) || ($topic_data['topic_status'] == ITEM_LOCKED && !$auth->acl_get('m_lock', $forum_id)) || !$qr_config['enabled'])\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\r\n\t// Hidden fields\r\n\t$s_hidden_fields = array(\r\n\t\t't'\t\t\t=> $topic_id,\r\n\t\t'f'\t\t\t=> $forum_id,\r\n\t\t'mode'\t\t=> 'reply',\r\n\t\t'lastclick'\t=> time(),\r\n\t\t'icon'\t\t=> 0,\r\n\t);\r\n\r\n\t// Set preferences such as allow smilies, bbcode, attachsig\r\n\t$reply_prefs = array(\r\n\t\t'disable_bbcode'\t=> ($config['allow_bbcode'] && $user->optionget('bbcode')) ? false : true,\r\n\t\t'disable_smilies'\t=> ($config['allow_smilies'] && $user->optionget('smilies')) ? false : true,\r\n\t\t'disable_magic_url'\t=> false,\r\n\t\t'attach_sig'\t\t=> ($config['allow_sig'] && $user->optionget('attachsig')) ? true: false,\r\n\t\t'notify'\t\t\t=> ($config['allow_topic_notify'] && ($user->data['user_notify'] || isset($topic_data['notify_status']))) ? true : false,\r\n\t\t'lock_topic'\t\t=> ($topic_data['topic_status'] == ITEM_LOCKED && $auth->acl_get('m_lock', $forum_id)) ? true : false,\r\n\t);\r\n\r\n\tforeach ($reply_prefs as $name => $value)\r\n\t{\r\n\t\tif ($value)\r\n\t\t{\r\n\t\t\t$s_hidden_fields[$name] = 1;\r\n\t\t}\r\n\t}\r\n\r\n\t$subject = ((strpos($topic_data['topic_title'], 'Re: ') !== 0) ? 'Re: ' : '') . censor_text($topic_data['topic_title']);\r\n\r\n\tif (!$qr_config['display_subject'])\r\n\t{\r\n\t\t// /me is a show-off\r\n\t\tlist($s_hidden_fields['subject'], $subject) = array($subject, '');\r\n\t}\r\n\r\n\t// Confirmation code handling (stolen from posting.php)\r\n\tif ($config['enable_post_confirm'] && !$user->data['is_registered'])\r\n\t{\r\n\t\t// Show confirm image\r\n\t\t$sql = 'DELETE FROM ' . CONFIRM_TABLE . \"\r\n\t\t\tWHERE session_id = '\" . $db->sql_escape($user->session_id) . \"'\r\n\t\t\t\tAND confirm_type = \" . CONFIRM_POST;\r\n\t\t$db->sql_query($sql);\r\n\r\n\t\t// Generate code\r\n\t\t$code = gen_rand_string(mt_rand(5, 8));\r\n\t\t$confirm_id = md5(unique_id($user->ip));\r\n\t\t$seed = hexdec(substr(unique_id(), 4, 10));\r\n\r\n\t\t// compute $seed % 0x7fffffff\r\n\t\t$seed -= 0x7fffffff * floor($seed / 0x7fffffff);\r\n\r\n\t\t$sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(\r\n\t\t\t'confirm_id'\t=> (string) $confirm_id,\r\n\t\t\t'session_id'\t=> (string) $user->session_id,\r\n\t\t\t'confirm_type'\t=> (int) CONFIRM_POST,\r\n\t\t\t'code'\t\t\t=> (string) $code,\r\n\t\t\t'seed'\t\t\t=> (int) $seed,\r\n\t\t));\r\n\r\n\t\t$db->sql_query($sql);\r\n\r\n\t\t$template->assign_vars(array(\r\n\t\t\t'S_CONFIRM_CODE'\t=> true,\r\n\t\t\t'CONFIRM_ID'\t\t=> $confirm_id,\r\n\t\t\t'CONFIRM_IMAGE'\t\t=> '<img src=\"' . append_sid(\"{$phpbb_root_path}ucp.$phpEx\", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_POST) . '\" alt=\"\" title=\"\" />',\r\n\t\t));\r\n\t}\r\n\r\n\t// new RC6/RC7 stuff\r\n\tadd_form_key('posting');\r\n\r\n\t// Page title & action URL, include session_id for security purpose\r\n\t$s_action = append_sid(\"{$phpbb_root_path}posting.$phpEx\", false, true, $user->session_id);\r\n\r\n\t// Assign template variables\r\n\t$template->assign_vars(array(\r\n\t\t'QR_SUBJECT'\t\t\t=> $subject,\r\n\r\n\t\t'S_QR_HIDDEN_FIELDS'\t=> build_hidden_fields($s_hidden_fields),\r\n\t\t'S_QR_POST_ACTION'\t\t=> $s_action,\r\n\r\n\t\t'S_QR_ENABLED'\t\t\t=> $qr_config['enabled'], // this is true anyway :P\r\n\t\t'S_QR_SUBJECT'\t\t\t=> $qr_config['display_subject'],\r\n\t\t'S_QR_HIDE_BOX'\t\t\t=> $qr_config['hide_box'],\r\n\t\t'S_QR_RESIZE'\t\t\t=> $qr_config['resize'],\r\n\t));\r\n}", "public static function removeMessage() {\n $con = pg_connect(\"host=\".CON_HOST.\" dbname=\".CON_DBNAME.\" user=\".CON_USER.\" password=\".CON_PASSWORD.\"\")\n or die (\"Could not connect to server.\");\n\n if($_REQUEST['id'] > 1) {\n $query = \"UPDATE message SET removed = true WHERE message_id = \". $_REQUEST['id'];\n }\n\n pg_query($con, $query) or die(\"Cannot execute the query.\");\n return true;\n }", "public function onMqUnsubscribe($server, int $fd, $fromId, $data)\n {\n echo \"取消订阅\";\n\n $payload = [];\n foreach ($data['topics'] as $K => $v){\n if (is_numeric($v) && $v < 3 ){\n $payload[] = chr($v);\n }else{\n $payload[] = chr(0x80);\n }\n }\n $server->send(\n $fd,\n MQTT::getAck(\n [\n 'cmd' => 11,\n 'message_id' => $data['message_id'] ??'',\n 'payload' => $payload\n ]\n )\n );\n\n }", "function qa_pm_delete($userid, $handle, $cookieid, $message, $box)\n{\n\trequire_once QA_INCLUDE_DIR . 'db/messages.php';\n\n\tqa_db_message_user_hide($message['messageid'], $box);\n\tqa_db_message_delete($message['messageid'], false);\n}", "public function cleanupDelete(KCommandContext $context)\n\t{\n\t\t$rows = $context->result;\n\t\t$table = $this->getService('com://site/ninjaboard.database.table.posts');\n\n\t\t// make sure we are not a row\n\t\tif ($rows instanceof KDatabaseRowDefault) $rows = array($rows);\n\t\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\t$topic\t= $this->getService('com://site/ninjaboard.model.topics')->id($row->ninjaboard_topic_id)->getItem();\n\t\t\t$query = $this->getService('koowa:database.adapter.mysqli')->getQuery()->where('ninjaboard_topic_id', '=', $topic->id);\n\t\t\t$posts = $table->count($query);\n\n\t\t\tif($posts)\n\t\t\t{\n\t\t\t\t//Replies does not count the first post, thus we subtract by 1\n\t\t\t\t$topic->replies = $posts - 1;\n\t\t\t\t\n\t\t\t\t// @TODO merge into one query\n\t\t\t\t$query = $this->getService('koowa:database.adapter.mysqli')->getQuery()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->select('ninjaboard_post_id')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('ninjaboard_topic_id', '=', $topic->id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->order('created_time', 'desc');\n\t\t\t\t$topic->last_post_id = $table->select($query, KDatabase::FETCH_FIELD);\n\t\t\t\t\n\t\t\t\t$query = $this->getService('koowa:database.adapter.mysqli')->getQuery()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->select('created_time')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('ninjaboard_topic_id', '=', $topic->id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->order('created_time', 'desc');\n\t\t\t\t$topic->last_post_on = $table->select($query, KDatabase::FETCH_FIELD);\n\t\t\t\t\n\t\t\t\t$query = $this->getService('koowa:database.adapter.mysqli')->getQuery()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->select('created_user_id')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('ninjaboard_topic_id', '=', $topic->id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->order('created_time', 'desc');\n\t\t\t\t$topic->last_post_by = $table->select($query, KDatabase::FETCH_FIELD);\n\n\t\t\t\t$topic->save();\n\t\t\t}\n\t\t\t\n\t\t\tif($topic->first_post_id == $row->id)\n\t\t\t{\n\t\t\t\t//If this is the last post, and only post in the topic, delete the topic.\n\t\t\t\t//If not, then don't delete it\n\t\t\t\tif(!$posts) $topic->delete();\n\t\t\t\telse return false;\n\t\t\t}\n\n\t\t\t//Update the forums' topics and posts count, and correct the last_post_id column\n\t\t\t$forums\t= $this->getService('com://site/ninjaboard.model.forums')->limit(0)->id($topic->forum_id)->getListWithParents();\n\t\t\t$forums->recount();\n\n\t\t\tif($row->created_by)\n\t\t\t{\n\t\t\t\t$user\t= $this->getService('com://site/ninjaboard.model.people')->id($row->created_by)->getItem();\n\t\t\t\tif(!$user->guest)\n\t\t\t\t{\n\t\t\t\t\t$query = $this->getService('koowa:database.adapter.mysqli')->getQuery()->where('created_user_id', '=', $user->id);\n\t\t\t\t\t$user->posts = $table->count($query);\n\n\t\t\t\t\t$user->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function uninstall_post_message()\n\t{\n\t\treturn FALSE;\n\t}", "public function purgeReply($rid){\n \n /**\n * Fetch Reply Details\n */ \n $replies = Reply::where('id','=',$rid)->first();\n \n /**\n * Purge Reply Votes\n */\n $this->purgeVotes('reply','reply_id',$rid);\n \n /**\n * Purge Reply Flagged Reports\n */\n $this->purgeReports('reply',$rid);\n \n /**\n * Purge Reply Notification\n */\n $this->purgeNotification('replylike',$rid);\n $this->purgeNotification('commentreply',$replies->comment_id);\n \n /**\n * Purge Reply\n */\n if($replies->delete()){\n return Response::json(array(\n 'status' => true,\n ));\n }\n }", "public function delete_topic($topic_id) {\n\n $topic = Topic::find($topic_id);\n $topic->delete();\n //delete all the messages assigend to this topic\n Message::where('topic_id', $topic_id)->delete();\n\n return response()->json('Topic Deleted', 200);\n }", "public function deleteMessages()\n {\n $this->_Database->query(\"DELETE FROM chat WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(time_posted) >= 3200\");\n }", "public function delete()\n {\n parent::delete();\n $receiptHandle = $this->job->getReceiptHandle();\n $this->mns->deleteMessage($receiptHandle);\n }", "function threadRemove(){\n\n\t$threadId\t\t\t \t= strip_tags($_GET['ThreadId']);\t\t\t\t #int - primaryKey\n\n\t$db = pdo(); # pdo() creates and returns a PDO object\n\t#dumpDie($_POST);\n\n\t$sql = \"DELETE FROM ma_Threads WHERE `ThreadID` = :ThreadID\";\n\n\t$stmt = $db->prepare($sql);\n\t//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);\n\t$stmt->bindValue(':ThreadID', $threadId, PDO::PARAM_INT);\n\n\ttry {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\t#feedback success or failure of update\n\n\tif ($stmt->rowCount() > 0)\n\t{//success! provide feedback, chance to change another!\n\t\tfeedback(\"Thread Removed Successfully From Timeline!\",\"success\");\n\t}else{//Problem! Provide feedback!\n\t\tfeedback(\"Thread Not Removed!\",\"warning\");\n\t}\n\tmyRedirect(THIS_PAGE);\n}", "function remove_message($db, $id)\n{\n\t$sql = \"DELETE from messages where id = :id\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':id'=>$id));\n\treturn;\n}", "public function deleteAnswer()\n {\n $this->is_answer = false;\n $this->topic->is_answered = false;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "public function deleteReply()\r\n{\r\n $query_string = \"DELETE FROM replies \";\r\n $query_string .= \"WHERE replyid = :replyid\";\r\n\r\n return $query_string;\r\n}", "public static function mjj_bbp_unsubscribe_notice(){\n\n\t\tglobal $post;\n\n\t\t$topic_id = ( isset( $_GET['tid'] ) && !empty($_GET['tid'] ) ? $_GET['tid'] : '' );\n\t\t$user_id = ( isset( $_GET['uid'] ) && !empty($_GET['uid'] ) ? $_GET['uid'] : '' );\n\t\t$to_check = ( isset( $_GET['nn'] ) && !empty($_GET['nn'] ) ? $_GET['nn'] : '' );\n\t\t$check = self::not_a_nonce( $user_id, $topic_id );\n\n\t\t$current_user = is_user_logged_in() ? wp_get_current_user() : false;\n\n\t\t//are there any of the query vars? If not, return\n\t\tif( !$topic_id && !$user_id && !$to_check ){\n\t\t\treturn;\n\t\t}\n\t\t//if you fail the check, it doesn't work. Also it has to be on the right topic.\n\t\telseif( ! hash_equals( $check, $to_check ) || (int)$post->ID !== (int)$topic_id ){\n\t\t\t$admin_email = get_bloginfo( 'admin_email' );\n\t\t\t$message = \"Something has gone wrong. You can manage your subscriptions from your profile. If you need assistance,\n\t\t\t\tplease email <a href='mailto:{$admin_email}'>{$admin_email}</a>\";\n\t\t}\n\t\t//if you are logged in and using someone else's link, it won't work for you (or unsubscribe them) so you get a link to your subscriptions page\n\t\telseif( is_user_logged_in() && (int)$current_user->ID !== (int)$user_id ){\n\n\t\t\t$subscriptions_link = bbp_get_user_profile_url( $current_user->ID ) . 'subscriptions/';\n\t\t\t$message = \"Unsubscribe links are unique to each user of the forum.<br />This link can&rsquo;t be used for you to unsubscribe, but you can manage all your subscriptions <a href='{$subscriptions_link}'>here</a>\";\n\n\t\t}\n\t\t//what else haven't I thought about? add anything I've forgotten here. If you are not logged in, you can still unsubscribe. That's ok. Better accidental unsubscriptions than people not being able to unsubscribe.\n\t\telse{\n\n\t\t\tbbp_remove_user_subscription( (int)$user_id, (int)$topic_id );\n\t\t\t$message = 'You have been unsubscribed from this topic.';\n\n\t\t}\n\n\t\techo '<div class=\"notice good\">';\n\t\techo $message;\n\t\techo '</div>';\n\n\t\treturn;\n\n\t}", "private function unsubscribe()\n {\n $this->botman->hears('unsubscribe', function(BotMan $bot) {\n $userId = $bot->getUser()->getId();\n Subscriber::where('telegram_user_id', $userId)->delete();\n $bot->reply('You have just unsubscribed from our updates!');\n });\n }", "function my_callback_delete_post( $result ) {\n\twp_delete_post( $result->ID, true );\n}", "public function unLikeIt(Reply $reply) {\n // $reply->like->where(['user_id', auth()->id()])->first()->delete();\n $reply->like->where('user_id', '1')->first()->delete();\n }", "function _fix_links_callback_topic($m)\n\t{\n\t\treturn 'index.php?page=topicview&id='.strval(import_id_remap_get('topic',strval($m[2]),true));\n\t}", "function action_delmessage($messageid) {\n global $wpdb, $out, $admin_user_login;\n // Get message attributes so we can figure out what to do.\n\n //Current provider ID \n $curID = convertToID($admin_user_login);\n \n $query = \"SELECT uf.user_login AS from_login, ut.user_login AS to_login, pm_clear.meta_key AS clear_p, \" .\n\t\t\"pm_delete1.meta_key AS delete_1 , pm_delete2.meta_key AS delete_2, pm_to.post_id AS parent \" .\n\t\t\"FROM {$wpdb->prefix}posts AS p \" .\n\t\t\"JOIN $wpdb->postmeta pm_to \" .\n\t\t\"ON ((p.post_parent = pm_to.post_id AND p.post_parent <> 0) \" .\n\t\t\"OR (p.id = pm_to.post_id AND p.post_parent = 0)) \" .\n\t\t\"AND pm_to.meta_key = '_fep_participants' \" .\n\t\t\"AND pm_to.meta_value <> p.post_author \" .\n\t\t\"LEFT JOIN $wpdb->postmeta AS pm_delete1 \" . \n\t\t\"ON ((pm_delete1.post_id = p.post_parent AND pm_delete1.meta_key = CONCAT('_fep_delete_by_', p.post_author) ) \" . \n\t\t\"OR (pm_delete1.post_id = p.id AND pm_delete1.meta_key = CONCAT('_fep_delete_by_', p.post_author) )) \" . \n\t\t\"LEFT JOIN $wpdb->postmeta AS pm_delete2 \" . \n\t\t\"ON ((pm_delete2.post_id = p.post_parent AND pm_delete2.meta_key = CONCAT('_fep_delete_by_', pm_to.meta_value) ) \" . \n\t\t\"OR (pm_delete2.post_id = p.id AND pm_delete2.meta_key = CONCAT('_fep_delete_by_', pm_to.meta_value) )) \" . \n\t\t\"LEFT JOIN wp_postmeta AS pm_clear \" .\n\t\t\"ON ((pm_clear.post_id = p.post_parent AND pm_clear.meta_key = CONCAT('_oemr_fep_clear_', p.id)) \" .\n\t\t\"OR (pm_clear.post_id = p.id AND pm_clear.meta_key = CONCAT('_oemr_fep_clear_', p.id))) \" .\n\t\t\"LEFT JOIN $wpdb->users AS uf ON uf.ID = p.post_author \" .\n\t\t\"LEFT JOIN $wpdb->users AS ut ON ut.ID = pm_to.meta_value \";\n\t$query2 = $query;\n \n\t$query .= \"WHERE p.id = %d\";\n\n $row = $wpdb->get_row($wpdb->prepare($query, array($messageid)), ARRAY_A);\n if (empty($row)) {\n\t$out['errmsg'] = \"Cannot delete, there is no message with ID $messageid.\";\n\treturn;\n }\n \n $parent = $row['parent'];\n $timestamp = idate(\"U\"); \n \n if ($row['from_login'] == $admin_user_login) {\n\t //clear the record if admin is from\n\t add_post_meta($messageid, '_oemr_fep_clear_' . $messageid, $timestamp);\n }\t \n \n else if ($row['to_login'] == $admin_user_login) {\n\t //clear the record if admin is to\n\t add_post_meta($messageid, '_oemr_fep_clear_' . $messageid, $timestamp);\n } \n \n $query2 .= \"WHERE (p.id = %d OR p.post_parent = %d) AND pm_clear.meta_key IS NULL AND p.post_type <> 'attachment'\";\n \n $row2 = $wpdb->get_row($wpdb->prepare($query2, array($parent, $parent)), ARRAY_A);\n \n if (empty($row2)) {\n\t add_post_meta($parent, '_fep_delete_by_' . $curID, $timestamp);\n }\n\t\t\n\t$row3 = $wpdb->get_row($wpdb->prepare($query, array($parent)), ARRAY_A);\n\t\n if (($row3['delete_1'] !== NULL) && ($row3['delete_2'] !== NULL)) {\n\t$query4 = $wpdb->prepare(\"SELECT ID FROM {$wpdb->prefix}posts \" .\n\t\"WHERE (ID = %d OR post_parent = %d) and post_type = 'fep_message'\", $parent, $parent);\n\t$row4s = $wpdb->get_results($query4, ARRAY_A);\n\tforeach ($row4s as $row4) {\n\t\t$query5 = $wpdb->prepare(\"SELECT ID, post_mime_type, guid \" .\n\t\t\"FROM {$wpdb->prefix}posts \" .\n\t\t\"WHERE post_parent = %d AND post_type = 'attachment'\", $row4['ID']);\n\t\t$row5s = $wpdb->get_results($query5, ARRAY_A);\n\t\tforeach ($row5s as $row5) {\n\t\t\t$url = $row5['guid'];\n\t\t\t$filename = basename($url);\n\t\t\t$path = parse_url($url, PHP_URL_PATH); // just the path part of the URL\n\t\t\t$parts = explode('/', $path); // all the components\n\t\t\tif ( get_option( 'uploads_use_yearmonth_folders' ) ) {\n\t\t\t\t$parts = array_slice($parts, -6); // the last six\n\t\t\t}\telse {\n\t\t\t\t$parts = array_slice($parts, -4); // the last 4\n\t\t\t}\n\t\t\t$path = implode('/', $parts); \n\t\t\t$filepath = ABSPATH . $path;\n\t\t\tunlink($filepath); //Delete the file from the server.\n\t\t\t$wpdb->query($wpdb->prepare(\"DELETE p FROM {$wpdb->prefix}posts AS p WHERE p.id = %d\",$row5['ID'])); \t\t\t\n\t\t}\n\t\t$wpdb->query($wpdb->prepare(\"DELETE p, pm FROM {$wpdb->prefix}posts AS p \" .\n\t\t\"INNER JOIN {$wpdb->prefix}postmeta AS pm ON pm.post_id = p.ID \" .\n\t\t\"WHERE p.ID = %d OR p.post_parent = %d AND pm.post_id = %d\",$row4['ID'],$row4['ID'],$row4['ID']));\n\t}\n } \n}", "function messageDelete(Message $message);", "public function deleteMessage($messageId);", "public function processDelete(ProcessHook $hook)\n {\n $deleteHookAction = ModUtil::getVar(self::MODULENAME, 'deletehookaction');\n // lock or remove\n $topic = $this->_em->getRepository('Zikula\\Module\\DizkusModule\\Entity\\TopicEntity')->getHookedTopic($hook);\n if (isset($topic)) {\n switch ($deleteHookAction) {\n case 'remove':\n ModUtil::apiFunc(self::MODULENAME, 'Topic', 'delete', array('topic' => $topic));\n break;\n case 'lock':\n default:\n $topic->lock();\n $this->_em->flush();\n break;\n }\n }\n $actionWord = $deleteHookAction == 'lock' ? $this->__('locked', $this->domain) : $this->__('deleted', $this->domain);\n $this->view->getRequest()->getSession()->getFlashBag()->add('status', $this->__f('Dizkus: Hooked discussion topic %s.', $actionWord, $this->domain));\n\n return true;\n }", "protected static function deleteAction($ajax) {\n\t\tglobal $db, $user;\n\t\tif(isset($_POST['id']) && $id = +$_POST['id'])\n\t\t\tif($user->IsLoggedIn()) {\n\t\t\t\t$uid = $user->ID;\n\t\t\t\t$db->autocommit(false);\n\t\t\t\tif($del = $db->prepare('delete from forum_replies where id=? and (user=? or ? in (select id from users where level=\\'' . +t7user::LEVEL_ADMIN . '\\'))'))\n\t\t\t\t\tif($del->bind_param('iii', $id, $uid, $uid))\n\t\t\t\t\t\tif($del->execute())\n\t\t\t\t\t\t\tif($del->affected_rows)\n\t\t\t\t\t\t\t\tif($db->query('delete from forum_discussions where id not in (select distinct discussion from forum_replies)')) {\n\t\t\t\t\t\t\t\t\t$ajax->Data->discussionDeleted = $db->affected_rows > 0;\n\t\t\t\t\t\t\t\t\tif($db->real_query('update users_stats as us set us.replies=(select count(1) from forum_replies where user=us.id)'))\n\t\t\t\t\t\t\t\t\t\tif($db->real_query('update forum_tags as t set count=(select count(1) from forum_discussion_tags where tag=t.id group by tag), lastused=(select min(r.posted) from forum_replies as r left join forum_discussion_tags as dt on dt.discussion=r.discussion where dt.tag=t.id group by dt.tag)'))\n\t\t\t\t\t\t\t\t\t\t\t$db->commit();\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t$ajax->Fail('error updating tag statistics', $db->errno . ' ' . $db->error);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$ajax->Fail('error updating user stats', $db->errno . ' ' . $db->error);\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t$ajax->Fail('error deleting empty discussions', $db->errno . ' ' . $db->error);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$ajax->Fail('reply not deleted. either it doesn’t exist or it doesn’t belong to you.');\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$ajax->Fail('error executing reply deletion', $del->errno . ' ' . $del->error);\n\t\t\t\t\telse\n\t\t\t\t\t\t$ajax->Fail('error binding parameters to delete reply', $del->errno . ' ' . $del->error);\n\t\t\t\telse\n\t\t\t\t\t$ajax->Fail('error preparing to delete reply', $db->errno . ' ' . $db->error);\n\t\t\t\tif($ajax->Data->fail)\n\t\t\t\t\t$db->rollback();\n\t\t\t} else\n\t\t\t\t$ajax->Fail('must be logged in to delete a reply.');\n\t\telse\n\t\t\t$ajax->Fail('id is required to delete a reply.');\n\t}", "public function notify_forum_remove_topic( $topic_id ) {\n\t\t$this->notify_forum_topic_payload( 'remove-topic', $topic_id );\n\t}", "function apoc_get_group_reply_info() {\n\n\tglobal $bp;\n\t$slug = $bp->action_variables[1];\n\t\n\tglobal $wpdb;\n\t$topic = $wpdb->get_row( \n\t\t$wpdb->prepare( \n\t\t\t\"SELECT post_title AS title, post_name AS url\n\t\t\tFROM $wpdb->posts \n\t\t\tWHERE ID = ( \n\t\t\t\tSELECT post_parent\n\t\t\t\tFROM $wpdb->posts\n\t\t\t\tWHERE post_name = %s )\",\n\t\t\t$slug )\n\t\t);\n\t\t\n\treturn( $topic );\n}", "public function unsubscribe(Topic $topic, Connection $connection);", "public function action_delete() {\n\t\t$id = $this->request->param('id');\n\t\tif($id) {\n\t\t\t$message = ORM::factory('Message', $id);\n\t\t\tif($message->loaded()) {\n\t\t\t\ttry {\n\t\t\t\t\t$message->delete();\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t$this->_set_msg('Could not delete message because another user is tied to it', 'error');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->redirect($this->request->referrer());\n\t\t}\n\t\t$this->_set_content('message_delete');\n\t}", "public function decForumTopicCount()\n {\n $dataMap = $this->forumNode()->dataMap();\n $decTopic = (int) $dataMap['topic_count']->content();\n $decTopic--;\n $dataMap['topic_count']->fromString( $decTopic );\n $dataMap['topic_count']->store();\n }", "public function delete_messages()\n {\n $this->message=array();\n Session::instance()->delete(\"hana_message\");\n }", "function processMoveTopic($topicID, $data) {\n\t\tglobal $DB, $menuvar, $safs_config;\n\t\t$numOfPosts = 0;\n\t\t$forumID = getForumIDByTopicID($topicID);\n\t\t$newForumID = $data['forum_id'];\n\t\t\n\t\t// Pull the posts in this topic, delete them and update our counts\n\t\t$sql = \"SELECT COUNT(id) AS numRows FROM `\" . DBTABLEPREFIX . \"posts` WHERE topic_id = '\" . $topicID . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\tif ($result && $DB->num_rows() > 0) {\n\t\t\t$row = $DB->fetch_array($result);\n\t\t\t$numOfPosts = $row['numRows'];\n\t\t\t\n\t\t\t$DB->free_result($result);\n\t\t}\n\t\t\n\t\t// Update the current forum post count\n\t\t$sql = \"UPDATE `\" . DBTABLEPREFIX . \"forums` SET posts = posts - \" . $numOfPosts . \" WHERE id = '\" . $forumID . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t// Update the new forum post count\n\t\t$sql = \"UPDATE `\" . DBTABLEPREFIX . \"forums` SET posts = posts + \" . $numOfPosts . \" WHERE id = '\" . keepsafe($newForumID) . \"'\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t// Move the topic\n\t\t// Dont escape since this method does that, double escape isn't fun\n\t\t$result = $DB->query_update(\"topics\", array('forum_id' => $newForumID), \"id = '\" . $topicID . \"'\");\n\t\t\n\t\t$returnVar = \"\n\t\t\t\t\t\t\t\t\t\t\t<h2 class=\\\"processFormTitle\\\">Move Topic</h2>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\\\"processFormBlock \" . (($result) ? \"processFormSuccess\" : \"processFormFailed\") . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t\t\" . (($result) ? \"Your topic has been moved and you're being redirected to the thread.\" : \"There was an error moving your topic, you're being redirected to the thread.\") . \"\n\t\t\t\t\t\t\t\t\t\t\t\t<meta http-equiv=\\\"refresh\\\" content=\\\"3;url=\" . $menuvar['VIEWTOPIC'] . \"&id=\" . $topicID . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t</div>\";\n\t\t\n\t\t// Return the HTML\n\t\treturn $returnVar;\n\t}", "public function onUnSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)\n {\n }", "public function mpp_delete_subscriber(){\n $response = array();\n $response['success'] = false;\n $response['message'] = __( 'Error: Unable to delete subscriber.', 'masterpopups' );\n\n if( ! $this->is_valid_nonce( 'xbox_ajax_nonce' ) ){\n die();\n }\n\n if( ! isset( $_POST['email'] ) || ! isset( $_POST['audience_id'] ) ){\n wp_send_json( $response );\n }\n $audience = get_post( $_POST['audience_id'] );\n if( $audience ){\n $email = $_POST['email'];\n $subscribers = (array) get_post_meta( $audience->ID, 'mpp_subscribers', true );\n if( isset( $subscribers[$email] ) ){\n unset( $subscribers[$email] );\n update_post_meta( $audience->ID, 'mpp_subscribers', $subscribers );\n $total_subscribers = (int) get_post_meta( $audience->ID, 'mpp_total-subscribers', true );\n update_post_meta( $audience->ID, 'mpp_total-subscribers', --$total_subscribers );\n $response['success'] = true;\n $response['message'] = __( 'Subscriber successfully deleted.', 'masterpopups' );\n $response['total'] = $total_subscribers;\n }\n }\n wp_send_json( $response );\n }", "private function act_mdel($raw) {\n\t\treturn \"<a class=\\\"msg-delete\\\" data-done=\\\"0\\\" data-recid=\\\"{$raw['id']}\\\" href=\\\"#\\\">Delete Message</a>\";\n\t}", "public function ReplyMessages(){\n\n\t\t$message_id = $this->uri->segment(3);\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/reply_message';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Reply Message',\n\t\t\t'student' => $this->setting_model->Get_All('students'),\n\t\t\t'londontec_users' => $this->setting_model->Get_All('londontec_users'),\n\t\t\t'messages' => $this->setting_model->Get_Single('message','message_id',$message_id)\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "static function deleteTopic($topicID)\n {\n $connection = new Connection();\n $connection->prepareQuery(\n \"DELETE FROM TOPICS WHERE Id = $topicID\");\n $result = $connection->executeQueryDML();\n $connection = NULL;\n }", "public function remove( $args, $assoc_args ) {\n\t\t$user = $this->get_user_id_from_identifier( $assoc_args['user-id'] );\n\n\t\t// Check if topic exists.\n\t\t$topic_id = $assoc_args['topic-id'];\n\t\tif ( ! bbp_is_topic( $topic_id ) ) {\n\t\t\t\\WP_CLI::error( 'No topic found by that ID.' );\n\t\t}\n\n\t\t\\WP_CLI::confirm( 'Are you sure you want to remove this topic from the user\\'s favorite list?', $assoc_args );\n\n\t\t// True if removed.\n\t\tif ( bbp_remove_user_favorite( $user->ID, $topic_id ) ) {\n\t\t\t\\WP_CLI::success( 'Favorite successfully removed.' );\n\t\t} else {\n\t\t\t\\WP_CLI::error( 'Could not remove favorite.' );\n\t\t}\n\t}", "function setReply($key,$content,$isNews=false){\n\t$mysql=new MySQL();\n\t$mysql->table(REPLY_TABLE)->where(\"`key`='$key'\")->delete();\n\tif($isNews==false){\t\t//it's a text\n\t\t$mysql->data(array('key'=>$key,'type'=>'text','content'=>$content))->table(REPLY_TABLE)->add();\n\t}else{\n\t\t$mysql->data(array('key'=>$key,'type'=>'news','content'=>$content))->table(REPLY_TABLE)->add();\n\t\t//News message do not content description or now\n\t\t//We can resepon just one NewsMessage now\n\t}\n\t\n\n}", "function um_delete_user_messages( $user_id ) {\r\n\t//Update with delete old messages conversations\r\n\tglobal $wpdb;\r\n\r\n\t$conversations = UM()->Messaging_API()->api()->table_name1;\r\n\t$messages = UM()->Messaging_API()->api()->table_name2;\r\n\r\n\t$wpdb->query( $wpdb->prepare(\r\n\t\t\"DELETE\r\n\t FROM {$conversations}\r\n\t WHERE user_a = %d OR\r\n\t user_b = %d\",\r\n\t\t$user_id,\r\n\t\t$user_id\r\n\t) );\r\n\r\n\t$wpdb->query( $wpdb->prepare(\r\n\t\t\"DELETE\r\n\t FROM {$messages}\r\n\t WHERE recipient = %d OR\r\n\t author = %d\",\r\n\t\t$user_id,\r\n\t\t$user_id\r\n\t) );\r\n}", "function undelete_posts()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->undelete['p']))\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'post_deleted'\t\t\t=> 0,\r\n\t\t\t\t'post_deleted_time'\t\t=> 0,\r\n\t\t\t);\r\n\t\t\t$sql = 'UPDATE ' . POSTS_TABLE . '\r\n\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\t\tWHERE ' . $db->sql_in_set('post_id', $this->undelete['p']);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\t// Add the post info to the search index since we are undeleting it\r\n\t\t\t$this->update_search_index($this->undelete['p'], false);\r\n\r\n\t\t\tforeach ($this->undelete['p'] as $id)\r\n\t\t\t{\r\n\t\t\t\t$topic_id = intval($this->post_data[$id]['topic_id']);\r\n\t\t\t\t$forum_id = intval($this->post_data[$id]['forum_id']);\r\n\r\n\t\t\t\t// Update the first/last topic info if we must\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_deleted'] != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Since the topic was deleted, undelete it\r\n\t\t\t\t\t$this->undelete['t'][] = $topic_id;\r\n\r\n\t\t\t\t\tif ($this->topic_data[$topic_id]['topic_poster'] != $user->data['user_id'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tadd_log('mod', $forum_id, $topic_id, 'LOG_UNDELETE_TOPIC', $this->topic_data[$topic_id]['topic_title']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->post_data[$id]['poster_id'] != $user->data['user_id'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tadd_log('mod', $forum_id, $topic_id, 'LOG_UNDELETE_POST', $this->post_data[$id]['post_subject']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_first_post_id'] > $id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->update_first_post_topic($topic_id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_last_post_id'] < $id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->update_last_post_topic($topic_id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\t\tSET topic_deleted_reply_count = topic_deleted_reply_count - 1\r\n\t\t\t\t\t\tWHERE topic_id = ' . $topic_id;\r\n\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t$this->topic_data[$topic_id]['topic_deleted_reply_count']--;\r\n\r\n\t\t\t\t// If there is a shadow topic, we will update it too.\r\n\t\t\t\tif (array_key_exists($topic_id, $this->shadow_topic_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\t\t\tSET topic_deleted_reply_count = topic_deleted_reply_count - 1\r\n\t\t\t\t\t\t\tWHERE topic_id = ' . intval($this->shadow_topic_ids[$topic_id]);\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\t\t\t$this->topic_data[$this->shadow_topic_ids[$topic_id]]['topic_deleted_reply_count']--;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If the topic is a global announcement, do not attempt to do any updates to forums\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Update the last post info for the forum if we must\r\n\t\t\t\t\tif ($this->forum_data[$forum_id]['forum_last_post_id'] < $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->update_last_post_forum($forum_id);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (array_key_exists($topic_id, $this->shadow_topic_ids))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($this->forum_data[$this->topic_data[$this->shadow_topic_ids[$topic_id]]['forum_id']]['forum_last_post_id'] == $id)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->update_last_post_forum($this->topic_data[$this->shadow_topic_ids[$topic_id]]['forum_id']);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\tSET forum_deleted_reply_count = forum_deleted_reply_count - 1\r\n\t\t\t\t\t\t\tWHERE forum_id = ' . $forum_id;\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t$this->forum_data[$forum_id]['forum_deleted_reply_count']--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Undelete the topics\r\n\t\t\t$this->undelete_topics();\r\n\t\t}\r\n\t}", "public function delete()\n {\n $data = Comment::where(\"reply\", $this->id)->get();\n foreach ($data as $comment) {\n $comment->delete();\n }\n\n /**\n * Delete self\n */\n parent::delete();\n }", "public function clearReplyTos()\n {\n $this->ReplyTo = array();\n $this->ReplyToQueue = array();\n }", "public function deleteTopic(Request $request){\n if($user = Auth::user()) {\n // check if user is admin\n $is_admin = Auth::user()->is_admin;\n \n if ( $is_admin == 1 ){\n\n if ( $request->topic_id != 0){\n\n $topicID = $request->topic_id;\n if(Topic::where('id', $topicID)->exists()) {\n $topic = Topic::find($topicID);\n $topic->delete();\n \n return response()->json([\n \"message\" => \"topic deleted\"\n ], 202);\n } else {\n return response()->json([\n \"message\" => \"Topic not found\"\n ], 404);\n }\n\n }\n }else{\n return response()->json([\n \"message\" => \"you dont have permissions\"\n ], 400);\n }\n }else{\n return response()->json([\n \"message\" => \"you dont have permissions\"\n ], 400);\n }\n }", "function qa_wall_delete_post($userid, $handle, $cookieid, $message)\n{\n\trequire_once QA_INCLUDE_DIR . 'db/messages.php';\n\n\tqa_db_message_delete($message['messageid']);\n\tqa_db_user_recount_posts($message['touserid']);\n\n\tqa_report_event('u_wall_delete', $userid, $handle, $cookieid, array(\n\t\t'messageid' => $message['messageid'],\n\t\t'oldmessage' => $message,\n\t));\n}", "function deleteMessages($messageId){\n\t\t\t//load data from persistence object\n\t\t\t$storageType \t\t= $this->configManager->getStorageType();\n\t\t\n\t\t\t\t\t\t\t\t\n\t\t\tif(strtolower($storageType) == 'file'){\n\t\t\t\t$fileName = $this->configManager->getDataDir().'/'.$this->configManager->getMessageFileName();\n\t\t\t\t$this->persistenceManager->setStorageType('file');\n\t\t\t\t$this->persistenceManager->setMessageFile($fileName);\n\t\t\t}elseif(strtolower($storageType) == 'mysql'){\n\t\t\t\tdie(\"MySQL storage type, not implemented yet!\");\n\t\t\t}else{\n\t\t\t\tdie(\"Unknown storage type!\");\n\t\t\t}\n\t\t\t\n\t\t\t$this->persistenceManager->deleteMessage($messageId);\n\t\t\t\n\t\t}", "public function destroy(Reply $reply)\n {\n $delete=$reply->delete();\n \n if($delete){\n \n return response(['message'=>'Deleted successfully!']);\n }\n }", "public function destroy($id1, $id2, $id3)\n {\n $message = Message::find($id3);\n $message->delete();\n return redirect(\"/subtopics/$id2\");\n }", "function caldol_most_replies_bbpress_topics_shortcode() {\n\n ?>\n\n<!-- html custom-functions -->\n\n<h4 style=\"margin-top: 15px;\">Discussions with the Most Replies</h4>\n\n<?php\n\nif ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'meta_key' => '_bbp_reply_count', 'orderby' => 'meta_value', 'post_parent' => 'any', 'posts_per_page' => 10 ) ) )\n\nbbp_get_template_part( 'bbpress/loop', 'topics' );\n\n?>\n\n<!-- end -->\n\n<?php }", "public function deleteSubject($topic_code) {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\n\t\t\t$topic_code = mysql_real_escape_string($topic_code, $sql->Link_ID); // Sanitise topic code\n\n\n\t\t\t// Get Subject Name from Subject Topic Code\n\t\t\t$query = \"SELECT Description FROM tblsubject where ID = '$topic_code'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$subject_name = $sql->Record['Description'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Delete subject\n\t\t\t// Courses and Occurrences are deleted automatically when subject deleted - due to relational table structure\n\t\t\t$query = \"DELETE FROM tblsubject WHERE ID = '$topic_code'\";\n\t\t\t$sql->query($query, $this->debug);\n\n\t\t\t// Sanitize subject name\n\t\t\t$subject_name = mysql_real_escape_string($subject_name, $sql->Link_ID); // sanitise subject name\n\n\t\t\t// Find page id of this subject page\n\t\t\t$page_id = '';\n\t\t\t$query = \"SELECT page_id FROM webmatrix_user_pages WHERE template = \".$this->subject_tpl_id.\" AND title = '$subject_name'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() == 1) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$page_id = $sql->Record['page_id'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Delete page\n\t\t\tif ($page_id != '') {\n\t\t\t\t$query = \"DELETE FROM webmatrix_user_pages WHERE template = \".$this->subject_tpl_id.\" AND title = '$subject_name' AND page_id = $page_id\";\n\t\t\t\t$sql->query($query, $this->debug);\n\t\t\t}\n\n\t\t\t/* delete page assignment and news & event assignments */\n\t\t\t$query = \"DELETE FROM webmatrix_extra_checkboxgroup WHERE text = '$topic_code'\";\n\t\t\t$sql->query($query, $this->debug);\n\n\n\t\t}", "function delete_user_topics($uid, $gid) {\n global $db;\n $group = $this->get_group_details($gid);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $group['userid'] && userid() != $uid && !has_access('admin_access', true))\n e(lang(\"you_cant_del_user_topics\"));\n else {\n $usr_topics = $this->get_topics(array('group' => $gid, 'user' => $uid));\n if (is_array($usr_topics))\n foreach ($usr_topics as $topic)\n $this->delete_topic($topic['topic_id']);\n e(lang(\"topics_deleted\"), \"m\");\n }\n }", "public static function delete_topic( $id ) {\n\n\t\t\tglobal $wpdb;\n\n\n\n\t\t\t$wpdb->update(\n\n\t\t\t\t\"{$wpdb->prefix}js_topics\",\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'is_active' => false\n\n\t\t\t\t),\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'topic_id' => $id\n\n\t\t\t\t)\n\n\t\t\t);\n\n\n\n\t\t\t$wpdb->delete(\n\n\t\t\t\t\"{$wpdb->prefix}js_topic_subjects\",\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'topic_id' => $id\n\n\t\t\t\t) \n\n\t\t\t);\n\n\t\t}", "function flagForDelete($msg_index) {\n //flag msg for deletion\n imap_delete($this->conn, $msg_index);\n echo \"$msg_index flagged for deletion\";\n }", "function remove_single_post() {\n remove_action('thematic_singlepost', 'thematic_single_post');\n}", "public function soft_delete($reason = '')\n\t{\n\t\tif ($this->post_deleted)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->post_deleted = titania::$time;\n\t\t$this->post_delete_user = phpbb::$user->data['user_id'];\n\t\t$this->post_edit_reason = $reason;\n\n\t\t// Update the postcount for the topic\n\t\t$this->update_topic_postcount();\n\n\t\t// Set the visibility appropriately if no posts are visibile to the public/authors\n\t\t$flags = count::get_flags(access::PUBLIC_LEVEL);\n\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t{\n\t\t\t// There are no posts visible to the public, change it to authors level access\n\t\t\t$this->topic->topic_access = access::AUTHOR_LEVEL;\n\n\t\t\t$flags = count::get_flags(access::AUTHOR_LEVEL);\n\t\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t\t{\n\t\t\t\t// There are no posts visible to authors, change it to teams level access\n\t\t\t\t$this->topic->topic_access = access::TEAM_LEVEL;\n\t\t\t}\n\t\t}\n\n\t\t// Sync the first topic post if required\n\t\tif ($this->post_id == $this->topic->topic_first_post_id)\n\t\t{\n\t\t\t$this->topic->sync_first_post($this->post_id);\n\t\t}\n\n\t\t// Sync the last topic post if required\n\t\tif ($this->post_id == $this->topic->topic_last_post_id)\n\t\t{\n\t\t\t$this->topic->sync_last_post($this->post_id);\n\t\t}\n\n\t\t// Submit the topic to store the updated information\n\t\t$this->topic->submit();\n\n\t\tparent::submit();\n\n\t\t// Update topics posted table\n\t\t$this->topic->update_posted_status('remove', $this->post_user_id);\n\n\t\t// Decrement the user's postcount if we must\n\t\tif ($this->post_approved && in_array($this->post_type, titania::$config->increment_postcount))\n\t\t{\n\t\t\tphpbb::update_user_postcount($this->post_user_id, '-');\n\t\t}\n\t}", "public function unsubscribeThread(ThreadRepositoryInterface $thread): PodiumResponse;", "public function delete($slug)\n {\n \t$record = Language::where('slug', '=', $slug)->first();\n /**\n * Check if the record is set to current default language\n * If so do not delete the record and send the appropriate message\n */\n\n if($record->is_default)\n {\n //Topics exists with the selected, so done delete the subject\n $response['status'] = 0;\n $response['message'] = LanguageHelper::getPhrase('it_is_set_to_default_language');\n return json_encode($response);\n }\n else {\n if(!env('DEMO_MODE')) {\n $record->delete();\n }\n $response['status'] = 1;\n $response['message'] = LanguageHelper::getPhrase('record_deleted_successfully');\n return json_encode($response);\n }\n }", "protected function uninstallPostInstallationMessages()\n\t{\n\t\t// Make sure it's Joomla! 3.2.0 or later\n\t\tif (!version_compare(JVERSION, '3.2.0', 'ge'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure there are post-installation messages\n\t\tif (empty($this->postInstallationMessages))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the extension ID for our component\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('extension_id')\n\t\t\t->from('#__extensions')\n\t\t\t->where($db->qn('type') . ' = ' . $db->q('component'))\n\t\t\t->where($db->qn('element') . ' = ' . $db->q($this->componentName));\n\t\t$db->setQuery($query);\n\n\t\ttry\n\t\t{\n\t\t\t$ids = $db->loadColumn();\n\t\t}\n\t\tcatch (Exception $exc)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$extension_id = array_shift($ids);\n\n\t\t$query = $db->getQuery(true)\n\t\t\t->delete($db->qn('#__postinstall_messages'))\n\t\t\t->where($db->qn('extension_id') . ' = ' . $db->q($extension_id));\n\n\t\ttry\n\t\t{\n\t\t\t$db->setQuery($query)->execute();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}", "public function destroy(Reply $reply)\n {\n $this->authorize('update', $reply);\n\n $reply->delete();\n\n if(request()->expectsJson()) {\n return response(['status' => 'Reply deleted']);\n }\n\n return redirect('/threads');\n }", "public function remove() {\n\t\tremove_action($this->controller->getHookName(),array($this,'handle'),$this->priority);\n }", "function private_messages_delete( int $message_id ) : mixed\n{\n // Require users to be logged in to run this action\n user_restrict_to_users();\n\n // Sanitize the data\n $user_id = sanitize(user_get_id(), 'int', 1);\n $message_id = sanitize($message_id, 'int', 0);\n $timestamp = time();\n\n // Error: Message ID not found\n if(!database_row_exists('users_private_messages', $message_id))\n return __('users_message_not_found');\n\n // Fetch some data regarding the message\n $dmessage = mysqli_fetch_array(query(\" SELECT users_private_messages.deleted_by_recipient AS 'pm_deleted_r' ,\n users_private_messages.deleted_by_sender AS 'pm_deleted_s' ,\n users_private_messages.fk_users_recipient AS 'pm_recipient' ,\n users_private_messages.fk_users_sender AS 'pm_sender'\n FROM users_private_messages\n WHERE users_private_messages.id = '$message_id' \"));\n\n // Determine whether user is sender or recipient\n $user_is_sender = ((int)$dmessage['pm_sender'] === $user_id);\n\n // Error: Message is already deleted\n if(($user_is_sender && $dmessage['pm_deleted_s']) || (!$user_is_sender && $dmessage['pm_deleted_r']))\n return __('users_message_predeleted');\n\n // Error: Message does not belong to user\n if((int)$dmessage['pm_recipient'] !== $user_id && (int)$dmessage['pm_sender'] !== $user_id)\n return __('users_message_ownership');\n\n // If both sender and recipient deleted the message, or if the message is sent to self, hard delete it\n if((!$user_is_sender && $dmessage['pm_deleted_s']) || ($user_is_sender && $dmessage['pm_deleted_r']) || ((int)$dmessage['pm_recipient'] === (int)$dmessage['pm_sender']))\n query(\" DELETE FROM users_private_messages\n WHERE users_private_messages.id = '$message_id' \");\n\n // Otherwise soft delete it\n else if($user_is_sender)\n query(\" UPDATE users_private_messages\n SET users_private_messages.deleted_by_sender = 1\n WHERE users_private_messages.id = '$message_id' \");\n else\n query(\" UPDATE users_private_messages\n SET users_private_messages.deleted_by_recipient = 1 ,\n users_private_messages.read_at = '$timestamp'\n WHERE users_private_messages.id = '$message_id' \");\n\n // All went well, return NULL\n return NULL;\n}", "public function testDelete(): void\n {\n $this->createInstance();\n $this->createAndLogin();\n\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $res2 = $this->fConnector->getDiscussionManagement()->deleteTopic($res->id)->wait();\n $this->assertTrue($res2, 'Test delete of a topic');\n $res3 = $this->fConnector->getDiscussionManagement()->getDiscussions($this->configTest['testTagName'])->wait();\n $found = false;\n foreach($res3 as $discussion){\n if($discussion->id === $res->id){\n $found = true;\n break;\n }\n }\n $this->assertFalse($found, 'Test delete of a topic, search for deleted topic');\n\n }", "public function delete()\n {\n parent::delete();\n $this->azure->deleteMessage($this->job);\n }", "function deleteReply($ids)\n {\n\n if (!is_array($ids)) {\n $ids = array($ids);\n }\n\n $ids = implode(',', $ids);\n\n /* Set up the http sending url. */\n $url = sprintf('cmd=delete_reply&ids=%s',\n urlencode($ids));\n\n $response = $this->_callURL($url);\n\n if (is_a($response, 'PEAR_Error')) {\n return PEAR::raiseError(sprintf(_(\"Send failed.\")));\n }\n\n $result = array();\n\n if (!array_key_exists('error_code', $response)) {\n\n if (count(explode(',', $ids)) == 1) {\n\n $result[$ids] = array(\n 0 => 1,\n 1 => true\n );\n } else {\n foreach ($response['deleted'] as $id) {\n $result[$id] = array(1, true);\n }\n }\n } else {\n\n if (count(explode(',', $ids)) == 1) {\n\n $result[$to] = array(\n 0 => 0,\n 1 => $response['error_message']\n );\n } else {\n foreach (explode(',', $ids) as $id) {\n $result[$id] = array(0, $response['error_message']);\n }\n }\n }\n\n return $result;\n }", "public function reply()\n\t{\n\n\t\t$reply = $this->store('reply', '/threads?id=_id_#form-reply');\n\n\t\t(new Thread)->updateTotalReplies($reply->parent_id);\n\n\t\tredirect('/threads?id=' . $reply->parent_id . '#reply-id' . $reply->id);\n\t\n\t}", "function ppmess_shortcode_delete_communication_view(){\n\t\n\tglobal $post;\n\t$data = ppmess_shortcode_delete_commun();\n?>\n\t<h3><?php echo esc_html__( 'Delete communication', 'ppmess' ); ?></h3>\n\t\t\n<?php\n\tif( $data['error'] !== FALSE ):\t?>\n\t\t<!-- Error occurred -->\n\t\t<div class=\"ppmess-info-dark\">\n\t\t\t<?php echo esc_html__('Error occurred: ', 'ppmess');\t?>\n\t\t\t\t<a class=\"post-link-ppmess\" href=\"<?php echo esc_url(get_permalink($post)); ?>\"><?php echo __('Go Back', 'ppmess'); ?></a>\n\t\t\t\t<?php // echo $data['error']; \t?>\n\t\t</div>\n<?php \n\telse:\t?>\t\n\t\t<div id=\"ppmessDeleteCommun\">\n\t\t\t<div class=\"user-info-delete-commun\">\n\t\t\t\t<?php echo esc_html__('Communication bitween', 'ppmess'); ?>\n\t\t\t\t<span class=\"span-mark\" title=\"<?php echo esc_attr__('Info of the logged user', 'ppmess'); ?>\">\n\t\t\t\t\t<?php echo esc_html($data['logged_user']); ?>\n\t\t\t\t</span>\n\t\t\t\t<?php echo $data['logged_user_id'] == $data['post_author_id'] ? ' (' . esc_html__('author of the post', 'ppmess') . ') ' : '';\t?>\n\t\t\t\t&#x21d4;\n\t\t\t\t<span class=\"span-mark\" title=\"<?php echo esc_attr__('Info of the user 2', 'ppmess'); ?>\">\n\t\t\t\t\t<?php echo esc_html($data['user2_login_name']);\t?>\n\t\t\t\t</span>\n\t\t\t\t<?php echo $data['user2_id'] == $data['post_author_id'] ? ' (' . esc_html__('author of the post', 'ppmess') . ') ' : '';\n\t\t\t\t\t\techo esc_html__('refers to post:', 'ppmess'); ?>\n\t\t\t\t\t<a class=\"post-link-ppmess\" href=\"<?php echo esc_url( $data['post_url'] ); ?>\" title=\"<?php echo esc_attr( $data['post_title'] ); ?>\">\n\t\t\t\t\t\t<?php echo $data['post_title']; ?>\n\t\t\t\t\t</a>\n\t\t\t\t\t<strong><?php echo esc_html__('will be deleted !', 'ppmess'); ?></strong>\n\t\t\t\t\t<br/>\n\t\t\t\t\t<span class=\"colorMark-1\"><?php echo esc_html__('unread messages', 'ppmess') . '(' . $data['unread_messages'] . ')'; ?></span> \n\t\t\t</div>\n\t\t\t\n\t\t\t<?php\t$token_delete_commun = md5(SALT_DELETE_COMMUN_PPMESS . $data['message_id'] . $data['post_id'] . $data['logged_user_id']);\t?>\n\t\t\t\n\t\t\t<!--------------------- Delete communication --------------------->\n\t\t\t<div class=\"confirm-delete-commun\">\n\t\t\t\t<?php // Confirm delete\n\t\t\t\t\t$link = admin_url('admin-ajax.php?action=ppmess_delete_commun&confirm_delete=1&post_id=' . $data['post_id'] . '&message_id=' . $data['message_id'] . '&token_delete_commun=' . $token_delete_commun . '&go_back_url=' . get_permalink($post));\n\t\t\t\t\techo '<a class=\"ppmess-tag-a ppmess-delete-commun-confirm\" data-post_id=\"' . $data['post_id'] . '\" data-message_id=\"' . $data['message_id'] . '\" data-confirm_delete=\"1\" data-token_delete_commun=\"' . $token_delete_commun . '\" data-go_back_url=\"' . get_permalink($post) . '\" href=\"' . $link . '\">' . esc_html__('Confirm delete', 'ppmess') . '</a>';\n\t\t\t\t?>\n\t\t\t\t<!-- Cancel delete --->\n\t\t\t\t<a class=\"ppmess-tag-a ppmess-delete-commun-cancel\" style=\"font-size:0.83em;\" href=\"<?php echo esc_url(get_permalink($post)); ?>\"><?php echo esc_html__('Cancel', 'ppmess'); ?></a>\n\t\t\t</div>\n\t\t</div><!-- ppmessDeleteCommun -->\n<?php\t\n\tendif;\n}", "function soft_delete_topics()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->soft_delete['t']))\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'topic_deleted'\t\t\t=> $user->data['user_id'],\r\n\t\t\t\t'topic_deleted_time'\t=> time(),\r\n\t\t\t);\r\n\r\n\t\t\t$to_update = array();\r\n\t\t\tforeach ($this->soft_delete['t'] as $id)\r\n\t\t\t{\r\n\t\t\t\tif (array_key_exists($id, $this->shadow_topic_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$to_update[] = $this->shadow_topic_ids[$id];\r\n\t\t\t\t\t$this->topic_data[$this->shadow_topic_ids[$id]] = array_merge($this->topic_data[$this->shadow_topic_ids[$id]], $sql_data);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$to_update[] = $id;\r\n\t\t\t\t$this->topic_data[$id] = array_merge($this->topic_data[$id], $sql_data);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\t\tWHERE ' . $db->sql_in_set('topic_id', $to_update);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\tforeach ($to_update as $id)\r\n\t\t\t{\r\n\t\t\t\t// If the topic is a global announcement, do not attempt to do any updates to forums\r\n\t\t\t\tif ($this->topic_data[$id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\tSET forum_deleted_topic_count = forum_deleted_topic_count + 1\r\n\t\t\t\t\t\t\tWHERE forum_id = ' . intval($this->topic_data[$id]['forum_id']);\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t$this->forum_data[$this->topic_data[$id]['forum_id']]['forum_deleted_topic_count']++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->update_board_stats();\r\n\t\t$this->update_user_stats();\r\n\t}", "public function deleteMsg($msg_id) {\n //get proper msg id \n $msg_id_decoded = urldecode($msg_id);\n //delete msg from server who has that spesific ID\n $this->user_model->deleteThisMsg($msg_id_decoded);\n\n redirect('login/home', FALSE);\n }", "function removeFromForums()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete category assignments\r\n $db->query( \"DELETE FROM eZForum_ForumCategoryLink WHERE ForumID='$this->ID'\" );\r\n }", "function messageDeleteRaw(TextChannelInterface $channel, string $messageID);" ]
[ "0.6173243", "0.6110355", "0.60386443", "0.59335697", "0.5903056", "0.58861184", "0.5884807", "0.58078104", "0.5772329", "0.5745504", "0.5729409", "0.5707725", "0.5707725", "0.56719047", "0.56715876", "0.56681883", "0.5620603", "0.5610656", "0.5610656", "0.55762625", "0.5562848", "0.5558233", "0.55405766", "0.5528848", "0.5500197", "0.5483444", "0.5481147", "0.5469196", "0.5463032", "0.5462326", "0.5445704", "0.5440851", "0.5439744", "0.54259586", "0.5405005", "0.53924775", "0.5390526", "0.53886175", "0.53839505", "0.5379318", "0.53784", "0.53695095", "0.5339123", "0.53346497", "0.5320052", "0.5298125", "0.5296694", "0.5290559", "0.52884823", "0.5288207", "0.52878565", "0.5274562", "0.52727616", "0.5272488", "0.52699894", "0.5269901", "0.52582145", "0.5222991", "0.5222031", "0.5219979", "0.5205984", "0.51983094", "0.51920146", "0.51841456", "0.5181869", "0.5172051", "0.51620394", "0.5155353", "0.5154419", "0.5147108", "0.51434493", "0.5138536", "0.5138163", "0.51264364", "0.51105034", "0.5109758", "0.5108807", "0.5102644", "0.5091301", "0.50901383", "0.50869", "0.5084858", "0.50837934", "0.5073244", "0.50696665", "0.5068753", "0.5061382", "0.50608325", "0.5055338", "0.5055285", "0.50538975", "0.505335", "0.5052599", "0.5050559", "0.5041431", "0.5040126", "0.5037381", "0.502264", "0.5022584", "0.50165796" ]
0.5537144
23
Returns the excerpt of the reply. This is similar to `bbp_get_reply_excerpt()` except: Excerpt length is by number of words and not number of characters. Omits inclusion of any blockquoted text.
public function get_reply_excerpt( $reply_id = 0, $words = 15 ) { $reply_id = bbp_get_reply_id( $reply_id ); $excerpt = get_post_field( 'post_excerpt', $reply_id ); if ( ! $excerpt ) { $excerpt = bbp_get_reply_content( $reply_id ); } $excerpt = $this->trim_text( $excerpt, $words, 'words' ); return apply_filters( 'bbp_get_reply_excerpt', $excerpt, $reply_id, $words ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function excerpt()\n {\n if (!$this->desc()->empty()) {\n $excerpt = $this->desc();\n } else {\n $excerpt = excerpt($this->text(), $length = 40, $mode = 'words');\n };\n\n return $excerpt;\n }", "public function excerpt()\n\t{\n\t\treturn ( ! empty($this->excerpt))? $this->excerpt : truncate_word($this->content, 200);\n\t}", "public function excerpt() { return $this->post->post_excerpt; }", "public function getExcerpt()\n {\n return $this->excerpt = get_the_excerpt($this->id);\n }", "public function excerpt(): string\n {\n $excerpt = get_the_excerpt($this->wpPost);\n\n return $this->setAttribute(__METHOD__, $excerpt);\n }", "public function getExcerptAttribute()\n {\n $body = $this->description;\n $words = explode(\" \", $body);\n $words30 = array_slice($words,0,30);\n\n $excerpt = implode(' ', $words30);\n\n return strip_tags($excerpt);\n }", "public function getExcerpt(): string\n {\n return $this->_excerpt;\n }", "public function get_excerpt() {\n\t\tif ( $excerpt = $this->get_field( 'post_excerpt' ) ) {\n\t\t\treturn $excerpt;\n\t\t}\n\t}", "function cc_post_excerpt() {\n\tglobal $post;\n\n\t$excerpt = htmlentities(strip_tags($post->post_content));\n\t$excerpt_a = array_slice (explode(\" \", $excerpt), 0, 55);\n\techo implode(\" \", $excerpt_a) . \"...\";\n}", "private function getPostExcerpt()\n {\n global $post;\n\n // If this is not a page or a single post, it cannot have an excerpt and\n // so the method should return an empty string.\n if (!is_page() && !is_singular()) {\n return '';\n }\n\n // Attempt to get a manaul excerpt\n $excerpt = apply_filters('the_excerpt', $post->post_excerpt);\n\n // If there is no manual excerpt, use the main content instead\n if (!$excerpt) {\n $excerpt = apply_filters('the_content', $post->post_content);\n }\n\n // Return the excerpt, stripped of any HTML code\n return strip_tags($excerpt);\n }", "public function get_excerpt($number_of_characters = 140, $ellipsis = '...') {\n\t\treturn APPC_UTILITY::get_excerpt_from_text($this->get_content(), $number_of_characters, $ellipsis);\n\t}", "public function get_excerpt();", "public function getExcerptAttribute()\n {\n return str_limit(strip_tags($this->description), 140);\n }", "public function getExcerpt($maxLength = 255);", "public function getExcerpt($length = 12) {\n\t\tif ($this->excerpt) {\n\t\t\treturn elgg_get_excerpt($this->instructions, $length);\n\t\t} else {\n\t\t\treturn elgg_get_excerpt($this->instructions, $length);\n\t\t}\n\t}", "public static function excerpt_length() {\n\t\t\t$cpt = self::get_post_type();\n\n\t\t\tif ( $cpt && $cpt !== 'post' ) {\n\t\t\t\treturn self::option( 'post_excerpt_' . $cpt, 20 );\n\t\t\t}\n\n\t\t\treturn self::option( 'post_excerpt', 20 );\n\t\t}", "public function getExcerptAttribute()\n {\n $value = $this->getAttribute('content');\n $format = $this->attributes['format'];\n\n list($excerpt, ) = explode('<!--more-->', $value, 2);\n\n return StoryFormat::driver($format)->parse($excerpt);\n }", "public function getExcerpt(Block $post)\n {\n // TODO: replace by ability to set custom excerpt\n $excerpt = $postBody = $post->getBodyForInsertion();\n if (preg_match('/^.{1,260}\\b/s', $postBody, $match))\n {\n $excerpt = $match[0];\n }\n\n return $excerpt;\n }", "public function getNoteExcerptAttribute()\n {\n return $this->note ? (\n strlen($this->note) >= 30 ? substr($this->note,0, 30) . '...' : $this->note\n ): '';\n }", "public function getExcerpt()\r\n\t\t{\r\n\t\t\treturn $this->_excerpt;$this->_created_date;\r\n\t\t}", "public function excerpt($length)\n {\n return \\Str::limit(strip_tags($this->bodyHtml()), $length, '...');\n }", "function accouk_post_excerpt() {\n if(has_excerpt()) {\n the_excerpt();\n }\n}", "function hwp_get_excerpt( $excerpt_length = 55, $id = false, $echo = true ) {\n $text = '';\n\n if ( $id ) {\n $the_post = & get_post( $id );\n $text = ( $the_post->post_excerpt ) ? $the_post->post_excerpt : $the_post->post_content;\n } else {\n global $post;\n $text = ( $post->post_excerpt ) ? $post->post_excerpt : get_the_content( '' );\n }\n\n $text = strip_shortcodes( $text );\n $text = apply_filters( 'the_content', $text );\n $text = str_replace( ']]>', ']]&gt;', $text );\n $text = strip_tags( $text );\n\n $excerpt_more = ' ' . '...';\n $words = preg_split( \"/[\\n\\r\\t ]+/\", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY );\n\n if ( count( $words ) > $excerpt_length ) {\n array_pop( $words );\n $text = implode( ' ', $words );\n $text = $text . $excerpt_more;\n } else {\n $text = implode( ' ', $words );\n }\n\n if ( $echo ) {\n echo apply_filters( 'the_content', $text );\n } else {\n return $text;\n }\n}", "function lucasato_get_the_excerpt($post_id)\n{\n $output = get_the_excerpt($post_id);\n return $output;\n}", "private function retrieve_excerpt() {\n\t\t$replacement = null;\n\n\t\t// The check `post_password_required` is because excerpt must be hidden for a post with a password.\n\t\tif ( ! empty( $this->args->ID ) && ! post_password_required( $this->args->ID ) ) {\n\t\t\tif ( $this->args->post_excerpt !== '' ) {\n\t\t\t\t$replacement = wp_strip_all_tags( $this->args->post_excerpt );\n\t\t\t}\n\t\t\telseif ( $this->args->post_content !== '' ) {\n\t\t\t\t$replacement = wp_html_excerpt( strip_shortcodes( $this->args->post_content ), 156 );\n\t\t\t\t// Trim the auto-generated string to a word boundary.\n\t\t\t\t$replacement = substr( $replacement, 0, strrpos( $replacement, ' ' ) );\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}", "function block_core_latest_posts_get_excerpt_length()\n {\n }", "public function excerpt($length = 300);", "public function getExcerpt($nb = NULL)\n {\n if ($this->getResume() != NULL) return $this->getResume();\n \n $text = $this->getTexte();\n $excerpt = substr($text, 0, $nb);\n $excerpt = substr($excerpt, 0, strrpos($excerpt, \" \"));\n $etc = \"...\";\n $excerpt = $excerpt.$etc;\n return $excerpt;\n }", "function jwp_post_excerpt() {\n return JWP_Post_Excerpt::get_instance();\n}", "function getTheExcerpt($post){\n\t$postfile = file_get_contents($post);\n\t$fullpost = getBetween('<div class=\"content\">',\"&nbsp;</div>\",$postfile);\n\t$postExcerpt = trimText($fullpost,750);\n\t$postExcerpt = stripslashes($postExcerpt);\n\treturn $postExcerpt;\n}", "private function retrieve_excerpt_only() {\n\t\t$replacement = null;\n\n\t\t// The check `post_password_required` is because excerpt must be hidden for a post with a password.\n\t\tif ( ! empty( $this->args->ID ) && $this->args->post_excerpt !== '' && ! post_password_required( $this->args->ID ) ) {\n\t\t\t$replacement = wp_strip_all_tags( $this->args->post_excerpt );\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function get_the_excerpt( $excerpt, $_post ) {\n\t\tglobal $post;\n\n\t\tif ( false !== strpos( get_post_type( $_post->ID ), 'tribe_' ) && is_archive() && ! empty( $post->ID ) && $post->ID === $_post->ID ) {\n\t\t\treturn fusion_get_post_content( $post->ID, 'yes', apply_filters( 'excerpt_length', 55 ), true );\n\t\t}\n\n\t\treturn $excerpt;\n\t}", "function get_my_excerpt(){\n\t$text = get_the_content();\n\t$text = strip_shortcodes($text);\n\t$text = apply_filters('the_content', $text);\n\t$text = strip_tags($text);\n\t$excerpt_length = 30; // set the number of words here\n\t$excerpt_more = '...';\n\t$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );\n\treturn $text;\n}", "public function excerpt($length = 600): string\n {\n return str_limit(strip_tags($this->description), $length);\n }", "function postExcerpt($content) {\n\t\t$clean = strip_tags($content);\n\t\tif (strlen($clean) > 120){\n\t\t\t$excerpt = substr($clean, 0, strpos($clean, ' ', 120));\n\t\t\tprint $excerpt . ' ...';\n\t\t}\n\t}", "function get_post_excerpt($entity)\n {\n return '';\n }", "public function get_the_excerpt( $post, $excerpt_max_len = null, $desc_min_length = null ) {\n\n\t\tif ( ! is_object( $post ) || ! is_a( $post, 'WP_Post' ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif ( ! empty( $post->post_excerpt ) ) {\n\t\t\t$post_excerpt = $post->post_excerpt;\n\t\t} else {\n\t\t\t$excerpt_max_len = ( $excerpt_max_len ) ? (int) $excerpt_max_len : $this->excerpt_max_length;\n\t\t\t$desc_min_length = ( $desc_min_length ) ? (int) $desc_min_length : $this->excerpt_min_length;\n\n\t\t\t$post_content = wp_strip_all_tags( strip_shortcodes( $post->post_content ) );\n\t\t\t$post_excerpt = substr( $post_content, 0, $excerpt_max_len );\n\n\t\t\t$excerpt_period_position = strrpos( $post_excerpt, '.' );\n\t\t\tif ( $excerpt_period_position ) {\n\t\t\t\t$excerpt_ending_on_period = substr( $post_excerpt, 0, $excerpt_period_position + 1 );\n\n\t\t\t\t// If the description would be too small, then use an ellipsis.\n\t\t\t\tif ( strlen( $excerpt_ending_on_period ) < $desc_min_length ) {\n\t\t\t\t\t$post_excerpt .= '&hellip;';\n\t\t\t\t} else {\n\t\t\t\t\t$post_excerpt = $excerpt_ending_on_period;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post_excerpt .= '&hellip;';\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Filter the excerpt as derived by this function.\n\t\t *\n\t\t * @param string $post_excerpt The derived excerpt.\n\t\t * @param WP_Post object $posts[0] The post object being considered.\n\t\t */\n\t\treturn apply_filters( 'amt_get_the_excerpt', $post_excerpt, $post );\n\t}", "public static function getExcerptFromPostID( $postID, $excerptLength = 35, $withP = false )\n\t\t{\n\n\t\t\t$postObject = get_post( $postID );\n\n\t\t\t// Gets post_content to be used as a basis for the excerpt\n\t\t\t$excerpt = $postObject->post_content;\n\t\t\t\n\t\t\t// Strips tags and images\n\t\t\t$excerpt = strip_tags( strip_shortcodes( $excerpt ) );\n\t\t\t$words = explode( ' ', $excerpt, $excerptLength + 1 );\n\n\t\t\tif( count( $words ) > $excerptLength ) :\n\n\t\t\t\tarray_pop( $words );\n\t\t\t\tarray_push( $words, '…' );\n\t\t\t\t$excerpt = implode( ' ', $words );\n\n\t\t\tendif;\n\n\t\t\tif( $withP ){\n\t\t\t\t$excerpt = '<p>' . $excerpt . '</p>';\n\t\t\t}\n\n\t\t\treturn $excerpt;\n\n\t\t}", "protected function getExcerpt($content)\n {\n // Check for excerpt tags\n $pattern = '#(\\<\\!\\-\\-\\s?excerpt\\s?\\-\\-\\>)(.*)(\\<\\!\\-\\-\\s?endexcerpt\\s?\\-\\-\\>)#si';\n if (preg_match($pattern, $content, $matches)) {\n return $matches[2];\n }\n\n // If all else get the content from the first paragraph\n return $this->description;\n }", "function t_excerpt_length(){\n\t// sets the amount of characters an excerpt contains\n\treturn 50;\n}", "function rw_custom_excerpt_more( $output )\n{\n if( has_excerpt() && !is_attachment() )\n {\n $output .= rw_continue_reading_link();\n }\n return $output;\n}", "public static function getExcerpt(\n string $str,\n int $startPos = 0,\n int $maxLength = 100\n ): string {\n $excerpt = $str;\n $str = str_replace('&nbsp;', ' ', $str);\n if (strlen($str) > $maxLength) {\n $excerpt = substr($str, $startPos, $maxLength - 3);\n $lastSpace = strrpos($excerpt, ' ');\n $excerpt = substr($excerpt, 0, (int)$lastSpace);\n $excerpt .= '...';\n }\n\n return $excerpt;\n }", "function excerpt($limit) {\n $excerpt = explode(' ', get_the_excerpt(), $limit);\n if (count($excerpt)>=$limit) {\n array_pop($excerpt);\n $excerpt = implode(\" \",$excerpt).'...';\n } else {\n $excerpt = implode(\" \",$excerpt);\n }\t\n $excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n return $excerpt;\n}", "function wp_html_excerpt($str, $count, $more = \\null)\n {\n }", "function excerpt($limit) {\n $excerpt = explode(' ', get_the_excerpt(), $limit);\n if (count($excerpt)>=$limit) {\n array_pop($excerpt);\n $excerpt = implode(\" \",$excerpt).'...';\n } else {\n $excerpt = implode(\" \",$excerpt);\n }\n $excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n return $excerpt;\n}", "function voyage_mikado_excerpt($excerpt_length = '') {\n global $post;\n\n if(post_password_required()) {\n echo get_the_password_form();\n } //does current post has read more tag set?\n elseif(voyage_mikado_post_has_read_more()) {\n global $more;\n\n //override global $more variable so this can be used in blog templates\n $more = 0;\n the_content(true);\n } //is word count set to something different that 0?\n elseif($excerpt_length != '0') {\n //if word count is set and different than empty take that value, else that general option from theme options\n $word_count = '45';\n if(isset($excerpt_length) && $excerpt_length != \"\") {\n $word_count = $excerpt_length;\n\n } elseif(voyage_mikado_options()->getOptionValue('number_of_chars') != '') {\n $word_count = esc_attr(voyage_mikado_options()->getOptionValue('number_of_chars'));\n }\n //if post excerpt field is filled take that as post excerpt, else that content of the post\n $post_excerpt = $post->post_excerpt != \"\" ? $post->post_excerpt : strip_tags($post->post_content);\n\n //remove leading dots if those exists\n $clean_excerpt = strlen($post_excerpt) && strpos($post_excerpt, '...') ? strstr($post_excerpt, '...', true) : $post_excerpt;\n\n //if clean excerpt has text left\n if($clean_excerpt !== '') {\n //explode current excerpt to words\n $excerpt_word_array = explode(' ', $clean_excerpt);\n\n //cut down that array based on the number of the words option\n $excerpt_word_array = array_slice($excerpt_word_array, 0, $word_count);\n\n //add exerpt postfix\n $excert_postfix = apply_filters('voyage_mikado_excerpt_postfix', '...');\n\n //and finally implode words together\n $excerpt = implode(' ', $excerpt_word_array).$excert_postfix;\n\n //is excerpt different than empty string?\n if($excerpt !== '') {\n echo '<p class=\"mkdf-post-excerpt\">'.wp_kses_post($excerpt).'</p>';\n }\n }\n }\n }", "function excerpt($limit) {\n $excerpt = explode(' ', get_the_excerpt(), $limit);\n if (count($excerpt)>=$limit) {\n array_pop($excerpt);\n $excerpt = implode(\" \",$excerpt);\n } else {\n $excerpt = implode(\" \",$excerpt);\n } \n $excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n return $excerpt;\n}", "function excerpt($limit) {\n $excerpt = explode(' ', get_the_excerpt(), $limit);\n if (count($excerpt)>=$limit) {\n array_pop($excerpt);\n $excerpt = implode(\" \",$excerpt).'....';\n } else {\n $excerpt = implode(\" \",$excerpt);\n } \n $excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n return $excerpt;\n}", "function excerpt($limit) {\n $excerpt = explode(' ', get_the_excerpt(), $limit);\n if (count($excerpt)>=$limit) {\n array_pop($excerpt);\n $excerpt = implode(\" \",$excerpt).'....';\n } else {\n $excerpt = implode(\" \",$excerpt);\n } \n $excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n return $excerpt;\n}", "function excerpt($limit) {\n\t$excerpt = explode(' ', get_the_excerpt(), $limit);\n\tif (count($excerpt)>=$limit) {\n\t\tarray_pop($excerpt);\n\t\t$excerpt = implode(\" \",$excerpt).'...';\n\t} else {\n\t\t$excerpt = implode(\" \",$excerpt);\n\t}\n\t$excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n\treturn $excerpt;\n}", "function get_excerpt($cut_excerpt_default = '') {\r\n if ($this->post->post_excerpt != '') {\r\n return $this->post->post_excerpt;\r\n }\r\n\r\n\r\n $buffy = '';\r\n if ($cut_excerpt_default != '') {\r\n $db_content_excerpt = td_util::get_option(get_class($this) . '_content_excerpt');\r\n\r\n if ($db_content_excerpt != '') {\r\n //cut from the database settings\r\n $buffy .= td_util::excerpt($this->post->post_content, $db_content_excerpt);\r\n } else {\r\n //cut at the default size\r\n $buffy .= td_util::excerpt($this->post->post_content, $cut_excerpt_default);\r\n }\r\n } else {\r\n $buffy .= $this->post->post_content;\r\n }\r\n\r\n return $buffy;\r\n }", "function launchpad_excerpt($max_words = 32, $echo = false, $id = false) {\n\tglobal $post;\n\t\n\t$tmp_post = false;\n\t\n\t// If an ID was passed, get the individual post.\n\tif($id !== false && (int) $id) {\n\t\t$tmp_post = get_post((int) $id);\n\t}\n\t\n\t// If there was no post based on the ID, use the global $post.\n\tif(!$tmp_post) {\n\t\t$tmp_post = $post;\n\t}\n\t\n\t// Normalize the max words.\n\t$max_words = (int) $max_words;\n\t\n\t// If the user made an excerpt, use it.\n\tif($tmp_post->post_excerpt) {\n\t\t$excerpt = $tmp_post->post_excerpt;\n\t\n\t// If the user added a more tag, use that content.\n\t} else if(stristr($tmp_post->post_content, '<!--more-->') !== false) {\n\t\t$excerpt = explode('<!--more-->', $tmp_post->post_content);\n\t\t$excerpt = array_shift($excerpt);\n\t\t$excerpt = strip_tags(apply_filters('the_content', $excerpt));\n\t\n\t// If all else fails, generate an excerpt based on the max words.\n\t} else {\n\t\t$content = $tmp_post->post_content;\n\t\t$content = trim(preg_replace('/\\s+/', ' ', strip_tags(apply_filters('the_content', $content))));\n\t\t$excerpt = explode(' ', $content);\n\t\t$excerpt = array_slice($excerpt, 0, $max_words);\n\t\t$excerpt = implode(' ', $excerpt);\n\t\tif(preg_match('/[A-Za-z0-9]/', substr($excerpt, -1))) {\n\t\t\t$excerpt .= '...';\n\t\t}\n\t}\n\t\n\t// Apply filters to allow the developer to change it.\n\t$excerpt = apply_filters('launchpad_excerpt', $excerpt);\n\t//$excerpt = htmlentities($excerpt, ENT_QUOTES);\n\t\n\tif($echo) {\n\t\techo $excerpt;\n\t}\n\treturn trim($excerpt);\n}", "function the_excerpt()\n {\n }", "function excerpt($limit) {\n\t$excerpt = explode(' ', get_the_excerpt(), $limit);\n\tif (count($excerpt)>=$limit) {\n\t\tarray_pop($excerpt);\n\t\t$excerpt = implode(\" \",$excerpt).'...';\n\t} else {\n\t\t$excerpt = implode(\" \",$excerpt);\n\t} \n\t$excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n\treturn $excerpt;\n}", "function rls_text_excerpt($length) {\n return 25;\n}", "function improved_trim_excerpt($text) { // Fakes an excerpt if needed\n global $post;\n if ( '' == $text ) {\n $text = get_the_content('');\n $text = apply_filters('the_content', $text);\n \n\t$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);\n\t$text = preg_replace('@<style[^>]*?>.*?</style>@si', '', $text);\n\t$text = preg_replace('@<p class=\"wp-caption-text\"[^>]*?>.*?</p>@si', '', $text);\t\n $text = str_replace('\\]\\]\\>', ']]&gt;', $text);\n $text = strip_tags($text, '<p><i><em><b><a><strong>');\n $excerpt_length = 140;\n $words = explode(' ', $text, $excerpt_length + 1);\n if (count($words)> $excerpt_length) {\n array_pop($words);\n array_push($words, '... <a href=\"'.get_permalink($post->ID).'\">'.'Read More &raquo;'.'</a>');\n $text = implode(' ', $words);\n }\n }\nreturn $text;\n}", "function make_excerpt($excerpt, $length = 200)\n{\n $excerpt = trim(preg_replace('/\\r\\n|\\r|\\n+/', ' ', strip_tags($excerpt)));\n return str_limit($excerpt, $length);\n}", "function get_comment_excerpt($comment_id = 0)\n {\n }", "public function excerptProvider()\n {\n return [[\"a string\"]];\n }", "function ridizain_ephemera_excerpt () {\r\n\t$theContent = trim(strip_tags(get_the_content()));\r\n\t\t$output = str_replace( '\"', '', $theContent);\r\n\t\t$output = str_replace( '\\r\\n', ' ', $output);\r\n\t\t$output = str_replace( '\\n', ' ', $output);\r\n\t\t\t$limit = '15';\r\n\t\t\t$content = explode(' ', $output, $limit);\r\n\t\t\tarray_pop($content);\r\n\t\t$content = implode(\" \",$content).\" \";\r\n\treturn strip_tags($content, ' ');\r\n}", "function excerpt($limit) {\n $excerpt = explode(' ', get_the_excerpt(), $limit);\n if (count($excerpt)>=$limit) {\n array_pop($excerpt);\n $excerpt = implode(\" \",$excerpt).'...';\n } else {\n $excerpt = implode(\" \",$excerpt);\n } \n $excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n return $excerpt;\n }", "function excerpt($string){\r\n\t$string= substr($string, 0, 10);\r\n\treturn $string . \"...\";\r\n}", "function ridizain_recentpost_excerpt () {\r\n\t$theContent = trim(strip_tags(get_the_content()));\r\n\t\t$output = str_replace( '\"', '', $theContent);\r\n\t\t$output = str_replace( '\\r\\n', ' ', $output);\r\n\t\t$output = str_replace( '\\n', ' ', $output);\r\n\t\t\tif (get_theme_mod( 'ridizain_recentpost_excerpt_length' )) :\r\n\t\t\t$limit = get_theme_mod( 'ridizain_recentpost_excerpt_length' );\r\n\t\t\telse : \r\n\t\t\t$limit = '15';\r\n\t\t\tendif;\r\n\t\t\t$content = explode(' ', $output, $limit);\r\n\t\t\tarray_pop($content);\r\n\t\t$content = implode(\" \",$content).\" \";\r\n\treturn strip_tags($content, ' ');\r\n}", "function excerpt($num) {\n$limit = $num+1;\n$excerpt = explode(' ', get_the_excerpt(), $limit);\narray_pop($excerpt);\n$excerpt = implode(\" \",$excerpt).\" <a href='\" .get_permalink($post->ID) .\" ' class='\".readmore.\"'>READ THIS</a>\";\necho $excerpt;\n}", "function dynamic_excerpt($length) { // Variable excerpt length. Length is set in characters\n\t global $post;\n\t $text = $post->post_excerpt;\n\t if ( '' == $text ) {\n\t $text = get_the_content('');\n\t $text = apply_filters('the_content', $text);\n\t $text = str_replace(']]>', ']]>', $text);\n\t }\n\t $text = strip_shortcodes($text); // optional, recommended\n\t $text = strip_tags($text); // use ' $text = strip_tags($text,'<p><a>'); ' if you want to keep some tags\n\t $text = mb_substr($text,0,$length).'';\n\t echo $text;\n\t}", "function excerpt($limit) {\n\t $excerpt = explode(' ', get_the_excerpt(), $limit);\n\t if (count($excerpt)>=$limit) {\n\t array_pop($excerpt);\n\t $excerpt = implode(\" \",$excerpt).'...';\n\t } else {\n\t $excerpt = implode(\" \",$excerpt);\n\t } \n\t $excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n\t return $excerpt;\n\t}", "function sm_modern_post_excerpt_length () {\n\treturn 20;\n}", "function medigroup_mikado_excerpt($excerpt_length = '') {\n global $post;\n\n if(post_password_required()) {\n echo get_the_password_form();\n } //does current post has read more tag set?\n elseif(medigroup_mikado_post_has_read_more()) {\n global $more;\n\n //override global $more variable so this can be used in blog templates\n $more = 0;\n the_content(true);\n } //is word count set to something different that 0?\n elseif($excerpt_length != '0') {\n //if word count is set and different than empty take that value, else that general option from theme options\n $word_count = '45';\n if(isset($excerpt_length) && $excerpt_length != \"\") {\n $word_count = $excerpt_length;\n\n } elseif(medigroup_mikado_options()->getOptionValue('number_of_chars') != '') {\n $word_count = esc_attr(medigroup_mikado_options()->getOptionValue('number_of_chars'));\n }\n //if post excerpt field is filled take that as post excerpt, else that content of the post\n $post_excerpt = $post->post_excerpt != \"\" ? $post->post_excerpt : strip_tags($post->post_content);\n\n //remove leading dots if those exists\n $clean_excerpt = strlen($post_excerpt) && strpos($post_excerpt, '...') ? strstr($post_excerpt, '...', true) : $post_excerpt;\n\n //if clean excerpt has text left\n if($clean_excerpt !== '') {\n //explode current excerpt to words\n $excerpt_word_array = explode(' ', $clean_excerpt);\n\n //cut down that array based on the number of the words option\n $excerpt_word_array = array_slice($excerpt_word_array, 0, $word_count);\n\n //add exerpt postfix\n $excert_postfix = apply_filters('medigroup_mikado_excerpt_postfix', '...');\n\n //and finally implode words together\n $excerpt = implode(' ', $excerpt_word_array).$excert_postfix;\n\n //is excerpt different than empty string?\n if($excerpt !== '') {\n echo '<p class=\"mkd-post-excerpt\">'.wp_kses_post($excerpt).'</p>';\n }\n }\n }\n }", "function echotheme_custom_excerpt_more($output) {\n\tif (has_excerpt() && ! is_attachment()) {\n\t\t$output .= echotheme_continue_reading_link();\n\t}\n\treturn $output;\n}", "function excerpt($num) {\n$limit = $num+1;\n$excerpt = explode(' ', get_the_excerpt(), $limit);\narray_pop($excerpt);\n$excerpt = implode(\" \",$excerpt).\" <a href='\" .get_permalink($post->ID) .\" ' class='\".readmore.\"'>Read More</a>\";\necho $excerpt;\n}", "public static function excerpt_read_more( $more ) {\n global $post;\n // Defining the $output (read more link)\n $output = '...<br><p><a class=\"read-more more-link\" href=\"'. get_permalink( $post->ID ) . '\"> Read More</a></p>';\n // Returning the $output\n return $output;\n }", "function octavo_trim_excerpt($return = '') {\n\t\n\t# Use `1` to finish sentence, otherwise use `0`.\n\t$finish_sentence = 1;\n\t# Tags to allow in the excerpt:\n\t$allowed_tags = '<a><strong><b><em><i>';\n\t\n\tif ($return == '') {\n\t\t\n\t\t# Setup text:\n\t\t$text = $return;\n\t\t# Get the full content:\n\t\t$text = get_the_content('');\n\t\t# Delete all shortcode tags from the content:\n\t\t$text = strip_shortcodes($text);\n\t\t# Filter it:\n\t\t$text = apply_filters('the_content', $text);\n\t\t# From the default wp_trim_excerpt():\n\t\t$text = str_replace(']]>', ']]&gt;', $text); // Some kind of precaution against malformed CDATA in RSS feeds I suppose.\n\t\t# Remove script tags:\n\t\t$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);\n\t\t# Allowed tags?\n\t\t$text = strip_tags($text, $allowed_tags);\n\t\t\n\t\t# Word length (depends on setting above).\n\t\t$excerpt_length = apply_filters('excerpt_length', 55); // Defaults to `55` words.\n\t\t\n\t\t# Divide the string into tokens; HTML tags, or words, followed by any whitespace:\n\t\t$tokens = array();\n\t\tpreg_match_all('/(<[^>]+>|[^<>\\s]+)\\s*/u', $text, $tokens);\n\t\t\n\t\t# Itterate over word tokens:\n\t\t$word = 0;\n\t\tforeach ($tokens[0] as $token) {\n\t\t\t\n\t\t\t# Parse each token:\n\t\t\tif (($word >= $excerpt_length) && ( ! $finish_sentence)) {\n\t\t\t\t\n\t\t\t\t# Limit reached:\n\t\t\t\tbreak; // Quit the loop.\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t# Is token a tag?\n\t\t\tif ($token[0] != '<') {\n\t\t\t\t\n\t\t\t\t# Check for the end of the sentence: '.', '?' or '!':\n\t\t\t\tif (($word >= $excerpt_length) && $finish_sentence && (preg_match('/[\\?\\.\\!]\\s*$/uS', $token) == 1)) {\n\t\t\t\t\t\n\t\t\t\t\t# Limit reached!\n\t\t\t\t\t$return .= trim($token); // Continue until '?' '.' or '!' occur to reach the end of the sentence.\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t# Add `1` to $word:\n\t\t\t\t$word++;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t# Append what's left of the token:\n\t\t\t$return .= $token;\n\t\t\t\n\t\t}\n\t\t\n\t\t# Add the excerpt suffix:\n\t\t$return .= apply_filters('excerpt_more', ' &hellip;');\n\t\t\n\t\t# Balances tags:\n\t\t$return = force_balance_tags($return);\n\t\t\n\t\t# Trim:\n\t\t$return = trim($return);\n\t\t\n\t}\n\t\n\t# Return the excerpt:\n\treturn $return;\n\t\n}", "function excerpt($limit) {\n\t\t$excerpt = explode(' ', get_the_excerpt(), $limit);\n\t\tif (count($excerpt)>=$limit) {\n\t\t\tarray_pop($excerpt);\n\t\t\t$excerpt = implode(\" \",$excerpt).'...';\n\t\t}\n\t\telse {\n\t\t\t$excerpt = implode(\" \",$excerpt);\n\t\t}\n\t\t$excerpt = preg_replace('`[[^]]*]`','',$excerpt);\n\t\treturn $excerpt;\n\t}", "function tptn_excerpt($content,$excerpt_length){\r\n\t$out = strip_tags($content);\r\n\t$blah = explode(' ',$out);\r\n\tif (!$excerpt_length) $excerpt_length = 10;\r\n\tif(count($blah) > $excerpt_length){\r\n\t\t$k = $excerpt_length;\r\n\t\t$use_dotdotdot = 1;\r\n\t}else{\r\n\t\t$k = count($blah);\r\n\t\t$use_dotdotdot = 0;\r\n\t}\r\n\t$excerpt = '';\r\n\tfor($i=0; $i<$k; $i++){\r\n\t\t$excerpt .= $blah[$i].' ';\r\n\t}\r\n\t$excerpt .= ($use_dotdotdot) ? '...' : '';\r\n\t$out = $excerpt;\r\n\treturn $out;\r\n}", "function wpdocs_custom_excerpt_length( $length ) {\n return 25;\n}", "function wpdocs_custom_excerpt_length( $length ) {\n return 25;\n}", "function my_excerpt($limit) {\n $excerpt = explode(' ', get_the_excerpt(), $limit);\n if (count($excerpt)>=$limit) {\n\tarray_pop($excerpt);\n\t$excerpt = implode(\" \",$excerpt).'...';\n } else {\n\t$excerpt = implode(\" \",$excerpt);\n } \n $excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n return $excerpt;\n}", "function get_character_limited_excerpt(){\n$permalink = get_permalink($post->ID);\n$excerpt = get_the_content();\n$excerpt = preg_replace(\" (\\[.*?\\])\",'',$excerpt);\n$excerpt = strip_shortcodes($excerpt);\n$excerpt = strip_tags($excerpt);\n$excerpt = substr($excerpt, 0, 150);\n$excerpt = substr($excerpt, 0, strripos($excerpt, \" \"));\n$excerpt = trim(preg_replace( '/\\s+/', ' ', $excerpt));\n$excerpt = $excerpt.'... <a href=\"'.$permalink.'\">Read More</a>';\nreturn $excerpt;\n}", "function excerpt($limit)\n{\n\t$excerpt = explode(' ', do_shortcode(get_the_content()), $limit);\n\n\tif (count($excerpt)>=$limit)\n\t{\n\t\tarray_pop($excerpt);\n\t\t$excerpt = implode(\" \",$excerpt).'...';\n\t}\n\telse\n\t{\n\t\t$excerpt = implode(\" \",$excerpt);\n\t}\n\t\t$excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n\t\treturn $excerpt;\n}", "function wpdocs_custom_excerpt_length( $length ) {\n return 15;\n}", "function wpdocs_custom_excerpt_length( $length ) {\n return 1000;\n}", "function wp_article_excerpt($text, $phrase, $radius = 100, $ellipsis = '...') {\r\n\tif (empty($text) || empty($phrase)) {\r\n\t\treturn wp_article_truncate($text, $radius * 2, array('ellipsis' => $ellipsis));\r\n\t}\r\n\r\n\t$append = $prepend = $ellipsis;\r\n\r\n\t$phraseLen = mb_strlen($phrase);\r\n\t$textLen = mb_strlen($text);\r\n\r\n\t$pos = mb_strpos(mb_strtolower($text), mb_strtolower($phrase));\r\n\tif ($pos === false) {\r\n\t\treturn mb_substr($text, 0, $radius) . $ellipsis;\r\n\t}\r\n\r\n\t$startPos = $pos - $radius;\r\n\tif ($startPos <= 0) {\r\n\t\t$startPos = 0;\r\n\t\t$prepend = '';\r\n\t}\r\n\r\n\t$endPos = $pos + $phraseLen + $radius;\r\n\tif ($endPos >= $textLen) {\r\n\t\t$endPos = $textLen;\r\n\t\t$append = '';\r\n\t}\r\n\r\n\t$excerpt = mb_substr($text, $startPos, $endPos - $startPos);\r\n\t$excerpt = $prepend . $excerpt . $append;\r\n\r\n\treturn $excerpt;\r\n}", "private function excerptClass($post) {\n\t\tif($this->excerpt == FALSE)\n\t\t\treturn $post;\n\t\telseif(is_string($this->excerpt))\n\t\t{\n\t\t\t$post->{$this->contentField} = $post->{$this->excerpt};\n\t\t}\n\t\telseif(is_int($this->excerpt))\n\t\t{\n\t\t\t$content = strip_tags($post->{$this->contentField});\n\t\t\tif(strlen($content)>$this->excerpt)\n\t\t\t\t$content = substr($content, 0, ($this->excerpt-1)).\"&hellip;\";\n\t\t\t$post->{$this->contentField} = $content;\n\t\t}\n\t\treturn $post;\n\t}", "function the_excerpt_dynamic($length) { // Outputs an excerpt of variable length (in characters)\n\tglobal $post;\n\t$text = $post->post_exerpt;\n\tif ( '' == $text ) {\n\t\t$text = get_the_content('');\n\t\t$text = apply_filters('the_content', $text);\n\t\t$text = str_replace(']]>', ']]>', $text);\n\t}\n\t\t$text = strip_shortcodes( $text ); // optional, recommended\n\t\t$text = strip_tags($text); // use ' $text = strip_tags($text,'<p><a>'); ' to keep some formats; optional\n\n\t\t$output = strlen($text);\n\t\tif($output <= $length ) {\n\t\t\t$text = substr($text,0,$length).'';\n\t\t}else {\n\t\t\t$text = substr($text,0,$length).'...';\n\t\t}\n\n\techo apply_filters('the_excerpt',$text);\n}", "function d4tw_excerpt_length( $length ) {\n return 20;\n}", "function mithpress_custom_excerpt_more( $output ) {\n\tif ( has_excerpt() && ! is_attachment() ) {\n\t\t$output .= mithpress_continue_reading_link();\n\t}\n\treturn $output;\n}", "function wpdocs_custom_excerpt_length( $length ) {\n return 8;\n}", "function neu_excerpt($num) {\n\t$limit = $num+1;\n\tif( get_the_excerpt() ){\n\t\t$excerpt = get_the_excerpt();\n\t}else{\n\t\t//no hay extracto es un postevento\n\t\t$excerpt = get_field('descripcion_postevento');\n\t}\n\t$excerpt = explode(' ', $excerpt, $limit);\n\tarray_pop($excerpt);\n\t$excerpt = implode(\" \",$excerpt).\" [...]\"; \n\techo $excerpt;\n}", "function wpdocs_custom_excerpt_length( $length ) {\r\n return 20;\r\n}", "protected function prepare_excerpt_response($excerpt, $post)\n {\n }", "function excerpt_size($legth = 150) {\r\n global $post;\r\n return substr(strip_tags($post->post_content), 0, $legth).'...';\r\n}", "function the_excerpt_limit($limit) {\n $excerpt = explode(' ', get_the_excerpt(), $limit);\n if (count($excerpt)>=$limit) {\n array_pop($excerpt);\n $excerpt = implode(\" \",$excerpt).'...';\n } else {\n $excerpt = implode(\" \",$excerpt);\n }\n $excerpt = preg_replace('`\\[[^\\]]*\\]`','',$excerpt);\n echo $excerpt;\n}", "function staff_bio_excerpt($text, $excerpt_length) {\n\t\t\tglobal $post;\n\t\t\tif (!$excerpt_length || !is_int($excerpt_length))$excerpt_length = 20;\n\t\t\tif ( '' != $text ) {\n\t\t\t\t$text = strip_shortcodes( $text );\n\t\t\t\t$text = apply_filters('the_content', $text);\n\t\t\t\t$text = str_replace(']]>', ']]>', $text);\n\t\t\t\t$excerpt_more = \" ...\";\n\t\t\t\t$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );\n\t\t\t}\n\t\t\treturn apply_filters('the_excerpt', $text);\n\t\t}", "public function getExcerpts()\n {\n return $this->hasMany(Excerpt::className(), ['book_id' => 'id']);\n }", "function rf_excerpt($content, $length)\n{\n $text = strip_shortcodes( $content );\n\n /** This filter is documented in wp-includes/post-template.php */\n $text = apply_filters( 'the_content', $text );\n $text = str_replace(']]>', ']]&gt;', $text);\n\n return wp_trim_words( $text, $length );\n}", "function get_the_excerpt($post = \\null)\n {\n }", "function custom_excerpt_length( $length ) {\nreturn 20;\n}", "function superfood_elated_woocommerce_excerpt_html_part($class_name = '', $excerpt_length = 0) {\n\t\t\n\t\t$excerpt = ($excerpt_length > 0) ? substr(get_the_excerpt(), 0, intval($excerpt_length)) : get_the_excerpt();\n\t\t\n\t\t$html = '<p itemprop=\"description\" class=\"eltdf-'.esc_attr($class_name).'-excerpt\">'.esc_html($excerpt).'</p>';\n\t\t\n\t\treturn $html;\n\t}", "function monaco_child_get_the_excerpt($content) {\n global $post;\n $link = '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> ' . __('[Read the full article...]', 'patrick') . '</a>';\n return preg_replace('/\\[.*\\]$/', '', $content) . $link;\n}", "function wpdocs_custom_excerpt_length( $length ) {\n return 150;\n}" ]
[ "0.76515836", "0.7562194", "0.7428226", "0.73379225", "0.7081189", "0.6987638", "0.69305927", "0.6787165", "0.67100835", "0.66077137", "0.65599805", "0.65590245", "0.65588135", "0.6514126", "0.6487091", "0.6386918", "0.6380975", "0.6323266", "0.63138306", "0.62950516", "0.62567276", "0.6212596", "0.62072784", "0.62025887", "0.6199743", "0.6163324", "0.6144665", "0.6142979", "0.61036557", "0.61014646", "0.60961795", "0.6043276", "0.60122997", "0.6008025", "0.594886", "0.59449565", "0.59211445", "0.5920926", "0.59142965", "0.59138036", "0.591378", "0.59114367", "0.5894297", "0.5891766", "0.58895075", "0.58893836", "0.58841777", "0.588166", "0.588166", "0.5876682", "0.5875962", "0.5874768", "0.58706707", "0.58631617", "0.586266", "0.5851962", "0.5838648", "0.5837601", "0.58176833", "0.58153415", "0.58136266", "0.58076847", "0.5798478", "0.5795812", "0.5777886", "0.57691956", "0.5767479", "0.5750825", "0.57467705", "0.57279783", "0.57261294", "0.5722598", "0.57221156", "0.5712929", "0.5709734", "0.5709734", "0.5709238", "0.5702759", "0.5701235", "0.56983757", "0.5690177", "0.56873536", "0.56870615", "0.56853396", "0.56851804", "0.5684866", "0.5680114", "0.5677085", "0.5674152", "0.56721836", "0.56673646", "0.56660235", "0.5663202", "0.5658046", "0.5657035", "0.56534535", "0.56461835", "0.56449574", "0.5643967", "0.5642892" ]
0.648478
15
Trims text by words or characters.
public function trim_text( $text, $length = 15, $trim_style = 'words' ) { $length = (int) $length; $trim_style = in_array( $trim_style, array( 'chars', 'words' ), true ) ? $trim_style : 'words'; // Remove blockquoted text since the text isn't original. $text = preg_replace( '/<blockquote>.+?<\/blockquote>/s', '', $text ); $text = trim( strip_tags( $text ) ); if ( function_exists( 'strip_shortcodes' ) ) { $text = strip_shortcodes( $text ); } // If trimming by chars, behave like a more multibyte-aware // /* bbp_get_reply_excerpt */(). if ( 'chars' === $trim_style ) { if ( function_exists( 'mb_strlen' ) ) { $text_length = mb_strlen( $text ); } else { $text_length = strlen( $text ); } if ( $length && ( $text_length > $length ) ) { if ( function_exists( 'mb_strlen' ) ) { $text = mb_substr( $text, 0, $length - 1 ); } else { $text = substr( $text, 0, $length - 1 ); } $text .= '&hellip;'; } } else { // Else trim by words. $text = wp_trim_words( $text, $length ); } return $text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function clean($text)\n {\n $text = preg_replace('/\\W+/', '', $text);\n \n // trim and lowercase\n $text = strtolower(trim($text, '-'));\n \n return $text;\n }", "function sanifyText($text) {\n // todo whitespace stripping removes commas \"ostuh,otuh\" and concats the words\n // fix this issue.\n return strtolower($text);\n}", "public static function clean ($text) {\n\t\t$to_return = strtolower($text);\n\t\t$to_return = preg_replace(\"/(?![.=$'€%-])\\p{P}/u\", \"\", $to_return);\n\t\t$to_return = trim($to_return);\n\t\t// remove double spacing\n\t\twhile (strpos($to_return, ' ')) {\n\t\t\t$to_return = str_replace(' ', ' ', $to_return);\n\t\t}\n\t\treturn $to_return;\n\t}", "function filter($word)\r\n{\r\n $word = trim($word);\r\n $word = preg_replace('/[^A-Za-z0-9\\-]/','', $word);\r\n return strtolower($word);\r\n}", "function __only1whitespace($text) {\n $text = preg_replace('!\\s+!', ' ', $text);\n return $text;\n }", "public function normalize($text)\n {\n return $this->convertAndSplitIntoWords($text)\n ->stripWordEndings()\n ->filterShortWords()\n ->filterDuplicates()\n ->getWords();\n }", "function wp_trim_words($text, $num_words = 55, $more = \\null)\n {\n }", "protected function trimContent($text)\n {\n return str_replace(['> ', ' <'], ['>', '<'], trim(preg_replace('/\\s+/', ' ', $text)));\n }", "function clean_my_words($words) {\n return strtolower($words);\n }", "public function trimText($str) {\n $str = preg_replace('/^\\p{Z}+|\\p{Z}+$/u', '', $str);\n return $str;\n }", "function textfilter_specialchars($text){\n\t$text = strip_tags(trim($text));\n\t$text = mb_convert_case($text, MB_CASE_LOWER, \"UTF-8\");\n\treturn $text;\n\t}", "function _strip_junk_words($words)\n\t{\n\t\t$bad=array('the','of','to','and','a','in','is','it','you','that','he','was','for','on','are',\n\t\t\t'with','as','I','his','they','be','at','this','or','had','by','but','what','some','we','can',\n\t\t\t'out','other','were','all','there','when','your','how','an','which','do','so','these','has','go',\n\t\t\t'come','did','no','my','where','me','our','thing','site','website');\n\t\t$_words=array();\n\t\tforeach ($words as $i=>$b)\n\t\t{\n\t\t\tif (!in_array($b,$bad))\n\t\t\t{\n\t\t\t\tif ((($b!='chat') || (!array_key_exists($i+1,$words)) || (($words[$i+1]!='room') && ($words[$i+1]!='rooms'))) && (($b!='user') || (!array_key_exists($i+1,$words)) || (($words[$i+1]!='group') && ($words[$i+1]!='groups'))))\n\t\t\t\t\t$_words[]=$b;\n\t\t\t\telse // Special case of compound terms that are actually single words in ocPortal; fix the word, and also stop ridiculous amounts of spurious result\n\t\t\t\t\t$words[$i+1]=$b.$words[$i+1];\n\t\t\t}\n\t\t}\n\t\treturn $_words;\n\t}", "function whitespace_clean($text)\n{\n\t$otext = $text;\n\t$text = preg_replace('/\\s\\s+/', ' ', $text);\n\t\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"In: $otext Out:$text\",3);\n\t\n\treturn trim($text);\t\n}", "public function stripStopWords($text)\n\t{\n\t\t$stopWords = explode(',', $this->stopWords);\n\t\tforeach($stopWords as $stopWord) {\n\t\t\t$stopWordQuoted = preg_quote($stopWord, '@');\n\t\t\t$text = preg_replace('@(^'.$stopWordQuoted.'|\\s+'.$stopWordQuoted.')([\\s.!?]+)@i', ' ', $text);\n\t\t}\n\t\treturn $text;\t\n\t}", "function text($text) {\n\t\t// Removing html tags\n\t\t$text = strip_tags($text);\n\t\t// Removing line breaks and tabs\n\t\t$text = preg_replace('/[\\n\\r\\t]+/',' ',$text);\n\t\t// Removing extra spaces\n\t\t$text = preg_replace('/ {2,}/',' ',$text);\n\t\treturn $text;\n\t}", "function cleanText($text)\n{\n\t$text = strtolower($text);\n\t//$text = iconv('utf-8', 'ascii//TRANSLIT', $text);\n\t$text = preg_replace(\"/&([a-z])[a-z]+;/i\", \"$1\", htmlentities($text));\n\t$text = preg_replace(\"#[[:punct:]]#\", \"\", $text);\n\treturn ($text);\n}", "public function _CleanText($text) {\n\t\t$white_rx = \"/<\\s*/\";\n\t\t$tag_rx = \"/<[^>]*>/\";\n\t\t\n\t\t$safelist = Array(\n\t\t\t'/<p>|<\\/p>/i',\n\t\t\t'/<h[0-9]>[^<]*<\\/h[0-9]>/i',\n\t\t\t'/<a\\shref=.[\\/h#][^>]*>|<\\/a>/i',\n\t\t\t'/<b>|<\\/b>/i',\n\t\t\t'/<strong>|<\\/strong>/i',\n\t\t\t'/<i>|<\\/i>/i',\n\t\t\t'/<em>|<\\/em>/i',\n\t\t\t'/<br[^>]*>/i',\n\t\t\t'/<img\\ssrc=.[\\/h][^>]*\\/>|<img\\ssrc=\"[\\/h][^>]*>[^<]*<\\/img>/i',\n\t\t\t'/<hr[^>]*>/',\n\t\t\t'/<ol[^>]*>|<\\/ol[^>]*>/i',\n\t\t\t'/<ul[^>]*>|<\\/ul[^>]*>/i',\n\t\t\t'/<li[^>]*>|<\\/li[^>]*>/i',\n\t\t\t'/<code[^>]*>|<\\/code[^>]*>/i',\n\t\t\t'/<pre[^>]*>|<\\/pre[^>]*>/i'\n\t\t);\n\t\t\n\t\t$unsafe_words = Array(\n\t\t\t\"/javascript/e\",\n\t\t\t\"/script/e\",\n\t\t\t\"/onclick/e\",\n\t\t\t\"/onm\\w{1,}=/e\",\n\t\t\t\"/JAVASCRIPT/e\",\n\t\t\t\"/SCRIPT/e\",\n\t\t\t\"/ONCLICK/e\",\n\t\t\t\"/ONM\\w{1,}=/e\"\n\t\t);\n\t\t\n\t\t$dirty_words = Array(\n\t\t\t\"/fuck/e\",\n\t\t\t\"/bitch/e\",\n\t\t\t\"/asshole/e\",\n\t\t\t\"/damn/e\",\n\t\t\t\"/whore/e\",\n\t\t\t\"/babi/e\",\n\t\t\t\"/buto/e\",\n\t\t\t\"/sundal/e\",\n\t\t\t\"/sial/e\",\n\t\t\t\"/pepek/e\",\n\t\t\t\"/pantat/e\",\n\t\t\t\"/puki/e\",\n\t\t\t\"/pukimak/e\",\n\t\t\t\"/tetek/e\",\n\t\t\t\"/kelentit/e\",\n\t\t\t\"/konek/e\",\n\t\t\t\"/kontol/e\",\n\t\t\t\"/motherfucker/e\",\n\t\t\t\"/boobies/e\",\n\t\t\t\"/FUCK/e\",\n\t\t\t\"/BITCH/e\",\n\t\t\t\"/ASSHOLE/e\",\n\t\t\t\"/DAMN/e\",\n\t\t\t\"/WHORE/e\",\n\t\t\t\"/BABI/e\",\n\t\t\t\"/BUTO/e\",\n\t\t\t\"/SUNDAL/e\",\n\t\t\t\"/SIAL/e\",\n\t\t\t\"/PEPEK/e\",\n\t\t\t\"/PANTAT/e\",\n\t\t\t\"/PUKI/e\",\n\t\t\t\"/PUKIMAK/e\",\n\t\t\t\"/TETEK/e\",\n\t\t\t\"/KELENTIT/e\",\n\t\t\t\"/KONEK/e\",\n\t\t\t\"/KONTOL/e\",\n\t\t\t\"/MOTHERFUCKER/e\",\n\t\t\t\"/BOOBIES/e\",\n\t\t);\n\t\t\n\t\t$text = addcslashes($text,\"\\x00\\'\\x1a\\x3c\\x3e\\x25\");\n\t\t$text = preg_replace($white_rx, \"<\", $text);\n\t\t\n\t\tpreg_match_all($tag_rx, $text, $matches);\n\t\t$finds = $matches[0];\n\t\tforeach($finds as $find) {\n\t\t\t$clean = true;\n\t\t\tforeach($safelist as $safetag) {\n\t\t\t\tif(preg_match($safetag, $find) > 0) {\n\t\t\t\t\t$clean = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($clean === true) {\n\t\t\t\t$text = str_ireplace($find, htmlentities($find), $text);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$text = preg_replace($unsafe_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = preg_replace($dirty_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = str_replace(\"zaseuuoqHSJAEWAdgsrppoVNAS\",\"<i>BEEP</i>\",$text);\n\t\tif(function_exists(\"mysql_real_escape_string\")) {\n\t\t\t$text = mysql_real_escape_string($text);\n\t\t} elseif(function_exists(\"mysqli_real_escape_string\")) {\n\t\t\t$text = mysqli_real_escape_string($text);\n\t\t}\n\t\treturn $text;\n\t}", "public function _CleanText($text) {\n\t\t$white_rx = \"/<\\s*/\";\n\t\t$tag_rx = \"/<[^>]*>/\";\n\t\t\n\t\t$safelist = Array(\n\t\t\t'/<p>|<\\/p>/i',\n\t\t\t'/<h[0-9]>[^<]*<\\/h[0-9]>/i',\n\t\t\t'/<a\\shref=.[\\/h#][^>]*>|<\\/a>/i',\n\t\t\t'/<b>|<\\/b>/i',\n\t\t\t'/<strong>|<\\/strong>/i',\n\t\t\t'/<i>|<\\/i>/i',\n\t\t\t'/<em>|<\\/em>/i',\n\t\t\t'/<br[^>]*>/i',\n\t\t\t'/<img\\ssrc=.[\\/h][^>]*\\/>|<img\\ssrc=\"[\\/h][^>]*>[^<]*<\\/img>/i',\n\t\t\t'/<hr[^>]*>/',\n\t\t\t'/<ol[^>]*>|<\\/ol[^>]*>/i',\n\t\t\t'/<ul[^>]*>|<\\/ul[^>]*>/i',\n\t\t\t'/<li[^>]*>|<\\/li[^>]*>/i',\n\t\t\t'/<code[^>]*>|<\\/code[^>]*>/i',\n\t\t\t'/<pre[^>]*>|<\\/pre[^>]*>/i'\n\t\t);\n\t\t\n\t\t$unsafe_words = Array(\n\t\t\t\"/javascript/e\",\n\t\t\t\"/script/e\",\n\t\t\t\"/onclick/e\",\n\t\t\t\"/onm\\w{1,}=/e\",\n\t\t\t\"/JAVASCRIPT/e\",\n\t\t\t\"/SCRIPT/e\",\n\t\t\t\"/ONCLICK/e\",\n\t\t\t\"/ONM\\w{1,}=/e\"\n\t\t);\n\t\t\n\t\t$dirty_words = Array(\n\t\t\t\"/fuck/e\",\n\t\t\t\"/bitch/e\",\n\t\t\t\"/asshole/e\",\n\t\t\t\"/damn/e\",\n\t\t\t\"/whore/e\",\n\t\t\t\"/babi/e\",\n\t\t\t\"/buto/e\",\n\t\t\t\"/sundal/e\",\n\t\t\t\"/sial/e\",\n\t\t\t\"/pepek/e\",\n\t\t\t\"/pantat/e\",\n\t\t\t\"/puki/e\",\n\t\t\t\"/pukimak/e\",\n\t\t\t\"/tetek/e\",\n\t\t\t\"/kelentit/e\",\n\t\t\t\"/konek/e\",\n\t\t\t\"/kontol/e\",\n\t\t\t\"/motherfucker/e\",\n\t\t\t\"/boobies/e\",\n\t\t\t\"/FUCK/e\",\n\t\t\t\"/BITCH/e\",\n\t\t\t\"/ASSHOLE/e\",\n\t\t\t\"/DAMN/e\",\n\t\t\t\"/WHORE/e\",\n\t\t\t\"/BABI/e\",\n\t\t\t\"/BUTO/e\",\n\t\t\t\"/SUNDAL/e\",\n\t\t\t\"/SIAL/e\",\n\t\t\t\"/PEPEK/e\",\n\t\t\t\"/PANTAT/e\",\n\t\t\t\"/PUKI/e\",\n\t\t\t\"/PUKIMAK/e\",\n\t\t\t\"/TETEK/e\",\n\t\t\t\"/KELENTIT/e\",\n\t\t\t\"/KONEK/e\",\n\t\t\t\"/KONTOL/e\",\n\t\t\t\"/MOTHERFUCKER/e\",\n\t\t\t\"/BOOBIES/e\",\n\t\t);\n\t\t\n\t\t$text = addcslashes($text,\"\\x00\\'\\x1a\\x3c\\x3e\\x25\");\n\t\t$text = preg_replace($white_rx, \"<\", $text);\n\t\t\n\t\tpreg_match_all($tag_rx, $text, $matches);\n\t\t$finds = $matches[0];\n\t\tforeach($finds as $find) {\n\t\t\t$clean = true;\n\t\t\tforeach($safelist as $safetag) {\n\t\t\t\tif(preg_match($safetag, $find) > 0) {\n\t\t\t\t\t$clean = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($clean === true) {\n\t\t\t\t$text = str_ireplace($find, htmlentities($find), $text);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$text = preg_replace($unsafe_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = preg_replace($dirty_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = str_replace(\"zaseuuoqHSJAEWAdgsrppoVNAS\",\"<i>BEEP</i>\",$text);\n\t\tif(function_exists(\"mysql_real_escape_string\")) {\n\t\t\t$text = mysql_real_escape_string($text);\n\t\t} elseif(function_exists(\"mysqli_real_escape_string\")) {\n\t\t\t$text = mysqli_real_escape_string($text);\n\t\t}\n\t\treturn $text;\n\t}", "function remove_nonalphanum( $data ) {\n\t$text = trim( $data, ' ' );\n\t$text = str_replace( ' ', '-', $text );\n\t$text = preg_replace( '/[^A-Za-z0-9-]/', '', $text );\n\treturn strtolower( $text );\n}", "function remove_allpuncutation($text)\n{\n\t$otext = $text;\n\t$text = preg_replace('/[^a-zA-Z0-9|+|-|\\*|Š|š|Ž|ž|À|Á|Â|Ã|Ä|Å|Æ|Ç|È|É|Ê|Ë|Ì|Í|Î|Ï|Ñ|Ò|Ó|Ô|Õ|Ö|Ø|Ù|Ú|Û|Ü|Ý|Þ|ß|à|á|â|ã|ä|å|æ|ç|è|é|ê|ë|ì|í|î|ï|ð|ñ|ò|ó|ô|õ|ö|ø|ù|ú|û|ý|þ|ÿ]/is', ' ', $text);\n\t\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"In: $otext Out:$text\",3);\n\t\n\treturn $text;\n}", "function filtrar($texto){\n\t\t$texto = htmlentities(strip_tags(trim($texto)));\n\t\t$texto = strtolower($texto);\n\t\treturn $texto;\n\t}", "function FilterTitle($text) {\n\t\t\treturn ucfirst(trim($text));\n\t\t}", "private function cleanText($text) {\n return $text;\n }", "public function trim_kalimat($text, $count){ \n\n\t\t$text = str_replace(\" \", \" \", $text); \n\t\t$string = explode(\" \", $text); \n\t\tfor ( $wordCounter = 0; $wordCounter <= $count; $wordCounter++ ){ \n\t\t$this->trimed .= $string[$wordCounter]; \n\t\tif ( $wordCounter < $count ){ $this->trimed .= \" \"; } \n\t\telse { $this->trimed .= \"...\"; } \n\t\t} \n\t\t$trimed = trim($this->trimed); \n\t\treturn $trimed; \n\t}", "function handleLineOfText($inputTextLine)\n{\n $inputTextLine = preg_replace('/\\s+/', ' ', $inputTextLine);\n\n //text to single words\n $words = explode(\" \", $inputTextLine);\n\n $mixedWords = [];\n\n //mix words from line\n foreach ($words as $word) {\n //mix word if contains more than 3 characters\n array_push($mixedWords, (strlen($word) > 3) ? mixWord($word) : $word);\n }\n\n return implode(\" \", $mixedWords);\n}", "function clean_text($text) {\n\treturn $text;\n}", "function wp_strip_all_tags($text, $remove_breaks = \\false)\n {\n }", "public function filter($value)\n {\n if (!is_string($value)) {\n return $value;\n }\n\n $value = (string) $value;\n\n // Split the string into separate words\n /** @var array $words */\n $words = explode(' ', (string) $value);\n $results = [];\n\n foreach ($words as $key => $word) {\n // If this is the first, or it's not a small word, capitalize it\n if ($key === 0 || !in_array($word, static::$_excludeWords, true)) {\n if ($this->options['encoding'] !== null) {\n $word = mb_convert_case($word, MB_CASE_TITLE, $this->options['encoding']);\n } else {\n $word = ucwords(strtolower($word));\n }\n }\n\n $word = trim($word);\n\n if (strlen($word) > 0) {\n $results[] = $word;\n }\n }\n\n return implode(' ', $results);\n }", "public function testWordsSplitByLetterWithIgnore()\n {\n $str = new Str($this->testString);\n $result = $str->words('/o/', true);\n $this->assertTrue(is_array($result));\n $this->assertTrue($result[0] === 'The quick br');\n $this->assertTrue($result[5] === 'wball');\n }", "public static function classify($text) {\n return preg_replace('/ /', '', ucwords(preg_replace('/_/', ' ', $text)));\n }", "function remove_puncutation($text)\n{\t\n\t$otext = $text;\n\t$text = preg_replace('/[^a-zA-Z0-9|+|-|*|\\/|\\.|?|!|Š|š|Ž|ž|À|Á|Â|Ã|Ä|Å|Æ|Ç|È|É|Ê|Ë|Ì|Í|Î|Ï|Ñ|Ò|Ó|Ô|Õ|Ö|Ø|Ù|Ú|Û|Ü|Ý|Þ|ß|à|á|â|ã|ä|å|æ|ç|è|é|ê|ë|ì| í|î|ï|ð|ñ|ò|ó|ô|õ|ö|ø|ù|ú|û|ý|þ|ÿ]/i', ' ', $text);\n\t\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"In: $otext Out:$text\",3);\n\t\n\treturn $text;\n}", "function my_cleaner($str)\n \t{\n \t$temp = trim($str);\n \t$res = preg_replace('/(\\s+)|(\\t+)/', ' ', $temp);\n \treturn $res;\n\t }", "function clean_for_aiml_match($text)\n{\n\t$otext = $text;\n\t$text= remove_allpuncutation($text); //was not all before\n\t$text= whitespace_clean($text);\n\t$text= captialise($text);\n\t\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"In: $otext Out:$text\",3);\n\t\t\n\treturn $text;\n}", "static public function cleanString($text, $ws = '-', $lower = FALSE)\n {\n $text=strtr($text,array(\n ','=>'-', '\\''=>'-', '\"'=>'-', '/'=>'',\n 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i',\n 'î'=>'i', 'ï'=>'i', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ü'=>'u',\n 'ý'=>'y', 'ÿ'=>'y', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E',\n 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ù'=>'U', 'Ú'=>'U',\n 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y',\n ));\n $text = trim(preg_replace('/\\W+/', $ws, $text),$ws);\n \n if($lower)\n $text = strtolower($text);\n \n return $text;\n }", "private function cleanNameText($text)\n {\n // TODO: unfinished\n $result = qtype_kekule_mol_naming_utils::cleanName($text, array(\n 'replaceunstandardchars' => $this->replaceunstandardchars,\n 'removespaces' => $this->removespaces,\n\t 'strictstereoflags' => $this->strictstereoflags\n ));\n return $result;\n }", "function kCleaner($keywordString){\n\t\tfor($k=0; $k<count($this->exceptChars); $k++){\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t$keywordString = str_ireplace($this->exceptChars[$k], ' ', $keywordString);\n\t\t}\n\n\t\tfunction filter_bad_words($matches) {\n\t\t $exceptWords = array('it'=>'', 'for'=>'', 'and'=>'', 'nor'=>'', 'but'=>'', 'or'=>'', 'yet'=>'', 'so'=>'', 'with'=>'', 'either'=>'', 'also'=>'', 'a'=>'', 'is'=>'', 'at'=>'', 'to'=>'', 'can'=>'', 'than'=>'', 'that'=>'', 'though'=>'', 'till'=>'', 'do'=>'', 'I'=>'', 'me'=>'', 'both'=>'', 'only'=>'', 'not'=>'', 'either'=>'', 'neither'=>'', 'if'=>'', 'as'=>'', 'by'=>'', 'the'=>'', 'in'=>'');\n\t\t $replace = $exceptWords[$matches[0]];\n\t\t return isset($replace) ? $replace : $matches[0];\n\t\t}\n\t\t//remove common words--the exceptwords\n\t\t$keywordString = preg_replace_callback('!\\w+!', 'filter_bad_words', $keywordString);\n\t\t\n\t\t//turn the string into array of single words, then remove extra whitespace\n\t\t$this->pieces = array_map('trim',explode(\" \",$keywordString));\n\t\t\n\t\t//remove any duplicate words\n\t\t$this->pieces = array_unique($this->pieces);\n\t\t\n\t\t//remove any empty values\n\t\tforeach($this->pieces as $key => $value) { \n\t\t if($value == '') { \n\t\t\tunset($this->pieces[$key]); \n\t\t } \n\t\t} \n\t\t//make the keys chronological\n\t\t$this->pieces = array_values($this->pieces);\n\t\t\n\t\t//if after all of that pieces is empty then make it NULL\n\t\tif(count($this->pieces)==0){\n\t\t\t$this->pieces = NULL;\n\t\t}\n\t}", "private function CleanUp($word) {\n $cleaned_word = trim(strip_tags(mb_strtoupper($word)));\n\n return $cleaned_word;\n }", "function slugify($text, $ws = '-')\n{\n\treturn GHelper::cleanString($text, $ws);\n}", "function apachesolr_clean_text($text) {\r\n // Add spaces before stripping tags to avoid running words together.\r\n $text = filter_xss(str_replace(array('<', '>'), array(' <', '> '), $text), array());\r\n // Decode entities and then make safe any < or > characters.\r\n return htmlspecialchars(html_entity_decode($text, ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8');\r\n}", "public function filter($value)\n {\n $whiteSpace = $this->allowWhiteSpace ? '\\s' : '';\n\n if ($this->englishAlphabethOnly || !self::$unicodeEnabled) {\n $pattern = '/[^a-zA-Z' . $whiteSpace . ']/';\n }\n else {\n $pattern = '/[^\\p{L}' . $whiteSpace . ']/u';\n }\n\n return preg_replace($pattern, '', (string) $value);\n }", "public function validateText($text)\n {\n $order = array(\"^\", \"[\", \"<\", \">\", \"=\", \"{\", \"}\", \"]\", \"*\");\n $text = str_replace($order, '', $text);\n return $text;\n }", "function normalizeText( $text, $isMetaData = false )\n {\n //include_once( 'lib/ezi18n/classes/ezchartransform.php' );\n $trans = eZCharTransform::instance();\n $text = $trans->transformByGroup( $text, 'search' );\n\n // Remove quotes and asterix when not handling search text by end-user\n if ( $isMetaData )\n {\n $text = str_replace( array( \"\\\"\", \"*\" ), array( \" \", \" \" ), $text );\n }\n\n return $text;\n }", "function cleanSearchTerms($arg) {\r\n return explode(\" \", preg_replace(\"/[^a-zA-Z0-9]+/\", \" \", strtolower(trim($arg))));\r\n}", "static public function slugify($text)\n {\n $text = preg_replace('/\\W+/', '-', $text);\n \n // trim and lowercase\n $text = strtolower(trim($text, '-'));\n \n return $text;\n }", "public function normal($text): string;", "function bad_words($text)\n\t\t\t{\n\t\t\t\t$swearWords = array('motherfucking', 'motherfucker', 'fucker', 'fuck', 'bitch', 'shit', 'pussy', 'nigger', 'slut', 'cunt');\n\n\t\t\t\t$replaceWith = array('m****rf*****g', 'm****rf***r', 'f****r', 'f**k', 'b***h', 's**t', 'p***y', 'n****r', 's**t', 'c**t');\n\n\t\t\t\t$text = str_ireplace($swearWords, $replaceWith, $text);\n\n\t\t\t\treturn $text;\n\t\t\t}", "function rw_trim_excerpt( $text='' )\n{\n $text = strip_shortcodes( $text );\n $text = apply_filters('the_content', $text);\n $text = str_replace(']]>', ']]&gt;', $text);\n $excerpt_length = apply_filters('excerpt_length', 55);\n $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');\n return wp_trim_words( $text, $excerpt_length, $excerpt_more );\n}", "public function trimSqlReallyTrimsAllWhitespaceDataProvider() {}", "function strip_word_doc( $html, $allowed_tags = '' )\n\t{\n\t\tmb_regex_encoding( 'UTF-8' );\n\n\t\t//replace MS special characters first\n\t\t$search = [\n\t\t\t'/&lsquo;/u',\n\t\t\t'/&rsquo;/u',\n\t\t\t'/&ldquo;/u',\n\t\t\t'/&rdquo;/u',\n\t\t\t'/&mdash;/u',\n\t\t];\n\t\t$replace = [\n\t\t\t'\\'',\n\t\t\t'\\'',\n\t\t\t'\"',\n\t\t\t'\"',\n\t\t\t'-',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//make sure _all_ html entities are converted to the plain ascii equivalents - it appears\n\t\t//in some MS headers, some html entities are encoded and some aren't\n\t\t$html = html_entity_decode( $html, ENT_QUOTES, 'UTF-8' );\n\n\t\t//try to strip out any C style comments first, since these, embedded in html comments, seem to\n\t\t//prevent strip_tags from removing html comments (MS Word introduced combination)\n\t\tif ( mb_stripos( $html, '/*' ) !== FALSE )\n\t\t{\n\t\t\t$html = mb_eregi_replace( '#/\\*.*?\\*/#s', '', $html, 'm' );\n\t\t}\n\n\t\t//introduce a space into any arithmetic expressions that could be caught by strip_tags so that they won't be\n\t\t//'<1' becomes '< 1'(note: somewhat application specific)\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/<([0-9]+)/',\n\t\t\t], [\n\t\t\t\t'< $1',\n\t\t\t], $html );\n\t\t$html = strip_tags( $html, $allowed_tags );\n\n\t\t//eliminate extraneous whitespace from start and end of line, or anywhere there are two or more spaces, convert it to one\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/^\\s\\s+/',\n\t\t\t\t'/\\s\\s+$/',\n\t\t\t\t'/\\s\\s+/u',\n\t\t\t], [\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t' ',\n\t\t\t], $html );\n\n\t\t//strip out inline css and simplify style tags\n\t\t$search = [\n\t\t\t'#<(strong|b)[^>]*>(.*?)</(strong|b)>#isu',\n\t\t\t'#<(em|i)[^>]*>(.*?)</(em|i)>#isu',\n\t\t\t'#<u[^>]*>(.*?)</u>#isu',\n\t\t];\n\t\t$replace = [\n\t\t\t'<b>$2</b>',\n\t\t\t'<i>$2</i>',\n\t\t\t'<u>$1</u>',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//on some of the ?newer MS Word exports, where you get conditionals of the form 'if gte mso 9', etc., it appears\n\t\t//that whatever is in one of the html comments prevents strip_tags from eradicating the html comment that contains\n\t\t//some MS Style Definitions - this last bit gets rid of any leftover comments */\n\t\t$num_matches = preg_match_all( \"/\\<!--/u\", $html, $matches );\n\t\tif ( $num_matches )\n\t\t{\n\t\t\t$html = preg_replace( '/\\<!--(.)*--\\>/isu', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}", "function me_trim_by_characters_with_html( $text, $length = 45, $append = '&hellip;', $allowable_tags = '<b><em><a>' ) {\n $length = (int) $length;\n $text = trim( strip_tags( $text, $allowable_tags ) );\n // if the length without tags is less than our target we are done\n if ( strlen( strip_tags( $text ) ) < $length )\n return $text;\n // count forward to find the $length character in unstripped $text not counting tags\n for ($i = 0, $j = 0, $l = strlen( $text ), $in_tag = false; $i < $l && ( $in_tag || $j < $length ); $i++) :\n switch ( $text[$i] ) :\n case '<': $in_tag = true; break;\n case '>': $in_tag = false; break;\n default :\n if ( ! $in_tag ) $j++;\n endswitch;\n endfor;\n // Step forward one and check for whitespace. If none, go back and find the last place we ended a word or html tag\n if ( isset( $text[$i++] ) )\n while ( ' ' != $text[$i] && '&nbsp;' != $text[$i] && '>' != $text[$i - 1] ) $i--;\n\n return balanceTags( substr( $text, 0, $i ), true ) . $append;\n}", "public function sOptimizeText($text)\n {\n $text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');\n $text = preg_replace('@<(script|style)[^>]*?>.*?</\\\\1>@si', '', $text);\n $text = preg_replace('!<[^>]*?>!u', ' ', $text);\n $text = preg_replace('/\\s\\s+/u', ' ', $text);\n $text = trim($text);\n\n return $text;\n }", "public static function trim_excerpt($text) {\n\t\tif ( '' == $text ) {\n\t\t\t$text = str_replace(']]>', ']]&gt;', $text);\n\t\t\t$text = strip_tags($text);\n\t\t\t$excerpt_length = 55;\n\t\t\t$words = explode(' ', $text, $excerpt_length + 1);\n\t\t\tif (count($words) > $excerpt_length) {\n\t\t\t\tarray_pop($words);\n\t\t\t\tarray_push($words, '[...]');\n\t\t\t\t$text = implode(' ', $words);\n\t\t\t}\n\t\t}\n\t\treturn $text;\n\t}", "public static function makeWordsFirstCapital($text = '') {\n if (!empty($text) && is_string($text)) {\n $words = explode(' ', $text);\n // Loop through words and capital if not all upper case.\n foreach ($words as &$word) {\n // Check for all caps?\n if (strtoupper($word) != $word) {\n // It is not all caps so process it.\n $word = ucwords($word);\n }\n\n // Check to see if it should be normalized.\n $normalize = [\n 'U.s.' => 'U.S.',\n 'u.s.' => 'U.S.',\n 'U.s.a.' => 'U.S.A.',\n 'Usa' => 'USA',\n 'Lecc' => 'LECC',\n ];\n foreach ($normalize as $bad => $good) {\n // Replace it with the good version if it is bad.\n $word = ($word == $bad) ? $good : $word;\n }\n }\n // Break the reference.\n unset($word);\n\n // Join them all back together.\n $text = implode(' ', $words);\n }\n\n return $text;\n }", "protected function collapseWhitespace($text) {\n $text = preg_replace('/[ \\t\\r\\n]+/', \" \", $text);\n return trim($text);\n }", "public static function words( $text = '' ) {\n\t\t$words = array();\n\n\t\tif ( empty( $text ) ) {\n\t\t\treturn $words;\n\t\t}\n\t\t$text = join( ' ', self::paragraphs( $text ) );\n\n\t\t$text = preg_replace( '/[^ [:alnum:]]/iu', '', self::lowercase( $text ) );\n\t\t$words = array_filter( explode( ' ', $text ) );\n\n\t\treturn $words;\n\t}", "static public function slugify($text)\n {\n $text = preg_replace('/\\W+/', '-', $text);\n \n // trim and lowercase\n $text = strtolower(trim($text, '-'));\n \n return $text;\n }", "function trim_string_by( $count, $string ) {\n\treturn ( absint( $count ) <= str_word_count( $string ) ) ?\n\t\twp_trim_words( $string, absint( $count ), '&hellip;' ) :\n\t\t\t$string;\n}", "public function testUcwordsSanitizer()\n {\n $this->assertEquals('Fernando Zueet', Sanitize::ucwords()->clean('fernando zueet'));\n\n $this->assertEquals('', Sanitize::ucwords()->clean(10));\n }", "static function eliminarEspacios($texto) {\n return (is_string($texto)) ? str_replace(\" \", \"\", $texto) : $texto;\n }", "function removeUnnecessaryCharas($string)\n{\n return preg_replace('~\\s+~s', '', $string);\n}", "public function min_whitespace($text)\n {\n }", "public function filterInput(string $input) : string {\n return trim(preg_replace('/[^a-zA-Z0-9\\s]/', '',$input));\t\n }", "public static function slugify($text)\n {\n $text = preg_replace('/\\W+/', '-', $text);\n \n // trim and lowercase\n $text = strtolower(trim($text, '-'));\n \n return $text;\n }", "static public function slugify($text)\n {\n $text = preg_replace('/\\W+/', '-', $text);\n\n // trim and lowercase\n $text = strtolower(trim($text, '-'));\n\n return $text;\n }", "function clean_word() {\r\n\t\tpreg_match_all('/<img[^<>]*? alt=\"Text Box:\\s*([^\"]*?)\"[^<>]*?>/is', $this->code, $text_box_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$counter = sizeof($text_box_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t$offset = $text_box_matches[0][$counter][1];\r\n\t\t\t$text = $text_box_matches[1][$counter][0];\r\n\t\t\t$text = '<p>' . str_replace('&#13;&#10;', '</p>\r\n<p>', $text) . '</p>';\r\n\t\t\t$this->code = substr($this->code, 0, $offset) . $text . substr($this->code, $offset + strlen($text_box_matches[0][$counter][0]));\r\n\t\t\t$counter--;\r\n\t\t}\r\n\t\t\r\n\t\t// although at least firefox seems smart enough to not display them, \r\n\t\t// some versions of word may use soft hyphens for print layout or some such nonsense\r\n\t\t// is this a candidate for general (basic) usage?\r\n\t\t$this->code = str_replace('&shy;', '', $this->code);\r\n\t\t// this needs revision for array(\"­\", \"&#173;\", \"&#xad;\", \"&shy;\"); and the fact that soft hyphens are misused by document authors (specific case: they show in RTF files but not in firefox)\r\n\t\t\r\n\t\tReTidy::decode_for_DOM_all_character_entities(); // since much of the clean_word work is removing styles\r\n\t\t\r\n\t\t// should we simply eliminate all names and ids (since the structure function will generate those which are needed)?\r\n\t\t// seems we should except for footnotes: _ftnref _ftn _ednref _edn\r\n\t\t$this->code = preg_replace('/ id=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/(<a[^<>]*?) name=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"([^<>]*?>)/is', '$1$3', $this->code);\r\n\t\t\r\n\t\t\r\n\t\t// often in word documents the lang attributes are wrong... so:\r\n\t\t$this->code = preg_replace('/ lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t\r\n\t\t// white background\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)whiteBG([^\"]*)\"/is', ' class=\"$1$2\"', $this->code);\r\n\t\t// parks canada specific:\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)backTop([^\"]*)\"/is', ' class=\"$1alignRight$2\"', $this->code);\t\t\r\n\t\t\r\n\t\t// topPage; these should not exist (since documents in their original format shall not have links to the top)\r\n\t\t// but they sometimes come from styles to classes. On tags other than spans they style the alignment.\r\n\t\t$this->code = preg_replace('/<span([^>]*)class=\"([^\"]*)topPage([^\"]*)\"/is', '<span$1class=\"$2$3\"', $this->code);\r\n\t\t\r\n\t\t// word document section <div>s\r\n\t\t//$this->code = preg_replace('/<div style=\"page\\s*:\\s*[^;]+;\">/is', '<div stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_stripme('<div style=\"page\\s*:\\s*[^;]+;\">');\r\n\t\t\r\n\t\t// remove style information declarations(?) or qualifications(?) like !msnorm and !important? \r\n\t\t// Nah, there is no need until word is seen to use !important (it could also be in government stylesheets so there is the remote chance that we\r\n\t\t// would like to keep it). Definately get rid of !msnorm though.\r\n\t\t$arrayStyleInformationPiecesToDelete = array(\r\n\t\t'!msorm',\r\n\t\t);\r\n\t\tforeach($arrayStyleInformationPiecesToDelete as $styleInformationPieceToDelete) {\r\n\t\t\t$styleInformationPieceToDeleteCount = -1;\r\n\t\t\twhile($styleInformationPieceToDeleteCount != 0) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*?)' . $styleInformationPieceToDelete . '([^\"]*?)\"/is', 'style=\"$1$2\"', $this->code, -1, $styleInformationPieceToDeleteCount);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// blockquote\r\n\t\tpreg_match_all('/<p[^<>]*style=[^<>]*(margin-right\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*(margin-left\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*>(.*?)<\\/p>/is', $this->code, $p_matches2);\r\n\t\tforeach($p_matches2[0] as $index => $value) {\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[2][$index], $margin_right_matches);\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[4][$index], $margin_left_matches);\r\n\t\t\tif($margin_right_matches[1] > 0.4 && $margin_left_matches[1] > 0.4) {\r\n\t\t\t\t$original = $new = $p_matches2[0][$index];\r\n\t\t\t\t$new = str_replace($p_matches2[1][$index], '', $new);\r\n\t\t\t\t$new = str_replace($p_matches2[3][$index], '', $new);\r\n\t\t\t\t$new = str_replace('<p', '<div', $new);\r\n\t\t\t\t$new = str_replace('</p>', '</div>', $new);\r\n\t\t\t\t$new = \"<blockquote>\" . $new . \"</blockquote>\";\r\n\t\t\t\t$this->code = str_replace($original, $new, $this->code);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// onmouseover, onmouseout; attributes to delete\r\n\t\t$arrayAttributesToDelete = array(\r\n\t\t'onmouseover',\r\n\t\t'onmouseout',\r\n\t\t);\r\n\t\tforeach($arrayAttributesToDelete as $attributeToDelete) {\r\n\t\t\t$this->code = preg_replace('/' . $attributeToDelete . '=\"([^\"]*)\"/is', '', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// microsoft styles to delete\r\n\t\t$arrayMicrosoftStylesToDelete = array(\r\n\t\t'page-break-before',\r\n\t\t'page-break-after',\r\n\t\t'page-break-inside',\r\n\t\t'text-autospace',\r\n\t\t'text-transform',\t\t\r\n\t\t//'border',\r\n\t\t'border-left', // (2011-11-07)\r\n\t\t'border-right', // (2011-11-07)\r\n\t\t'border-bottom', // (2011-11-07)\r\n\t\t'border-top', // (2011-11-07)\r\n\t\t'border-collapse',\r\n\t\t'margin', //// notice that we may in some cases want to keep margins (as an indication of indentation)\r\n\t\t'margin-left', ////\r\n\t\t'margin-right', ////\r\n\t\t'margin-top', ////\r\n\t\t'margin-bottom', ////\t\t\t\t\t\t\t\r\n\t\t'padding',\r\n\t\t'padding-left',\r\n\t\t'padding-right',\r\n\t\t'padding-top',\r\n\t\t'padding-bottom',\r\n\t\t'font',\r\n\t\t'font-size', //// notice that we may in some cases want to keep font-size\r\n\t\t'font-family',\r\n\t\t//'font-style', // font-style: italic;\r\n\t\t//'text-decoration', // text-decoration: underline;\r\n\t\t'line-height',\r\n\t\t'layout-grid-mode',\r\n\t\t'page',\r\n\t\t'text-indent', //// notice that we may in some cases want to keep text-indent\r\n\t\t'font-variant', //// this may have to be amended in the future (if some document uses small caps without capitalizing those first letters that need to be capitalized)\r\n\t\t'mso-style-name',\r\n\t\t'mso-style-link',\r\n\t\t'z-index',\r\n\t\t'position',\r\n\t\t// we cannot enable the following and keep other style information that these are substrings of\r\n\t\t'top',\r\n\t\t'right',\r\n\t\t'bottom',\r\n\t\t'left',\r\n\t\t'letter-spacing',\r\n\t\t);\r\n\t\t// for this we assume that there are no embedded stylesheets\r\n\t\tforeach($arrayMicrosoftStylesToDelete as $microsoftStyle) {\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($this->config['strict_accessibility_level'] > 0) { // then just make it grey\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesToDelete = array(\r\n\t\t//'color' => array('black', 'windowtext'), // these can sometimes override other colours that we keep so ideally we would like to keep these in but style attributes for colour...\r\n\t\t'text-align' => array('justify'),\r\n\t\t'font-weight' => array('normal', 'normal !msorm', 'normal !msnorm'), \r\n\t\t// we take this out although it can usefully cascade other styles\r\n\t\t// which brings up the point that these all probably can... ;(\r\n\t\t//'font-variant' => array('normal', 'normal!important', 'normal !important', 'small-caps'),\r\n\t\t'background' => array('white', '#FFFFFF'),\r\n\t\t'background-color' => array('white', '#FFFFFF'),\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesToDelete as $style => $value) {\r\n\t\t\tforeach($value as $information) {\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . ';\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countC);\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . '\"/is', 'style=\"$1\"', $this->code, -1, $countD);\r\n\t\t\t\t\tif($countC === 0 && $countD === 0) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesOnTagsToDelete = array(\r\n\t\t'text-align' => array('left' => array('p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'font-weight' => array('bold' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'vertical-align' => array( \r\n\t\t// we should be careful here not to remove any styles that might be used to identify footnotes; although\r\n\t\t// I do not know of any that are currently (2011-11-28) used\r\n\t\t'baseline' => array('span'),\r\n\t\t'sub' => array('span'),\r\n\t\t'super' => array('span'),\r\n\t\t'top' => array('span'),\r\n\t\t'text-top' => array('span'),\r\n\t\t'middle' => array('span'),\r\n\t\t'bottom' => array('span'),\r\n\t\t'text-bottom' => array('span'),\r\n\t\t'inherit' => array('span'),\r\n\t\t),\r\n\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesOnTagsToDelete as $property => $stylings) {\r\n\t\t\tforeach($stylings as $styling => $tags) {\r\n\t\t\t\t$tagsString = implode(\"|\", $tags);\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . ';\\s*([^\"]*)\"/is', '<$1$2 style=\"$3$4\"', $this->code, -1, $countE);\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . '\"/is', '<$1$2 style=\"$3\"', $this->code, -1, $countF);\r\n\t\t\t\t\tif($countE === 0 && $countF === 0) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// pseudo-elements\r\n\t\t// <a style=\":visited { color: purple; }\">\r\n\t\t$countE = -1;\r\n\t\twhile($countE !== 0) {\r\n\t\t\t//print(\"doing pseudo-elements<br>\\r\\n\");\r\n\t\t\t$this->code = preg_replace('/style=\"([^\"]{0,}):\\w+\\s*\\{[^\\{\\}]{0,}\\}([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countE);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// <hr> with width\r\n\t\t$this->code = preg_replace('/<hr([^<>]*) width=\"[^\"]*\"([^<>]*)\\/>/is', '<hr$1$2/>', $this->code);\r\n\t\t\r\n\t\t// microsoft using operating system independant CSS...\r\n\t\t// I guess for this we assume that we are using windows.\r\n\t\t$this->code = preg_replace('/style=\"([^\"]*)border\\s*:\\s*solid\\s+windowtext\\s+1.0pt\\s*(;?)([^\"]*)\"/is', 'style=\"$1border: 1px solid black$2$3\"', $this->code);\r\n\t\t\r\n\t\t// superscript using CSS\r\n\t\t//$this->code = preg_replace('/(<(\\w*)[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?)([^\"]*\"[^<>]*>.*?<\\/\\2>)/is', '<sup>$1$4</sup>', $this->code, -1, $countC);\r\n\t\t$this->code = preg_replace('/<(\\w+[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?[^\"]*\"[^<>]*)>/is', '<$1$2 newtag=\"sup\">', $this->code);\r\n\t\t\r\n\t\t// clean up stupidity generated by tidy\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) start=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) type=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t\r\n\t\tReTidy::post_dom();\r\n\t\t// remove empty <a> tags; aside from general cleanup, to avoid the regular expression recursion limit of 100 (for the ridiculous\r\n\t\t// case of something like that many anchors at the same spot...\r\n\t\t//$this->code = str_replace('<a></a>', '', $this->code);\r\n\t\t$this->code = preg_replace('/<a>([^<>]*?)<\\/a>/is', '$1', $this->code);\r\n\t//\tReTidy::extra_space();\r\n\t\t\r\n\t\t// lists where each list element has a <ul>\r\n\t\tif(ReTidy::is_XHTML()) {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br /><br /></li>', $this->code);\r\n\t\t} else {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br><br></li>', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// empty text blocks; notice that we would not want to do this generally\r\n\t\t$this->code = preg_replace('/<(p|h1|h2|h3|h4|h5|h6|li)( [^<>]*){0,1}>&nbsp;<\\/\\1>/is', '', $this->code);\r\n\t\t// some sort of full-width break from word that we do not want\r\n\t\t$this->code = preg_replace('/<br [^<>]*clear\\s*=\\s*[\"\\']*all[\"\\']*[^<>]*\\/>/is', '', $this->code);\r\n\t\t// force a border onto tables because word html uses border on cells rather than on the table\r\n\t\t$this->code = preg_replace('/<table([^<>]*) border=\"0\"/is', '<table$1 border=\"1\"', $this->code);\r\n\t\t// despan anchors\r\n\t\tpreg_match_all('/(<a ([^<>]*)[^\\/<>]>)(.*?)(<\\/a>)/is', $this->code, $anchor_matches);\r\n\t\tforeach($anchor_matches[0] as $index => $value) {\r\n\t\t\tif(strpos($anchor_matches[2][$index], \"href=\") === false) {\r\n\t\t\t\tif(strpos($anchor_matches[2][$index], \"name=\") !== false || strpos($anchor_matches[2][$index], \"id=\") !== false) {\r\n\t\t\t\t\t$this->code = str_replace($anchor_matches[1][$index] . $anchor_matches[3][$index] . $anchor_matches[4][$index], $anchor_matches[1][$index] . $anchor_matches[4][$index] . $anchor_matches[3][$index], $this->code);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// simplify lists that unnecessarily have a list for each list item\r\n\t\tpreg_match_all('/<ol([^<>]*?)>(.*?)<\\/ol>/is', $this->code, $ol_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($ol_matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $start_matches);\r\n\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $type_matches);\r\n\t\t\t$start = $start_matches[1];\r\n\t\t\t$type = $type_matches[1];\r\n\t\t\t$combine_string = \"\";\r\n\t\t\twhile(true) {\r\n\t\t\t\t$end_of_previous_offset = $ol_matches[0][$size - 1][1] + strlen($ol_matches[0][$size - 1][0]);\r\n\t\t\t\t$end_of_current_offset = $ol_matches[0][$size][1] + strlen($ol_matches[0][$size][0]);\r\n\t\t\t\t$combine_string = substr($this->code, $end_of_previous_offset, $end_of_current_offset - $end_of_previous_offset) . $combine_string;\r\n\t\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $type_matches2);\r\n\t\t\t\t$type2 = $type_matches2[1];\r\n\t\t\t\tif($type !== $type2) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $start_matches2);\r\n\t\t\t\t$start2 = $start_matches2[1];\r\n\t\t\t\tif(!is_numeric($start2) || $start2 >= $start) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tReTidy::preg_match_last('/<[^<>]+>/is', substr($this->code, 0, $ol_matches[0][$size][1]), $last_tag_piece_matches);\r\n\t\t\t\tif($last_tag_piece_matches[0] !== \"</ol>\") {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$start = $start2;\r\n\t\t\t\t$size--;\r\n\t\t\t}\r\n\t\t\t$cleaned_combine_string = $combine_string;\r\n\t\t\t$cleaned_combine_string = preg_replace('/<\\/ol>\\s*<ol[^<>]*?>/is', '', $cleaned_combine_string);\r\n\t\t\t$this->code = str_replace($combine_string, $cleaned_combine_string, $this->code);\r\n\t\t\t$size--;\r\n\t\t}\r\n\t\t\r\n\t\tReTidy::clean_redundant_sufficient_inline();\r\n\t\tReTidy::double_breaks_to_paragraphs();\r\n\t\tReTidy::encode_for_DOM_all_character_entities(); // re-encode character entities that were decoded at the start of this function\r\n\t\t//$this->code = preg_replace('/(&nbsp;|&#160;|&#xA0;){3,}/is', '&nbsp;&nbsp;', $this->code); // added 2015-06-04\r\n\t\tReTidy::mitigate_consecutive_non_breaking_spaces(); // plz\r\n\t}", "function trim_excerpt( $text, $excerpt_length = null ) {\n\t\t$text = strip_shortcodes( $text );\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t$text = apply_filters( 'the_content', $text );\n\t\t$text = str_replace( ']]>', ']]&gt;', $text );\n\n\t\tif ( ! $excerpt_length ) {\n\t\t\t/**\n\t\t\t * Filters the number of words in an excerpt.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t *\n\t\t\t * @param int $number The number of words. Default 55.\n\t\t\t */\n\t\t\t$excerpt_length = apply_filters( 'excerpt_length', 55 );\n\t\t}\n\t\t$more_text = ' &hellip;';\n\t\t$excerpt_more = apply_filters( 'excerpt_more', $more_text );\n\n\t\t$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );\n\n\t\treturn $text;\n\t}", "function trimAllSpaces(string $string):string\n{\n $string = preg_replace('/\\s+/', '', $string);\n return $string;\n}", "public static function stems($text) {\n $words = preg_split('/[^a-zA-Z\\'\"-]+/', $text, -1, PREG_SPLIT_NO_EMPTY);\n // stemmer plugin\n require_once BASEPATH . '/application/plugins/class.stemmer.inc';\n $stemmer = new Stemmer();\n\n $result = '';\n\n foreach ($words as $word) {\n // if is at least three characters and not in the list of stopwords...\n if ((strlen($word) > 2) && !in_array($word, self::$stopwords)) {\n // stem & attach to result\n $result .= $stemmer->stem(strtolower($word)) . ' ';\n }\n }\n // trailing space\n $result = substr($result, 0, -1);\n\n return $result;\n }", "function regexspacecleaner ($text, $chartocleanaround=\"\", $spacereplacement=\" \"){\n\t$regex_pattern=\"/&nbsp;|&#0160;|&#xa0;/i\";\n\t$text = preg_replace($regex_pattern, \" \", $text);\n\t\n\t//let's turn breaks into a single space\n\t$regex_pattern=\"/<\\s*br\\s*\\/\\s*>/\";\n\t$text = preg_replace($regex_pattern, \" \", $text);\n\t\n\t//let's turn tabs, newlines, and form feeds into a single space\n\t$regex_pattern=\"/\\t|\\r|\\n|\\f|\\v/\";\n\t$text = preg_replace($regex_pattern, \" \", $text);\n\t\n\t//let's turn all runs of white space into a single space\n\t$regex_pattern=\"/\\s{2,}/\";\n\t$text = preg_replace($regex_pattern, \" \", $text);\n\t\n\t//let's get rid of beginning and trailing spaces\n\t$regex_pattern=\"/^\\s|\\s$/\";\n\t$text = preg_replace($regex_pattern, \"\", $text);\n\t\n\t//get rid of spaces around $chartocleanaround\n\tif($chartocleanaround!==\"\"){\n\t\t$regex_pattern=\"/\\s*$chartocleanaround\\s*/\";\n\t\t$text = preg_replace($regex_pattern, \"$chartocleanaround\", $text);\n\t\t//get rid of any runs of the $chartocleanround\n\t\t$regex_pattern=\"/$chartocleanaround+/\";\n\t\t$text = preg_replace($regex_pattern, \"$chartocleanaround\", $text);\n\t}\n\t\n\t//replace remaining spaces with $spacereplacement\n\tif($spacereplacement!==\" \"){\n\t\t$regex_pattern=\"/\\s+/\";\n\t\t$text = preg_replace($regex_pattern, \"$spacereplacement\", $text);\n\t}\n\t\n\treturn $text;\n}", "function trim_excerpt($text) { return rtrim($text,'[...]'); }", "public function it_can_trim_strings()\n {\n $sanitized = $this->sanitize([\n 'name' => ' James BROWN ',\n 'signer' => true,\n ],[\n 'name' => 'trim',\n 'signer' => 'trim',\n ]);\n\n $this->assertEquals([\n 'name' => 'James BROWN',\n 'signer' => true,\n ], $sanitized);\n }", "function txt_alphanumerical_clean( $t, $additional_tags=\"\" )\n\t{\n\t\tif ( $additional_tags )\n\t\t{\n\t\t\t$additional_tags = preg_quote( $additional_tags, \"/\" );\n\t\t}\n\t\t\n\t\treturn preg_replace( \"/[^a-zA-Z0-9\\-\\_\".$additional_tags.\"]/\", \"\" , $t );\n }", "public function wordFilter($text = '', $exact = TRUE) {\n\t\tif (!isset($this->bad_words)) {\n\t\t\t$this->fetchBadWords();\n\t\t} // end if\n\n\t\tif ($exact === TRUE) {\n\t\t\treturn strtr($text, $this->bad_words);\n\t\t} // end if\n\n reset($this->bad_words);\n while(list($word, $replace) = each($this->bad_words)) {\n $text = mb_ereg_replace('/(^|\\b)' . $word . '(\\b|!|\\?|\\.|,|$)/i', $replace, $text);\n } // end while\n\t\treturn $text;\n\t}", "public function tidy()\n {\n $str = UTF8::normalize_msword($this->str);\n\n return static::create($str, $this->encoding);\n }", "private function cleanup_word($word)\n {\n $tmp = self::remove_utf8_bom(mb_convert_encoding(trim($word), 'UTF-8', mb_detect_encoding($word)));\n \n // Remove unwanted characters\n $punctuation = array('?', '!', '\"');\n \n foreach($punctuation as $p)\n $tmp = str_replace($p, '', $tmp);\n\n // Remove trailing punctuation\n $punctuation[] = '.';\n $punctuation[] = ',';\n $punctuation[] = ':';\n $punctuation[] = ';';\n \n foreach($punctuation as $p) \n {\n if(substr($tmp, -1) == $p)\n {\n $tmp = substr($tmp, 0, -1);\n }\n }\n \n return $tmp;\n }", "function remove_strange_chars($txt){\n\t\treturn(str_replace(array('<','>',\"'\",\";\",\"&\",\"\\\\\"),'',$txt));\n\t}", "function sanitize_text(string $text = '')\n{\n return filter_var(trim($text), FILTER_SANITIZE_FULL_SPECIAL_CHARS);\n}", "protected function convertAndSplitIntoWords($text)\n {\n mb_internal_encoding(\"UTF-8\");\n $text = mb_strtolower($text);\n $text = str_replace(\n array('ą', 'č', 'ę', 'ė', 'į', 'š', 'ų', 'ū', 'ž'),\n array('a', 'c', 'e', 'e', 'i', 's', 'u', 'u', 'z'),\n $text\n );\n $text = preg_replace('/[^\\w+. ]/', '', $text);\n $this->words = preg_split('/[\\s.]+/', $text);\n\n return $this;\n }", "function p_trim_space($arr)\n{\n\tforeach ($arr as $ind => &$value)\n\t{\n\t\t$value = trim($value);\n\t\n\t\tif ($ind==\"to\" || $ind==\"from\")\n\t\t{\n\t\t\t$value=strtolower($value);\n\t\t}\n\t}\n\tunset($value);\n\treturn $arr;\n}", "public static function trimall($value){\n return preg_replace('/(\\s){2,}/', '$1', trim($value));\n }", "function slug ($text)\n {\n $text = preg_replace('/\\W|_/', '-', $text);\n // Clean up extra dashes\n $text = preg_replace('/-+/', '-', trim($text, '-')); // Clean up extra dashes\n // lowercase\n $text = strtolower($text);\n if (empty($text))\n {\n return false;\n }\n return $text;\n }", "function trim_space($s)\n {\n $s = mb_ereg_replace('^( | )+', '', $s);\n $s = mb_ereg_replace('( | )+$', '', $s);\n\n return $s;\n }", "function filter_alphanum($input) {\n return preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $input);\n}", "function string_filter($string)\n{\n $string = preg_replace(\"/[^A-Za-z']/\", \"\", $string);\n $string = trim(ucfirst(strtolower($string)));\n $string = str_replace(\"'\", \"\\'\", $string);\n return $string;\n}", "function normalizeString(string $text)\n{\n $text = preg_replace('/\\n|^\\'|\\'$|^\\\"|\\\"$/', '', $text);\n $text = preg_replace('/\\s+/', ' ', $text);\n return $text;\n}", "function delete_format($text, $etiquetas_permitidas = NULL)\n{\n return strip_tags($text, $etiquetas_permitidas);\n}", "function text_do_better($string)\n{\n\t$string = preg_replace('/^[ \\t]*[\\r\\n]+/m', '', $string);\n\t$string = str_replace(\"\\n\", \"\", $string);\n\t$string = str_replace(\"\\r\", \"\", $string);\n\t\n\t// remove non-breaking spaces and other non-standart spaces\n\t$string = preg_replace('~\\s+~u', ' ', $string);\n\t// replace controls symbols with \"?\"\n\t$string = preg_replace('~\\p{C}+~u', '?', $string);\n\t\n\treturn $string;\n}", "public function remove($word)\n {\n return preg_replace('/-*(ku|mu|nya)$/', '', $word, 1);\n }", "private function strip($given) {\n\t\t$stripped = preg_replace(array('/\\s{2,}/', '/[\\t\\n]/'), ' ', trim($given));\n\t\t\n\t\t// For each of these characters, remove any surrounding white space\n\t\t$clean = array(';', ',', '(', ')', '=', ':', '[', ']', '/', '!', '>', '<', '&lt;', '&gt;');\n\t\tforeach($clean as $c) {\n\t\t\t$stripped = preg_replace('/\\s*\\\\' . $c . '\\s*/', $c, $stripped);\n\t\t}\n\n\t\treturn $stripped;\n\t}", "protected function filterTrim($value) {\n return trim($value);\n }", "function make_clean_str($str) {\n\treturn ucwords(trim(preg_replace('/[ ]+/',' ',preg_replace('/[^0-9a-zA-Z\\+]/',' ',strtolower($str))),' '));\n}", "function squish(){\n\t\t$out = $this->trim();\n\t\treturn $out->gsub('/\\s+/',' ');\n\t}", "private function stripSS($text) {\n return stripSS($text);\n }", "function clear($text) {\n\t$text = preg_replace('/\\s+/', ' ', $text);\n\t$text = trim($text);\n\t$text = addslashes($text);\n\treturn $text;\n}", "function custom_trim_excerpt($text) { // Fakes an excerpt if needed\rglobal $post;\rif ( '' == $text ) {\r$text = get_the_content('');\r$text = apply_filters('the_content', $text);\r$text = str_replace(']]>', ']]>', $text);\r$text = strip_tags($text);\r$excerpt_length = 90;\r$words = explode(' ', $text, $excerpt_length + 1);\rif (count($words) > $excerpt_length) {\rarray_pop($words);\rarray_push($words, '...');\r$text = implode(' ', $words);\r}\r}\rreturn $text;\r}", "function remove_words($input,$replace,$words_array = array(),$unique_words = true)\r\n\r\n{\r\n\r\n\t //separate all words based on spaces\r\n\r\n\t $input_array = explode(' ',$input);\r\n\r\n\t //create the return array\r\n\r\n\t $return = array();\r\n\r\n\t\r\n\r\n\t //loops through words, remove bad words, keep good ones\r\n\r\n\t foreach($input_array as $word)\r\n\r\n\t {\r\n\r\n\t\t//if it's a word we should add...\r\n\r\n\t\tif(!in_array($word,$words_array) && ($unique_words ? !in_array($word,$return) : true))\r\n\r\n\t\t{\r\n\r\n\t\t $return[] = $word;\r\n\r\n\t\t}\r\n\r\n\t }\r\n\r\n\t\r\n\r\n\t //return good words separated by dashes\r\n\r\n\t return implode($replace,$return);\r\n\r\n}", "public static function splitIntoWords($text)\n {\n // Prefix any sequence of capital letters with a space,\n // surround numbers with spaces,\n // and replace any sequence of non-letters with one space.\n $normalized = preg_replace(\n [\n '/\\p{Lu}+/u',\n '/\\p{N}+/u',\n '/[^\\p{L}\\p{N}]+/u',\n ],\n [\n ' \\0',\n ' \\0 ',\n ' ',\n ],\n $text\n );\n\n // Split into single words.\n return array_filter(explode(' ', $normalized));\n }", "protected function stripWordEndings()\n {\n $word_endings = array(\n 'i?[yuoe]+[js][ie]', // matches: ioji, oji, yje, oje, uje, ėse, yse etc\n '[aeiouy]+m?s?' // matches: as, is, ys, ims, ams, a, į etc\n );\n\n $regex = '/' . join('|', $word_endings) . '$/';\n $this->words = preg_replace($regex, '', $this->words, 1);\n\n return $this;\n }", "function remove_space(&$tags)\n{\n\t$len = mb_strlen($tags);\n\tif (mb_substr($tags, 0 , 1) !== \",\")\n\t\treturn false;\n\t$tags = mb_substr($tags, 1);\n\t$len--;\n\twhile ($len !== 0 && (mb_substr($tags, 0 , 1) === \"\\t\" || mb_substr($tags, 0 , 1) === \" \"))\n\t{\n\t\t$tags = mb_substr($tags, 1);\n\t\t$len--;\t\t\n\t}\n\tif ($len === 0)\n\t\treturn false;\n\treturn true;\n}", "function pun_trim($str)\r\n{\r\n\tglobal $lang_common;\r\n\r\n\tif (strpos($lang_common['lang_encoding'], '8859') !== false)\r\n\t{\r\n\t\t$fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0));\r\n\t\treturn trim(str_replace($fishy_chars, ' ', $str));\r\n\t}\r\n\telse\r\n\t\treturn trim($str);\r\n}" ]
[ "0.69188327", "0.66766316", "0.66430444", "0.63031006", "0.62658346", "0.6256051", "0.6241119", "0.616963", "0.61289316", "0.6115035", "0.6071767", "0.60407156", "0.60137826", "0.59885806", "0.59490436", "0.5881841", "0.58650196", "0.58650196", "0.5826245", "0.57644933", "0.57220703", "0.57181567", "0.5715567", "0.56701136", "0.56365496", "0.5625694", "0.5606703", "0.5547456", "0.5537861", "0.55208176", "0.55158955", "0.5515712", "0.55127877", "0.5505148", "0.5503573", "0.5499344", "0.5486589", "0.5480277", "0.5457959", "0.5457587", "0.54300106", "0.5409616", "0.53562534", "0.5354089", "0.5353903", "0.53452003", "0.53436863", "0.5339355", "0.53393316", "0.5332006", "0.5324872", "0.53218627", "0.5313657", "0.5305945", "0.53002185", "0.52980626", "0.52968735", "0.5292664", "0.5283308", "0.5271771", "0.52633065", "0.52623177", "0.5259499", "0.5259076", "0.52520853", "0.5242025", "0.52371377", "0.52349615", "0.52311724", "0.5229352", "0.5228476", "0.5222471", "0.519596", "0.5195754", "0.51944566", "0.5194057", "0.5185138", "0.51844776", "0.51817197", "0.5176321", "0.5171898", "0.516744", "0.51660925", "0.5159859", "0.51592773", "0.5148193", "0.51336265", "0.51334095", "0.51293105", "0.5129232", "0.5126742", "0.51194525", "0.5107238", "0.5104408", "0.51007205", "0.5100224", "0.50954515", "0.50930196", "0.50909954", "0.5088863" ]
0.56967753
23
Create New User name User Name email unique email type user/admin dob date of birth address profession
public function create(Request $request) { try{ $data = $request->all(); $data['email_verified_at'] = Carbon::now(); $data['password'] = Hash::make($data['password']); $created = User::create($data); if(isset($created)){ return response()->json([ 'status' => 'success', 'data' => $created, 'message' => '', ]); }else{ return response()->json([ 'status' => 'failed', 'data' => [], 'message' => 'Parameter is wrong or missing!', ]); } }catch (\Exception $exception) { return response()->json([ 'status' => 'Exception', 'data' => [], 'error_code' => $exception->getCode(), 'message' => $exception->getMessage(), ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function CreateUser(string $name, \n string $username, \n string $email, \n string $password, \n string $birthdate)\n {\n\n }", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "protected function _createUser()\n {\n $data = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }", "public function doCreate() {\n if(\n isset($_POST['email']) &&\n isset($_POST['password']) &&\n isset($_POST['lastName']) &&\n isset($_POST['firstName']) &&\n isset($_POST['address']) &&\n isset($_POST['postalCode']) &&\n isset($_POST['city'])\n ) {\n $alreadyExist = $this->userManager->findByEmail($_POST['email']);\n\n if(!$alreadyExist) {\n $newUser = new User($_POST);\n $this->userManager->create($newUser);\n $page = 'login';\n }\n else {\n $error = \"ERROR : This email (\".$_POST['email'].\") is used by another user\";\n $page = 'create';\n }\n }\n\n require('./View/default.php');\n }", "function create_user($name, $email, $pass, $type, $sex, $dob)\n\t{\n\t\t$con = dbConnect(\"localhost\", \"root\", \"\", \"jobportal\");\n\t\tif($con)\n\t\t{\n\t\t\t//Insertion into User Master\n\t\t\tmysqli_query($con, \"INSERT INTO user_master(uName, uEmail, uPass,\n\t\t\tuType, uSex, uDob) VALUES ('$name', '$email', '$pass', '$type', '$sex', '$dob')\");\n\t\t\t\n\t\t\t//Last ID generated\n\t\t\t$uId = mysqli_insert_id($con);\n\t\t\treturn $uId;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "protected function createUser ()\n {\n /* Method of the UserFactory class */\n $this->_objUser = UserFactory::createUser(ucfirst($_SESSION[\"userType\"])); \n $this->_objUser->setFirstName($_SESSION[\"emailID\"]);\n }", "public function create_user()\n\t{\n\t\tif (!$this->ion_auth->logged_in())\n\t\t{\n\t\t\t// redirect them to the login page\n\t\t\tredirect('/admin/login', 'refresh');\n\t\t}\n\t\t$this->data['title'] = $this->lang->line('create_user_heading');\n\n\t\t//See the ion_auth config to check if allow_user_registration is TRUE\n\t\tif( ! $this->config->item('allow_user_registration', 'ion_auth')){\n\n\t\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t\t{\n\t\t\t\tredirect('/admin', 'refresh');\n\t\t\t}\n\n\t\t}\n\n\n\t\t$tables = $this->config->item('tables', 'ion_auth');\n\t\t$identity_column = $this->config->item('identity', 'ion_auth');\n\t\t$this->data['identity_column'] = $identity_column;\n\n\t\t// validate form input\n\t\t$this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'trim|required');\n\t\t$this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'trim|required');\n\t\tif ($identity_column !== 'email')\n\t\t{\n\t\t\t$this->form_validation->set_rules('identity', $this->lang->line('create_user_validation_identity_label'), 'trim|required|is_unique[' . $tables['users'] . '.' . $identity_column . ']');\n\t\t\t$this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'trim|required|valid_email');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'trim|required|valid_email|is_unique[' . $tables['users'] . '.email]');\n\t\t}\n\t\t$this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'trim');\n\t\t$this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'trim');\n\t\t$this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n\t\t$this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n\t\tif ($this->form_validation->run() === TRUE)\n\t\t{\n\t\t\t$email = strtolower($this->input->post('email'));\n\t\t\t$identity = ($identity_column === 'email') ? $email : $this->input->post('identity');\n\t\t\t$password = $this->input->post('password');\n\n\t\t\t$additional_data = array(\n\t\t\t\t'first_name' => $this->input->post('first_name'),\n\t\t\t\t'last_name' => $this->input->post('last_name'),\n\t\t\t\t'company' => $this->input->post('company'),\n\t\t\t\t'phone' => $this->input->post('phone'),\n\t\t\t);\n\t\t}\n\t\tif ($this->form_validation->run() === TRUE && $this->ion_auth->register($identity, $password, $email, $additional_data))\n\t\t{\n\t\t\t// check to see if we are creating the user\n\t\t\t// redirect them back to the admin page\n\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\tredirect(\"auth\", 'refresh');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// display the create user form\n\t\t\t// set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['first_name'] = array(\n\t\t\t\t'name' => 'first_name',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'first_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('first_name'),\n\t\t\t);\n\t\t\t$this->data['last_name'] = array(\n\t\t\t\t'name' => 'last_name',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'last_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('last_name'),\n\t\t\t);\n\t\t\t$this->data['identity'] = array(\n\t\t\t\t'name' => 'identity',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'identity',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('identity'),\n\t\t\t);\n\t\t\t$this->data['email'] = array(\n\t\t\t\t'name' => 'email',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'email',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('email'),\n\t\t\t);\n\t\t\t$this->data['company'] = array(\n\t\t\t\t'name' => 'company',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'company',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('company'),\n\t\t\t);\n\t\t\t$this->data['phone'] = array(\n\t\t\t\t'name' => 'phone',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'phone',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('phone'),\n\t\t\t);\n\t\t\t$this->data['password'] = array(\n\t\t\t\t'name' => 'password',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'password',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password'),\n\t\t\t);\n\t\t\t$this->data['password_confirm'] = array(\n\t\t\t\t'name' => 'password_confirm',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'password_confirm',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password_confirm'),\n\t\t\t);\n\n\n\t\t\t$this->load->view('templates/header',$this->data);\n\t\t\t$this->load->view('/admin/create_user');\n\t\t\t$this->load->view('templates/footer');\n\t\t}\n\t}", "function _create_user($user_data){\n \n $person_id=$this->model->insert($user_data);\n return $person_id;\n \n }", "function createUser() {\n\t\t$new_member_insert_data = array(\n\t\t\t'User_Mail_address' => $this->input->post('email_address'),\n\t\t\t'User_Name' => $this->input->post('username'),\n\t\t\t'User_Pwd' => md5($this->input->post('password'))\n\t\t);\n\t\t$insert = $this->db->insert('users', $new_member_insert_data);\n\t\treturn $insert;\n\t}", "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "function create_newuser($data){\n\tglobal $DB, $CFG, $USER;\n\t$atalvariables = get_atalvariables();\n\t$roleid = theme_get_roleidbyname('student');\n\t$schoolname = '';\n\t$city = '';\n\tif ($data->flag == 'add') {\n\t\t// Creating new user.\n\t\t$usertype = $data->usertype;\n\t\tif($usertype=='student'){\n\t\t\t//Can only be created by incharge login [logged in user id used to fetch the school id]\n\t\t\t$schooldata = $DB->get_record('user_school', array('userid'=>$USER->id), '*', MUST_EXIST);\n\t\t\t$schoolid = (isset($schooldata->schoolid))?$schooldata->schoolid:0;\n\t\t\t$roleid = theme_get_roleidbyname('student');\n\t\t} else{\n\t\t\t$schoolid = $data->school;\n\t\t\t$roleid = theme_get_roleidbyname($usertype);\n\t\t}\n\t\t$state = \"0\";\n\t\t$sql = \"SELECT s.name,c.name as city,ss.name as state FROM {school} s JOIN {city} c ON s.cityid = c.id LEFT JOIN {state} ss ON c.stateid=ss.id WHERE s.id=\".$schoolid;\n\t\t$result = $DB->get_record_sql($sql);\n\t\tif(isset($result->name)){\n\t\t\t$schoolname = $result->name;\n\t\t $city = $result->city;\n\t\t\t$state = (!empty($result->state))?$result->state:'0';\n\t\t}\n\t\t$user = new stdClass();\n\t\t$user->auth = 'manual';\n\t\t$user->confirmed = 1;\n\t\t$user->deleted = 0;\n\t\t$user->timezone = '99';\n\t\t$user->mnethostid = 1;\n\t\tif(isset($data->username)){\n\t\t\t$user->username = $data->username;\n\t\t}\n\t\telse\n\t\t\t$user->username = trim($data->email);\n\t\t//$user->password = hash_internal_user_password($data->newpassword);\n\t\t$ran = generate_randomstring();\n\t\t$user->passraw = $ran;\n\t\t$user->password=hash_internal_user_password($ran);\n\t\t$user->firstname = $data->firstname;\n\t\t$user->lastname = $data->lastname;\n\t\t$user->email = $data->email;\n\t\t$user->icq = \"newuser\";\n\t\t$user->msn = $roleid;\n\t\t$user->institution = $schoolname;\n\t\t$user->city = $city;\n\t\t/* if(isset($data->state)){\n\t\t\t$user->aim = $data->state;\n\t\t} */\n\t\t$user->aim = (isset($data->state) && !empty($data->state))?$data->state:$state;\n\t\t$user->country = 'IN';\n\t\t$user->timecreated = time();\n\t\t$user->timemodified = time();\n\t\tif(isset($data->gender)){\n\t\t\t$user->gender = $data->gender;\n\t\t}\n\t\tif(isset($data->phone1)){\n\t\t\t$user->phone1 = $data->phone1;\n\t\t}\n\t\t// Insert the user into the database.\n\t\t$newuserid = $DB->insert_record('user', $user);\n\t\t$usercontext = context_user::instance($newuserid);\n\t\t$cm = new stdClass();\n\t\t$cm->userid = $newuserid;\n\t\t$cm->schoolid = $schoolid;\n\t\t$cm->role = $usertype;\n\t\tif(isset($data->studentclass)){\n\t\t\t$cm->studentclass = $data->studentclass;\n\t\t}\n\t\t$DB->insert_record('user_school', $cm);\n\t}\n\t$name = $user->firstname.' '.$user->lastname;\n\tsend_welcomemail($roleid,$newuserid,$name,$data->email,$user->username,$ran);\n\treturn true;\n}", "public function create_user($user)\n{\t\n\t $uname=$user->__get('uname');\n\t//echo $username;\n\t $pwd=$user->__get('password');\n\t $fname=$user->__get('fname');\n\t $lname=$user->__get('lname');\n\t $mail=$user->__get('email');\n\t $gender=$user->__get('gender');\n\t $role=$user->__get('role');\n\t $dob=$user->__get('dob');\n\t$con = connect();\n\tmysqli_query($con, \"INSERT INTO user VALUES(NULL,'$fname','$lname','$uname','$pwd','$mail','$gender',STR_TO_DATE('$dob','%m/%d/%Y'),'$role')\");\n}", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}", "public function createUser()\n {\n }", "public function createEnterpriseUser($input);", "function createUser() {\n $data = array(\n 'userName' => $this->input->post('username'),\n 'email' => $this->input->post('email'),\n 'status' => 0,\n 'roleID' => 5,\n 'password' => md5($this->input->post('password').SALT),\n );\n $this->db->insert('user', $data);\n }", "function create_user()\n\t{\n\t\t$this->data['title'] = \"Create User\";\n\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('auth', 'refresh');\n\t\t}\n\n\t\t$tables = $this->config->item('tables','ion_auth');\n\n\t\t//validate form input\n\t\t$this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique['.$tables['users'].'.email]');\n\t\t$this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n\t\t$this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n\t\tif ($this->form_validation->run() == true)\n\t\t{\n\t\t\t$username = strtolower($this->input->post('first_name')) . ' ' . strtolower($this->input->post('last_name'));\n\t\t\t$email = strtolower($this->input->post('email'));\n\t\t\t$password = $this->input->post('password');\n\n\t\t\t$additional_data = array(\n\t\t\t\t'first_name' => $this->input->post('first_name'),\n\t\t\t\t'last_name' => $this->input->post('last_name'),\n\t\t\t\t'company' => $this->input->post('company'),\n\t\t\t\t'phone' => $this->input->post('phone'),\n\t\t\t);\n\t\t}\n\t\tif ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data))\n\t\t{\n\t\t\t//check to see if we are creating the user\n\t\t\t//redirect them back to the admin page\n\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\tredirect(\"auth\", 'refresh');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//display the create user form\n\t\t\t//set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['first_name'] = array(\n\t\t\t\t'name' => 'first_name',\n\t\t\t\t'id' => 'first_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('first_name'),\n\t\t\t);\n\t\t\t$this->data['last_name'] = array(\n\t\t\t\t'name' => 'last_name',\n\t\t\t\t'id' => 'last_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('last_name'),\n\t\t\t);\n\t\t\t$this->data['email'] = array(\n\t\t\t\t'name' => 'email',\n\t\t\t\t'id' => 'email',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('email'),\n\t\t\t);\n\t\t\t$this->data['company'] = array(\n\t\t\t\t'name' => 'company',\n\t\t\t\t'id' => 'company',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('company'),\n\t\t\t);\n\t\t\t$this->data['phone'] = array(\n\t\t\t\t'name' => 'phone',\n\t\t\t\t'id' => 'phone',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('phone'),\n\t\t\t);\n\t\t\t$this->data['password'] = array(\n\t\t\t\t'name' => 'password',\n\t\t\t\t'id' => 'password',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password'),\n\t\t\t);\n\t\t\t$this->data['password_confirm'] = array(\n\t\t\t\t'name' => 'password_confirm',\n\t\t\t\t'id' => 'password_confirm',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password_confirm'),\n\t\t\t);\n\n\t\t\t$this->_render_page('auth/create_user', $this->data);\n\t\t}\n\t}", "function createUser($username, $password, $email, $user_type, $additional_data)\n {\n\n //check email avialability\n if ($this->email_check($email)) {\n $this->uniportal->set_error('Email already exist.');\n return FALSE;\n }\n\n //check username avialability\n if ($this->username_check($username)) {\n $this->uniportal->set_error('User name already exit.');\n return FALSE;\n }\n\n $password = sha1($password);\n\n // USERS table.\n $data = array(\n 'USERNAME' => $username,\n 'PASSWORD' => $password,\n 'EMAIL' => $email,\n 'USERTYPE' => $user_type,\n 'FIRST_NAME' => $additional_data['first_name'],\n 'MIDDLE_NAME' => $additional_data['middle_name'],\n 'LAST_NAME' => $additional_data['last_name'],\n 'GENDER' => $additional_data['gender'],\n 'DATE_BIRTH' => $additional_data['date_birth'],\n 'MARITAL_STAUS' => $additional_data['marital_staus'],\n 'ACADEMIC_YEAR' => $additional_data['academic_year'],\n 'REGISTRATION_NUMBER' => $additional_data['registration_no'],\n 'EMPLOYEE_NUMBER' => $additional_data['employee_no'],\n 'CREATED_ON' => now(),\n 'LAST_LOGIN' => now(),\n 'ACTIVE' => 1,\n );\n\n $this->db->insert($this->table['USERS'], $data);\n\n // Meta table.\n $id = $this->db->insert_id();\n return $this->db->affected_rows() > 0 ? $id : false;\n }", "public function create() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"INSERT INTO users (id, mail, name, password, role, state) VALUES (?, ?, ?, ?, ?, ?)\");\n\t\t$stmt->execute(array($this->id, $this->mail, $this->name, $this->password, $this->role, $this->state));\n\t}", "function autoregister_create_new_user($itemId)\n {\n $item = Item::newInstance()->findByPrimaryKey($itemId['pk_i_id']);\n // if not exist user\n if( $item['fk_i_user_id'] == NULL ) {\n // create new user + send email\n $name = $item['s_contact_name'];\n $email = $item['s_contact_email'];\n // prepare data for register user\n $aux_password = osc_genRandomPassword();\n // clear params ....\n $input = array();\n $input['s_name'] = Params::getParam('s_name') ;\n Params::setParam('s_name', $name ); // from inserted item\n $input['s_email'] = Params::getParam('s_email') ;\n Params::setParam('s_email', $email ); // from inserted item\n $input['s_password'] = Params::getParam('s_password') ;\n Params::setParam('s_password', $aux_password ); // generated\n $input['s_password2'] = Params::getParam('s_password2') ;\n Params::setParam('s_password2', $aux_password ); // generated\n $input['s_website'] = Params::getParam('s_website') ;\n Params::setParam('s_website', '');\n $input['s_phone_land'] = Params::getParam('s_phone_land') ;\n Params::setParam('s_phone_land', '');\n $input['s_phone_mobile'] = Params::getParam('s_phone_mobile') ;\n Params::setParam('s_phone_mobile', '');\n $input['countryId'] = Params::getParam('countryId');\n Params::setParam('countryId', '');\n $input['regionId'] = Params::getParam('regionId');\n Params::setParam('regionId', '');\n $input['cityId'] = Params::getParam('cityId');\n Params::setParam('cityId', '');\n $input['cityArea'] = Params::getParam('cityArea') ;\n Params::setParam('cityArea', '');\n $input['address'] = Params::getParam('address') ;\n Params::setParam('address', '');\n $input['b_company'] = (Params::getParam('b_company') != '' && Params::getParam('b_company') != 0) ? 1 : 0 ;\n Params::setParam('b_company', '0');\n\n require_once LIB_PATH . 'osclass/UserActions.php' ;\n $userActions = new UserActions(false) ;\n $success = $userActions->add() ;\n\n switch($success) {\n case 1: osc_add_flash_ok_message( _m('The user has been created. An activation email has been sent')) ;\n $success = true;\n break;\n case 2: osc_add_flash_ok_message( _m('Your account has been created successfully')) ;\n $success = true;\n break;\n case 3: osc_add_flash_warning_message( _m('The specified e-mail is already in use')) ;\n $success = false;\n break;\n case 4: osc_add_flash_error_message( _m('The reCAPTCHA was not entered correctly')) ;\n $success = false;\n break;\n case 5: osc_add_flash_warning_message( _m('The email is not valid')) ;\n $success = false;\n break;\n case 6: osc_add_flash_warning_message( _m('The password cannot be empty')) ;\n $success = false;\n break;\n case 7: osc_add_flash_warning_message( _m(\"Passwords don't match\")) ;\n $success = false;\n break;\n }\n\n if($success) {\n Log::newInstance()->insertLog('plugin_autoregister', 'autoregister', '', $email.' '.$_SERVER['REMOTE_ADDR'], 'autoregister', osc_logged_admin_id()) ;\n // update user of item\n $user = User::newInstance()->findByEmail($email);\n Item::newInstance()->update(array('fk_i_user_id' => $user['pk_i_id'] ), array('pk_i_id' => $itemId ) );\n $item = Item::newInstance()->findByPrimaryKey($itemId);\n\n autoregister_sendMail($email, $user, $aux_password);\n\n // not activated\n if( $item['b_active'] != 1 ) {\n osc_run_hook('hook_email_item_validation', $item);\n }\n }\n\n // set params again\n Params::setParam('s_name', $input['s_name']);\n Params::setParam('s_email', $input['s_email']);\n Params::getParam('s_password', $input['s_password']) ;\n Params::getParam('s_password2', $input['s_password2']) ;\n Params::setParam('s_website', $input['s_website']);\n Params::setParam('s_phone_land', $input['s_phone_land']);\n Params::setParam('s_phone_mobile', $input['s_phone_mobile']);\n Params::setParam('countryId', $input['countryId']);\n Params::setParam('regionId', $input['regionId']);\n Params::setParam('cityId', $input['cityId']);\n Params::setParam('cityArea', $input['cityArea'] );\n Params::setParam('address', $input['address']);\n Params::setParam('b_company', $input['b_company']);\n // end\n }\n }", "public function create($salutation, $firstname, $lastname, $street, $streetnr, $city, $citynr, $birthdate, $email, $tel, $mobile, $language, $username, $password, $salt) {\n\t\t\n\t\tif(!$this->_db->createUser($salutation, $firstname, $lastname, $street, $streetnr, $city, $citynr, $birthdate, $email, $tel, $mobile, $language, $username, $password, $salt)){\n\t\t\tthrow new Exception('Sorry, there was a problem creating your account;');\r\n\t\t}\r\n\t}", "public function actionCreate() {\n $this->pageTitle = \"Thamor - Register\";\n $model = new User('register');\n $model->country = \"Canada\";\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['User'])) {\n\n $model->attributes = $_POST['User'];\n // echo $model->dob; exit;\n if ($model->validate()) {\n $model->password = md5($model->password);\n $model->updated_at = date(\"Y-m-d H:i:s\");\n $model->status = USER::USER_PENDING;\n\n $model->save();\n Yii::app()->user->setFlash('register', 'Registation Successful! You can login after we approve your application within 24 Hours.');\n if (Yii::app()->user->isAdmin()) {\n $this->redirect(array('/user/admin'));\n } else {\n $this->redirect(array('/user/success'));\n }\n }\n }\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function createUser(){\n \n $password = DbrLib::rand_string(8);\n \n /**\n * create username \n */\n $firstName = strtolower(self::translitStringToAscii($this->pprs_first_name));\n $secondName = strtolower(self::translitStringToAscii($this->pprs_second_name));\n $username = $firstName . substr($secondName, 0, 1);\n $i = 1;\n while(User::model()->findByAttributes(['username'=>$username])){\n $i ++;\n if($i> strlen($secondName)){\n $username = $firstName . DbrLib::rand_string(2);\n }\n $username = $firstName . substr($secondName, 0, $i); \n }\n \n /**\n * get email from person contacts\n */\n $contacts = $this->ppcnPersonContacts;\n $email = '';\n foreach($contacts as $contact){\n if($contact->ppcn_pcnt_type == PcntContactType::TYPE_EMAIL ){\n $email = trim($contact->ppcn_value);\n }\n }\n \n /**\n * create user record\n */\n $user = new User();\n $user->username = $username;\n $user->password = $password;\n $user->email = $email;\n $user->status = User::STATUS_ACTIVE;\n \n if(!$user->validate()){\n return CHtml::errorSummary($user);\n }\n \n $user->save();\n \n /**\n * create profile record\n */\n $profile=new Profile;\n $profile->user_id=$user->id;\n $profile->first_name = $this->pprs_first_name;\n $profile->last_name = $this->pprs_second_name;\n $profile->sys_ccmp_id = Yii::app()->sysCompany->getActiveCompany();\n $profile->person_id=$this->primaryKey;\n\t\t$profile->save(); \n \n return true;\n \n \n }", "function create_user()\n{\n\t// Check to see if the account is admin\n\t$account_type = account_type();\n\t\n\tif ( $account_type == 0 )\n\t{\n\t\t// Connect to the database\n\t\t$link = dbConnect();\n\t\t\n\t\t$query = mysql_query( \"SELECT first_name, last_name FROM BCD_User WHERE username = '\" . $_SESSION[ 'username' ] . \"'\" );\n\t\t\n\t\t// Close the database\n\t\tdbClose( $link );\n\t}\n}", "public function create() \n\t{\n\t\n\t\t$this->form_validation->set_rules('firstname', 'First name', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('lastname', 'Last name', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('email', 'Email address', 'trim|required|valid_email|xss_clean');\n\t\t$this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean|min_length[8]|max_length[20]');\n\t\t$this->form_validation->set_rules('group', 'Role', 'trim|required|xss_clean');\n\t\t\n\t\t\n\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\n\t\t\t$this->session->set_flashdata('error_message', $this->lang->line('users_create_error1').validation_errors());\n\t\t\t\n\t\t\tredirect(\"/users/\", \"refresh\");\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$userID = $this->usermodel->newUser($_POST);\n\t\t\t\n\t\t\t$this->session->set_flashdata('success_message', $this->lang->line('users_create_success'));\n\t\t\t\n\t\t\t\n\t\t\t//send email\n\t\t\t$this->load->library('email');\n\t\t\t\n\t\t\t$this->email->from($this->config->item('support_email'), $this->config->item('support_name'));\n\t\t\t$this->email->to($_POST['email']); \n\t\t\t\n\t\t\t$this->email->subject('Your new Databased account');\n\t\t\t$this->email->message( $this->load->view('auth/email/new', array('email'=>$_POST['email'], 'password'=>$_POST['password']), true ) );\t\n\t\t\t\n\t\t\t$this->email->send();\n\t\t\t\n\t\t\t//echo $this->email->print_debugger();\n\t\t\t\n\t\t\tredirect(\"/users/\".$userID, \"refresh\");\n\t\t\n\t\t}\n\t\n\t}", "function makeUser($firstname, $lastname, $username, $email, $department, $isReadOnly){\n $password = genPassword(7);\n $md5_password = md5($password);\n sqlQuery(\"INSERT INTO users SET user_firstname='$firstname', user_lastname='$lastname', user_username='$username', user_email='$email', user_isreadonly='$isReadOnly', user_department='$department', user_password='$md5_password'\");\n sendSignupEmail(getUserId($username), $password);\n alog(\"Added user $username\");\n}", "function create_user($username, $password, $email)\n {\n }", "function new_user($firstName,$lastName,$email,$password){\t\n $salt = generate_salt();\n $encPassword = encrypt_password($password,$salt);\n\n //$user = create_user_object($firstName,$lastName,$email,$encPassword,$salt,$userType);\n save_user_info($firstName,$lastName,$email,$encPassword,$salt);\n \n return true;\n}", "public function create($fname, $lname, $email, $password, $cpassword, $user_type) {\n // sanitize input\n \n // validate the email\n if($this->validateEmail($email)) {\n \n // validate the passwords\n if($this->validatePassword($password)) {\n //\n }\n\n }\n \n }", "public function actionCreate()\n {\n Yii::$app->getView()->params['title'] = '<i class=\"glyphicon glyphicon-edit\"></i> Пользователи: создать';\n $model = new User();\n\n if ($model->load(Yii::$app->request->post())) {\n $password = Yii::$app->security->generatePasswordHash($model->password);\n $model->password = $password;\n $date = Yii::$app->formatter->asDate($model->birthday, 'php:Y-m-d');\n $model->birthday=$date;\n if ($model->save()) {\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "function admin_insert_new_user(){\r\n\t\tif(isset($_POST['doctor_create_user'])){\r\n\t\t\t$result['insert_new_user_data'] = $this->model->insert_new_user();\r\n\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t}\r\n\t\tif(isset($_POST['doctor_update_user'])){\r\n\t\t\tif($this->model->update_new_user_record()){\r\n\t\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t\t} \r\n\t\t} \r\n\t}", "public function create_user()\n {\n $this->data['title'] = $this->lang->line('create_user_heading');\n\n if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n {\n redirect('admin', 'refresh');\n }\n\n $tables = $this->config->item('tables','ion_auth');\n $identity_column = $this->config->item('identity','ion_auth');\n $this->data['identity_column'] = $identity_column;\n\n // validate form input\n $this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required');\n $this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required');\n if($identity_column!=='email')\n {\n $this->form_validation->set_rules('identity',$this->lang->line('create_user_validation_identity_label'),'required|is_unique['.$tables['users'].'.'.$identity_column.']');\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email');\n }\n else\n {\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique[' . $tables['users'] . '.email]');\n }\n\n $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n if ($this->form_validation->run() == true)\n {\n $email = strtolower($this->input->post('email'));\n $identity = ($identity_column==='email') ? $email : $this->input->post('identity');\n $password = $this->input->post('password');\n\n $additional_data = array(\n 'first_name' => $this->input->post('first_name'),\n 'last_name' => $this->input->post('last_name'),\n 'company' => $this->input->post('company'),\n 'phone' => $this->input->post('phone'),\n );\n }\n if ($this->form_validation->run() == true && $this->ion_auth->register($identity, $password, $email, $additional_data))\n {\n // check to see if we are creating the user\n // redirect them back to the admin page\n $this->session->set_flashdata('message', $this->ion_auth->messages());\n redirect(\"/admin/users\", 'refresh');\n }\n else\n {\n // display the create user form\n // set the flash data error message if there is one\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n $this->data['first_name'] = array(\n 'name' => 'first_name',\n 'id' => 'first_name',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('first_name'),\n );\n $this->data['last_name'] = array(\n 'name' => 'last_name',\n 'id' => 'last_name',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('last_name'),\n );\n $this->data['identity'] = array(\n 'name' => 'identity',\n 'id' => 'identity',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('identity'),\n );\n $this->data['email'] = array(\n 'name' => 'email',\n 'id' => 'email',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('email'),\n );\n $this->data['company'] = array(\n 'name' => 'company',\n 'id' => 'company',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('company'),\n );\n $this->data['phone'] = array(\n 'name' => 'phone',\n 'id' => 'phone',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('phone'),\n );\n $this->data['password'] = array(\n 'name' => 'password',\n 'id' => 'password',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password'),\n );\n $this->data['password_confirm'] = array(\n 'name' => 'password_confirm',\n 'id' => 'password_confirm',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password_confirm'),\n );\n\n\t\t\t$this->template->set('title', 'Users - Create');\n\t\t\t$this->template->load('admin/default_layout', 'contents' , 'admin/create_user', $this->data);\n }\n }", "function create_user()\r\n\t{\r\n\t\t$additional_data = array();\r\n\t\tif ($this->form_validation->run() == true)\r\n\t\t{\r\n\t\t\t$nickname \t= $this->input->post('nickname');\r\n\t\t\t$email \t= $this->input->post('email');\r\n\t\t\t$password \t= $this->input->post('password');\r\n\t\t\t$national\t= $this->input->post('national');\r\n\t\t\t$plan \t\t= $this->input->post('plan');\r\n\t\t\t$ed_level\t= $this->input->post('ed_level');\r\n\t\t\t$lang\t\t= $this->input->post('lang');\r\n\t\t\t$gender\t= $this->input->post('gender');\r\n\t\t\t\r\n\t\t\t$additional_data = array(\r\n\t\t\t\t'email'\t\t\t\t=> $email,\r\n\t\t\t\t'pass' \t\t\t=> $password,\r\n\t\t\t\t'nickname' \t\t\t=> $nickname,\r\n\t\t\t\t'last_name' \t\t\t=> '',\r\n\t\t\t\t'middle_name'\t\t\t=> '',\r\n\t\t\t\t'first_name'\t\t\t=> '',\r\n\t\t\t\t'gender'\t\t\t\t=> $gender,\r\n\t\t\t\t'addr1'\t\t\t\t=> '',\r\n\t\t\t\t'addr2'\t\t\t\t=> '',\r\n\t\t\t\t'addr3'\t\t\t\t=> '',\r\n\t\t\t\t'country'\t\t\t\t=> '',\r\n\t\t\t\t'zip_code'\t\t\t\t=> '',\r\n\t\t\t\t'nationality' \t\t=> $national,\r\n\t\t\t\t'ethnicity' \t\t\t=> '',\r\n\t\t\t\t'birthday_day' \t\t=> '',\r\n\t\t\t\t'birthday_month' \t\t=> '',\r\n\t\t\t\t'birthday_year' \t\t=> '',\r\n\t\t\t\t'language' \t\t\t=> $lang,\r\n\t\t\t\t'currently_school' \t=> '',\r\n\t\t\t\t'graduation_year' \t=> '',\r\n\t\t\t\t'area_of_interests' \t=> '',\r\n\t\t\t\t'major' \t\t\t\t=> '',\r\n\t\t\t\t'parents_email' \t\t=> '',\r\n\t\t\t\t'grade' \t\t\t\t=> $ed_level,\r\n\t\t\t\t'activationKey' \t\t=> mt_rand() . mt_rand() . mt_rand() . mt_rand() . mt_rand(),\r\n\t\t\t\t'remember_code'\t\t=> sha1($password)\r\n\t\t\t);\r\n\r\n\t\t}\r\n\r\n\r\n\t\tif ($this->form_validation->run() == true && $this->ion_auth->register($email, $password, $additional_data))\r\n\t\t{\r\n\t\t\t//check to see if we are creating the user\r\n\t\t\t//redirect them back to the admin page\r\n\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\r\n\t\t\tredirect(\"dashboard\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');\r\n\t\t\t\r\n\t\t\t$this->session->set_flashdata('app_error', $this->ion_auth->errors());\r\n\t\t\t\r\n\t\t\t$data['national'] = $this->config->item('national');\r\n\t\t\t\r\n\t\t\t$data['nickname'] = array('name' => 'nickname',\r\n\t\t\t\t'id' => 'nickname',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'value' => $this->form_validation->set_value('nickname'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'NICKNAME *'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['email'] = array('name' => 'email',\r\n\t\t\t\t'id' => 'email',\r\n\t\t\t\t'type' => 'email',\r\n\t\t\t\t'value' => $this->form_validation->set_value('email'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'EMAIL ADDRESS'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['password'] = array('name' => 'password',\r\n\t\t\t\t'id' => 'password',\r\n\t\t\t\t'type' => 'password',\r\n\t\t\t\t'value' => $this->form_validation->set_value('password'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'PASSWORD'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['cpassword'] = array('name' => 'cpassword',\r\n\t\t\t\t'id' => 'cpassword',\r\n\t\t\t\t'type' => 'password',\r\n\t\t\t\t'value' => $this->form_validation->set_value('cpassword'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'CONFIRM PASSWORD'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['lang'] = array('name' => 'lang',\r\n\t\t\t\t'id' => 'lang',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'LANGUAGE SPOKEN'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['show_form'] = \"show\";\r\n\r\n\t\t\t\r\n\t\t\t$this->render_page('signup/index', $data);\r\n\t\t}\r\n\t}", "public function createUser($first, $last, $email, $UTEPID, $fmajor, $smajor, $minor, $concentration, $p) {\r\n if($this -> testConnection()) {\r\n $key = hash('sha256', $p);\r\n $req = 'INSERT INTO `user_info` (uid, firstname, lastname, email, utepid, fmajor, smajor, minor, concentration)\r\n VALUES (\"'.$key.'\", \"'.$first.'\", \"'.$last.'\", \"'.$email.'\", \"'.$UTEPID.'\", \"'.$fmajor.'\", \"'.$smajor.'\", \"'.$minor.'\", \"'.$concentration.'\" )';\r\n\r\n if($this -> c -> query($req) === TRUE) {\r\n echo \"User created successfully.\";\r\n return TRUE;\r\n } else {\r\n echo \"Error creating record: \".$this -> c -> error;\r\n return FALSE;\r\n }\r\n } else echo \"Not connected to server.\";\r\n return FALSE;\r\n }", "public function create_user()\n {\n $this->data['title'] = $this->lang->line('create_user_heading');\n\n if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n {\n redirect('auth', 'refresh');\n }\n\n $tables = $this->config->item('tables','ion_auth');\n $identity_column = $this->config->item('identity','ion_auth');\n $this->data['identity_column'] = $identity_column;\n\n // validate form input\n $this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required');\n $this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required');\n if($identity_column!=='email')\n {\n $this->form_validation->set_rules('identity',$this->lang->line('create_user_validation_identity_label'),'required|is_unique['.$tables['users'].'.'.$identity_column.']');\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email');\n }\n else\n {\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique[' . $tables['users'] . '.email]');\n }\n $this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'trim');\n $this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'trim');\n $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n if ($this->form_validation->run() == true)\n {\n $email = strtolower($this->input->post('email'));\n $identity = ($identity_column==='email') ? $email : $this->input->post('identity');\n $password = $this->input->post('password');\n\n $additional_data = array(\n 'first_name' => $this->input->post('first_name'),\n 'last_name' => $this->input->post('last_name'),\n 'company' => $this->input->post('company'),\n 'phone' => $this->input->post('phone'),\n );\n }\n if ($this->form_validation->run() == true && $this->ion_auth->register($identity, $password, $email, $additional_data))\n {\n // check to see if we are creating the user\n $this->emailNotification($identity, $email, $password);\n // redirect them back to the admin page\n $this->session->set_flashdata('message', $this->ion_auth->messages());\n redirect(\"auth\", 'refresh');\n }\n else\n {\n\t\t\t\n\t\t\t//var_dump($ss);exit;\n // display the create user form\n // set the flash data error message if there is one\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n $this->data['first_name'] = array(\n 'name' => 'first_name',\n 'id' => 'first_name',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('first_name'),\n );\n $this->data['last_name'] = array(\n 'name' => 'last_name',\n 'id' => 'last_name',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('last_name'),\n );\n $this->data['identity'] = array(\n 'name' => 'identity',\n 'id' => 'identity',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('identity'),\n );\n $this->data['email'] = array(\n 'name' => 'email',\n 'id' => 'email',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('email'),\n );\n $this->data['organisation'] = array(\n 'name' => 'company',\n 'id' => 'organisation',\n 'type' => 'select',\n 'options' => $this->get_options(),\n );\n $this->data['company'] = array(\n 'name' => 'company',\n 'id' => 'company',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('company'),\n );\n $this->data['phone'] = array(\n 'name' => 'phone',\n 'id' => 'phone',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('phone'),\n );\n $this->data['password'] = array(\n 'name' => 'password',\n 'id' => 'password',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password'),\n );\n $this->data['password_confirm'] = array(\n 'name' => 'password_confirm',\n 'id' => 'password_confirm',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password_confirm'),\n );\n\n $this->_render_page('auth/create_user', $this->data);\n }\n }", "public function create_table_new_user(){\n $sql = \" CREATE TABLE IF NOT EXISTS {$this->table_new_user} (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(250) DEFAULT NULL,\n `lastname` varchar(250) DEFAULT NULL,\n `dni` varchar(50) DEFAULT NULL,\n `email` varchar(100) DEFAULT NULL,\n `phone` varchar(50) DEFAULT NULL,\n `day` datetime DEFAULT NULL,\n `hour` char(20) DEFAULT NULL,\n `deleted` boolean DEFAULT FALSE,\n `date` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n )\";\n\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n }", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function crea_user(){\n\t\tif ($this->input->post('tipo_persona')==\"Natural\") {\n\t\t\t$nombres = 'Nombres del titular';\n\t\t\t$apellid = 'Apellidos del titular';\n\t\t\t$cedulas = 'Cédula de identidad';\n\t\t\t$numerif = 'RIF del titular';\n\t\t} else {\n\t\t\t$nombres = 'Razón social';\n\t\t\t$apellid = 'Representante legal';\n\t\t\t$cedulas = 'C.I. Representante legal';\n\t\t\t$numerif = 'RIF de la empresa';\n\t\t}\n\t\tif ($this->input->post('nacionalidad')==\"Local\") {\n\t\t\t$condced = 'required|min_length[6]|max_length[8]|callback_validanumero';\n\t\t\t$condrif = 'required|min_length[9]|max_length[10]|callback_validarif';\n\t\t} else {\n\t\t\t$condced = 'required|min_length[6]|max_length[9]|callback_validanumero';\n\t\t\t$condrif = 'required|min_length[9]|max_length[11]|callback_validarif';\n\t\t}\n\t\t$this->form_validation->set_rules('tit_nombres', $nombres, 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('tit_apellidos', $apellid, 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('tit_cedula', $cedulas, $condced);\n\t\t$this->form_validation->set_rules('tit_rif', $numerif, $condrif);\n\t\tif ($this->input->post('tipo_persona')==\"Natural\") {\n\t\t\t$this->form_validation->set_rules('tit_fecha_nac', 'Fecha de nacimiento', 'required');\n\t\t\t$this->form_validation->set_rules('tit_edo_civil', 'Estado Civil', 'required');\n\t\t\t$this->form_validation->set_rules('tit_sexo', 'Sexo', 'required');\n\t\t\t$this->form_validation->set_rules('tit_profesion', 'Profesión', 'required|max_length[150]');\n\n\t\t\t$this->form_validation->set_rules('cot_nombres', 'Nombres del cotitular', 'max_length[150]');\n\t\t\t$this->form_validation->set_rules('cot_apellidos', 'Apellidos del cotitular', 'max_length[150]');\n\t\t\t$this->form_validation->set_rules('cot_cedula', 'Cédula de identidad', 'min_length[6]|max_length[9]|callback_validanumero');\n\t\t\t$this->form_validation->set_rules('cot_rif', 'RIF del cotitular', 'min_length[8]|max_length[11]|callback_validarif');\n\t\t}\n\t\t$this->form_validation->set_rules('calle', 'Calle/Avenida/Vereda', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('cruce', 'Cruce con/Entre calles', 'max_length[150]');\n\t\t$this->form_validation->set_rules('casa', 'Casa/Edificio', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('sector', 'Urbanización/Sector', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('piso', 'Piso Nro.', 'max_length[50]');\n\t\t$this->form_validation->set_rules('apto', 'Apto.', 'max_length[50]');\n\t\t$this->form_validation->set_rules('referencia', 'Punto de referencia', 'max_length[150]');\n\t\t$this->form_validation->set_rules('ciudad', 'Ciudad', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('municipio', 'Municipio', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('estado', 'Estado', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('parroquia', 'Parroquia', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('cod_postal', 'Código Postal', 'required|max_length[10]');\n\t\t$this->form_validation->set_rules('pais', 'País', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('tel_local', 'Teléfono Local', 'required|min_length[11]|max_length[50]|callback_validanumero');\n\t\t$this->form_validation->set_rules('tel_celular', 'Teléfono Celular', 'required|min_length[11]|max_length[50]|callback_validanumero');\n\t\t$this->form_validation->set_rules('email', 'Dirección de Correo Electrónico', 'required|max_length[150]|valid_email');\n/*\n\t\t$this->form_validation->set_rules('enrol_codigo', 'Código del enrolador', 'required|exact_length[5]|callback_validacodigo|callback_existecodigo');\n\t\t$this->form_validation->set_rules('enrol_nombre_completo', 'Nombres y Apellidos del enrolador', 'required|max_length[200]');\n\n\t\t$this->form_validation->set_rules('patroc_codigo', 'Código del patrocinador', 'required|exact_length[5]|callback_validacodigo|callback_existecodigo');\n\t\t$this->form_validation->set_rules('patroc_nombre_completo', 'Nombres y Apellidos del patrocinador', 'required|max_length[200]');\n*/\n\t\t$this->form_validation->set_rules('banco_nombre_cta', 'Nombre del titula de la cuenta', 'required|max_length[200]');\n\t\t$this->form_validation->set_rules('banco_numero_cta', 'Número de cuenta bancaria', 'required|min_length[13]|max_length[20]|callback_validanumero');\n\t\t$this->form_validation->set_rules('banco_nombre_bco', 'Nombre del Banco', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('banco_sucursal', 'Sucursal bancaria', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('banco_estado', 'Estado de ubicación del banco', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('banco_tipo_cta', 'Tipo de cuenta', 'required');\n\n\t\t$this->form_validation->set_message('required', 'El campo {field} es obligatorio, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('valid_email', 'Debe incluir un correo electrónico válido, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('max_length', 'El campo {field} no debe exceder de {param} caracteres, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('min_length', 'El campo {field} debe tener al menos {param} caracteres, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('exact_length', 'El campo {field} debe tener {param} caracteres, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('validanumero', 'El campo {field} sólo debe contener números, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('validarif', 'El campo {field} debe contener el formato válido para RIF (1 letra: V, J ó E) y hasta 10 números sin guiones ni puntos, pulse atrás para corregir');\n\n\t\tif ($this->form_validation->run() == FALSE){\n $this->registro();\n } else {\n\t\t\t$data = new stdClass();\n\t\t\t$data->title = \"MANNA - La Provisión que cambiará tu vida\";\n\t\t\t$data->contenido = \"apl/auth/contrato\"; //aqui es la dirección física del controlador\n\t\t\t$data->panel_title = \"Afiliación de aliados comerciales - Página 3 de 3\";\n\n\t\t\t$data->tit_nombres = $this->input->post('tit_nombres');\n \t$data->tit_apellidos = $this->input->post('tit_apellidos');\n \t$data->tit_cedula = $this->input->post('tit_cedula');\n \t$data->tit_rif = $this->input->post('tit_rif');\n \t$data->tit_fecha_nac = $this->input->post('tit_fecha_nac');\n \t$data->tit_edo_civil = $this->input->post('tit_edo_civil');\n \t$data->tit_sexo = $this->input->post('tit_sexo');\n \t$data->tit_profesion = $this->input->post('tit_profesion');\n \t$data->cot_nombres = $this->input->post('cot_nombres');\n \t$data->cot_apellidos = $this->input->post('cot_apellidos');\n \t$data->cot_cedula = $this->input->post('cot_cedula');\n \t$data->cot_rif = $this->input->post('cot_rif');\n \t$data->cot_fecha_nac = $this->input->post('cot_fecha_nac');\n \t$data->cot_edo_civil = $this->input->post('cot_edo_civil');\n \t$data->cot_sexo = $this->input->post('cot_sexo');\n \t$data->calle = $this->input->post('calle');\n \t$data->cruce = $this->input->post('cruce');\n \t$data->casa = $this->input->post('casa');\n \t$data->sector = $this->input->post('sector');\n \t$data->piso = $this->input->post('piso');\n \t$data->apto = $this->input->post('apto');\n \t$data->referencia = $this->input->post('referencia');\n \t$data->ciudad = $this->input->post('ciudad');\n \t$data->municipio = $this->input->post('municipio');\n \t$data->estado = $this->input->post('estado');\n \t$data->parroquia = $this->input->post('parroquia');\n \t$data->cod_postal = $this->input->post('cod_postal');\n \t$data->pais = $this->input->post('pais');\n \t$data->tel_local = $this->input->post('tel_local');\n \t$data->tel_celular = $this->input->post('tel_celular');\n \t$data->email = $this->input->post('email');\n \t$data->enrol_codigo = $this->input->post('enrol_codigo');\n \t$data->enrol_nombre_completo = $this->input->post('enrol_nombre_completo');\n \t$data->patroc_codigo = $this->input->post('patroc_codigo');\n \t$data->patroc_nombre_completo = $this->input->post('patroc_nombre_completo');\n \t$data->banco_nombre_cta = $this->input->post('banco_nombre_cta');\n \t$data->banco_numero_cta = $this->input->post('banco_numero_cta');\n \t$data->banco_nombre_bco = $this->input->post('banco_nombre_bco');\n \t$data->banco_sucursal = $this->input->post('banco_sucursal');\n \t$data->banco_estado = $this->input->post('banco_estado');\n \t$data->banco_tipo_cta = $this->input->post('banco_tipo_cta');\n \t$data->tipo_persona = $this->input->post('tipo_persona');\n \t$data->nacionalidad = $this->input->post('nacionalidad');\n \t$data->tipo_afiliado = $this->input->post('tipo_afiliado');\n \t$data->tipo_kit = $this->input->post('tipo_kit');\n \t$data->fechapago = $this->input->post('fechapago');\n// \t$data->fechapago = substr($this->input->post('fechapago'),6,4).\"-\".substr($this->input->post('fechapago'),3,2).\"-\".substr($this->input->post('fechapago'),0,2);\n \t$data->numcomprobante = $this->input->post('numcomprobante');\n \t$data->bancoorigen = $this->input->post('bancoorigen');\n \t$data->envio = $this->input->post('envio'); \t\n \t$data->direccion_envio = $this->input->post('direccion_envio');\n\n\t\t\t$data->active = \"registro\";\n\t\t\t$this->load->view('menu',$data);\n\t\t}\n\t}", "public function creat_new_user()\n {\n \n factory(User::class)->create();\n $respone=$this->post('/admin/category/create',[\n 'name' => 'Tuan',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'active'=>1,\n 'password' => '2', // password\n 'remember_token' => Str::random(10),\n ]);\n // $this->assertCount(8,User::all());\n }", "public function create()\n {\n\n if(strtolower(Request::method()) == \"post\"){\n $user_m = Model(\"User\");\n\n $data[\"name\"] = trim(Request::input(\"user\"));\n $data[\"password\"] = bcrypt(trim(md5(Request::input(\"password\"))));\n\n if($user_info = $user_m->userInfo(['name' => $data['name'] ])){\n $rsCode = -1001;\n $msg = $this->showMsg($rsCode);\n \n }\n\n\n $rs = $user_m->insert_user($data); \n\n $rsCode = $rs?1001:-1000;\n\n // dump($rs);\n $msg = $this->showMsg($rsCode); \n }\n\n return view('admin.foundation.user.create', ['title'=>\"CoG | Tell your world\"]);\n }", "public function registerNewUser($fullName,$email,$password);", "public function create_user()\r\n {\r\n $this->data['title'] = $this->lang->line('create_user_heading');\r\n\r\n if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\r\n {\r\n //redirect('auth', 'refresh');\r\n }\r\n\r\n $tables = $this->config->item('tables','ion_auth');\r\n $identity_column = $this->config->item('identity','ion_auth');\r\n $this->data['identity_column'] = $identity_column;\r\n\r\n // validate form input\r\n $this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required');\r\n $this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required');\r\n if($identity_column!=='email')\r\n {\r\n $this->form_validation->set_rules('identity',$this->lang->line('create_user_validation_identity_label'),'required|is_unique['.$tables['users'].'.'.$identity_column.']');\r\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email');\r\n }\r\n else\r\n {\r\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique[' . $tables['users'] . '.email]');\r\n }\r\n $this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'trim');\r\n $this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'trim');\r\n $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\r\n $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\r\n\r\n if ($this->form_validation->run() == true)\r\n {\r\n $email = strtolower($this->input->post('email'));\r\n $identity = ($identity_column==='email') ? $email : $this->input->post('identity');\r\n $password = $this->input->post('password');\r\n\r\n $additional_data = array(\r\n 'first_name' => $this->input->post('first_name'),\r\n 'last_name' => $this->input->post('last_name'),\r\n 'company' => $this->input->post('company'),\r\n 'phone' => $this->input->post('phone'),\r\n );\r\n }\r\n if ($this->form_validation->run() == true && $this->ion_auth->register($identity, $password, $email, $additional_data))\r\n {\r\n // check to see if we are creating the user\r\n // redirect them back to the admin page\r\n $this->session->set_flashdata('message', $this->ion_auth->messages());\r\n redirect(\"auth\", 'refresh');\r\n }\r\n else\r\n {\r\n // display the create user form\r\n // set the flash data error message if there is one\r\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\r\n\r\n $this->data['first_name'] = array(\r\n 'name' => 'first_name',\r\n 'id' => 'first_name',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('first_name'),\r\n );\r\n $this->data['last_name'] = array(\r\n 'name' => 'last_name',\r\n 'id' => 'last_name',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('last_name'),\r\n );\r\n $this->data['identity'] = array(\r\n 'name' => 'identity',\r\n 'id' => 'identity',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('identity'),\r\n );\r\n $this->data['email'] = array(\r\n 'name' => 'email',\r\n 'id' => 'email',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('email'),\r\n );\r\n $this->data['company'] = array(\r\n 'name' => 'company',\r\n 'id' => 'company',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('company'),\r\n );\r\n $this->data['phone'] = array(\r\n 'name' => 'phone',\r\n 'id' => 'phone',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('phone'),\r\n );\r\n $this->data['password'] = array(\r\n 'name' => 'password',\r\n 'id' => 'password',\r\n 'type' => 'password',\r\n 'value' => $this->form_validation->set_value('password'),\r\n );\r\n $this->data['password_confirm'] = array(\r\n 'name' => 'password_confirm',\r\n 'id' => 'password_confirm',\r\n 'type' => 'password',\r\n 'value' => $this->form_validation->set_value('password_confirm'),\r\n );\r\n\t\t\t\r\n\t\t\t$this->_render_page('auth/create_user', $this->data);\r\n }\r\n }", "public static function create() {\n\t\tif (empty(Validator::$errors)) {\n\t\t\tself::insert(self::$tablename, array(\"email\"=>self::$email, \"password_hash\"=>self::$password_hash));\n\t\t\tSession::setFlash(\"alert-success\",\"You have successfully signed up!\");\n\t\t} else {\n\t\t\tSession::setFlash(\"alert-danger\", self::display(Validator::$errors));\n\t\t\tValidator::$errors = [];\n\t\t}\n\t}", "function user_create($data){\n if(isset($data['umd_val'])){\n $dval = $data['umd_val'];\n } else if(count($this->domain_seq)){\n $dval = $this->domain_seq[0];\n } else {\n return 2;\n }\n if(!isset($this->domains[$dval])) return 2;\n if(!in_array($dval,$this->quest_provider('d:user','create',TRUE,FALSE)))\n return 3;\n $tmp = $this->domains[$dval]->user_create($data);\n if($tmp>0) return $tmp;\n foreach($this->domains as $cd) $cd->cache_clear();\n return $this->vdn_make($data['uname'],$dval);\n }", "public function p_signup() {\n\n $q= 'Select email \n From users \n WHERE email=\"'.$_POST['email'].'\"';\n # see if the email exists\n $emailexists= DB::instance(DB_NAME)->select_field($q);\n \n # email exists, throw an error\n if($emailexists){ \n \n Router::redirect(\"/users/signup/error\"); \n \n }\n \n #requires all fields to be entered if java script is disabled, otherwise thow a different error\n \n elseif (!$_POST['email'] OR !$_POST['last_name'] OR !$_POST['first_name'] OR !$_POST['password']) {\n Router::redirect(\"/users/signup/error2\"); \n }\n # all is well , proceed with signup\n else{\n \n $_POST['created']= Time::now();\n $_POST['password']= sha1(PASSWORD_SALT.$_POST['password']); \n $_POST['token']= sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n # add user to the database and redirect to users login page \n $user_id=DB::instance(DB_NAME)->insert_row('users',$_POST);\n # Create users first Notebook\n $notebook['name']= $_POST['first_name'].' Notebook';\n $notebook['user_id']= $user_id;\n $notebook['created']= Time::now(); \n $notebook['modified']= Time::now(); \n DB::instance(DB_NAME)->insert_row('notebooks',$notebook); \n\n Router::redirect('/users/login');\n }\n \n }", "public function actionCreate()\n\t{\n\t\t$this->addToTitle(\"Create Account\");\n\t\t$model=new User('create');\n\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\t$temp_passwd = $_POST['User']['password'];\n\t\t\t$temp_usernm = $_POST['User']['email'];\n\t\t\tif($model->validate()&&$model->save())\n\t\t\t{\n\t\t\t\t//log create new uesr\n\t\t\t\tYii::log(\"new user sign up, email:$model->email\");\n\t\t\t\t\n\t\t\t\t$emailServe = new EmailSending();\n\t\t\t\t$emailServe->sendEmailConfirm($model);\n\t\t\t\t\n\t\t\t\t$model->moveToWaitConfirm();\n\t\t\t\t$this->redirect(array('email/waitConfirm'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array('model'=>$model));\n\t}", "function createUser(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\t\t\t\n\t\t\t//Check if username meets minimum requirements\n\t\t\tif($this->username == \"\" || $this->username == null || strlen($this->username) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Username\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t//Check if username already exists\n\t\t\t\tif($db->query('SELECT * FROM user WHERE Username = \"'.$this->username.'\"')->rowCount() > 0){\n\t\t\t\t\t$json->exists(\"Username\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Check if password meets minimum requirements\n\t\t\tif($this->password == \"\" || $this->password == null || strlen($this->password) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Password\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$passHash = generatePassword($this->password);\n\t\t\t\t$this->password = $passHash;\n\t\t\t\t$apiHash = generateApiKey($this->username.\"\".date('Y-m-d'));\n\t\t\t}\n\t\t\t\n\t\t\t//Check if admin is empty or invalid, if so make user non-admin\n\t\t\tif($this->admin == \"\" || $this->admin == null || $this->admin < 0)\n\t\t\t\t$this->admin = 0;\n\t\t\t\n\t\t\tif($this->subject == \"\" || $this->subject == null || $this->subject < 0)\n\t\t\t\t$this->subject = 0;\n\t\t\t\t\n\t\t\t$insert = $db->prepare('INSERT INTO user VALUES (DEFAULT, :username, :password, :subject, :admin, :api)');\n\t\t\t$insert->bindParam(':username', $this->username);\n\t\t\t$insert->bindParam(':password', $this->password);\n\t\t\t$insert->bindParam(':subject', $this->subject);\n\t\t\t$insert->bindParam(':admin', $this->admin);\n\t\t\t$insert->bindParam(':api', $apiHash);\n\t\t\t\n\t\t\tif($insert->execute()){\n\t\t\t\t$json->created(\"User\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$json->server();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "public function m_insert_supervisor_user(){\n $this->FirstName = $_POST['FirstName'];\n $this->LastName = $_POST['LastName'];\n $this->EmailPN = $_POST['EmailPN'];\n $this->Password = password_hash($_POST['Password'], PASSWORD_DEFAULT);\n //insert value to users table\n $this->db->insert('users', $this);\n }", "public function save_user()\n\t{\n $user= new Users();\n $user->setNom($_POST['nom']);\n $user->setPrenom($_POST['prenom']);\n $user->setDate_naissance($_POST['date_naiss']);\n $user->setEmail($_POST['mail']);\n $user->setPassword($_POST['pwd']); \n\n $user->Create_user();\n\t}", "public function postCreate() {\n \t$validator = Validator::make(Input::all(), User::$rules);\n\n \t// i made a user with [email protected], goodbye\n \tif ($validator->passes()) {\n \t\t// validation has passed, save user in DB\n \t\t$user = new User;\n \t\t$user->first_name = Input::get('first_name');\n \t\t$user->last_name = Input::get('last_name');\n \t\t$user->email = Input::get('email');\n \t\t$user->password = Hash::make(Input::get('password'));\n \t\t$user->save();\n\n \t\treturn Redirect::to('users/login')->with('message', '<div class=\"alert alert-success\" role=\"alert\">Thanks for registering!</div>');\n \t}\n \telse {\n \t\t// validation has failed, display error messages\n \t\treturn Redirect::to('users/register')->with('message', '<div class=\"alert alert-warning\" role=\"alert\">The following errors occurred</div>')->withErrors($validator)->withInput();\n \t}\n }", "private function createUser($type='') {\n return $this->ec->createUser($type);\n }", "public function actionCreate()\n {\n $model = new User();\n\n if (isset($_POST['User']))\n {\n\n $transaction = Yii::app()->db->beginTransaction();\n\n try\n {\n $model->setAttributes($_POST['User']);\n $model->salt = Registration::model()->generateSalt();\n $model->password = Registration::model()->hashPassword($model->password, $model->salt);\n $model->registrationIp = Yii::app()->request->userHostAddress;\n\n if ($model->save())\n {\n $profile = new Profile();\n $profile->user_id = $model->id;\n if ($profile->save())\n {\n $transaction->commit();\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Новый пользователь добавлен!'));\n $this->redirect(array('view', 'id' => $model->id));\n }\n else\n {\n throw new CDbException(Yii::t('user', 'При создании пользователя произошла ошибка! Подробности в журнале исполнения.'));\n }\n }\n\n }\n catch (CDbException $e)\n {\n $transaction->rollback();\n Yii::log($e->getMessage(), CLogger::LEVEL_ERROR, UserModule::$logCategory);\n Yii::app()->user->setFlash(YFlashMessages::ERROR_MESSAGE, $e->getMessage());\n $this->redirect(array('create'));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function voxy_create_new_user()\n {\n $data = $this->input->post();\n\n if(!(isset($data['external_user_id']) && $data['external_user_id'])){\n $this->ajax_data_return['msg'] = 'ID người dùng không hợp lệ !';\n return $this->ajax_response();\n }\n if(isset($data['expiration_date']) && $data['expiration_date'] != ''){\n $data['expiration_date'] = strtotime($data['expiration_date']);\n }\n if(isset($data['date_of_next_vpa']) && $data['date_of_next_vpa'] != ''){\n $data['date_of_next_vpa'] = strtotime($data['date_of_next_vpa']);\n }\n if(isset($data['can_reserve_group_sessions']) && $data['can_reserve_group_sessions'] != ''){\n $data['can_reserve_group_sessions'] = strtolower($data['can_reserve_group_sessions']);\n }\n\n $api_data = $this->m_voxy_connect->register_a_new_user($data['external_user_id'], $data);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n } else {\n $this->ajax_data_return['status'] = TRUE;\n $this->ajax_data_return['msg'] = 'Tạo tài khoản người dùng thành công !';\n $this->ajax_data_return['data'] = $api_data;\n }\n\n return $this->ajax_response();\n }", "function create_app_user($db) {\n\t\t\t\t\t$query = \"INSERT INTO app_user VALUES (\n\t\t\t\t\t\t\t\t'$_POST[phone_number]', \n\t\t\t\t\t\t\t\t'$_POST[email]', \n\t\t\t\t\t\t\t\t'$_POST[name]', \n\t\t\t\t\t\t\t\t'$_POST[gender]', \n\t\t\t\t\t\t\t\t'$_POST[dob]',\n\t\t\t\t\t\t\t\t'$_POST[password]'\n\t\t\t\t\t\t\t\t );\";\n\n\t\t\t\t\treturn pg_query($db, $query);\n\t\t\t\t}", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level', 16 => 'store_owner');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel, 16 => 1);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n }", "protected function createDefaultUser() {\n User::create([\n 'name' => 'Admin',\n 'puntaje' => 1,\n 'lastname' => 'Admin',\n 'nacimiento' => Carbon::now(),\n 'fecha_visita' => Carbon::now(),\n 'email' => '[email protected]',\n 'equipo_id' => 1,\n 'password' => Hash::make('123456789')\n ]); \n }", "public function actionCreateUser()\n {\n $model = new User();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $model->setPassword($model->password);\n $model->generateAuthKey();\n $model->generateEmailConfirmToken();\n if ($model->save()) {\n // нужно добавить следующие три строки:\n // $auth = Yii::$app->authManager;\n // $authorRole = $auth->getRole('superadmin');\n // $auth->assign($authorRole, $user->getId());\n return $this->redirect(['view-user', 'id' => $model->id]);\n }else{\n print_arr($model->errors);\n die('A');\n }\n } else {\n return $this->render('user/create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n\t\t$model = new User();\n\t\t\n\t\tif (isset($_POST['User'])) {\n\t\t\t$error = FALSE;\n\t\t\t$model->attributes = Yii::app()->input->post('User');\n\t\t\t\n\t\t\tif ($model->validate()) {\n\t\t\t\n\t\t\t\t$user = User::model()->findByAttributes(array(\n\t\t\t\t\t'username'\t\t\t\t\t\t\t\t\t\t\t\t\t=> $model->username\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\tif (isset($user)) {\n\t\t\t\t\t$error = 'Username already present';\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t$_POST['User']['country'] != '' &&\n\t\t\t\t\t!array_key_exists($_POST['User']['country'],Yii::app()->params->countries)\n\t\t\t\t) {\n\t\t\t\t\t$error = 'State are invalid';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (\n\t\t\t\t\t$_POST['User']['job'] != '' &&\n\t\t\t\t\t!array_key_exists($_POST['User']['job'],Yii::app()->params->jobs)\n\t\t\t\t) {\n\t\t\t\t\t$error = 'Job are invalid';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (\n\t\t\t\t\t$_POST['User']['sex'] != '' &&\n\t\t\t\t\t!array_key_exists($_POST['User']['sex'],Yii::app()->params->sexs)\n\t\t\t\t) {\n\t\t\t\t\t$error = 'Sex are invalid';\n\t\t\t\t}\n\t\t\t\tif (!$error) {\n\t\t\t\t\t$model->password = CPasswordHelper::hashPassword($model->password);\n\t\t\t\t\t$model->save();\n\t\t\t\t\t$this->redirect(array('site/login'));\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFlash($error);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->render('create',array(\n\t\t\t'model'\t\t\t\t\t\t\t\t\t\t\t\t\t\t=> $model,\n\t\t));\n\t}", "public function createUser(){\n $post = $this->_app->request->post();\n \n // Load the request schema\n $requestSchema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n \n // Get the alert message stream\n $ms = $this->_app->alerts; \n \n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $ms->addMessageTranslated(\"danger\", \"ACCESS_DENIED\");\n $this->_app->halt(403);\n }\n\n // Set up Fortress to process the request\n $rf = new \\Fortress\\HTTPRequestFortress($ms, $requestSchema, $post); \n \n // Sanitize data\n $rf->sanitize();\n \n // Validate, and halt on validation errors.\n $error = !$rf->validate(true);\n \n // Get the filtered data\n $data = $rf->data(); \n \n // Remove csrf_token, password confirmation from object data\n $rf->removeFields(['csrf_token, passwordc']);\n \n // Perform desired data transformations on required fields. Is this a feature we could add to Fortress?\n $data['user_name'] = strtolower(trim($data['user_name']));\n $data['display_name'] = trim($data['display_name']);\n $data['email'] = strtolower(trim($data['email']));\n $data['active'] = 1;\n \n // Check if username or email already exists\n if (UserLoader::exists($data['user_name'], 'user_name')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_USERNAME_IN_USE\", $data);\n $error = true;\n }\n\n if (UserLoader::exists($data['email'], 'email')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_EMAIL_IN_USE\", $data);\n $error = true;\n }\n \n // Halt on any validation errors\n if ($error) {\n $this->_app->halt(400);\n }\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primaryGroup = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Set default values if not specified or not authorized\n if (!isset($data['locale']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"locale\"]))\n $data['locale'] = $this->_app->site->default_locale;\n \n if (!isset($data['title']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"title\"])) {\n // Set default title for new users\n $data['title'] = $primaryGroup->new_user_title;\n }\n \n if (!isset($data['primary_group_id']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"primary_group_id\"])) {\n $data['primary_group_id'] = $primaryGroup->id;\n }\n \n // Set groups to default groups if not specified or not authorized to set groups\n if (!isset($data['groups']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"groups\"])) {\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n $data['groups'] = [];\n foreach ($default_groups as $group_id => $group){\n $data['groups'][$group_id] = \"1\";\n }\n }\n \n // Hash password\n $data['password'] = Authentication::hashPassword($data['password']);\n \n // Create the user\n $user = new User($data);\n\n // Add user to groups, including selected primary group\n $user->addGroup($data['primary_group_id']);\n foreach ($data['groups'] as $group_id => $is_member) {\n if ($is_member == \"1\"){ \n $user->addGroup($group_id); \n }\n }\n \n // Store new user to database\n $user->store(); \n \n // Success message\n $ms->addMessageTranslated(\"success\", \"ACCOUNT_CREATION_COMPLETE\", $data);\n }", "public function createUserDetail($userName,$password,$email,$about,$onlineStatus,$maxContacts,$maxFavorites,$birthday,$gender,$avatarFile,$thumbFile,$go_id,$reg_status,$invite_user_id,$create_id,$desired_team_title='',$signup_team_id=null)\r\n {\r\n \r\n $now = time();\r\n \r\n $valueArray = array();\r\n $valueArray['name'] = $userName;\r\n $valueArray['email'] = $email;\r\n $valueArray['password'] = $password;\r\n $valueArray['about'] = $about;\r\n $valueArray['online_status'] =$onlineStatus;\r\n $valueArray['max_contact_count'] = $maxContacts;\r\n $valueArray['max_favorite_count'] = $maxFavorites;\r\n $valueArray['birthday'] = $birthday;\r\n $valueArray['gender'] = $gender;\r\n $valueArray['avatar_file_id'] = $avatarFile;\r\n $valueArray['avatar_thumb_file_id'] = $thumbFile;\r\n $valueArray['created'] = $now;\r\n $valueArray['modified'] = $now;\r\n $valueArray['go_id'] = $go_id; \r\n $valueArray['reg_status'] = $reg_status; \r\n $valueArray['invite_user_id'] = $invite_user_id; \r\n $valueArray['create_id'] = $create_id; \r\n $valueArray['desired_team_title'] = $desired_team_title; \r\n $valueArray['signup_team_id'] = $signup_team_id;\r\n if($this->DB->insert('user',$valueArray)){\r\n return $this->DB->lastInsertId(\"_id\");\r\n }else{\r\n return null;\r\n }\r\n \r\n }", "public function create_user($username, $password, $email){\n\n\t$hashed_password = password_hash($password, PASSWORD_DEFAULT);\n\t$sql = \"INSERT INTO users VALUES \n\t(NULL, :type_id, :email, :username, :password, :created_at, :updated_at)\";\n\t$statement = $this->dbh->prepare($sql);\n\t$statement->execute([\n\t\t'type_id' => '2',\n\t\t'email' => $email,\n\t\t'username' => $username,\n\t\t'password' => $hashed_password,\n\t\t'created_at' => date('Y-m-d H:i:s'),\n\t\t'updated_at' => date('Y-m-d H:i:s')\n\t\t]);\n\techo \"signup succesfull\";\n\t // header(\"refresh:3;url=index.php\"); \n\t}", "private function generateUser()\n {\n \t$user=new User();\n \t$user->scenario = 'registration';\n \t$user->username=$this->user_name_prefix . '_' . time() . ++$this->userNameCounter;\n \t$user->email=time() . ++$this->emailCounter . $this->faker->unique()->email;\n \t$user->language = Yii::$app->language;\n \t$user->status = User::STATUS_ENABLED;\n \t$this->userId = $user->save(false) ? $user->id:false;\n \t$this->data[] = ['id'=>$user->id,'type'=>'user'];\n \treturn true;\n }", "public function createUser($name, $email, $password,$mobile,$address, $typeid, $isactive, $created,$updated) {\n $response = array();\n\n // First check if user already existed in db\n if (!$this->isUserExists($email)) {\n \n $stmt = $this->conn->prepare(\"INSERT INTO user(user_name, user_email, user_pass, user_mobile,user_address, type_id,isactive,created,updated) values(?,?,?,?,?,?,?,?,?)\");\n $stmt->bind_param(\"sssssssss\", $name, $email, $password, $mobile, $address,$typeid,$isactive, $created,$updated);\n\n $result = $stmt->execute();\n\n $stmt->close();\n\n // Check for successful insertion\n if ($result) {\n // User successfully inserted\n return USER_CREATED_SUCCESSFULLY;\n } else {\n // Failed to create user\n return USER_CREATE_FAILED;\n }\n } else {\n // User with same email already existed in the db\n return USER_ALREADY_EXISTED;\n }\n\n return $response;\n }", "public function createUser( UserDataInf $user )\n {\n \n $userName = $user->getName();\n \n if( $this->userExists( $userName ) )\n {\n $this->protocol->info( \"Systemuser {$userName} allready exists.\" ); \n return;\n }\n \n $sqlPerson = <<<SQL\nINSERT INTO core_person\n( firstname, lastname )\nVALUES\n( '{$user->getFirstname()}', '{$user->getLastname()}' );\nSQL;\n\n $idPerson = $this->db->insert( $sqlPerson );\n $passwd = Password::passwordHash( $user->getPasswd() );\n \n $sqlUser = <<<SQL\nINSERT INTO wbfsys_role_user\n( \n name, \n id_person, \n inactive, \n non_cert_login,\n profile,\n level,\n password\n)\nVALUES\n( \n '{$userName}', \n {$idPerson}, \n FALSE, \n TRUE, \n '{$user->getProfile()}', \n '{$user->getLevel()}',\n '{$passwd}'\n);\nSQL;\n\n $idUser = $this->db->insert( $sqlUser );\n \n }", "public function createUser($email, $password, $firstname, $lastname, $phone, $blood_type, $piercing, $tattoo, $sickness, $birthyear, $gender, $weight) {\n require_once 'PassHash.php';\n $response = array();\n\n // First check if user already existed in db\n if ($this->isUserExists($email)==0) {\n // Generating password hash\n\t\t\t\n\t\t\t$pass=new PassHash();\n\t\t\t\n $password_hash = $pass->hash($password); \n\n // Generating API key\n $api_key = $this->generateApiKey();\n\n // insert query\n \n //insert user data\n $result_data=$this->con->query(\"Insert into user_data (blood_type, piercing, tattoo, sickness) Values ('\".$blood_type.\"','\".$piercing.\"', '\".$tattoo.\"', '\".$sickness.\"')\");\n \n \n //get latest user data entry\n //get latest user data entry\n $usrdata=$this->con->query(\"SELECT MAX(iduser_data) AS data FROM user_data;\");\n $usdata=$usrdata->fetch_assoc();\n $data=$usdata['data'];\n \n //insert Users table\n $result_user = $this->con->query(\"INSERT INTO user(email, pass, phone, active, firstname, lastname, locked, lock_count, score, api_key, birth_year, gender, weight, user_data_iduser_data) \n values('\".$email.\"','\".$password_hash.\"','\".$phone.\"',1,'\".$firstname.\"','\".$lastname.\"',0,0,0,'\".$api_key.\"','\".$birthyear.\"','\".$gender.\"','\".$weight.\"','\".$data.\"');\");\n \n \n // Check for successful insertion\n if ($result_user && $result_data) {\n // User successfully inserted\n return USER_CREATED;\n } else {\n // Failed to create user\n return USER_CREATE_FAILED;\n }\n } else {\n // User with same email already existed in the db\n return USER_EXISTS;\n }\n\n return $response;\n }", "public function create()\n {\n $this->resetFields();\n //DAN MEMBUKA AREA\n $this->openUser();\n }", "public function createUser(){\n //richiamo le classi di cui avrò bisogno\n require_once \"./application/models/input_manager.php\";\n require_once \"./application/models/mail_manager.php\";\n\n $errors = array();\n\n //verifico il metodo di richiesta\n if($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n //verifico che i campi siano impostati e che non siano stringhe vuote\n if (isset($_POST['firstname']) && !empty($_POST['firstname']) && isset($_POST['lastname']) && !empty($_POST['lastname'])\n && isset($_POST['username']) && !empty($_POST['username']) &&\n isset($_POST['email']) && !empty($_POST['email'])) {\n\n //genero un nuovo input_manager e testo gli inserimenti\n $exists = false;\n $im = new input_manager();\n $firstname = filter_var($im->checkInputSpace($_POST['firstname']), FILTER_SANITIZE_STRING);\n $lastname = filter_var($im->checkInputSpace($_POST['lastname']), FILTER_SANITIZE_STRING);\n $username = filter_var($im->checkInput($_POST['username']), FILTER_SANITIZE_STRING);\n $email = filter_var($im->checkInput($_POST['email']), FILTER_SANITIZE_EMAIL);\n\n //verifico che la lunghezza dei campi corrisponda con quella consentita\n if(!(strlen($firstname) > 0 && strlen($firstname) <= 50) || !preg_match('/^[\\p{L}a-zA-Z\\' ]+$/', $firstname)){\n array_push($errors, \"Il nome deve essere lungo tra gli 1 e 50 caratteri\");\n }\n if(!(strlen($lastname) > 0 && strlen($lastname) <= 50) || !preg_match('/^[\\p{L}a-zA-Z\\' ]+$/', $lastname)){\n array_push($errors, \"Il cognome deve essere lungo tra gli 1 e 50 caratteri\");\n }\n if(!(strlen($username) > 0 && strlen($username) <= 50) || !preg_match('/^[\\p{L}a-zA-Z0-9\\d._\\- ]+$/', $username)){\n array_push($errors, \"Lo username deve essere lungo tra gli 1 e 50 caratteri\");\n }\n if(!(strlen($email) > 0 && strlen($email) <= 50) || !filter_var($email, FILTER_VALIDATE_EMAIL)){\n array_push($errors, \"L'email deve essere formattata nel seguente modo: [email protected]\");\n }\n\n //se sono di lunghezze sbagliate ritorno l'errore\n if(count($errors) != 0){\n $_SESSION['errors'] = $errors;\n $data = array(\n 'firstname' => $firstname,\n 'lastname' => $lastname,\n 'username' => $username,\n 'email' => $email\n );\n $_SESSION['data'] = $data;\n header('Location: ' . URL . 'newUser');\n exit();\n }\n\n //verifico che la password sia la stessa in entrambi i campi\n\n $users = (new utente_model)->getUsers();\n //verifico che l'email non sia già in uso\n foreach ($users as $row) {\n if ($row['email'] == $email) {\n array_push($errors, \"L'email è già in uso\");\n $exists = true;\n }\n }\n //se non esiste inserisco il nuovo utente nel db\n if(!$exists) {\n try {\n $password = bin2hex(random_bytes(4));\n (new utente_model)->addUser($firstname, $lastname, $username, $email, $password, true);\n unset($_POST);\n $mm = new mail_manager();\n $body = \"<h3>Un admin di Grotti Ticinesi ha creato un account con la tua email</h3>La password per accedervi è la seguente: <br><b>\" . $password . \"</b><br><br>Accedi dal seguente link: <a href='\" . URL . \"login'>Grotti ticino</a>\";\n $mm->sendMail($email, $body, \"Grotti Ticinesi - Benvenuto\");\n header('Location: ' . URL . 'admin');\n exit();\n }catch(Exception $e){\n $_SESSION['warning'] = $e->getCode() . \" - \" . $e->getMessage();\n header('Location: ' . URL . 'warning');\n exit();\n }\n }else{\n //se è già in uso ritorno l'errore\n $_SESSION['errors'] = $errors;\n $data = array(\n 'firstname' => $firstname,\n 'lastname' => $lastname,\n 'username' => $username,\n 'email' => $email\n );\n $_SESSION['data'] = $data;\n header('Location: ' . URL . 'newUser');\n exit();\n }\n //se le password non sono uguali ritorno l'errore\n }else{\n //se non sono stati inseriti tutti i dati ritorno l'errore\n array_push($errors, \"Inserire tutti i dati\");\n $_SESSION['errors'] = $errors;\n header('Location: ' . URL . 'newUser');\n exit();\n }\n }\n }", "public function create()\n {\n $data['id'] = $this->db->order_by('id', 'desc')->get($this->User->table)->row()->id + 1;\n \n $this->Helper->view('user/create', $data);\n }", "protected function add_new_user($name, $email, $avatar, $bio, $password, $sexe) {\r\n\r\n $activation_key = '';\r\n\r\n // Generate Email Activation Key\r\n for ($i = 0; $i < 6; $i++) {\r\n $activation_key = $activation_key . rand(0, 9);\r\n }\r\n\r\n // Connect To DB\r\n $connection = DB::connect();\r\n // Insert New User Data Into Users Table\r\n $stmt = \"INSERT INTO users\r\n (`name`, `email`, `avatar`, `bio`, `password`, `sexe`, `theme`, `account_type`, `activation_key`)\r\n VALUES\r\n ('$name', '$email', '$avatar', '$bio', '$password', '$sexe', 'light', 'user', '$activation_key')\";\r\n\r\n if ($connection->query($stmt) === false) {\r\n echo '<script>alert(\"لا نستطيع إضافة مستخدم جديد الآن، يمكنك الإتصال بفريق الدعم أو المحاولة لاحقا\")</script>';\r\n return;\r\n }\r\n\r\n // Get User ID\r\n $stmt = \"SELECT id FROM users WHERE `email` = '$email'\";\r\n $result = $connection->query($stmt);\r\n\r\n // Create New Session User Variable\r\n $_SESSION['user_id'] = $result->fetch_assoc()['id'];\r\n\r\n // Redirect To Profile Page\r\n $profile_url = DB::MAIN_URL . 'profile.php';\r\n header('location: ' . $profile_url);\r\n\r\n }", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "protected function createUser()\n {\n $this->question('Enter your details for the admin user.');\n\n $user = \\App\\User::create([\n 'name' => $this->ask('Name', 'Admin'),\n 'email' => $this->ask('Email address', 'noreply@'.str_replace(['http://', 'https://'], '', config('app.url'))),\n 'password' => Hash::make($this->ask('Password')),\n ]);\n \n $this->info(\"Admin user created successfully. You can log in with username {$user->email}\");\n }", "public function create_londontec_users(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/adduser';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Create Londontec New users',\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function create()\n\t{\n\t\t$check_email = \" SELECT * FROM admin WHERE \";\n\t\t$check_email .= \" (email = '\".$this->email.\"') \";\n\t\t$check_email_query = mysqli_query($this->plug, $check_email);\n\t\tif(!$check_email_query)\n\t\t{\n\t\t\techo 'Error checking email query <br />'.mysqli_error($this->plug);\n\t\t}elseif (mysqli_num_rows($check_email_query)) {\n\t\t\t# code...\n\t\t\techo ' <b>'.$this->email.'</b> already exits !';\n\t\t}else{\n\t\t\t# check if phone number already exits\n\t\t\t$check_phone = \" SELECT * FROM admin WHERE \";\n\t\t\t$check_phone .= \" (phone = '\".$this->phone.\"') \";\n\t\t\t$check_phone_query = mysqli_query($this->plug, $check_phone);\n\t\t\tif(!$check_phone_query)\n\t\t\t{\n\t\t\t\techo 'Error running phone check query <br />'.mysqli_error($this->plug);\n\t\t\t}elseif (mysqli_num_rows($check_phone_query)) {\n\t\t\t\t# code...\n\t\t\t\techo ' <b>'.$this->phone.'</b> already exits !';\n\t\t\t}else{\n\t\t\t\t# sign up user \n\t\t\t\t$add_user = \" INSERT INTO admin \";\n\t\t\t\t$add_user .= \" (username, email, password, phone, date ) \";\n\t\t\t\t$add_user .= \" VALUES('\".$this->username.\"', '\".$this->email.\"', \";\n\t\t\t\t$add_user .= \" '\".$this->password.\"', '\".$this->phone.\"', '\".$this->date.\"') \";\n\t\t\t\t$add_user_query = mysqli_query($this->plug, $add_user);\n\t\t\t\tif(!$add_user_query)\n\t\t\t\t{\n\t\t\t\t\techo 'Error running add user query <br />'.mysqli_error($this->plug);\n\t\t\t\t}elseif(mysqli_affected_rows($this->plug))\n\t\t\t\t{\n\t\t\t\t\techo ' Thanks for signing up. <br />';\n\t\t\t\t\techo ' Activation code has been sent! ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function setNewUser($request){\r\n \t//Post vars\r\n\t \t$postVars = $request->getPostVars();\r\n\t\t$nome = $postVars['nome'] ?? '';\r\n\t\t$email = $postVars['email'] ?? '';\r\n\t\t$senha = $postVars['senha'] ?? '';\r\n\r\n\t\t//Valida email\r\n\t\t$obUser = EntityUser::getUserByEmail($email);\r\n\t\tif($obUser instanceof EntityUser){\r\n\r\n\t\t\t$request->getRouter()->redirect('/admin/users/new?status=duplicated');\r\n\t\t}\r\n\r\n\t\t//NOVA INSTANCIA DE FEEDBACK\r\n\t\t$obUser = new EntityUser;\r\n\t\t$obUser->nome = $nome;\r\n\t\t$obUser->email = $email;\r\n\t\t$obUser->senha = password_hash($senha,PASSWORD_DEFAULT);\r\n\t\t$obUser->cadastrar();\r\n\r\n\t\t//REDIRECIONA O USUARIO\r\n\t\t$request->getRouter()->redirect('/admin/users/'.$obUser->id.'/edit?status=created');\r\n\r\n\t}", "function create_user()\n\t{\n\t\t/* Load */\n\t\t$this->load->config('admin/dp_config');\n\t\t$this->load->config('common/dp_config');\n\n\t\t/* Data */\n\t\t$this->data['title'] = $this->config->item('title');\n\t\t$this->data['title_lg'] = $this->config->item('title_lg');\n\t\t$this->data['auth_social_network'] = $this->config->item('auth_social_network');\n\t\t$this->data['forgot_password'] = $this->config->item('forgot_password');\n\t\t$this->data['new_membership'] = $this->config->item('new_membership');\n\n\t\t// if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t// {\n\t\t// \tredirect('auth', 'refresh');\n\t\t// }\n\t\t$this->data['first_name'] = array(\n\t\t\t'name' => 'first_name',\n\t\t\t'id' => 'first_name',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('first_name'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"First Name\",\n\t\t);\n\t\t$this->data['last_name'] = array(\n\t\t\t'name' => 'last_name',\n\t\t\t'id' => 'last_name',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('last_name'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Last Name\",\n\t\t);\n\t\t$this->data['email'] = array(\n\t\t\t'name' => 'email',\n\t\t\t'id' => 'email',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('email'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Email\",\n\t\t);\n\t\t$this->data['company'] = array(\n\t\t\t'name' => 'company',\n\t\t\t'id' => 'company',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('company'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Company\",\n\t\t);\n\t\t$this->data['phone'] = array(\n\t\t\t'name' => 'phone',\n\t\t\t'id' => 'phone',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('phone'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Phone\",\n\t\t);\n\t\t$this->data['password'] = array(\n\t\t\t'name' => 'password',\n\t\t\t'id' => 'password',\n\t\t\t'type' => 'password',\n\t\t\t'value' => $this->form_validation->set_value('password'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Password\",\n\t\t);\n\t\t$this->data['password_confirm'] = array(\n\t\t\t'name' => 'password_confirm',\n\t\t\t'id' => 'password_confirm',\n\t\t\t'type' => 'password',\n\t\t\t'value' => $this->form_validation->set_value('password_confirm'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Confirm Password\",\n\t\t);\n\n\t\t$this->template->auth_render('auth/create_user', $this->data);\n\t}", "static private function createNewUserFromPost() {\r\n\t\t$errors = array();\r\n\r\n\t\t$activationHash = (System::isAtLocalhost()) ? '' : self::getRandomHash();\r\n\t\t$newAccountId = DB::getInstance()->insert('account',\r\n\t\t\t\tarray('username', 'name', 'mail', 'password', 'registerdate', 'activation_hash'),\r\n\t\t\t\tarray($_POST['new_username'], $_POST['name'], $_POST['email'], self::passwordToHash($_POST['password']), time(), $activationHash));\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = true;\r\n\t\tself::$NEW_REGISTERED_ID = $newAccountId;\r\n\r\n\t\tif ($newAccountId === false)\r\n\t\t\t$errors[] = __('There went something wrong. Please contact the administrator.');\r\n\t\telse {\r\n\t\t\tself::importEmptyValuesFor($newAccountId);\r\n\t\t\tself::setSpecialConfigValuesFor($newAccountId);\r\n\r\n\t\t\tif ($activationHash != '')\r\n\t\t\t\tself::setAndSendActivationKeyFor($newAccountId, $errors);\r\n\t\t}\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = false;\r\n\t\tself::$NEW_REGISTERED_ID = -1;\r\n\r\n\t\treturn $errors;\r\n\t}", "public function createUser($uid, $fullname, $phone_no, $email, $login_with){\n\n if(!$this->isUserIdExist($uid)){\n $stmt = $this->con->prepare(\"INSERT INTO users (uid, fullname, phone_no, email, login_with,reg_date) VALUES (?,?,?,?,?,?);\");\n $stmt->bind_param(\"ssssss\",$uid, $fullname, $phone_no, $email, $login_with,$reg_date);\n $reg_date = date(\"Y-m-d\").' '.date(\"H:i:s\");\n if($stmt->execute()){\n return USER_CREATED;\n }else{\n return USER_FAILURE;\n }\n }\n return USER_EXISTS;\n }", "function add_user ($User_name, $User_password, $User_email, $user_type)\n\t{\n\t\tglobal $conn;\n\n $sql_i = \"INSERT INTO login_db(user_name, user_password, user_email, user_type) VALUES \" .\n \"('$User_name', '$User_password', '$User_email', '$user_type')\";\n\n run_update($sql_i);\n\t}", "function createNewUser($nickName, $eMail, $password, $rights=2)\n {\n global $usrTableName,\n $usrSessionIDFieldType, $usrSessionIDField,\n $usrUniqueIDFieldType, $usrUniqueIDField,\n $usrEMail, $usrRightsField, $usrNicknameField, $usrPassword,\n $usrPasswordAlgorithm;\n\n\n $this->check_usrFieldTypes();\n\n $stage=0;\n try {\n $cc=db_sql(\"select count(*) from $usrTableName where $usrNicknameField='$nickName'\");\n $stage++;\n if ($cc==0) {\n\n switch (strtoupper($usrUniqueIDFieldType))\n {\n case 'INTEGER':\n $guid=intval(db_sql(\"select max($usrSessionIDField) from $usrTableName\"));\n $guid++;\n break;\n case 'CHAR':\n case 'VARCHAR':\n case 'CHARACTER VARYING':\n if (function_exists($usrPasswordAlgorithm))\n $guid=$usrPasswordAlgorithm(md5('USER_SECURITY'.y_uniqid()));\n else {\n _recordWastedTime(\"Throwing an exception \"+__FILE__+\":\"+__LINE__);\n throw new Exception(\"userPasswordAlgorithm '$usrPasswordAlgorithm' is not a recognized function\");\n }\n break;\n default: {\n _recordWastedTime(\"Throwing an exception \"+__FILE__+\":\"+__LINE__);\n throw new Exception(\"$usrTableName.$usrSessionIDField is of type '$usrSessionIDFieldType' which is not usable by userContext\");\n }\n }\n $stage++;\n\n $userData=array();\n $userData[$usrUniqueIDField]=$guid;\n $userData[$usrPassword]=$usrPasswordAlgorithm($password);\n $userData[$usrEMail]=$eMail;\n $userData[$usrRightsField]=$rights;\n $userData[$usrNicknameField]=$nickName;\n\n // die(\"plain password: '$password'<br>\\n\".var_dump($userData));\n\n $fieldList='';\n $fieldValue='';\n foreach($userData as $k=>$v) {\n if ($k>'') {\n if (db_fieldExists($usrTableName, $k)) {\n $fieldType=strtoupper(db_fieldType($usrTableName,$k));\n if (strpos(\"*$fieldType\",'CHAR')>0)\n $v=\"'$v'\";\n if ($fieldList>'') {\n $fieldList.=', ';\n $fieldValue.=', ';\n }\n $fieldList.=$k;\n $fieldValue.=$v;\n } else\n throw new Exception(\"$k does not exists in table $usrTableName\");\n }\n }\n\n $stage++;\n\n $sql=\"insert into $usrTableName ($fieldList) values ($fieldValue)\";\n // die($password.\"<br>\".$sql);\n db_sql($sql);\n $stage++;\n }\n }\n catch(Exception $e)\n {\n $aux=\"ERROR AT USER CREATION (stage: $stage) \".$e->getMessage();\n _dumpY(8,0,$aux);\n die($aux);\n }\n }", "protected function create(array $data)\n {\n Session::flash('success');\n $user = User::create([\n 'id_std' => $data['idstd'],\n 'name' => $data['name'],\n 'years' => $data['years'],\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'type' =>'member',\n 'status' => 'unconfirm',\n ]);\n\n $emails = User::select('email')->where('type','admin')->get();\n $email = array_pluck($emails, 'email');\n Mail::send('sendmail/mail_member_register', compact('user'), function($message) use ($email) {\n $message->to($email);\n $message->subject('ตรวจสอบรายชื่อลงทะเบียนศิษย์เก่าสาขาวิทยาการคอมพิวเตอร์ ');\n $message->from('[email protected]','Alumni CS UBU');\n });\n return $user;\n }", "final static public function CreateUser(){\n\t\t\n\t\t$wr = static::validation();\n\t\t$record = new static::$modelNM();\t//instantiate new object\n\t\t$record->username = $_POST[\"username\"];\n\t\t$record->fname = $_POST[\"fname\"];\n\t\t$record->lname = $_POST[\"lname\"];\n\t\t$record->gender = $_POST[\"gender\"];\n\t\t$record->phone = $_POST[\"phone\"];\n\t\t$record->birthday = $_POST[\"birthday\"];\n\t\t$record->email = $_POST[\"email\"];\n\t\t$record->addhashpassword($_POST[\"password\"]);\n\n\n\t\tif($wr != \"\") {\n\t\t\techo $wr;\n\t\t\t$_SESSION[\"Temprecord\"] = $record;\n\t\t\treturn NULL;\n\t\t} else {\n\t\t\t//$_SESSION[\"Temprecord\"] = NULL;\n\t\t}\n\t\t\n\t\n\t\t$record->GoFunction(\"Insert\");\t//Run Insert() in modol class and echo success or not\n\t\tsetcookie(\"Username\", $_POST[\"username\"], time() + (86400 * 30), \"/\");\n\t\treturn 1;\t//return display html table code from ShowData\n\t}", "public function newUser($request)\r\n {\r\n /*\r\n * As before we set $params1 'Username'. We need this to check if user exist in database beacuse we don't allow\r\n * two user in database with the same username.\r\n */\r\n $params1 = [\r\n 'Username' => $request['username']\r\n ];\r\n if ($this->existUser($params1) == True) {\r\n /*\r\n * If in the database exits user with the same username then you return false (user must change username)\r\n */\r\n\r\n return False;\r\n } else {\r\n\r\n /*\r\n * Next step is creating a valid activation hash code. We need this for security (in URL you dont want to show UserID\r\n * beacuse in this case attacker has more information about your database)\r\n * Each of users in database has unique activation hash code. Activation hash code we need for activation account and\r\n * reseting password.\r\n *\r\n * Now,follow algorithm for creating unique activation hash code.\r\n */\r\n while (True) {\r\n $params2 = [\r\n 'Activation' => password_hash(rand(), PASSWORD_DEFAULT)\r\n ];\r\n\r\n if ($this->existUser($params2) != True) {\r\n break;\r\n }\r\n }\r\n\r\n /*\r\n * Next step is set params which need to create new user into database.\r\n */\r\n\r\n $params3 = [\r\n 'Username' => $request['username'],\r\n 'Email' => $request['email'],\r\n 'Password' => password_hash($request['password'], PASSWORD_DEFAULT),\r\n 'IsDeleted' => '0',\r\n 'Registration' => (new DateTime('now'))->format('Y-m-d h:s'),\r\n 'Activation' => $params2['Activation']\r\n ];\r\n\r\n $userID = $this->create();\r\n\r\n /*\r\n * Creating link which is send to user mail at registration for activating his account.\r\n */\r\n $link = \"http://www.mdtohtml.com/index.php?activation=\" . $params3['Activation'];\r\n\r\n /*\r\n * Inserting new user in database\r\n */\r\n $this->update($userID, $params3);\r\n\r\n /*\r\n * Now we have to prepare data to send activation mail to user (mail).\r\n */\r\n\r\n $data = [\r\n 'email' => $request['email'],\r\n 'title' => 'Registration support',\r\n 'body' => \"Hello!\\n\\nClick on below link to confirm your registration.\\n\\n$link\",\r\n 'subject' => 'Confirm password',\r\n 'user' => $request['username'],\r\n 'link' => $link,\r\n 'username' => '[email protected]',\r\n 'password' => 'preskok123'\r\n\r\n ];\r\n\r\n /*\r\n * At the end sending activating mail to user.\r\n */\r\n\r\n $this->send_mail($data);\r\n return True;\r\n }\r\n\r\n }", "function createUser($firstname, $lastname, $email, $phone, $password){\n\n\t\tglobal $conn;\n\n\t\t$md5Password = md5($password);\n\n\t\t$query = \"INSERT INTO User (firstname, lastname, email, phone, password)\n\t\tVALUES('\" . $firstname . \"', '\" . $lastname . \"', '\" . $email . \"', '\" . $phone . \"', '\" . $md5Password . \"')\";\n\n\t\tif($conn->query($query) === TRUE){\n\t\t\treturn \"VALID_INSERTION\";\n\t\t} else {\n\t\t\treturn \"Error inserting User: \" . $conn->error . \"<br/>\";\n\t\t}\n\n\t}", "public function createUser($data,$fname,$lname,$username){\n\t\t\t$this->db->from('tbl_employees')->where(array('fname'=>$fname,'lname'=>$lname));\n\t\t\t$query = $this->db->get();\n\t\t\tif($query->num_rows() == 0){\n\t\t\t\t$this->db->from('tbl_employees')->where('username',$username);\n\t\t\t\t$query = $this->db->get();\n\t\t\t\tif($query->num_rows() == 0){\n\t\t\t\t\t$this->db->insert('tbl_employees',$data);\n\t\t\t\t\treturn \"created\";\n\t\t\t\t}else{\n\t\t\t\t\treturn \"username\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn \"person\";\n\t\t\t}\n\t\t}", "protected function _createUser() {\n\t\t$user = System_Locator_TableLocator::getInstance()->get('User')->createRow();\n\t\t$user->username = $this->getUsername();\n\t\t$user->setPassword($this->getPassword());\n\t\t$user->email = $this->getEmail();\n\t\t$user->countryCode = $this->getCountryCode();\n\t\t$user->createdAt = date(DATE_ISO8601); \n\t\treturn $user;\n\t}", "protected function createUser()\n {\n $errors = $this->validate(['username','password','email','group_id']);\n\n if(count($errors) > 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => $errors\n ]);\n }\n\n $arrUserData = [\n 'username' => $this->request->variable('username',''),\n 'user_password' => $this->request->variable('password',''), // already hashed by contao\n 'user_email' => $this->request->variable('email',''),\n 'group_id' => $this->request->variable('group_id',''),\n 'user_type' => USER_NORMAL\n ];\n\n // Create the user and get an ID\n $userID = user_add($arrUserData);\n\n // If user wasn't created, send failed response\n if(!$userID)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'phpbb Could not create user',\n 'error' => ['Could not create phpBB user']\n ]);\n }\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user created',\n 'data' => [\n 'user_id' => $userID\n ]\n ]);\n }", "public function create(){\n \n $data = array();\n $data['login'] = $_POST['login'];\n $data['password'] = Hash::create('sha256', $_POST['password'], HASH_KEY);\n $data['role'] = $_POST['role'];\n \n //Do the Error checking\n \n $this->model->RunCreate($data);\n /*\n * After we Post the user info to create, the header is refereshed so that the data appears dynamically \n * below in the users list\n */\n header('location: ' . URL . 'users');\n }", "public function vxUserCreateInsert($usr_nick, $usr_password, $usr_email, $usr_gender) {\n\t\tif (get_magic_quotes_gpc()) {\n\t\t\t$usr_nick = stripslashes($usr_nick);\n\t\t\t$usr_nick = mysql_real_escape_string($usr_nick);\n\t\t\t\n\t\t\t$usr_password = stripslashes($usr_password);\n\t\t\t$usr_password = mysql_real_escape_string($usr_password);\n\t\t} else {\n\t\t\t$usr_nick = mysql_real_escape_string($usr_nick);\n\t\t\t$usr_password = mysql_real_escape_string($usr_password);\n\t\t}\n\t\t$usr_password_encrypted = sha1($usr_password);\n\t\t$usr_created = time();\n\t\t\n\t\t/* insert new user */\n\t\t$sql = \"INSERT INTO babel_user(usr_nick, usr_password, usr_email, usr_gender, usr_created, usr_lastupdated) VALUES('{$usr_nick}', '{$usr_password_encrypted}', '{$usr_email}', {$usr_gender}, {$usr_created}, {$usr_created})\";\n\t\tmysql_query($sql, $this->db);\n\t\t\n\t\t$sql = \"SELECT usr_id, usr_nick, usr_password, usr_email, usr_money FROM babel_user WHERE usr_email = '{$usr_email}'\";\n\t\t$User = mysql_fetch_object(mysql_query($sql, $this->db));\n\t\t\n\t\t$grp_created = time();\n\t\t$sql = \"INSERT INTO babel_group(grp_oid, grp_nick, grp_created, grp_lastupdated) VALUES({$User->usr_id}, '{$User->usr_nick}', {$grp_created}, {$grp_created})\";\n\t\tmysql_query($sql, $this->db);\n\t\t\n\t\t$sql = \"SELECT grp_id, grp_nick FROM babel_group WHERE grp_nick = '{$User->usr_nick}'\";\n\t\t$Group = mysql_fetch_object(mysql_query($sql, $this->db));\n\t\t\n\t\t$sql = \"UPDATE babel_user SET usr_gid = {$Group->grp_id} WHERE usr_id = {$User->usr_id} LIMIT 1\";\n\t\tmysql_query($sql, $this->db);\n\t\t\n\t\treturn $User;\n\t}", "function addUser(){\n $data= array(\n 'title'=>$this->security->xss_clean($this->input->post('title')),\n 'fname'=>$this->security->xss_clean($this->input->post('fname')),\n 'lname'=>$this->security->xss_clean($this->input->post('lname')),\n 'gender'=>$this->security->xss_clean($this->input->post('gender')),\n 'email'=>$this->security->xss_clean($this->input->post('email')),\n 'password'=>$this->security->xss_clean(md5($this->input->post('password'))),\n 'mobile'=>$this->security->xss_clean($this->input->post('mobile')),\n 'work_phone'=>$this->security->xss_clean($this->input->post('work_phone')),\n 'address'=>$this->security->xss_clean($this->input->post('address')),\n 'type'=>$this->security->xss_clean($this->input->post('type'))\n );\n \n $this->db->insert('user', $data);\n }", "public function insert_new_user($data)\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n $password = md5($password);\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->orWhere(\"phone_number = '$phone_number'\")->All();\n if($count[0]['count']==0)\n {\n $query = Yii::$app->db;\n $result = $query->createCommand()->insert('core_users', [\n \"user_name\"=>$user_name,\n \"email\"=>$email,\n \"password\"=>$password,\n \"phone_number\"=>$phone_number,\n //\"phone_prefix\"=>'91',\n \"user_status\"=>'1',\n \"company_name\"=>$company_name,\n \"designation\"=>$designation,\n \"company_email\"=>$company_email,\n \"company_address\"=>$address,\n \"user_type\"=>1\n ])->execute();\n \n \n $subject=\"Big Equipments India | User Registration\";\n //get message to send to user\n $message = Mail_settings::get_registration_message();\n //send email to user\n Mail_settings::send_email_notification($email,$subject,$message);\n \n if($result)\n {\n return true;\n }\n return false;\n }\n return false;\n \n }", "public function registerNewUser()\n\t{\n\t\t$Request= new Request();\n\t\t\n\t\t$Controler_Main= Controler_Main::getInstance();\n\t\t$ErrorString=\"\";\n\t\tif(strlen($Request->getAsString(\"tb_Name\"))<3){$ErrorString.=\":T_REGISTER_ERROR1: <br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Pass\"))<5){$ErrorString.=\":T_REGISTER_ERROR2: <br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Pass\"))===$Request->getAsString(\"tb_PassConfirme\")){$ErrorString.=\":T_REGISTER_ERROR3:<br />\";}\n\t\t$UserFinder= new UserFinder();\n\t\tif(strlen($Request->getAsString(\"tb_Mail\"))>3)\n\t\t{\n\t\t\t$User=$UserFinder->findByMail($Request->getAsString(\"tb_Mail\"));\n\t\t\tif($User->getId()!=0)\n\t\t\t{\n\t\t\t\t$ErrorString.=\":T_REGISTER_ERROR4: <br />\";\n\t\t\t}\n\t\t}else\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR5: <br />\";\n\t\t}\t\n\t\tif(strlen($Request->getAsString(\"tb_Mail\"))===$Request->getAsString(\"tb_MailConfirme\")){$ErrorString.=\":T_REGISTER_ERROR6:<br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Name\")))\n\t\t{\n\t\t\t$User=$UserFinder->findByName($Request->getAsString(\"tb_Name\"));\n\t\t\tif($User->getId()!=0){$ErrorString.=\":T_REGISTER_ERROR7: <br />\";}\n\t\t}\n\t\t\n\t\t\n\t\tif(!$this->isMailCorrect($Request->getAsString(\"tb_Mail\")))\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR8: <br />\";\n\t\t}\t\n\t\t\n\t\tif(strtolower($_SESSION['Captcha'])!=(strtolower($Request->getAsString(\"tb_Captcha\"))))\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR9: <br />\";\n\t\t}\n\t\t\t\n\t\tif(strlen($ErrorString)!=0)\n\t\t{\n\t\t\t$this->showRegister($ErrorString);\n\t\t\t$this->setCaptchaCode();\n\t\t\treturn false;\n\t\t}\n\t\t$User= new User(0,$Request->getAsString(\"tb_Name\"),md5($Request->getAsString(\"tb_Pass\")),$Request->getAsString(\"tb_Mail\"),0,1,0,0);\t\n\t\t$UserManager= new UserManager();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// user Ordner anlegen\n\t\t\n\t\t// htaccess zugriff legen\n\t\tif(!is_dir(STORE_FOLDER.\"/\".md5($User->getName())))\n\t\t{\n\t\t\tmkdir(STORE_FOLDER.\"/\".md5($User->getName()), 0777);// ordner erstellen\n\t\t\t$User->setFolder(STORE_FOLDER.\"/\".md5($User->getName()));\n\t\t}else\n\t\t{\n\t\t\t$Folder=STORE_FOLDER.\"/\".md5($User->getName()+mktime());\n\t\t\tmkdir($Folder, 0777);\n\t\t\t$User->setFolder($Folder);\n\t\t}\n\t\t\n\t\t$User->setSpaceMax(MAXSPACE);\n\t\t//var_dump(\"und den UserFinder eintragen\");\n\t\t$UserManager->insertUser($User);// user in die db eintragen\n\t\tif(!$UserManager->getLastInsertId())\n\t\t{\n\t\t\t$this->showRegister($ErrorString);\n\t\t\treturn false;\n\t\t}\n\t\t$User->setId($UserManager->getLastInsertId());\n\t\t$this->userLogin();\n\t\t\n\n\t}", "function create_user($email){\r\n\r\n $post_array = $_POST;\r\n $default_usergroup = \"11\";\r\n\r\n $distributor = $this->aauth->get_user();\r\n $distributor_id = $distributor->user_link_id;\r\n\r\n $new_user_id = '';\r\n $this->load->model('user_model');\r\n\r\n $password = $this->generateRandomString(6);\r\n\r\n $new_user_id = $this->aauth->create_user($post_array['email'],$password,$post_array['name'],$post_array['username'],$default_usergroup);\r\n $errors = $this->aauth->get_errors_array();\r\n\r\n if(is_array($errors) && count($errors) >= 1){\r\n $this->event_model->track('user','attempted_add_user', $errors[0]);\r\n $this->form_validation->set_message('create_user', $errors[0]);\r\n return false;\r\n\r\n }else{\r\n\r\n $this->user_model->update_user_cellphone($post_array['email'], array(\r\n \"cellphone\" => $post_array['cellphone'],\r\n \"user_link_id\" => $distributor_id,\r\n \"parent_id\" => $new_user_id\r\n ));\r\n $this->send_welcome($post_array['email'],$post_array['name'],$post_array['username'],$post_array['cellphone'],$password);\r\n $this->event_model->track('user','add_user', $new_user_id);\r\n $this->form_validation->set_message('create_user', \"<script>window.location.replace('/distributors/distributor_profile/user');</script>\");\r\n return false;\r\n }\r\n \r\n }", "public function creer(){ /*** Cree un utilisateur par insertion d'un tuple dans la table UserTab ***/\r\n \r\n \r\n // $this -> setInscrit(1);\r\n $this -> insertDb();//Insertion en Bd d'un tuple user\r\n\t\t\t\r\n }", "function create_user($data) {\n\t\t$data['created'] = date('Y-m-d H:i:s');\n\n\t\tif ($this->db->insert($this->table_name, $data)) {\n\t\t\t$user_id = $this->db->insert_id();\n\t\t\treturn array('user_id' => $user_id);\n\t\t}\n\t\treturn NULL;\n\t}", "function User_Create($Username,$Password,$Email)\n\t{\n\t\t$IID=j::$Session->CreateUser($Username,$Password);\n\t\tif ($IID===null) return null;\n\t\tj::SQL(\"INSERT INTO jfp_xuser (ID,Email,CreateTimestamp) VALUES (?,?,?)\",$IID,$Email,time());\n\t\treturn $IID;\n\t\t\n\t}", "protected function create()\n {\n// dd(request());\n // create new user in database\n $newUser = User::create([\n 'name' => \\request('name'),\n 'email' => \\request('email'),\n 'student_id' => \\request('student_id'),\n 'phone' => \\request('phone'),\n 'password' => bcrypt(\\request('password')),\n 'remember_token' => \\request('_token'),\n ]);\n\n\n //login the new user\n\n auth()->login($newUser);\n\n }", "function create_user ( $ID, $first_name, $last_name, $email ) {\n\tglobal $access_token, $canvas_base_url;\n\t\n\t$pass=md5(uniqid($first_name.$last_name, true));\n\t$url=$canvas_base_url.\"/api/v1/accounts/1/users.json\";\n\tsystem(\"curl $url -F 'user[name]=$first_name $last_name' -F 'user[short_name]=$first_name' -F 'pseudonym[unique_id]=$email' -F 'pseudonym[password]=$pass' -F 'pseudonym[sis_user_id]=$ID' -H 'Authorization: Bearer $access_token'\");\n\t\n}" ]
[ "0.7457281", "0.73658985", "0.73658985", "0.73658985", "0.73658985", "0.73649424", "0.7346559", "0.7329289", "0.72126853", "0.7200816", "0.7191553", "0.71124655", "0.71086645", "0.71002537", "0.70262283", "0.70057905", "0.70048046", "0.6996431", "0.699579", "0.6972558", "0.6941183", "0.69401646", "0.6939146", "0.6934393", "0.69318306", "0.69252133", "0.6911243", "0.68789876", "0.6855263", "0.6854782", "0.6834481", "0.68288887", "0.6825449", "0.6818155", "0.6817758", "0.6817712", "0.68147475", "0.6811145", "0.6809717", "0.6808902", "0.6807894", "0.6800386", "0.6799168", "0.67684674", "0.6765137", "0.6762934", "0.6758874", "0.6754043", "0.67525554", "0.6738215", "0.67323565", "0.67307484", "0.67223704", "0.67198026", "0.6716969", "0.6716388", "0.67132187", "0.6704095", "0.67001164", "0.66775155", "0.6669487", "0.66645646", "0.66645014", "0.66591805", "0.6652597", "0.6652559", "0.66517437", "0.6640848", "0.6637904", "0.66322976", "0.66314685", "0.6631432", "0.66289705", "0.6617356", "0.66131544", "0.66118515", "0.66111207", "0.6604761", "0.659637", "0.6595527", "0.6592767", "0.65919393", "0.6590566", "0.65905184", "0.65887773", "0.6584803", "0.6582831", "0.6578829", "0.65768003", "0.65751684", "0.65706503", "0.6568166", "0.65681", "0.6565254", "0.6561558", "0.6560265", "0.6559759", "0.65584", "0.65546125", "0.6553582", "0.65531373" ]
0.0
-1
/ Copyright (C) 2010, All Rights Reserved. This file is part of RPInventory. RPInventory is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. RPInventory is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with RPInventory. If not, see < / Takes the smarty variable and the name of the variable storing the information to be displayed
function paginate( $smarty, $itemVarName, $currentSortIndex, $currentSortDir, $mode ){ require_once('lib/SmartyPaginate.class.php'); SmartyPaginate::reset(); /* Remove the old session data */ SmartyPaginate::connect(); SmartyPaginate::setLimit( 15 ); $smarty->assign( $itemVarName, getPaginatedResults( $smarty, $itemVarName, $currentSortIndex, $currentSortDir, $mode ) ); SmartyPaginate::assign( $smarty ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function smarty_function_itemname($params, $smarty)\n{\n if(isset($params['id'])){\n return aioncp::GetInstance()->get_item_name($params['id']);\n }\n\n}", "function smarty_function_echo($params, &$smarty)\n{\n if(isset($smarty->parent->tpl_vars[$params['var']]))\n {\n return $smarty->parent->tpl_vars[$params['var']]->value;\n }\n return isset($params['default'])?$params['default']:\"\";\n}", "function smarty_std(){\n global $smarty;\n $smarty->assign('USER',$_SESSION['ldapab']['username']);\n}", "function smarty_function_var($params, &$smarty) {\n\tif($params['var']) {\n\t\treturn $smarty->getTemplateVars($params['var']);\n\t}\n\t\n\treturn \"\";\n}", "public function smarty($resource_name, $params = array()) {\n\t\techo $this->load($resource_name, $params);\n\t}", "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}", "function generateTemplateVariableHTML($rec,$cntr) {\n global $_TABLES,$_CONF;\n\n $p = new Template($_CONF['path_layout'] . 'nexflow/admin');\n $p->set_file ('variables','template_variables.thtml');\n $p->set_file ('variable_rec','template_variable_record.thtml');\n\n $p->set_var('template_id',$rec);\n $p->set_var('cntr',$cntr);\n\n $sql = \"SELECT * FROM {$_TABLES['nftemplatevariables']} WHERE nf_templateID='{$rec}' ORDER BY id\";\n $query = DB_Query($sql);\n $numrows = DB_numrows($query);\n if ($numrows > 0) {\n $j=1;\n $p->set_var('show_vars','');\n $p->set_var('vdivid','');\n\n while ( $A = DB_fetchArray($query) ) {\n $edit_link = \"[&nbsp;<a href=\\\"#\\\" onClick='ajaxUpdateTemplateVar(\\\"edit\\\",{$rec},{$cntr},{$j});'\\\">Edit</a>&nbsp;]\";\n $del_link = \"[&nbsp;<a href=\\\"#\\\" onClick='ajaxUpdateTemplateVar(\\\"delete\\\",{$rec},{$cntr},{$j});'\\\">Delete</a>&nbsp;]\";\n $p->set_var('variable_name',$A['variableName']);\n $p->set_var('variable_value',$A['variableValue']);\n $p->set_var('var_id',$j);\n $p->set_var('edit_link',$edit_link);\n $p->set_var('delete_link',$del_link);\n if ($j == 1) {\n $p->parse('template_variable_records','variable_rec');\n } else {\n $p->parse('template_variable_records','variable_rec',true);\n }\n $j++;\n }\n } else {\n $p->set_var('show_vars','none');\n $p->set_var('vdivid',\"vars{$cntr}\");\n $p->set_var('template_variable_records','');\n }\n $p->parse ('output', 'variables');\n $html = $p->finish ($p->get_var('output'));\n $html = htmlentities($html);\n\n return $html;\n}", "public function index(){\n $this->smarty->display('admin/waterbar/inventory.tpl');\n }", "public abstract function fillComponent(&$smarty_tpl);", "function smarty_function_echo_r($params, &$smarty)\n{\n\tif(is_null($params['var']))\n\t{\n\t\techo 'NULL';\n\t\treturn;\n\t}\n\t\n if(!isset($params['var']))\n {\n\t\ttrigger_error(\"assign: missing 'var' parameter\");\n return;\n }\n\t\n\techo_r($params['var']);\n}", "function yy_r76(){if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\\'smarty\\'') { $this->_retvalue = $this->compiler->compileTag('special_smarty_variable',$this->yystack[$this->yyidx + 0]->minor['index']);} else {\r\n $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor['var'] .')->value'.$this->yystack[$this->yyidx + 0]->minor['index']; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor['var'],\"'\"))->nocache;} }", "public static function listItemsTpl()\n {\n extract(FeedPage::$var);\n?>\n<?php include(\"tpl/list_items.tpl.php\"); ?>\n<?php\n }", "function smarty_function_value_filter($params)\n{\n \n App::uses('SmartyComponent', 'Controller/Component');\n $Smarty = new SmartyComponent(new ComponentCollection());\n\n $assignments = array('id_attribute' => $params['id_attribute']\n ,'name_attribute' => $params['name_attribute']\n ,'values_attribute' => $params['values_attribute']);\n if(isset($params['is_active']))$assignments['is_active'] = $params['is_active'];\n if(isset($params['alias_micro_template']))\n {\n $params['template'] = $params['alias_micro_template'];\n $display_template = $Smarty->load_template($params, 'value_filter');\n }\n else $display_template = $params['template'];\n $Smarty->display($display_template, $assignments);\n\n}", "function tpl_language()\n{\n global $smarty, $lang, $config;\n\n $smarty->assign('lang', $lang);\n $smarty->assign('config', $config);\n}", "function smarty_resource_pagesvar_trusted($tplName, &$smarty)\n{\n}", "public function display (string $tpl, array $vars = NULL)\n {\n }", "function show_ProductVariables($product_id)\n\t\t{\n\t\t\tglobal $db,$ecom_siteid;\n\t\t\t//$_REQUEST['product_id'] = $product_id;\n\t\t\t// ######################################################\n\t\t\t// Check whether any variables exists for current product\n\t\t\t// ######################################################\n\t\t\t$sql_var = \"SELECT var_id,var_name,var_value_exists, var_price \n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\tproduct_variables \n\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\tproducts_product_id = \".$product_id.\" \n\t\t\t\t\t\t\tAND var_hide= 0\n\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\tvar_order\";\n\t\t\t$ret_var = $db->query($sql_var);\n\t\n\t\t\t\n\t\t\tif ($db->num_rows($ret_var))\n\t\t\t{\n\t\t\t\t\n\t\t ?>\n\t\t\t\t\n\t\t\t\t<?php\n\t\t\t\t\t// Case of variables\n\t\t\t\t\tif ($db->num_rows($ret_var) or $db->num_rows($ret_msg))\n\t\t\t\t\t{\n\t\t\t\t\t\twhile ($row_var = $db->fetch_array($ret_var))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($row_var['var_value_exists']==1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// check whether values exists current variable\n\t\t\t\t\t\t\t\t$sql_vals = \"SELECT var_value_id, var_addprice,var_value \n\t\t\t\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\t\t\tproduct_variable_data \n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\t\t\tproduct_variables_var_id =\".$row_var['var_id'].\" \n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\t\t\t\t\t\t\tvar_order\";\n\t\t\t\t\t\t\t\t$ret_vals = $db->query($sql_vals);\n\t\t\t\t\t\t\t\tif ($db->num_rows($ret_vals))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$var_Proceed = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$var_Proceed = true;\n\t\t\t\t\t\t\tif ($var_Proceed)// Show the variable if it is valid to show\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($row_var['var_value_exists']==1)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$var_vals='';\n\t\t\t\t\t?>\n\t\t\t\t\t\t\t <span style=\"display:block\"><strong><?php echo stripslashes($row_var['var_name'])?>:</strong>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\twhile ($row_vals = $db->fetch_array($ret_vals))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t//echo stripslashes($row_vals['var_value']).\",\";\n\t\t\t\t\t\t\t\t\t\t\t\tif($var_vals!='')\n\t\t\t\t\t\t\t\t\t\t\t\t$var_vals .= \",\".$row_vals['var_value'];\n\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t$var_vals = $row_vals['var_value'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\techo $var_vals;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/*?>\n\t\t\t\t\t\t\t\t\t\t\t<select name=\"var_<?php echo $row_var['var_id']?>\">\n\t\t\t\t\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\t\t\t\t\t\twhile ($row_vals = $db->fetch_array($ret_vals))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $row_vals['var_value_id']?>\"><?php echo stripslashes($row_vals['var_value'])?><?php echo Show_Variable_Additional_Price($row_vals['var_addprice'])?></option>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t</select>\t\t\t*/\t?>\t</span>\t\t\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t?> \n\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t// ######################################################\n\t\t\t\t// End of variables section\n\t\t\t\t// ######################################################\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t?>\t\n\t\t\t\n\t\t\t<?php\n\t\t\t\t\n\t\t\t}\n\t\t}", "function MyShop_Main($args) {\n global $_CONF, $_TABLES, $_MYSHOP_CONF;\n\n $T = new Template($_CONF['path'] . 'plugins/myshop/templates');\n\n $T->set_file(array (\n 'topmenu' => 'topmenu.thtml',\n 'product' => 'product.thtml',\n 'table' => 'table.thtml',\n ));\n\n $row = MyShop_GetProduct(\"on\");\n if ($row == \"\")\n {\n $row = MyShop_str('no_product');\n }\n\n $T->set_var(array(\n 'lang_piname' => $_MYSHOP_CONF['pi_display_name'],\n 'icon_url' => $_CONF['site_url'] . '/myshop/images/myshop.png',\n 'title' => MyShop_str('pi_name'),\n 'caption' => MyShop_str('top_menu_caption'),\n 'menu1' => MyShop_str('top_menu1'),\n 'menu2' => MyShop_str('top_menu2'),\n 'menu3' => MyShop_str('top_menu3'),\n 'menu4' => MyShop_str('top_menu4'),\n 'meta1' => MyShop_str('product_name'),\n 'meta2' => MyShop_str('tbl_head_text'),\n 'meta3' => MyShop_str('tbl_head_price'),\n 'meta4' => MyShop_str('stock'),\n 'meta5' => MyShop_str('tbl_head_image'),\n 'notfound' => $notfound,\n 'h1' => MyShop_str('tbl_head_image'),\n 'h2' => MyShop_str('tbl_head_text'),\n 'h3' => MyShop_str('tbl_head_price'),\n 'h4' => MyShop_str('stock'),\n 'h5' => \"-\",\n 'list' => $row,\n ));\n\n $T->parse('output', 'topmenu');\n $content .= $T->finish($T->get_var('output'));\n\n $T->parse('output', 'product');\n $content .= $T->finish($T->get_var('output'));\n\n $T->parse('output', 'table');\n $content .= $T->finish($T->get_var('output'));\n \n $display = COM_createHTMLDocument($content);\n COM_output($display);\n}", "function yy_r160(){$this->_retvalue = '\".'.'$_smarty_tpl->getVariable(\\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\\')->value'.'.\"'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor,\"'\"))->nocache; $this->compiler->has_variable_string = true; }", "function tpl_list($list)\n{\n global $smarty, $config;\n global $listcolumns;\n if(!$list)\n {\n $smarty->assign('totalresults', 0);\n return;\n }\n for ($i=0; $i < count($list); $i++)\n {\n // setup imgurls\n $list[$i]['imgurl'] = ($config['thumbnail']) ? getThumbnail($list[$i]['imgurl']) : '';\n\n // check for flagfile\n $languages = $list[$i]['language'];\n $flagfile = img('flags/'.$languages.'.gif');\n if (file_exists($flagfile))\n {\n // one langage\n $list[$i]['flagfile'][$languages] = $flagfile;\n $list[$i]['language'] = array($list[$i]['language']);\n }\n else\n {\n // multiple languages\n $langary = preg_split('/,\\s*/', $languages);\n $list[$i]['language'] = $langary;\n\n // assign them all\n foreach ($langary as $languagepart)\n {\n $flagfile = img('flags/'.$languagepart.'.gif');\n if (file_exists($flagfile))\n {\n $list[$i]['flagfile'][$languagepart] = $flagfile;\n }\n }\n }\n\n // is this file editable?\n if (localnet())\n {\n $list[$i]['editable'] = ($config['multiuser']) ?\n check_permission(PERM_WRITE, $list[$i]['owner_id']) : true;\n }\n else\n {\n $list[$i]['editable'] = false;\n }\n/*\n uncomment this to allow display of rating in the 'Browse' tab\n require_once 'custom.php';\n customfields($list[$i], 'out');\n*/\n }\n\n // do adultcheck\n if (is_array($list))\n {\n $list = array_filter($list, \"adultcheck_for_video\");\n }\n\n // enable dynamic columns in list view\n $smarty->assign('listcolumns', session_get('listcolumns'));\n $smarty->assign('list', $list);\n\n // show total number of movies in footer\n $smarty->assign('totalresults', count($list));\n}", "public function showLogin($error = null) {\n $this -> smarty -> assign('titulo','Iniciar Sesión');\n $this -> smarty -> assign('error', $error); \n //le paso por medio de assign el nombre de la variable (titulo) y el contenido\n $this -> smarty -> display('templates/login.tpl');\n //llamo a la funcion display en el template login\n $this -> smarty -> display('templates/footer.tpl'); \n}", "function doTemplateVar(&$item, $maxLength = 250, $addHighlight = 1)\n\t{\n\t\tglobal $CONF, $manager, $member, $catid;\n\n// Paese setting\n\t\t$item_id = intval($item->itemid);\n\t\t$resultQuery = 'SELECT '\n\t\t\t\t\t . ' %s as result '\n\t\t\t\t\t . 'FROM '\n\t\t\t\t\t . ' %s '\n\t\t\t\t\t . 'WHERE '\n\t\t\t\t\t . ' %s = ' . $item_id;\n\n// Parse item\n\t\t$results['Item'] = strip_tags($item->body).strip_tags($item->more);\n\n// Parse commets\n\t\tif ($this->getOption(\"commentsearch\")) {\n\t\t\t$cmntQuery = sprintf($resultQuery, cbody, sql_table('comment'), 'citem');\n\t\t\t$response = sql_query($cmntQuery);\n\t\t\twhile ($cmnt = mysql_fetch_object($response)) {\n\t\t\t\t$results['comment'] .= strip_tags($cmnt->result);\n\t\t\t}\n\t\t}\n\n// Parse trackback\n\t\tif ($this->getOption(\"trackbacksearch\") &&\n\t\t\t$manager->pluginInstalled('NP_TrackBack')) {\n//\t\t\t$titlQuery = sprintf($resultQuery, title, sql_table('plugin_tb'), 'tb_id');\n//\t\t\t$response = quickQuery($titlQuery);\n//\t\t\t$results['Trackback_title'] = strip_tags($response);\n\t\t\t\n\t\t\t$trbkQuery =sprintf($resultQuery, excerpt, sql_table('plugin_tb'), 'tb_id');\n\t\t\t$response = sql_query($trbkQuery);\n\t\t\twhile ($tb = mysql_fetch_object($response)) {\n\t\t\t\t$results['Trackback'] .= strip_tags($tb->result);\n\t\t\t}\n\t\t}\n\t\t$queryStrings = $this->getQueryStrings();\n\t\tforeach($results as $resKey => $resValue) {\n\t\t\t$strCount = 1;\n\t\t\tforeach($queryStrings as $queryValue) {\n\t\t\t\tif (!(mb_substr_count($resValue, $this->_hsc($queryValue)))) {\n\t\t\t\t\t$strCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($strCount > count($queryStrings)) {\n\t\t\t\t$resValue = '';\n\t\t\t}\n\t\t\tif ($resValue) {\n\t\t\t\tif ($addHighlight) {\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach($queryStrings as $queryValue) {\n\t\t\t\t\t\tmb_regex_encoding(_CHARSET);\n\t\t\t\t\t\t$pattern = \"<span class='highlight_{$i}'>{$queryValue}</span>\";\n\t\t\t\t\t\t$resValue = mb_eregi_replace($this->_hsc($queryValue), $pattern, $resValue);\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\tif ($i == 10) {\n\t\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$str_array = mb_split('</span>', $resValue);\n\t\t\t\t\t$num = count($str_array);\n\t\t\t\t\t$lastKey = $num +(-1);\n\t\t\t\t\t$resWidth = 0;\n\t\t\t\t\t$check = FALSE;\n\t\t\t\t\tforeach($str_array as $key => $value) {\n\t\t\t\t\t\t$tmpStr = mb_split(\"<span class='highlight\", $value);\n\t\t\t\t\t\t$tmpStr[0] = mb_eregi_replace('&lt;', '<', $tmpStr[0]);\n\t\t\t\t\t\t$tmpStr[0] = mb_eregi_replace('&gt;', '>', $tmpStr[0]);\n\t\t\t\t\t\t$tmpStr[0] = mb_eregi_replace('&amp;', '&', $tmpStr[0]);\n//\t\t\t\t\t\t$tmpStr[0] = mb_eregi_replace('&nbsp;', ' ', $tmpStr[0]);\n\t\t\t\t\t\t$lastp = mb_strwidth($tmpStr[0], _CHARSET);\n\t\t\t\t\t\tif ($key == 0) {\n\t\t\t\t\t\t\tif ($lastp > 20) {\n\t\t\t\t\t\t\t\t$temp_s = '...'\n\t\t\t\t\t\t\t\t\t\t. mb_substr($tmpStr[0], -20, 20, _CHARSET);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$temp_s = $tmpStr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$resWidth += 20;\n\t\t\t\t\t\t} elseif ($key > 0 && $key < $lastKey) {\n\t\t\t\t\t\t\tif ($lastp > 30) {\n\t\t\t\t\t\t\t\t$temp_s = mb_substr($tmpStr[0], 0, 10, _CHARSET)\n\t\t\t\t\t\t\t\t\t\t. '...'\n\t\t\t\t\t\t\t\t\t\t. mb_substr($tmpStr[0], -10, 10, _CHARSET);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$temp_s = $tmpStr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$resWidth += 30;\n\t\t\t\t\t\t} elseif ($key == $lastKey) {\n\t\t\t\t\t\t\tif ($lastp > 20) {\n\t\t\t\t\t\t\t\t$temp_s = mb_substr($tmpStr[0], 0, 20, _CHARSET)\n\t\t\t\t\t\t\t\t\t\t. '...';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$temp_s = $tmpStr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$resWidth += 20;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($key != $lastKey) {\n\t\t\t\t\t\t\t$str_array[$key] = $this->_hsc($temp_s)\n\t\t\t\t\t\t\t\t\t\t\t . \"<span class='highlight\"\n\t\t\t\t\t\t\t\t\t\t\t . $tmpStr[1];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$str_array[$key] = $this->_hsc($temp_s);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($maxLength < $resWidth && !$check) {\n\t\t\t\t\t\t\t$strKey = $key;\n\t\t\t\t\t\t\t$check = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($strKey > 0) {\n\t\t\t\t\t\t$str_array = array_slice($str_array, 0, $strKey);\n\t\t\t\t\t\t$str_array[$strKey] = $str_array[$strKey] . '...';\n\t\t\t\t\t}\n\t\t\t\t\t$resValue = '<span class=\"queryPosition\">in '\n\t\t\t\t\t\t\t . $this->_hsc($resKey)\n\t\t\t\t\t\t\t . '</span>'\n\t\t\t\t\t\t\t . '<div class=\"queryResults\">'\n\t\t\t\t\t\t\t . @implode('</span>', $str_array)\n\t\t\t\t\t\t\t . '</div>';\n\t\t\t\t} else {\n\t\t\t\t\t$tmpValue = '<span class=\"queryPosition\">in '\n\t\t\t\t\t\t\t . $this->_hsc($resKey)\n\t\t\t\t\t\t\t . '</span>'\n\t\t\t\t\t\t\t . '<div class=\"queryResults\">'\n\t\t\t\t\t\t\t . $this->_hsc(shorten($resValue, $maxLength, '...'))\n\t\t\t\t\t\t\t . '</div>';\n\t\t\t\t\t$resValue = $tmpValue;\n\t\t\t\t}\n\t\t\t\techo $resValue;\n\t\t\t}\n\t\t}\n\t}", "function smarty_resource_pagesvar_secure($tpl_name, &$smarty)\n{\n return true;\n}", "function tpl_edit($video)\n{\n\tglobal $smarty, $config, $lang;\n\n\t// create a form ready quoted version for each value\n\tforeach (array_keys($video) as $key)\n {\n\t\t$video['q_'.$key] = formvar($video[$key]);\n\t}\n\n\t// use custom function for language\n\t$video['f_language'] = custom_language_input('language', $video['language']);\n\n\t// create mediatype selectbox\n $smarty->assign('mediatypes', out_mediatypes());\n if (!isset($video['mediatype'])) $video['mediatype'] = $config['mediadefault'];\n\n\t// prepare the custom fields\n\tcustomfields($video, 'in');\n\n if ($config['multiuser'])\n {\n $smarty->assign('owners', out_owners(array('0' => ''), (check_permission(PERM_ADMIN)) ? false : PERM_WRITE, true));\n }\n\n\t// item genres\n\t$item_genres = getItemGenres($video['id']);\n\t// new-style\n $smarty->assign('genres', out_genres2($item_genres));\n#dlog(out_genres2($item_genres));\n#dlog($item_genres);\n // classic\n $smarty->assign('genreselect', out_genres($item_genres));\n\n\t// assign data\n\t$smarty->assign('video', $video);\n\n\t// get drilldown url for visit link\n\tif ($video['imdbID'])\n {\n require_once './engines/engines.php';\n $engine = engineGetEngine($video['imdbID']);\t\n $smarty->assign('link', engineGetContentUrl($video['imdbID'], $engine));\n $smarty->assign('engine', $engine);\n\t}\n\n/*\n // populate autocomplete boxes\n $smarty->assign('audio_codecs', array_column(runSQL('SELECT DISTINCT audio_codec FROM '.TBL_DATA.' WHERE audio_codec IS NOT NULL'), 'audio_codec'));\n $smarty->assign('video_codecs', array_column(runSQL('SELECT DISTINCT video_codec FROM '.TBL_DATA.' WHERE video_codec IS NOT NULL'), 'video_codec'));\n*/ \n\t$smarty->assign('lookup', array('0' => $lang['radio_look_ignore'],\n\t\t\t\t\t\t\t '1' => $lang['radio_look_lookup'],\n\t\t\t\t\t\t\t '2' => $lang['radio_look_overwrite']));\n\n // needed for ajax image lookup\n $smarty->assign('engines', $config['engines']);\n}", "function yy_r99(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\\'smarty\\'') { $this->_retvalue = $this->compiler->compileTag('special_smarty_variable',$this->yystack[$this->yyidx + -1]->minor['index']).$this->yystack[$this->yyidx + 0]->minor;} else {\r\n $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -1]->minor['var'] .')->value'.$this->yystack[$this->yyidx + -1]->minor['index'].$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -1]->minor['var'],\"'\"))->nocache;} }", "function smarty_function_sC_template_printSurvey($params , &$smarty)\n{\n //$returnVal = '';\n\n if (strcmp($params['user_type'], \"user\") == 0) {\n $header = '<form name=\"submitSurvey\" method=\"POST\" action=\"user.php?ctg=survey&op=survey_store&screen_survey=3\">\n <table width=\"100%\">';\n }\n if (strcmp($params['user_type'], \"external\") == 0) {\n $header = '<form name=\"submitSurvey\" method=\"POST\" action=\"external_survey.php?username='.$params['username'].'&coupon='.$params['coupon'].'&surveys_ID='.$params['surveys_ID'].'&op=survey_store&screen=3\">\n <table width=\"98%\">';\n }\n if (strcmp($params['user_type'], \"instructor\") == 0) {\n $header = '<table width=\"100%\" align=\"left\">';\n }\n\n foreach ($params['data'][0] as $key => $value) {\n if (strcmp($key, \"survey_name\") == 0 ) {\n $header .= '<tr><td align=\"left\"><b>'.$value.'</b></td>\n </tr>';\n } elseif (strcmp($key, \"survey_info\") == 0 ) {\n $header .= '<tr><td align=\"left\"><b>'.$value.'</b></td>\n </tr>\n <tr><td class=\"horizontalSeparator\">&nbsp;</td></tr>\n ';\n } else {\n continue;\n }\n }\n $header .= '<tr><td colspan=\"2\">'.$params['intro'].'</td></tr>\n <tr><td colspan=\"2\">&nbsp;</td></tr>';\n\n $questions = '';\n for ($i = 0; $i < sizeof($params['questions']); $i ++) {\n $j = $i +1;\n $questions .= '<tr>\n <td><input type=\"hidden\" name=\"surveys_ID\" value=\"'.$params['questions'][$i]['surveys_ID'].'\"></td>\n <td><input type=\"hidden\" name=\"question_ID['.$i.']\" value=\"'.$params['questions'][$i]['id'].'\"></td>\n </tr>';\n if (strcmp($params['questions'][$i]['type'], \"yes_no\") == 0) {\n\t\t\t$questions .= ' <tr><td class = \"questionWeight\" style = \"vertical-align:middle\"><img style = \"vertical-align:middle\" src=\"images/32x32/surveys.png\"/>'._QUESTION.'&nbsp;'.$j.'</td></tr>\n <tr>\n <td>\n &nbsp;'.$params['questions'][$i]['question'].'\n </td>\n </tr>\n <tr><td>&nbsp;</td></tr>\n <tr>\n <td>\n &nbsp;&nbsp;<select name=\"answer['.$i.']\">';\n $cnt = 0;\n\t\t\tforeach (unserialize($params['questions'][$i]['answers']) as $key => $value) {\n \tforeach ($value as $new_key => $new_value) {\n \t$questions .= '<option value=\"'.$new_value.'\">'.$new_value.'</option>';\n $cnt ++;\n\t\t\t\t}\n\t\t\t}\n $questions.='\n </select>\n </td>\n </tr>';\n\t\t\tif ($params['action'] == 'survey_preview') {\n \t$user_answer = unserialize($params['answers'][$i]['user_answers']);\n $questions .= '<tr><td class=\"surveyAnswer\">'._STUDENTANSWER.':'.$user_answer.'</td></tr>';\n\t\t\t}\n }\n if (strcmp($params['questions'][$i]['type'], \"development\") == 0 ) {\n $questions .= ' <tr><td class=\"questionWeight\" style = \"vertical-align:middle\"><img style = \"vertical-align:middle\" src=\"images/32x32/surveys.png\" border=\"0px\" />'._QUESTION.'&nbsp;'.$j.'</td></tr>\n <tr>\n <td>\n &nbsp;'.$params['questions'][$i]['question'].'\n </td>\n </tr>\n <tr><td>&nbsp;</td></td>\n <tr>\n <td>\n <textarea class=\"simpleEditor\" rows=\"5\" cols=\"50\" id=\"data\" name=\"answer['.$i.']\">\n </textarea>\n <td>\n </tr>\n ';\n if ($params['action'] == 'survey_preview') {\n \t\t$user_answer = unserialize($params['answers'][$i]['user_answers']);\n \t$questions .= '<tr><td class=\"surveyAnswer\">'._STUDENTANSWER.'&nbsp;:&nbsp;'.$user_answer.'</td></tr>';\n }\n }\n if (strcmp($params['questions'][$i]['type'], \"dropdown\") == 0) {\n $choices = unserialize($params['questions'][$i]['answers']);\n $questions .= '<tr><td class=\"questionWeight\" style = \"vertical-align:middle\"><img style = \"vertical-align:middle\" src=\"images/32x32/surveys.png\" border=\"0px\" />'._QUESTION.'&nbsp;'.$j.'</td></tr>\n <tr>\n <td>\n &nbsp;'.$params['questions'][$i]['question'].'\n </td>\n </tr>\n <tr><td>&nbsp;</td></tr>\n <tr>\n <td>\n &nbsp;&nbsp;<select name=\"answer['.$i.']\">\n ';\n\t\t\tfor ($k = 0; $k < sizeof($choices['drop_down']); $k ++) {\n \t$questions .= '<option name=\"label['.$k.']\">'.$choices['drop_down'][$k].'</option>';\n\t\t\t}\n $questoins .='\n </select>\n </td>\n </tr>';\n\n if ($params['action'] == 'survey_preview') {\n $user_answer = unserialize($params['answers'][$i]['user_answers']);\n $questions .= '<tr><td class=\"surveyAnswer\">'._STUDENTANSWER.'&nbsp;:&nbsp;'.$user_answer.'</td></tr>';\n }\n }\n if (strcmp($params['questions'][$i]['type'], \"multiple_one\") == 0) {\n $choices = unserialize($params['questions'][$i]['answers']);\n $questions .= '<tr><td class=\"questionWeight\" style = \"vertical-align:middle\"><img style = \"vertical-align:middle\" src=\"images/32x32/surveys.png\" border=\"0px\" />'._QUESTION.'&nbsp;'.$j.'</td></tr>\n <tr>\n <td>\n &nbsp;'.$params['questions'][$i]['question'].'\n </td>\n </tr>\n <tr><td>&nbsp;</td></tr>\n <tr><td>\n <radiogroup>\n ';\n\t\t\tfor ($k = 0; $k < sizeof($choices['multiple_one']); $k ++) {\n\t\t\t\t$questions .= '<input style = \"vertical-align:top\" class=\"inputRadioSurvey\" type=\"radio\" name=\"answer['.$i.']\" value=\"'.$choices['multiple_one'][$k].'\">&nbsp;'.$choices['multiple_one'][$k].'<br>';\n\t\t\t}\n $questions .= '</radiogroup>\n </td></tr>';\n if ($params['action'] == 'survey_preview') {\n\t\t\t\t$user_answer = unserialize($params['answers'][$i]['user_answers']);\n $questions .= '<tr><td class=\"surveyAnswer\">'._STUDENTANSWER.'&nbsp;:&nbsp;'.$user_answer.'</td></tr>';\n }\n }\n if (strcmp($params['questions'][$i]['type'], \"multiple_many\") == 0) {\n $choices = unserialize($params['questions'][$i]['answers']);\n $questions .= '<tr><td class=\"questionWeight\" style = \"vertical-align:middle\"><img style = \"vertical-align:middle\" src=\"images/32x32/surveys.png\" border=\"0px\" />'._QUESTION.'&nbsp;'.$j.'</td></tr>\n <tr>\n <td>&nbsp;'.$params['questions'][$i]['question'].'</td>\n </tr>\n <tr><td>&nbsp;</td></tr>\n ';\n\t\t\tfor ($k = 0; $k < sizeof($choices['multiple_many']); $k++) {\n \t$questions .= '<tr><td><input class=\"inputCheckbox\" type=\"checkbox\" name=\"answer['.$i.']['.$k.']\" value=\"'.$choices['multiple_many'][$k].'\"/>&nbsp;'.$choices['multiple_many'][$k].'</td></tr>';\n\t\t\t}\n if ($params['action'] == 'survey_preview') {\n $user_answer = unserialize($params['answers'][$i]['user_answers']);\n $keys = array_keys($user_answer);\n $questions .= '<tr><td class=\"surveyAnswer\">'._STUDENTANSWER.':&nbsp;&nbsp;';\n for ($j = 0; $j < sizeof($user_answer); $j ++) {\n $questions .= $user_answer[$keys[$j]].' &nbsp;';\n }\n $questions .= '</td></tr>';\n }\n }\n $questions .= '<tr><td>&nbsp;</td></tr>';\n }\n if (strcmp($params['user_type'], \"instructor\") == 0 ) {\n $questions .= '<tr><td align=\"center\">&nbsp;</td></tr></table>';\n }\n if (strcmp($params['user_type'], \"user\") == 0 || strcmp($params['user_type'], \"external\") == 0) {\n $questions .= '<tr><td align=\"left\"><input class=\"flatButton\" type=\"submit\" value=\"'._SURVEYSUBMIT.'\"/></td></tr>\n </table></form>';\n }\n\n $returnVal = '<table style = \"width:100%;text-align:left\"><tr><td>'.$header.$questions.'</td></tr></table>';\n\n return $returnVal;\n}", "function template_product($params,&$smarty)\n {\n extract($params);\n return product($id);\n }", "function print_menu($tpl,$varname='menu_niveau2',$items=array(),$id='') {\n if (empty($id)) $id=$varname;\n\n $res=\"<div id=\\\"$id\\\"><ul class=\\\"menu_niveau2\\\">\";\n foreach ($items as $item) {\n \t//passage progressif aux icones actions V15 avec un li onClick et plus un lien href trop long\n if (is_object($item) && !empty($item->js))\t\n \t\t$res.= print_menu_item2($tpl,false,$item);\n else\n \t\t$res.= print_menu_item($tpl,false,$item);\n }\n //print_r($res);\n if ($tpl && $varname)\n \t$tpl->assign($varname, $res.\"</ul></div>\");\n else return $res; //chainage\n\n}", "function print_icones_action($tpl,$varname='icones_action',$items=array(),$id='') {\n if (empty($id)) $id=$varname;\n\n $res=\"<div id=\\\"$id\\\"><ul class=\\\"menu_niveau2\\\" >\";\n foreach ($items as $item) {\n $res.= print_menu_item2($tpl,false,$item);\n }\n //print_r($res);\n if ($tpl && $varname)\n \t\t$tpl->assign($varname, $res.\"</ul></div>\");\n \telse return $res;\t\n\n}", "function show($word='') {\n $smarty = new Smarty; \n $smarty->assign(\"word\",$word);\n $smarty->assign(\"new\",$new);\n $smarty->assign(\"path\",$subscr);\n $smarty->assign(\"from\",$this->from);\n $smarty->display(\"{$this->path}search.tpl\");\n //$link->close();\n }", "function smarty_modifier_debug_print_var( $var, $depth = 0, $length = 40 )\r\n{\r\n $_replace = array( \"\\n\" => \"<i>\\\\n</i>\", \"\\r\" => \"<i>\\\\r</i>\", \"\\t\" => \"<i>\\\\t</i>\" );\r\n switch ( gettype( $var ) )\r\n {\r\n case \"array\" :\r\n $results = \"<b>Array (\".count( $var ).\")</b>\";\r\n foreach ( $var as $curr_key => $curr_val )\r\n {\r\n $results .= \"<br>\".str_repeat( \"&nbsp;\", $depth * 2 ).\"<b>\".strtr( $curr_key, $_replace ).\"</b> =&gt; \".smarty_modifier_debug_print_var( $curr_val, ++$depth, $length );\r\n $depth--;\r\n }\r\n break;\r\n case \"object\" :\r\n $object_vars = get_object_vars( $var );\r\n $results = \"<b>\".get_class( $var ).\" Object (\".count( $object_vars ).\")</b>\";\r\n foreach ( $object_vars as $curr_key => $curr_val )\r\n {\r\n $results .= \"<br>\".str_repeat( \"&nbsp;\", $depth * 2 ).\"<b> -&gt;\".strtr( $curr_key, $_replace ).\"</b> = \".smarty_modifier_debug_print_var( $curr_val, ++$depth, $length );\r\n $depth--;\r\n }\r\n break;\r\n case \"boolean\" :\r\n case \"NULL\" :\r\n case \"resource\" :\r\n if ( TRUE === $var )\r\n {\r\n $results = \"true\";\r\n }\r\n else if ( FALSE === $var )\r\n {\r\n $results = \"false\";\r\n }\r\n else if ( NULL === $var )\r\n {\r\n $results = \"null\";\r\n }\r\n else\r\n {\r\n $results = htmlspecialchars( ( boolean )$var );\r\n }\r\n $results = \"<i>\".$results.\"</i>\";\r\n break;\r\n case \"integer\" :\r\n case \"float\" :\r\n $results = htmlspecialchars( ( boolean )$var );\r\n break;\r\n case \"string\" :\r\n $results = strtr( $var, $_replace );\r\n if ( $length < strlen( $var ) )\r\n {\r\n $results = substr( $var, 0, $length - 3 ).\"...\";\r\n }\r\n $results = htmlspecialchars( \"\\\"\".$results.\"\\\"\" );\r\n break;\r\n case \"unknown type\" :\r\n default :\r\n do\r\n {\r\n $results = strtr( ( boolean )$var, $_replace );\r\n if ( $length < strlen( $results ) )\r\n {\r\n $results = substr( $results, 0, $length - 3 ).\"...\";\r\n }\r\n $results = htmlspecialchars( $results );\r\n break;\r\n } while ( 1 );\r\n }\r\n return $results;\r\n}", "function init_tpl(){\n foreach($this->extra_var as $k=>$v){\n $this->ss->assign($k,$v);\n }\n if($this->action_type == 'editview'){\n/* It's for date fields - start */\n global $timedate, $current_user;\n $this->ss->assign('CALENDAR_DATEFORMAT', $timedate->get_cal_date_format());\n $this->ss->assign('USER_DATEFORMAT', $timedate->get_user_date_format());\n $time_format = $timedate->get_user_time_format();\n $this->ss->assign('TIME_FORMAT', $time_format);\n\n $date_format = $timedate->get_cal_date_format();\n $time_separator = ':';\n $match='';\n if (preg_match('/\\d+([^\\d])\\d+([^\\d]*)/s', $time_format, $match)){\n $time_separator = $match[1];\n }\n $t23 = strpos($time_format, '23') !== false ? '%H' : '%I';\n if (!isset($match[2]) || $match[2] == ''){\n $this->ss->assign('CALENDAR_FORMAT', $date_format . ' ' . $t23 . $time_separator . '%M');\n }\n else{\n $pm = $match[2] == 'pm' ? '%P' : '%p';\n $this->ss->assign('CALENDAR_FORMAT', $date_format . ' ' . $t23 . $time_separator . '%M' . $pm);\n }\n $this->ss->assign('CALENDAR_FDOW', $current_user->get_first_day_of_week());\n $this->ss->assign('TIME_SEPARATOR', $time_separator);\n/* It's for date fields - end */\n }\n $this->ss->assign('count_values',$this->count_values);\n $this->ss->assign('count',count($this->count_values)-1);\n $this->ss->assign('displayParams',$this->displayParams);\n $this->ss->assign('vardef',$this->vardef);\n $this->ss->assign('module',$this->related_module);\n $this->ss->assign('values',$this->bean->{$this->value_name});\n $this->ss->assign('showSelectButton',$this->showSelectButton);\n $this->ss->assign('hideShowHideButton',$this->hideShowHideButton);\n $this->ss->assign('APP',$GLOBALS['app_strings']);\n }", "private function loadSmarty()\n {\n }", "function __ ($var, $rpl = null)\n{\n global $main;\n if (array_key_exists ($var, $main->template->vars_l))\n {\n if (is_array ($rpl))\n $cnt = vsprintf ($main->template->vars_l[$var], $rpl);\n else\n $cnt = $main->template->vars_l[$var];\n echo $cnt;\n }\n}", "function minorite_field($variables) {\n return render($variables['items']);\n}", "function yy_r77(){ $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -2]->minor,\"'\"))->nocache; }", "function tpl_show($video)\n{\n global $smarty, $config;\n\n // imageurl\n $video['imgurl'] = getThumbnail($video['imgurl'], $video['title']);\n\n // make soft linebreaks:\n $video['filename'] = preg_replace('/(_|\\.|-)/', '$1<wbr />', $video['filename']);\n\n // split comma-separated countries, prevent empty array\n $video['country'] = preg_split('/,\\s*/', $video['country'], -1, PREG_SPLIT_NO_EMPTY);\n\n // split comma-separated multiple languages, prevent empty array\n $video['language'] = preg_split('/,\\s*/', $video['language'], -1, PREG_SPLIT_NO_EMPTY);\n\n // humanreadable filesize:\n $video['filesize'] = round($video['filesize']/(1024*1024), 2);\n\n // break plot and comment\n $video['plot'] = nl2br($video['plot']);\n $video['comment'] = nl2br($video['comment']);\n\n\t// cast\n $smarty->assign('cast_toggle', $config['showcasttoggle']);\n $show_cast = true;\n if ($config['showcasttoggle'])\n {\n $show_cast = (isset($_GET['show_cast']) && $_GET['show_cast'] == '1');\n }\n $smarty->assign('show_cast', $show_cast);\n $video['cast'] = [];\n if ($show_cast)\n {\n \t$video['cast'] = prepare_cast($video['actors']);\n }\n\n // prepare the custom fields\n customfields($video, 'out');\n\n // hide owner if not using multi-user\n if (!$config['multiuser']) unset($video['owner']);\n\n // get drilldown url for image\n if ($video['imdbID'])\n {\n require_once './engines/engines.php';\n $smarty->assign('link', engineGetContentUrl($video['imdbID'], engineGetEngine($video['imdbID'])));\n }\n\n // add episodes information\n if (array_key_exists('episodes', $video) && is_array($video['episodes']))\n {\n // allow multiple columns\n $smarty->assign('listcolumns', session_get('listcolumns'));\n }\n\n $smarty->assign('castcolumns', $config['castcolumns']);\n $smarty->assign('video', $video);\n\n // get genre ids and names\n $smarty->assign('genres', getItemGenres($video['id'], true));\n\n // make engines available\n $smarty->assign('engines', $config['engine']);\n\n // allow XML export\n foreach (array('xls','pdf','xml') as $export)\n {\n if ($config[$export]) $smarty->assign($export, 'show.php?id='.$video['id'].'&amp;');\n }\n // new-style way of exporting\n // $smarty->assign('exports', listExports('show.php?id='.$video['id'].'&amp;'));\n}", "public function render (string $tpl, array $vars = NULL)\n {\n }", "function smarty_catalogue_template_assign($smarty, &$smarty_famille, &$familles, &$nav, $hid, $var = '', $link = '', $rootpath = '', $web_root_path = '') {\n\tglobal $recursive_mode;\n\tglobal $wce_mode;\n\tglobal $scriptenv;\n\n\tif (isset($familles['tree'][$hid])) {\n\t\tif (isset($familles['list'][$hid])) {\n\t\t\tif ($familles['list'][$hid]['depth'] == 0) $localvar = \"sw_root{$familles['list'][$hid]['position']}\";\n\t\t\telse $localvar = \"{$var}sw_heading{$familles['list'][$hid]['depth']}\";\n\t\t}\n\t\t$selprec = 0;\n\n\t\t$nbFam = count($familles['tree'][$hid]);\n\t\t$i = 0;\n\n\t\tforeach($familles['tree'][$hid] as $id) {\n\t\t\t$i++;\n\t\t\t$detail = $familles['list'][$id];\n\n\t\t\t$depth = $detail['depth'] - 1;\n\t\t\tif ($depth == 0) {\n\t\t\t\t$localvar = \"cata{$detail['position']}\";\n\t\t\t\t$rootpath = $localvar;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$localvar = \"famille{$depth}\";\n\t\t\t}\n\t\t\t$locallink = ($link != '') ? \"{$link}-{$id}\" : \"{$id}\";\n\n\t\t\tswitch($wce_mode) {\n\t\t\t\tcase 'display';\n\t\t\t\tdefault:\n\t\t\t\t\t// test if url rewrite activated\n\t\t\t\t\tif ($detail['urlrewrite'] != '') {\n\t\t\t\t\t\t// Gestion du lien vers un article WCE\n\t\t\t\t\t\tif ($detail['id_article_wce'] > 0) {\n\t\t\t\t\t\t\t$script = '/'.$detail['urlrewrite_article'].\".html?\".http_build_query(array('catafam'=>'/'.$detail['urlrewrite']));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$script = $web_root_path.'/'.$detail['urlrewrite']; //.\".html\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//$script = $web_root_path.'/catalogue/'.str_replace(' ', '_', $detail['label']).'/'.$detail['id_famille'];\n\t\t\t\t\t\t$script = '?op=catalogue&param='.$detail['id_famille'];\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$sel = '';\n\n\t\t\tif (isset($nav[$depth]) && $nav[$depth] == $id) {\n\t\t\t\t$tpl_path = array(\n\t\t\t\t\t'DEPTH' => $depth,\n\t\t\t\t\t'LABEL' => $detail['label'],\n\t\t\t\t\t'LINK' => $script\n\t\t\t\t\t);\n\n\t\t\t\t$smarty->assign(\"path\",$tpl_path);\n\t\t\t\t$tpl_headcur = array(\n\t\t\t\t\t'TITLE' => $detail['label'],\n\t\t\t\t\t'ID_FAMILLE' => $id,\n\t\t\t\t\t'POSITION' => $detail['position'],\n\t\t\t\t\t'COLOR' => $detail['color'],\n\t\t\t\t\t'COLOR2' => $detail['color2'],\n\t\t\t\t\t'COLOR3' => $detail['color3'],\n\t\t\t\t\t'COLOR4' => $detail['color4'],\n\t\t\t\t\t'DESCRIPTION' => isset($detail['description']) ? $detail['description'] : '');\n\n\t\t\t\t$smarty->assign(\"HEADING{$depth}\",$tpl_headcur);\n\n\t\t\t\t$sel = 'selected';\n\t\t\t\t$selprec=$id;\n\t\t\t}\n\n\t\t\tif ($detail['visible']) {\n\t\t\t\tif (!empty($detail['url'])) $script = $detail['url'];\n\t\t\t\tif ($depth > 0) {\n\t\t\t\t\tif ($selprec>0 && $selprec!=$detail['id']) {\n\t\t\t\t\t\t// on a le suivant\n\t\t\t\t\t\t$detail['selprec']=\"selected\";\n\t\t\t\t\t\t$selprec=0;\n\t\t\t\t\t}\n\t\t\t\t\telse $detail['selprec']=\"\";\n\n\t\t\t\t\t$smarty_famille[$localvar][$detail['id']]=array(\n\t\t\t\t\t'DEPTH' => $depth,\n\t\t\t\t\t'ID_FAMILLE' => $detail['id'],\n\t\t\t\t\t'LABEL' => $detail['label'],\n\t\t\t\t\t'POSITION' => $detail['position'],\n\t\t\t\t\t'IMAGE' \t => $detail['image'],\n\t\t\t\t\t'LINK' => $script,\n\t\t\t\t\t'SEL' => $sel,\n\t\t\t\t\t'COLOR' => $detail['color'],\n\t\t\t\t\t'COLOR2' => $detail['color2'],\n\t\t\t\t\t'COLOR3' => $detail['color3'],\n\t\t\t\t\t'COLOR4' => $detail['color4'],\n\t\t\t\t\t'SELPREC' => $detail['selprec'],\n\t\t\t\t\t'ISLAST'\t\t=> $nbFam==$i,\n\t\t\t\t\t);\n\n\t\t\t\t\tif ($sel==\"selected\") {\n\t\t\t\t\t\t$smarty_famille['SELECTEDHEADING']= array(\n\t\t\t\t\t\t'DEPTH' => $depth,\n\t\t\t\t\t\t'ID_FAMILLE' => $detail['id'],\n\t\t\t\t\t\t'LABEL' => $detail['label'],\n\t\t\t\t\t\t'POSITION' => $detail['position'],\n\t\t\t\t\t\t'IMAGE' \t => $detail['image'],\n\t\t\t\t\t\t'COLOR' => $detail['color'],\n\t\t\t\t\t\t'COLOR2' => $detail['color2'],\n\t\t\t\t\t\t'COLOR3' => $detail['color3'],\n\t\t\t\t\t\t'COLOR4' => $detail['color4'],\n\t\t\t\t\t\t'LINK' => $script\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$smarty_famille[$localvar]=array(\n\t\t\t\t\t'DEPTH' => $depth,\n\t\t\t\t\t'ID_FAMILLE' => $detail['id'],\n\t\t\t\t\t'LABEL' => $detail['label'],\n\t\t\t\t\t'POSITION' => $detail['position'],\n\t\t\t\t\t'IMAGE' \t => $detail['image'],\n\t\t\t\t\t'COLOR' => $detail['color'],\n\t\t\t\t\t'COLOR2' => $detail['color2'],\n\t\t\t\t\t'COLOR3' => $detail['color3'],\n\t\t\t\t\t'COLOR4' => $detail['color4'],\n\t\t\t\t\t'LINK' => $script,\n\t\t\t\t\t'SEL' => $sel,\n\t\t\t\t\t'ISLAST'\t\t=> $nbFam==$i,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ($depth == 0 || (isset($recursive_mode[$depth]) && $recursive_mode[$depth] == 'prof')) {\n\t\t\t\t\tif (isset($familles['tree'][$id])) {\n\t\t\t\t\t\tif ($depth > 0) {\n\t\t\t\t\t\t\tsmarty_catalogue_template_assign($smarty, $smarty_famille[$localvar][$detail['id']], $familles, $nav, $id, \"{$localvar}.\", $locallink, $rootpath, $web_root_path);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tsmarty_catalogue_template_assign($smarty, $smarty_famille[$localvar], $familles, $nav, $id, \"{$localvar}.\", $locallink, $rootpath, $web_root_path);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isset($familles['list'][$hid])) {\n\t\t\t$depth = $familles['list'][$hid]['depth'];\n\t\t\tif ($depth > 0 && isset($nav[$depth-1]) && $nav[$depth-1] == $hid && !(isset($recursive_mode[$depth]) && $recursive_mode[$depth] == 'prof'))\n\t\t\t{\n\t\t\t\tif ($link!='' && isset($nav[$depth])) $link .= \"-$nav[$depth]\";\n\t\t\t\telseif (isset($nav[$depth])) $link = \"$nav[$depth]\";\n\n\t\t\t\tif (isset($nav[$depth]) && isset($familles['tree'][$nav[$depth]])) smarty_catalogue_template_assign($smarty,$smarty_famille,$familles, $nav, $nav[$depth], '', $link,$rootpath);\n\t\t\t}\n\t\t}\n\n\t}\n}", "function smarty_function_shipping($params, $template)\r\n{\t\r\n\tglobal $config;\r\n\tglobal $order;\t\t\r\n\t\t\r\n\tApp::uses('SmartyComponent', 'Controller/Component');\r\n\t\t$Smarty = new SmartyComponent(new ComponentCollection());\r\n\r\n\tApp::import('Model', 'ShippingMethod');\r\n\t\t$ShippingMethod = new ShippingMethod();\r\n\r\n\t// Get the shipping method \r\n\t$shipping = $ShippingMethod->read(null,$order['Order']['shipping_method_id']);\r\n\t\r\n\t$assignments = array('shipping_alias' => $shipping['ShippingMethod']['code']);\r\n\r\n\t$display_template = $Smarty->load_template($params,'shipping');\t\r\n\t$Smarty->display($display_template,$assignments);\r\n\t\r\n}", "public function shop_item()\n {\n $this->el = new XTemplate($this->temp, $this->path);\n\n // for element that have wrapper and comment\n $this->el->assign('WRAPPER', $this->wrapper);\n $this->el->assign('LINK', $this->link);\n\n // scan all variables when using\n foreach ($this->shop_item as $key => $value) {\n\n // customize if need when more vars in html template *\n $this->el->assign('IMG', $value);\n\n // fixed loop\n $this->el->parse('shop_item');\n }\n\n // fixed out results\n echo $this->el->text('shop_item');\n\n }", "function _phptemplate_variables($hook, $vars) {\n if ($hook == 'page') {\n\n if ($secondary = menu_secondary_local_tasks()) {\n $output = '<span class=\"clear\"></span>';\n $output .= \"<ul class=\\\"tabs secondary\\\">\\n\". $secondary .\"</ul>\\n\";\n $vars['tabs2'] = $output;\n }\n\n // Hook into color.module\n if (module_exists('color')) {\n _color_page_alter($vars);\n }\n return $vars;\n }\n return array();\n}", "function doTemplateVar(&$item) {\n global $DIR_MEDIA, $CONF;\n\n // see if there is a podcast file here\n if (strstr($item->body.\" \".$item->more, \"<div class=\\\"podcast\\\"\")) {\n\n if (strstr($item->body.\" \".$item->more, \".mp3\")) {\n $search = \"/http:\\/\\/.*?\\.mp3/i\";\n\t$type = \"audio/mpeg\";\n } else {\n $search = \"/http:\\/\\/.*?\\.torrent/i\";\n\t$type = \"application/x-bittorrent\";\n }\n \n $mem = MEMBER::createFromName($item->author);\n $id = $mem->getId();\n preg_match($search, $item->body.\" \".$item->more, $result);\n $mfile = explode(\"/\", $result[0]);\n $file = $DIR_MEDIA . $id . '/' . $mfile[sizeof($mfile)-1];\n $size = filesize($file);\n\n $url = $result[0];\n echo \"<enclosure url=\\\"$url\\\" length=\\\"$size\\\" type=\\\"$type\\\"/>\";\n }\n }", "function display() {\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Search Systems';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to Menu','sysinventory');\n\n // Grab data for form selects\n \n // Departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n if(empty($depts)) { //some priviledge checking\n $error = \"You are not the administrator of any departments.\";\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n Sysinventory_Menu::showMenu($error);\n return;\n }\n $deptIdSelect = array();\n $deptIdSelect[0] = \"Show All Departments\";\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // Locations\n $db = new PHPWS_DB('sysinventory_location');\n $locations = $db->select();\n $locIdSelect = array();\n $locIdSelect[0] = \"Show All Locations\";\n foreach($locations as $location) {\n $locIdSelect[$location['id']] = $location['description'];\n }\n \n // Set up the form\n $form = new PHPWS_Form('add_system');\n $form->setAction('index.php?module=sysinventory');\n $form->setMethod('get');\n $form->addSubmit('submit','Run Query');\n $form->addReset('reset','Reset');\n $form->addHidden('showreport','yes');\n $form->addHidden('action','report');\n\n // Build the form elements using data from above where necessary\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department:');\n $form->addSelect('location_id',$locIdSelect);\n $form->setLabel('location_id','Location');\n $form->addText('room_number');\n $form->setLabel('room_number','Room Number:');\n $form->addText('model');\n $form->setLabel('model','Model:');\n $form->addText('hdd');\n $form->setLabel('hdd','Hard Disk Size:');\n $form->addText('proc');\n $form->setLabel('proc','Processor:');\n $form->addText('ram');\n $form->setLabel('ram','RAM:');\n $form->addCheck('dual_mon','yes');\n $form->setLabel('dual_mon','Dual Monitor?');\n $form->addText('mac');\n $form->setLabel('mac','MAC Address:');\n $form->addText('printer');\n $form->setLabel('printer','Printer:');\n $form->addText('staff_member');\n $form->setLabel('staff_member','Staff Member:');\n $form->addText('username');\n $form->setLabel('username','Username:');\n $form->addText('telephone');\n $form->setLabel('telephone','Telephone Number:');\n $form->addCheck('docking_stand','yes');\n $form->setLabel('docking_stand','Docking Stand?');\n $form->addCheck('deep_freeze','yes');\n $form->setLabel('deep_freeze','Deep Freeze?');\n $form->addText('purchase_date');\n $form->setReadOnly('purchase_date');\n $form->setLabel('purchase_date','Purchase Date:');\n $form->addText('vlan');\n $form->setLabel('vlan','VLAN:');\n $form->addCheck('reformat','yes');\n $form->setLabel('reformat','Reformat?');\n $form->addTextarea('notes');\n $form->setLabel('notes','Notes:');\n\n Sysinventory_QueryUI::populate($form);\n\n $form->mergeTemplate($tpl);\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','build_query.tpl');\n\n javascript('/jquery/');\n Layout::addStyle('sysinventory','flora.datepicker.css');\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n \n }", "function display() {\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Search Systems';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to Menu','sysinventory');\n\n // Grab data for form selects\n \n // Departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n if(empty($depts)) { //some priviledge checking\n $error = \"You are not the administrator of any departments.\";\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n Sysinventory_Menu::showMenu($error);\n return;\n }\n $deptIdSelect = array();\n $deptIdSelect[0] = \"Show All Departments\";\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // Locations\n $db = new PHPWS_DB('sysinventory_location');\n $locations = $db->select();\n $locIdSelect = array();\n $locIdSelect[0] = \"Show All Locations\";\n foreach($locations as $location) {\n $locIdSelect[$location['id']] = $location['description'];\n }\n \n // Set up the form\n $form = new PHPWS_Form('add_system');\n $form->setAction('index.php?module=sysinventory');\n $form->setMethod('get');\n $form->addSubmit('submit','Run Query');\n $form->addReset('reset','Reset');\n $form->addHidden('showreport','yes');\n $form->addHidden('action','report');\n\n // Build the form elements using data from above where necessary\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department:');\n $form->addSelect('location_id',$locIdSelect);\n $form->setLabel('location_id','Location');\n $form->addText('room_number');\n $form->setLabel('room_number','Room Number:');\n $form->addText('model');\n $form->setLabel('model','Model:');\n $form->addText('hdd');\n $form->setLabel('hdd','Hard Disk Size:');\n $form->addText('proc');\n $form->setLabel('proc','Processor:');\n $form->addText('ram');\n $form->setLabel('ram','RAM:');\n $form->addCheck('dual_mon','yes');\n $form->setLabel('dual_mon','Dual Monitor?');\n $form->addText('mac');\n $form->setLabel('mac','MAC Address:');\n $form->addText('printer');\n $form->setLabel('printer','Printer:');\n $form->addText('staff_member');\n $form->setLabel('staff_member','Staff Member:');\n $form->addText('username');\n $form->setLabel('username','Username:');\n $form->addText('telephone');\n $form->setLabel('telephone','Telephone Number:');\n $form->addCheck('docking_stand','yes');\n $form->setLabel('docking_stand','Docking Stand?');\n $form->addCheck('deep_freeze','yes');\n $form->setLabel('deep_freeze','Deep Freeze?');\n $form->addText('purchase_date');\n $form->setReadOnly('purchase_date');\n $form->setLabel('purchase_date','Purchase Date:');\n $form->addText('vlan');\n $form->setLabel('vlan','VLAN:');\n $form->addCheck('reformat','yes');\n $form->setLabel('reformat','Reformat?');\n $form->addTextarea('notes');\n $form->setLabel('notes','Notes:');\n\n Sysinventory_QueryUI::populate($form);\n\n $form->mergeTemplate($tpl);\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','build_query.tpl');\n\n javascript('/jquery/');\n Layout::addStyle('sysinventory','flora.datepicker.css');\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n \n }", "function get_fields_from_template($tpl){\n global $smarty;\n global $FIELDS;\n $tpl = $smarty->template_dir.'/'.$tpl;\n $data = @file_get_contents($tpl);\n $matches = array();\n preg_match_all('/\\$entry\\.(\\w+)/',$data,$matches);\n $matches = array_unique((array) $matches[1]);\n $return = array();\n foreach($matches as $f){\n if($FIELDS[$f]){\n $return[] = $FIELDS[$f];\n }elseif($FIELDS[\"_$f\"]){\n $return[] = $FIELDS[\"_$f\"];\n }elseif($f = 'markers'){\n $return[] = 'marker';\n }\n }\n return $return;\n}", "public static function updateTpl()\n {\n extract(FeedPage::$var);\n?>\n<?php include(\"tpl/update.tpl.php\"); ?>\n<?php\n }", "function View(){\n\t\tglobal $title,$db,$footer;\n\t\tinclude \"fn_tgl_indo.php\";\n\t\t$smarty = new Smarty;\n \t\t//$smarty->force_compile = true;\n\t\t$smarty->debugging = true;\n\t\t$smarty->caching = true;\n\t\t$smarty->cache_lifetime = 0;\n\n\t\t$caridata = isset($_REQUEST['caridata']) ? $_REQUEST['caridata'] : '';\n\t\t$id_contract_status = isset($_REQUEST['id_contract_status']) ? $_REQUEST['id_contract_status'] : '';\n\t\t$id_customer_name = isset($_REQUEST['id_customer_name']) ? $_REQUEST['id_customer_name'] : '';\n\t\t$bill_period = isset($_REQUEST['bill_period']) ? $_REQUEST['bill_period'] : '';\n\t\t$btnprint = ''; \n\t\t$info = ''; \n\n\t\tif(empty($caridata)){\n\t\t\t$sql = \"\"; \t\t\n\t\t \t$sumtotal = 0;\n \t\t\t$list[] = array(\"id\"=>\"-\",\"contract_number_file\"=>\"-\",\"cc_name\"=>\"-\",\"site_name\"=>\"-\",\n \t\t\t\t\t \"account_no\"=>\"-\",\"total\"=>\"-\");\n \t\t\t$namacustomer = \"\";\n \t\t\t$contractstatus = \"\";\n \t\t\t$bill_period = \"\";\n \t\t\t$btnprint = ''; \n\t\t\t$info = ''; \n\n \t\t\t//CONTRACT NUMBER\tUSER NAME\tSITE NAME\tACCOUNT \t TOTAL BALANCE \n\t\t\t \n\n\t\t}else{\n\t\t$id_contract_status = isset($_REQUEST['id_contract_status']) ? $_REQUEST['id_contract_status'] : '';\n\t\t$id_customer_name = isset($_REQUEST['id_customer_name']) ? $_REQUEST['id_customer_name'] : '';\n\t\t$bill_period = isset($_REQUEST['bill_period']) ? $_REQUEST['bill_period'] : '';\n\n\t\t\t$sql = \"select a.id,b.customer_name,a.project_no,a.site_name,c.account_manager,\n a.cc_name, c.phone,c.email,c.site_code,c.contract_number_file,\n\t\t\t\t\tc.account_no,c.contract_status_opt, d.bill_periode, d.bill_amount,\n\t\t\t\t\te.charges,sum(d.bill_amount) as total from pdct_customer a\n left join pdct_customer_name b on b.id = a.id_customer_name\n left join pdct_contract c on c.id_customer = a.id\n left join pdct_billing d on d.id_contract = c.id\n left join pdct_charges e on e.id = d.charges\n where a.id_customer_name = '$id_customer_name'\n\t\t\t\t\tand c.contract_status_opt = '$id_contract_status' \n\t\t\t\t\tand d.bill_periode = '$bill_period' GROUP BY c.site_code\";\n\t\t\t\n\t\t\t\n\t\t\t$exsql = $db->Execute($sql);\n\t\t\t$availability = $exsql->RecordCount();\n\n\t\t\t\t\tif($availability > 0){\n\t\t\t\t\t\t$sumtotal = 0;\n\t\t\t\t\t\twhile ($row = $exsql->FetchRow()) {\n\t\t\t\t\t\t$list[] = array(\"id\"=>$row['id'],\"contract_number_file\"=>$row['contract_number_file'],\"cc_name\"=>$row['cc_name'],\"site_name\"=>$row['site_name'], \"account_no\"=>$row['account_no'],\n\t\t\t\t\t\t\t\"total\"=>number_format($row['total']),0,\".\",\".\");\n \n\t\t\t\t\t\t \n\t\t\t\t\t\t$sumtotal += $row['total'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$btnprint = '<button type=\"submit\" name=\"print\" class=\"btn btn-primary\">\n \t\t\t\t\t\t<i class=\"glyphicon glyphicon-print\"> </i> Print Resume Proforma Invoice </button>'; \n\n\t\t\t\t\t\t$info = '<div class=\"alert alert-info\" align=\"center\"> <b>Data Tersedia Sebanyak '.$availability.' Data </b> </div>'; \n\n\t\t\t\t\t\t\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\t$sql = \"\"; \t\t\n\t\t \t\t\t\t$sumtotal = 0;\n \t\t\t\t\t\t\t$list[] = array(\"id\"=>\"kosong\",\"contract_number_file\"=>\"kosong\",\"cc_name\"=>\"-kosong\",\"site_name\"=>\"kosong\",\"account_no\"=>\"kosong\",\"total\"=>\"kosong\");\n \t\t\t\t\t\t$namacustomer = \"\";\n \t\t\t\t\t\t$contractstatus = \"\";\n \t\t\t\t\t\t$tahun = \"\";\n\n \t\t\t\t\t\t$btnprint = ''; \n\n\t\t\t\t\t\t$info = ''; \n\t\t\t\t\t}\n\n\t\t\t\t//get data customer\n\t\t\t\t$sqlcust = \"select * from pdct_customer_name where id = '$id_customer_name'\";\n\t \t\t\t$exsqlcust =$db->Execute($sqlcust);\n\t\t\t \t$getcust = $exsqlcust->FetchRow();\n\t\t\t \t$namacustomer = $getcust['customer_name'];\n\n\t\t\t\t//get data contract status\n\t\t\t\t$sqlcont = \"select * from pdct_contract_status where id = '$id_contract_status'\";\n\t \t\t\t$exsqlcont =$db->Execute($sqlcont);\n\t\t\t \t$getcont = $exsqlcont->FetchRow();\n\t\t\t \t$contractstatus = $getcont['contract_status'];\n\t\t \n\n\t\t}\n\n\t\t//echo $sql;\n \t\t \n\n\t\t$customer_name_opt = $this->customer_name_opt();\n\t\t$smarty->assign(\"customer_name_opt\",$customer_name_opt);\n\n\t\t$contract_status = $this->contract_status();\n\t\t$smarty->assign(\"contract_status\",$contract_status);\n\t\t$smarty->assign(\"btnprint\",$btnprint);\n\t\t$smarty->assign(\"info\",$info);\n\n\n\t\t$bill_period_opt = $this->bill_period_opt();\n\t\t$smarty->assign(\"bill_period_opt\",$bill_period_opt);\n\n\t\t$smarty->assign(\"footer\",$footer);\n\t\t$smarty->assign(\"title\",$title);\n\t\t$smarty->assign(\"list\",$list);\n\t\t$smarty->assign(\"namacustomer\",$namacustomer);\n\t\t$smarty->assign(\"contractstatus\",$contractstatus);\n\t\t$smarty->assign(\"caridata\",$caridata);\n\t\t \n\t\t$smarty->assign(\"id_contract_status\",$id_contract_status);\n\t\t$smarty->assign(\"id_customer_name\",$id_customer_name);\n\t\t$smarty->assign(\"bill_period\",$bill_period);\t\n\t\t$smarty->assign(\"sumtotal\",number_format($sumtotal),0,\".\",\".\");\n\t\t$smarty->assign(\"username\",$_SESSION['username']);\n\t \t$smarty->assign(\"level_user\",$_SESSION['level_user']);\n\t \t$smarty->assign(\"nama_pegawai\",$_SESSION['nama_pegawai']);\n\t\t$smarty->display(\"resume_proforma_invoice.tpl\");\n\t\t}", "private function _getContent()\n {\n return '{*Sailthru zephyr code is used for full functionality*}\n <div id=\"main\">\n <table width=\"700\">\n <tr>\n <td>\n <h2><p>Hello {profile.vars.name}</p></h2>\n <p>Did you forget the following items in your cart?</p>\n <table>\n <thead>\n <tr>\n <td colspan=\"2\">\n <div><span style=\"display:block;text-align:center;color:white;font-size:13px;font-weight:bold;padding:15px;text-shadow:0 -1px 1px #af301f;white-space:nowrap;text-transform:uppercase;letter-spacing:1;background-color:#d14836;min-height:29px;line-height:29px;margin:0 0 0 0;border:1px solid #af301f;margin-top:5px\"><a href=\"{profile.purchase_incomplete.items[0].vars.checkout_url}\">Re-Order Now!</a></span></div>\n </td>\n </tr>\n </thead>\n <tbody>\n {sum = 0}\n {foreach profile.purchase_incomplete.items as i}\n <table width=\"650\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin:0 0 20px 0;background:#fff;border:1px solid #e5e5e5\">\n <tbody>\n <tr>\n <td style=\"padding:20px\"><a href=\"{i.url}\"><img width=\"180\" height=\"135\" border=\"0\" alt=\"{i.title}\" src=\"{i.vars.image_url}\"></a></td>\n <td width=\"420\" valign=\"top\" style=\"padding:20px 10px 20px 0\">\n <div style=\"padding:5px 0;color:#333;font-size:18px;font-weight:bold;line-height:21px\">{i.title}</div>\n <div style=\"padding:0 0 5px 0;color:#999;line-height:21px;margin:0px\">{i.vars.currency}{i.price/100}</div>\n <div style=\"color:#999;font-weight:bold;line-height:21px;margin:0px\">{i.description}</div>\n <div><span style=\"display:block;text-align:center;width:120px;border-left:1px solid #b43e2e;border-right:1px solid #b43e2e;color:white;font-size:13px;font-weight:bold;padding:0 15px;text-shadow:0 -1px 1px #af301f;white-space:nowrap;text-transform:uppercase;letter-spacing:1;background-color:#d14836;min-height:29px;line-height:29px;margin:0 0 0 0;border:1px solid #af301f;margin-top:5px\"><a href=\"{i.url}\">Buy Now</a></span></div>\n </td>\n </tr>\n </tbody>\n </table>\n {/foreach}\n <tr>\n <td align=\"left\" valign=\"top\" style=\"padding:3px 9px\" colspan=\"2\"></td>\n <td align=\"right\" valign=\"top\" style=\"padding:3px 9px\"></td>\n </tr>\n </tbody>\n <tfoot>\n </tfoot>\n </table>\n <p><small>If you believe this has been sent to you in error, please safely <a href=\"{optout_confirm_url}\">unsubscribe</a>.</small></p>\n {beacon}\n </td>\n </tr>\n </table>\n </div>';\n }", "function int()\n {\n// $smarty->setTemplateDir(TPL_PATH);\n// $smarty->setCompileDir(COMPILE_PATH);\n// $smarty->setCacheDir(CACHE_PATH);\n// $smarty->display(\"admin/admin.html\");\n //$this->smarty->display(\"admin/admin.html\");\n $smarty=new smarty();\n }", "function tpl_display($template)\n{\n global $config;\n\n // caching enabled?\n if ($config['http_caching'])\n {\n require_once('./core/httpcache.php');\n httpCacheCaptureStart();\n }\n\n tpl_display_show($template, !$config['http_caching']);\n\n if ($config['http_caching'])\n {\n httpCacheOutput($template, httpCacheCaptureEnd());\n }\n}", "public static function createSmartyObject()\n\t{\n $appModuleArr[\"app\"] = MmmUtility::mmmAppName;\n $appModuleArr[\"module\"] = MmmUtility::mmmModuleName;\n\t\t$appModuleArr[\"useUploads\"] = 1;\n $smarty = JsCommon::getSmartySettings('appModule',$appModuleArr);\n\t\treturn $smarty;\n\t}", "public function display_template($echo = false){\n\n $this->smarty->assignLang(\"site_name\", SITE_NAME); \n $this->smarty->assignLang(\"site_tag_line\", SITE_TAG_LINE); \n $this->smarty->assign(\"root_dir\", ROOT_DIR); \n $this->smarty->assign(\"www_server\", WWW_SERVER);\n $this->smarty->assign(\"admin_server\", ADMIN_SERVER);\n $this->smarty->assign(\"domain\", DOMAIN);\n $this->smarty->assign(\"secure_server\", SECURE_SERVER);\n $this->smarty->assign(\"form_action\", htmlspecialchars($_SERVER['PHP_SELF']) . '?' . $_SERVER[\"QUERY_STRING\"]);\n $this->smarty->assign(\"onloadscript\", $this->onloadscript);\n if(sizeof($this->warn_controls) == 0){\n $this->smarty->assign(\"set_focus_control\", $this->set_focus_control);\n }else{\n $this->smarty->assign(\"set_focus_control\", $this->warn_controls[0]);\t\t\n }\n $this->smarty->assign(\"warnings\", $this->warnings);\n $this->smarty->assign(\"data\", $this->data);\n $this->smarty->assign(\"show_warnings\", sizeof($this->warnings) >0);\n $this->smarty->assign(\"warn_controls\", $this->warn_controls); \n $this->smarty->assign(\"page_title\", htmlspecialchars($this->page_title));\n $this->smarty->assign(\"menu_item\", $this->menu_item);\t\t\n $this->smarty->assign(\"tracker_location\", $this->tracker_location);\t\t\t\t\n $this->smarty->assign(\"show_tracker\",$this->show_tracker);\t\t\t\t\n $this->smarty->assign(\"viewstate\", $this->serialize_viewstate());\n\t\t$this->smarty->assign(\"rss_link\", $this->rss_link);\n\t\t$this->smarty->assign(\"current_url\", $_SERVER['REQUEST_URI']);\n\t\t$this->smarty->assign(\"google_maps_key\", GOOGLE_MAPS_KEY);\n\t\t$this->smarty->assign(\"use_body_script\", $this->use_body_script);\n\n foreach($this->warn_controls as $warn_control) {\n $this->assign('warn_' . $warn_control, true);\n }\n\n if ($echo != false){\n $this->smarty->display($this->smarty_template);\n }else{\n echo $this->smarty->fetch($this->smarty_template); \n }\n }", "public function smarty_display($template) {\n\n // Generic hooks\n $hook_name = \"preDisplay\".ucfirst($this->view_p).\"Hook\";\n\n // echo $hook_name.PHP_EOL.\"<br/>\";\n\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tend_flickr'][$hook_name]))\n foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tend_flickr'][$hook_name] as $cRef)\n $obj = & t3lib_div::callUserFunction($cRef,$this->smarty,$this);\n\n return $this->smarty->display($template);\n }", "function smarty_function_error_message($params,&$smarty)\r\n{\r\n if (!isset($params['field'])) \r\n {\r\n $smarty->_trigger_fatal_error(\"[plugin] parameter 'field' cannot be empty\"); \r\n }\r\n if (!array_key_exists('template', $params))\r\n {\r\n $params['template'] = true;\r\n }\r\n $field = (string)$params['field'];\r\n if ($field[strlen($field)-1] == '.')\r\n {\r\n $pos = intval($GLOBALS['__error_message'][$field]);\r\n $GLOBALS['__error_message'][$field] = $pos + 1;\r\n $field .= $pos;\r\n }\r\n $error_message = $smarty->error($field);\r\n $tpl = $smarty->get_template_vars('Error_Message_Template');\r\n \r\n if (!empty($error_message))\r\n {\r\n if (array_key_exists('message', $params))\r\n {\r\n $error_message = $params['message'];\r\n }\r\n if ($params['template'] && !empty($tpl))\r\n {\r\n $vars = array(\r\n '{$error}', \r\n '{$field}', \r\n '{$name}'\r\n );\r\n $vals = array(\r\n $error_message, \r\n $params['field'],\r\n 'error-'.$params['field']\r\n );\r\n $error = str_replace($vars, $vals, $tpl);\r\n } else {\r\n $class = empty($params['class']) ? 'error_message' : $params['class'];\r\n $error = '<span class=\"'.$class.'\">' . $error_message . '</span>';\r\n }\r\n $return = $params['prefix'] . $error . $params['sufix'];\r\n if (empty($params['return']))\r\n {\r\n echo $return;\r\n } else {\r\n return $return; \r\n }\r\n }\r\n}", "public function render()\n {\n $myConfig = $this->getConfig();\n\n parent::render();\n\n $oAuthUser = oxNew('oxuser');\n $oAuthUser->loadAdminUser();\n $blisMallAdmin = $oAuthUser->oxuser__oxrights->value == \"malladmin\";\n\n if ($blisMallAdmin && !$myConfig->isDemoShop()) {\n $aClassVars = get_object_vars($myConfig);\n $aSystemInfo = array();\n $aSystemInfo['pkg.info'] = $myConfig->getPackageInfo();\n $oSmarty = oxRegistry::get(\"oxUtilsView\")->getSmarty();\n while (list($name, $value) = each($aClassVars)) {\n if (gettype($value) == \"object\") {\n continue;\n }\n // security fix - we do not output dbname and dbpwd cause of demoshops\n if ($name == \"oDB\" || $name == \"dbUser\" || $name == \"dbPwd\" ||\n $name == \"oSerial\" || $name == \"aSerials\" || $name == \"sSerialNr\"\n ) {\n continue;\n }\n\n $value = var_export($value, true);\n $value = str_replace(\"\\n\", \"<br>\", $value);\n $aSystemInfo[$name] = $value;\n //echo( \"$name = $value <br>\");\n }\n $oSmarty->assign(\"oViewConf\", $this->_aViewData[\"oViewConf\"]);\n $oSmarty->assign(\"oView\", $this->_aViewData[\"oView\"]);\n $oSmarty->assign(\"shop\", $this->_aViewData[\"shop\"]);\n $oSmarty->assign(\"isdemo\", $myConfig->isDemoShop());\n $oSmarty->assign(\"aSystemInfo\", $aSystemInfo);\n echo $oSmarty->fetch(\"systeminfo.tpl\");\n echo(\"<br><br>\");\n\n phpinfo();\n\n oxRegistry::getUtils()->showMessageAndExit(\"\");\n } else {\n return oxRegistry::getUtils()->showMessageAndExit(\"Access denied !\");\n }\n }", "public static function display($strTemplateName) {\r\n\t\tself::$_smarty->display($strTemplateName);\r\n\t}", "function smarty_function_find_special_param($params, &$smarty)\n{\n\t//$params['id_product'] $params['id_product_group'] $params['param_tag']\n $GLOBALS['GCMS']->assign('findSpecialParam', RelProParam::get(array(\"id_product\" => $params['id_product'],\"id_product_group\" =>$params['id_product_group'],\"param_tag\"=>$params['param_tag']), false, null, \"param\" ));\n}", "private static function display($html) { self::$smarty->display($html); }", "function smarty_function_yuimenubar($params,&$smarty) {\n\n\n\t//$str = \"\";\n\techo'<script type=\"text/javascript\">\n function buildmenu () {\n var oMenuBar = new YAHOO.widget.MenuBar(\"'.$params['buildon'].'\", { \n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconstraintoviewport:false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpostion:\"dynamic\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvisible:true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tzindex:250,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tautosubmenudisplay: true, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\thidedelay: 750, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlazyload: true });\n\n var aSubmenuData = ';\n\t\t\t\techo navigationmodule::navtojson();\n\t\t\techo\t';\n oMenuBar.subscribe(\"beforeRender\", function () {\n\n if (this.getRoot() == this) {\n\t\t\t\t\tfor (i=0; i<=this.getItems().length; i++){\n\t\t\t\t\t\tvar j=i+1;\n\t\t\t\t\t\t//console.debug(this.getItem(4));\n\t this.getItem(i).cfg.setProperty(\"submenu\", aSubmenuData[j]);\n\t\t\t\t\t}\n\t\t\t\t\t\n }\n\n });\n\n oMenuBar.render(); \n \n }\n\t\tYAHOO.util.Event.onDOMReady(buildmenu);\n </script>\n ';\n\t\n\t\n}", "function smarty_function_escape_special_chars( $string )\r\n{\r\n if ( !is_array( $string ) )\r\n {\r\n $string = preg_replace( \"!&(#?\\\\w+);!\", \"%%%SMARTY_START%%%\\\\1%%%SMARTY_END%%%\", $string );\r\n $string = htmlspecialchars( $string );\r\n $string = str_replace( array( \"%%%SMARTY_START%%%\", \"%%%SMARTY_END%%%\" ), array( \"&\", \";\" ), $string );\r\n }\r\n return $string;\r\n}", "function yy_r92(){ $this->_retvalue = '['.$this->compiler->compileTag('special_smarty_variable','[\\'section\\'][\\''.$this->yystack[$this->yyidx + -3]->minor.'\\'][\\''.$this->yystack[$this->yyidx + -1]->minor.'\\']').']'; }", "function smarty_function_yuimenu($params,&$smarty) {\n\n\n\t//$str = \"\";\n\techo'<script type=\"text/javascript\">\n\t\tfunction buildmenu () {\n\t\t\tvar oMenu = new YAHOO.widget.Menu(\"'.$params['buildon'].'\", { \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition: \"static\", \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thidedelay:\t750, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlazyload: true });\n\n\t\t\tvar sidenav = ';\n\t\t\t\techo navigationmodule::navtojson();\n\t\t\techo ';\n\t\t\toMenu.subscribe(\"beforeRender\", function () {\n\n\t\t\t\tif (this.getRoot() == this) {\n\t\n\t\t\t\t//\tconsole.debug(this.getItems().length);\n\t\t\t\t\t\n\t\t\t\t\tfor (i=0; i<=this.getItems().length; i++){\n\t\t\t\t\t\t//\tvar j=i+1;\n\t\t\t\t\t\tif(sidenav[i].itemdata!=\"\"){\n\t\t\t\t\t\t\t//console.debug(sidenav[i].itemdata);\n\t\t\t\t\t\tthis.getItem(i).cfg.setProperty(\"submenu\", sidenav[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\toMenu.render();\t\t\t\n\t\t\n\t\t}\n\t\tYAHOO.util.Event.onDOMReady(buildmenu);\n\t</script>\n\t';\n\t\n\t\n}", "function yy_r91(){ $this->_retvalue = '['.$this->compiler->compileTag('special_smarty_variable','[\\'section\\'][\\''.$this->yystack[$this->yyidx + -1]->minor.'\\'][\\'index\\']').']'; }", "function prepare_vars_for_template_usage()\n {\n }", "function getSmartyTemplate() {\n\t\t\n\t\t/* Call in Smarty to display template */\n\t\tbfLoad ( 'bfSmarty' );\n\t\t\n\t\t/* @var $tmp bfSmarty */\n\t\t$tmp = bfSmarty::getInstance ( 'com_form' );\n\t\t$tmp->_setTemplatePath ( dirname ( __FILE__ ) . DS . strtolower ( $this->_FORM_CONFIG ['layout'] ) );\n\t\t\n\t\t/* set the head data into the Joomla JDocument or J1.0.x equivilent */\n\t\t$this->_setHeadData ();\n\t\t\n\t\t/* set form title H1 */\n\t\tif ($this->_FORM_CONFIG ['page_title'])\n\t\t\t$tmp->assign ( 'PAGE_TITLE', $this->_FORM_CONFIG ['page_title'] );\n\t\t\t\n\t\t/* get the Form tag and add to template as {FORM_OPENTAG}*/\n\t\t$tmp->assign ( 'FORM_OPEN_TAG', $this->onGetFormHead () );\n\t\t$tmp->assign ( 'FORM_CLOSE_TAG', $this->onGetFormFooter () );\n\t\t$tmp->assign ( 'FORM_ID', $this->_FORM_CONFIG ['id'] );\n\t\t\n\t\t/* failed validation */\n\t\tif (@defined ( '_BF_FAILED_VALIDATION' )) {\n\t\t\t$tmp->assign ( 'FAIL_VALIDATION', true );\n\t\t\t$messages = unserialize ( _BF_FAILED_VALIDATION_MESSAGES );\n\t\t\t$tmp->assign ( 'fail_messages', $messages );\n\t\t\n\t\t}\n\t\t\n\t\tif (isset ( $this->_FORM_CONFIG ['onlyssl'] ) && $this->_FORM_CONFIG ['onlyssl'] == 1) {\n\t\t\t$tmp->assign ( 'SECURE_FORM', '1' );\n\t\t}\n\t\treturn $tmp;\n\t}", "public function renderIn(){ \n $login = $this->hlp->logn();\n $this->template->isVendor = $this->listings->isVendor($login);\n $this->template->listings = $this->listings->getListings($login); \n $this->template->currentUser = $login;\n }", "function smarty_function_scrName( $params, &$this )\r\n{\r\n extract($params);\r\n\r\n\treturn getScreenName( $APP_ID, $SCR_ID, $language );\r\n}", "function smarty_block_setAboutPage($params,$content,&$smarty,&$repeat)\n{\n if(!is_null($content))\n {\n global $about_page_body,$about_page_title;\n $about_page_body=$content;\n $about_page_title=$params[\"title\"];\n }\n \n}", "function yy_r79(){$this->_retvalue = '$_smarty_tpl->getConfigVariable(\\''. $this->yystack[$this->yyidx + -1]->minor .'\\')'; }", "function smarty_modifier_price($string)\n{\n $price = doubleval($string);\n $price = number_format($price,2,'.',',');\n return '$'.$price;\n}", "private function initSmarty() {\n \n require_once (Quantum::QUANTUM_ROOT.'system/lib/smarty/Smarty.class.php');\n \n $smarty = new Smarty();\n $smarty ->template_dir = Quantum::QUANTUM_ROOT.\"system/views\";\n $smarty->compile_dir = Quantum::QUANTUM_ROOT.\"system/tmp\";\n $smarty->allow_php_tag = true;\n $smarty->plugins_dir[] = Quantum::QUANTUM_ROOT.'system/plugins';\n \n Quantum\\Output::init($smarty);\n }", "public function printVar($varName) {\n if ( isset($this->templateVars[$varName]) ) {\n echo $this->templateVars[$varName];\n }\n }", "function output( \\Smarty_Internal_Template $template, $results ) {\r\n\t\treturn $template->smarty->fetch( 'string:' . $results->body );\r\n\t}", "function CK07()\n {\n global $template;\n global $connect;\n global $id,$param;\n\n $query = \"select * from products\n where stock_manage=1\n and org_id='$id'\";\n\n $result = mysql_query ( $query, $connect ); \n\n $master_code = substr( $template, 0,1);\n include \"template/\" . $master_code .\"/\" . $template . \".htm\";\n }", "function smarty_resource_pagesvar_source($tplName, &$tplSource, &$smarty)\n{\n if (isset($tplName)) {\n $tplSource = $GLOBALS[$tplName];\n\n return true;\n }\n\n return false;\n}", "function ___ ($var, $rpl = null)\n{\n global $main;\n if (array_key_exists ($var, $main->template->vars_l))\n {\n if (is_array ($rpl))\n $cnt = vsprintf ($main->template->vars_l[$var], $rpl);\n else\n $cnt = $main->template->vars_l[$var];\n return $cnt;\n }\n}", "function display($tpl = null)\n\t{\n\n //Get limit, default is 10\n $limit = JRequest::getVar('limit');\n $id = JRequest::getVar('id');\n $language = JRequest::getVar('language');\n\n if(!$limit) {\n $limit = 10;\n }\n\n // Get a db connection.\n $db = JFactory::getDbo();\n \n // Create a new query object.\n $query = $db->getQuery(true);\n\n // Select all records from the user profile table where key begins with \"custom.\".\n // Order it by the ordering field.\n $query->select('*');\n $query->from('#__menu');\n $query->where('menutype=\"main\" && language=\"'.$language.'\" && type!=\"url\"');\n //state = 1 AND language = 'en-GB'\n \n \n //echo 'menutype=\"main\" && language=\"'.$language.'\" && type!=\"url\" || menutype=\"topleft\" && language=\"'.$language.'\" && type!=\"url\"';\n \n\n\n $db->setQuery((string)$query);\n\n // Load the results as a list of stdClass objects (see later for more options on retrieving data).\n $results = $db->loadObjectList();\n\n $responseArray = [];\n $menuItemsArray = [];\n foreach($results as $menu_item){\n if($menu_item->fulltext == \"\"){\n $menu_item->fulltext = null;\n }\n\n $menuItemsArray[] = ['menu_type' => $menu_item->menutype,\n 'title' => $menu_item->title,\n 'alias' => $menu_item->fulltext,\n 'path' => $menu_item->path,\n 'link' => $menu_item->link,\n 'id' => $menu_item->id,\n 'parent_id' => $menu_item->parent_id,\n 'level' => $menu_item->level,\n 'component_id' => $menu_item->component_id,\n 'checked_out' => $menu_item->checked_out,\n 'checked_out_time' => $menu_item->checked_out_time,\n 'browserNav' => $menu_item->browserNav,\n 'access' => $menu_item->access,\n 'img' => $menu_item->img,\n 'template_style_id' => $menu_item->template_style_id,\n 'params' => $menu_item->params,\n 'lft' => $menu_item->lft,\n 'rgt' => $menu_item->rgt,\n 'home' => $menu_item->home,\n 'language' => $menu_item->language,\n 'client_id' => $menu_item->client_id,\n 'category_ids' => ((isset(json_decode($menu_item->params)->featured_categories)) ? json_decode($menu_item->params)->featured_categories : intval(filter_var($menu_item->link, FILTER_SANITIZE_NUMBER_INT)))\n ];\n }\n\n $responseArray['start_date'] = null;\n $responseArray['end_date'] = null;\n $responseArray['total_items'] = count($results);\n $responseArray['total_pages'] = ceil(count($results)/$limit);\n $responseArray['page'] = $page;\n $responseArray['results'] = $menuItemsArray;\n //echo var_dump($results);\n \n echo json_encode($responseArray);\n \n\t}", "function Smarty_eshop() {\n\t\t$this->Smarty();\n\t\t$this->template_dir = './templates/';\n\t\t$this->compile_dir = './templates_c/';\n\t\t$this->config_dir = './configs/';\n\t\t$this->cache_dir = './cache/';\n\t\t$this->caching = false;\n\t\t//$this->assign(’app_name’,’eShop’);\n\t}", "public static function indexTpl()\n {\n extract(FeedPage::$var);\n?>\n<?php include(\"tpl/index.tpl.php\"); ?>\n<?php\n }", "public function showSignIn($error = null){\n \n //creo una instancia de la clase smarty\n $this -> smarty -> assign('titulo','Iniciar Sesión');\n $this -> smarty -> assign('error', $error); \n //le paso por medio de assign el nombre de la variable (titulo) y el contenido\n $this -> smarty -> display('templates/signIn.tpl');\n //llamo a la funcion display en el template login\n $this -> smarty -> display('templates/footer.tpl');\n}", "function display($tpl = null)\n\t{\t\n\t\t$input \t= JFactory::getApplication()->input;\n\t\t$dbo \t= JFactory::getDbo();\n\n\t\t// request\n\t\t\n\t\t$id \t\t= $input->getUint('id', 0);\n\t\t$type \t\t= $input->getString('type', '');\n\t\t$rm_hash \t= $input->getString('rmhash', ''); // used to confirm removal\n\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase 'packages':\n\t\t\t\t$dtcol = 'createdon';\n\t\t\t\t$table = '#__vikappointments_package_order';\n\t\t\t\tbreak;\n\n\t\t\tcase 'employees':\n\t\t\t\t$dtcol = 'createdon';\n\t\t\t\t$table = '#__vikappointments_subscr_order';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$dtcol = 'checkin_ts';\n\t\t\t\t$table = '#__vikappointments_reservation';\n\t\t}\n\n\t\t$real_hash = $this->checkForRemove($id, $table, $rm_hash, $dbo);\n\n\t\t//\n\t\t\n\t\t$credit_card = null;\n\n\t\t$q = $dbo->getQuery(true)\n\t\t\t->select($dbo->qn(array($dtcol, 'cc_data', 'status')))\n\t\t\t->from($dbo->qn($table))\n\t\t\t->where($dbo->qn('id') . ' = ' . $id);\n\n\t\t$dbo->setQuery($q, 0, 1);\n\t\t$dbo->execute();\n\n\t\tif (!$dbo->getNumRows())\n\t\t{\n\t\t\t// order does not exist\n\t\t\texit (JText::_('JGLOBAL_NO_MATCHING_RESULTS'));\n\t\t}\n\n\t\t$order = $dbo->loadAssoc();\n\n\t\tif (!strlen($credit_card = $order['cc_data']))\n\t\t{\n\t\t\t// credit card details empty\n\t\t\texit (JText::_('JGLOBAL_NO_MATCHING_RESULTS'));\n\t\t}\n\n\t\tUILoader::import('libraries.crypt.cipher');\n\n\t\t/**\n\t\t * Since the decryption is made using mcrypt package, an exception\n\t\t * could be thrown as the server might not have it installed.\n\t\t * \t\t\t\n\t\t * We need to wrap the code below within a try/catch and take\n\t\t * the plain string without decrypting it. This was just an \n\t\t * additional security layer that doesn't alter the compliance\n\t\t * with PCI/DSS rules.\n\t\t *\n\t\t * @since 1.6.2\n\t\t */\n\t\ttry\n\t\t{\n\t\t\t// unmask encrypted string\n\t\t\t$cipher = SecureCipher::getInstance();\n\n\t\t\t$credit_card = $cipher->safeEncodingDecryption($credit_card);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// This server doesn't support current decryption algorithm.\n\t\t\t// Try decoding plain text\n\t\t\t$credit_card = base64_decode($credit_card);\n\t\t}\n\n\t\t// decode credit card JSON-string\n\t\t$credit_card = json_decode($credit_card);\n\n\t\t// get expiration date\n\n\t\t$this->expDate = $order[$dtcol];\n\n\t\tif ($type == 'packages' || $type == 'employees')\n\t\t{\n\t\t\t$this->expDate += 86400 * ($order['status'] == 'CONFIRMED' ? 7 : 30);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->expDate += 86400;\n\t\t}\n\n\t\t//\n\t\t\n\t\t$this->creditCard \t= &$credit_card;\n\t\t$this->order \t\t= &$order;\n\t\t$this->id \t\t\t= &$id;\n\t\t$this->type \t\t= &$type;\n\t\t$this->rmHash \t\t= &$real_hash;\n\n\t\t// Display the template\n\t\tparent::display($tpl);\n\t}", "function yy_r106()\n {\n if ($this->yystack[$this->yyidx + 0]->minor['var'] == 'smarty') {\n $this->_retvalue = $this->compiler->compileTag('Internal_SpecialVariable', array(), $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']);\n } else {\n $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']) . $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'];\n }\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "function smarty_function_init($params, &$smarty)\n{\n if(isset($smarty->parent->tpl_vars[$params['name']]))\n {\n return \"name=\\\"\".$params['name'].\"\\\" value=\\\"\".$smarty->parent->tpl_vars[$params['name']]->value.\"\\\"\";\n }\n\n if(isset($params['default']))\n \treturn \"name=\\\"\".$params['name'].\"\\\" value=\\\"\".$params['default'].\"\\\"\";\n else\n \treturn \"name=\\\"\".$params['name'].\"\\\" value=\\\"\\\"\";\n\n}", "function yy_r129()\n {\n if ($this->yystack[$this->yyidx + - 1]->minor['var'] == '\\'smarty\\'') {\n $this->_retvalue = $this->compiler->compileTag('Internal_SpecialVariable', array(), $this->yystack[$this->yyidx + - 1]->minor['smarty_internal_index']) . $this->yystack[$this->yyidx + 0]->minor;\n } else {\n $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + - 1]->minor['var']) . $this->yystack[$this->yyidx + - 1]->minor['smarty_internal_index'] . $this->yystack[$this->yyidx + 0]->minor;\n }\n }", "public static function editFeedTpl()\n {\n extract(FeedPage::$var);\n?>\n<?php include(\"tpl/edit_feed.tpl.php\"); ?>\n<?php\n }", "function tpl_footer()\n{\n global $smarty, $config, $SQLtrace;\n\n if ($config['debug'])\n {\n $out = $config;\n $out['db_password'] = '***';\n $session = $_SESSION['vdb'];\n $session['db_password'] = '***';\n \n ob_start();\n print '<pre>';\n dump($SQLtrace);\n dump($out);\n dump($session);\n print '</pre>';\n# phpinfo();\n $debug = ob_get_contents();\n ob_end_clean();\n \n $smarty->assign('DEBUG', $debug);\n }\n $smarty->assign('version', VERSION);\n}", "public function hookDisplayFooterProduct($params)\r\n {\r\n $id_product = (int) Tools::getValue('id_product');\r\n\r\n $query1 = \"SELECT custom_field_1 FROM `\" . _DB_PREFIX_ . \"product_lang` WHERE id_product='$id_product'\"; //end of the query\r\n $value1 = Db::getInstance()->getValue($query1);\r\n\r\n $query2 = \"SELECT custom_field_2 FROM `\" . _DB_PREFIX_ . \"product_lang` WHERE id_product='$id_product'\"; //end of the query\r\n $value2 = Db::getInstance()->getValue($query2);\r\n\r\n $query3 = \"SELECT custom_field_3 FROM `\" . _DB_PREFIX_ . \"product_lang` WHERE id_product='$id_product'\"; //end of the query\r\n $value3 = Db::getInstance()->getValue($query3);\r\n\r\n\r\n $this->context->smarty->assign(array('value1' => $value1, 'value2' => $value2, 'value3' => $value3));\r\n\r\n return $this->display(__FILE__, 'sleedmoduleproduct.tpl');\r\n }", "function smarty_resource_mailTemplate_trusted($tpl_name, &$mailTemplate)\r\n{\r\n}", "function smarty_resource_email_template_source($email_id, &$email_source, &$smarty)\n{\n\tglobal $db;\n\t\n // do database call here to fetch your template,\n // populating $tpl_source\n\t$sql = \" SELECT email_content FROM email_template \"\n\t\t . \" WHERE email_id = '\". $email_id .\"'\";\n\t\t\t\n\t$db->query($sql);\n\t$db->next_record();\n\n if ($db->num_rows()) {\n $email_source = $db->f('email_content');\n return true;\n } else {\n return false;\n }\n}", "public function getTemplateVariable($items=array()) {\n\t\t\n\t\t$results = array();\n\t\t\n\t\tforeach($items as $key=>$item) {\n\t\t\t$item = (isset($item['CartItem'])) ? $item['CartItem'] : $item;\n\t\t\t$result = array('id' => $item['variant_id'],\n\t\t\t\t\t\n\t\t\t\t\t'price' => $item['product_price'],\n\t\t\t\t\t'line_price' => $item['line_price'],\n\t\t\t\t\t'quantity' => $item['product_quantity'],\n\t\t\t\t\t'requires_shipping' => $item['shipping_required'],\n\t\t\t\t\t'weight' => $item['product_weight'],\n\t\t\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t$result['product'] = !empty($item['Product']) ? Product::getTemplateVariable($item, false) : array();\n\t\t\t$result['variant'] = !empty($item['CheckedOutVariant']) ? VariantModel::getTemplateVariable($item['CheckedOutVariant'], false) : array();\n\t\t\t\n\t\t\t// we get the latest product and variant title where possible\n\t\t\t// we also collect the sku from variant\n\t\t\t// collect vendor from product\n\t\t\tif (!empty($result['product'])) {\n\t\t\t\t$productTitle = $result['product']['title'] ;\n\t\t\t\t$vendor = $result['product']['vendor'] ;\n\t\t\t} else {\n\t\t\t\t$productTitle = $item['product_title'];\n\t\t\t\t$vendor = '';\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($result['variant'])) {\n\t\t\t\t$variantTitle = $result['variant']['title'] ;\n\t\t\t\t$variantSKU = $result['variant']['sku'] ;\n\t\t\t} else {\n\t\t\t\t$variantTitle = $item['variant_title'];\n\t\t\t\t$variantSKU = '';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t/**\n\t\t\t * for the cart item title, if there is 1 variant for the product\n\t\t\t * and the variant title starts with \"default\" case-insensitive\n\t\t\t * we just use ProductTitle\n\t\t\t **/\n\t\t\tApp::uses('StringLib', 'UtilityLib.Lib');\n\t\t\tif (count($result['product']['variants']) == 1) {\n\t\t\t\tif (StringLib::startsWith($variantTitle, 'default', false)) {\n\t\t\t\t\t$result['title'] = $productTitle;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// In all other cases, we use ProductTitle - VariantTitle\n\t\t\tif (!isset($result['title'])) {\n\t\t\t\t$result['title'] = $productTitle . ' - ' . $variantTitle;\n\t\t\t}\n\t\t\t\n\t\t\t// assign the sku\n\t\t\t$result['sku'] = $variantSKU;\n\t\t\t$result['vendor'] = $vendor;\n\t\t\t\n\t\t\t\n\t\t\t$results[] = $result;\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "function yy_r80(){$this->_retvalue = '$_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -1]->minor .')'; }", "function smarty_function_rexscript_start($params, &$smarty) {\n static $used_uin = array();\n $is_uin = class_exists('RexResponse');\n $uin = '';\n \n $section = $smarty->tpl_vars['workspace']->value;\n\n $result = '';\n if (!isset($params['ready']) || $params['ready']) {\n $result .= \"jQuery(document).ready(function() {\\n\";\n $result .= \"/* \".var_export($is_uin, true).\"; \".var_export($used_uin, true).\" */\\n\";\n if ($is_uin) {\n $uin = RexResponse::getDialogUin();\n $result .= \"/* \".var_export($uin, true).\" */\\n\";\n $section = $section == 'main' || $section == 'default' ? '' : '_'.$section;\n if ($uin && !isset($used_uin[$uin])) {\n $result .= \"/* Hello1! */\\n\";\n $result .= \"window.rex_dt_\".$uin.\" = jQuery('#rex_dc_\".$uin.\"');\\n\";\n $used_uin[$uin] = true;\n } elseif (!isset($used_uin['__global'.$section])) {\n $result .= \"/* Hello2! */\\n\";\n $result .= \"window.rex_dt___global\".$section.\" = jQuery('#active_template_content\".$section.\"');\\n\";\n $used_uin['__global'.$section] = true;\n }\n } \n }\n\n $result .= \"(function(){\\n\";\n\n $result .= \"var mod = '\".addslashes($smarty->tpl_vars['mod']->value).\"'\\n\";\n $result .= \"var act = '\".addslashes($smarty->tpl_vars['act']->value).\"'\\n\";\n $result .= \"var task = '\".addslashes($smarty->tpl_vars['task']->value).\"'\\n\";\n $result .= \"var workspace = '\".addslashes($section).\"'\\n\";\n $result .= \"var layout = '\".addslashes($smarty->tpl_vars['layout']->value).\"'\\n\";\n $result .= \"var environment = '\".addslashes($smarty->tpl_vars['environment']->value).\"'\\n\";\n $result .= \"var user_environment = '\".addslashes($smarty->tpl_vars['user_environment']->value).\"'\\n\";\n $result .= \"var base_path = '\".addslashes($smarty->tpl_vars['base_path']->value).\"'\\n\";\n\n if (!$is_uin) {\n return;\n }\n\n if ($uin) {\n $result .= \"var uin = '\".$uin.\"';\\n\";\n } else {\n $result .= \"var uin = '';\\n\";\n }\n $result .= \"var template = this;\\n\";\n if (!isset($params['ready']) || $params['ready'] and 1 != 1) {\n $result .= \"template.find('*').die();\\n\";\n $result .= \"template.rexClearIntervals();\\n\";\n }\n return $result;\n}", "public function formatVariable(){\r\n\t\t\r\n\t\tforeach($this->template as $k=>$v){\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function filterSmarty($file) {\n $smarty = SmartyWrapper::getInstance();\n\n // Set a few global template vars\n $smarty->assign('subtemplate', $this->output);\n $smarty->assign('pathclasses', $this->cfgReader->getPathClasses());\n $smarty->assign('cfg', $this->cfgReader->getResolved());\n\n // Return the template's output\n return $smarty->fetch($file);\n }", "function display() {\n // unless they're trying to be sneaky, since the link to it would\n // be hidden.\n if(!Current_User::isDeity()){\n return \"Uh Uh Uh! You didn't say the magic word!\";\n }\n\n // Set extra page tags\n $tpl['HOMELINK'] = PHPWS_Text::moduleLink('Back to Menu','sysinventory');\n \n // Form for adding new department\n $form = &new PHPWS_Form('add_department');\n $form->addText('description');\n $form->setLabel('description','Description');\n $form->addSubmit('submit','Add Department');\n $form->setAction('index.php?module=sysinventory&action=edit_departments');\n $form->addHidden('addDep',TRUE);\n\n $tpl['PAGER'] = Sysinventory_DepartmentUI::doPager();\n $form->mergeTemplate($tpl);\n return PHPWS_Template::process($form->getTemplate(), 'sysinventory', 'edit_department.tpl');\n }", "function display() {\n // unless they're trying to be sneaky, since the link to it would\n // be hidden.\n if(!Current_User::isDeity()){\n return \"Uh Uh Uh! You didn't say the magic word!\";\n }\n\n // Set extra page tags\n $tpl['HOMELINK'] = PHPWS_Text::moduleLink('Back to Menu','sysinventory');\n \n // Form for adding new department\n $form = &new PHPWS_Form('add_department');\n $form->addText('description');\n $form->setLabel('description','Description');\n $form->addSubmit('submit','Add Department');\n $form->setAction('index.php?module=sysinventory&action=edit_departments');\n $form->addHidden('addDep',TRUE);\n\n $tpl['PAGER'] = Sysinventory_DepartmentUI::doPager();\n $form->mergeTemplate($tpl);\n return PHPWS_Template::process($form->getTemplate(), 'sysinventory', 'edit_department.tpl');\n }", "function smarty_function_dkl_getdao($params,&$smarty){\n // Chequeo que esté seteado el parámetro 'nombre'\n if(empty($params['assign'])){\n Denko::plugin_fatal_error('el parámetro <b>assign</b> es requerido','dkl_getdao');\n }\n\n // Obtengo el DAOLister\n $daoLister = DK_DAOLister::getDaoLister($smarty);\n $dao = $daoLister->getDAO();\n $smarty->assign($params['assign'],$dao);\n}", "function setBlock($resource_name, $variable = NULL, $cache_id = null)\n\t{ \n if (strpos($resource_name, '.') === false) {\n\t\t\t$resource_name .= '.tpl';\n\t\t}\n \n if ($variable){\n $content = parent::fetch($theme.'/'.$resource_name, $cache_id);\n \n $this->_globals[$variable] = $content;\n \n parent::clear_all_assign();\n\n } else {\n\t\t\n\n return parent::fetch($resource_name, $cache_id);\n }\n\t}", "public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }" ]
[ "0.66824406", "0.640931", "0.6351606", "0.6045967", "0.600682", "0.5994472", "0.59510165", "0.59400827", "0.5926806", "0.58821535", "0.58789176", "0.5868464", "0.58200896", "0.5808499", "0.5799845", "0.5765845", "0.5744255", "0.57057756", "0.5702797", "0.5692192", "0.56902736", "0.5681658", "0.5665647", "0.56531394", "0.56438196", "0.5637215", "0.5622167", "0.5621445", "0.5612563", "0.5604401", "0.5594942", "0.5574808", "0.5557399", "0.55568194", "0.5555954", "0.55442494", "0.5519405", "0.54902744", "0.5489337", "0.54827976", "0.547675", "0.54716194", "0.5452019", "0.54463357", "0.54463357", "0.54445344", "0.5442913", "0.5431155", "0.5426744", "0.54258925", "0.5417969", "0.5414879", "0.5411531", "0.5402746", "0.5388464", "0.5370489", "0.53670835", "0.53504044", "0.5347464", "0.5345229", "0.5339554", "0.53322685", "0.5320354", "0.53151095", "0.5314114", "0.53139335", "0.52989906", "0.52814054", "0.52765626", "0.5263025", "0.52580583", "0.5253724", "0.52510446", "0.52478623", "0.52474093", "0.5244392", "0.524306", "0.5241701", "0.5241695", "0.52380484", "0.52356285", "0.52339494", "0.5232029", "0.5229274", "0.52130455", "0.5211652", "0.5205686", "0.52053505", "0.5194362", "0.51938313", "0.5193447", "0.51923835", "0.519093", "0.51894593", "0.5163395", "0.5161955", "0.5159313", "0.5159313", "0.51572675", "0.5147596", "0.5147016" ]
0.0
-1
For internal only. DO NOT USE IT.
public function deserialize($param) { if ($param === null) { return; } if (array_key_exists("Bucket",$param) and $param["Bucket"] !== null) { $this->Bucket = $param["Bucket"]; } if (array_key_exists("Region",$param) and $param["Region"] !== null) { $this->Region = $param["Region"]; } if (array_key_exists("Object",$param) and $param["Object"] !== null) { $this->Object = $param["Object"]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __init__() { }", "private function __() {\n }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "private function __construct()\t{}", "private function init()\n\t{\n\t\treturn;\n\t}", "final private function __construct() {}", "final private function __construct() {}", "final private function __construct(){\r\r\n\t}", "final private function __construct() {\n\t\t\t}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function _i() {\n }", "protected function fixSelf() {}", "protected function fixSelf() {}", "protected final function __construct() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function init()\n\t{\n\t\t\n\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct() {\r\n\t\t\r\n\t}", "protected function init() {return;}", "final private function __construct()\n\t{\n\t}", "private function __construct () {}", "final private function __construct()\n {\n }", "private final function __construct() {}", "public function __init(){}", "public function helper()\n\t{\n\t\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct()\n\t{\n\t\t\n\t}" ]
[ "0.62667596", "0.61522275", "0.5991058", "0.5991058", "0.5991058", "0.5991058", "0.599059", "0.599059", "0.599059", "0.599059", "0.599059", "0.599059", "0.59895796", "0.59895796", "0.594942", "0.59396714", "0.591702", "0.591702", "0.58706886", "0.5867353", "0.58557546", "0.58557546", "0.58557546", "0.5798249", "0.57967234", "0.57967234", "0.5781167", "0.5750919", "0.5750919", "0.5750919", "0.5750919", "0.5746352", "0.57416487", "0.5712709", "0.5702875", "0.5694244", "0.5680521", "0.5674593", "0.5668346", "0.56408286", "0.56400037", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626867", "0.5626064", "0.5623724", "0.5623724", "0.5610592" ]
0.0
-1
Zapis danych do pliku z backupem
public function saveTablesToFile($name=null, $filename) { /** jeżeli bez parametru to wszystkie tabele */ if(!isset($name)) { $tables = $this->getTablesList(); } /** jeżeli parametr do tablica */ elseif(isset($name) && is_array($name)) { $tables = $name; } /** jeżeli parametr to nazwa tabeli */ elseif(isset($name) && is_string($name)) { $tables = array(strtolower($name)); } if(!empty($tables)) { if(file_exists($this->backupDirPath . '/' . $filename . '.sql')) { unlink($this->backupDirPath . '/' . $filename . '.sql'); } $file_handle = fopen($this->backupDirPath . '/' . $filename . '.sql', 'a+'); foreach($tables as $table) { /** * Czy podana nazwa tabeli w parametrze zgadza sie z nazwami tabel w bazie */ if(in_array($table, $this->getTablesList())) { $structure = $this->getData("SHOW CREATE TABLE $table"); fputs($file_handle, "-- Usunięcie tabeli" . $structure['Table'] . "\n" . 'DROP TABLE IF EXISTS ' . $structure['Table'] . ';' . "\n\n"); fputs($file_handle, "-- Struktura tabeli" . $structure['Table'] . "\n" . $structure['Create Table'] . ';' . "\n\n"); /** pobranie liczby rekordow */ $row_numbers = $this->getData("SELECT COUNT(*) as sum FROM $table"); $row_numbers = $row_numbers['sum']; /** pobieranie kolumn i określanie kolumn */ $columns = $this->getData("SHOW COLUMNS FROM $table", false); $columns_string = null; for($i = 0; $i < count($columns); $i++) { if($i >= 0 && $i < count($columns) - 1) $columns_string .= '`'.$columns[$i]['Field'] . '`,'; if($i == count($columns) - 1) $columns_string .= '`'.$columns[$i]['Field'].'`'; } /** zapis danych ustawic pobieranie paczek po 250 ? **/ /** jeżeli wierszy jest mniej niż 250 */ if($row_numbers < 250 && $row_numbers > 0) { if($rows = $this->getData("SELECT * FROM $table", false)) { fputs($file_handle, "-- Zrzut danych z tabeli" . $structure['Table'] . "\n"); fputs($file_handle, "INS" . "ERT INTO $table ($columns_string) VALUES \n"); /** @var konstrukcja wyrażenia */ for($i = 0; $i < count($rows); $i++) { $row_str = '('; for($j = 0; $j < count($columns); $j++) { if($j < count($columns) - 1) { $row_str .= "'" . $rows[$i][$columns[$j]['Field']] . "',"; } else { $row_str .= "'" . $rows[$i][$columns[$j]['Field']] . "'"; } } if($i < count($rows) - 1) { $row_str .= "),\n"; } else { $row_str .= ");\n"; } fputs($file_handle, $row_str); } fputs($file_handle, "\n\n"); } } else { $start = 0; $amount = 150; fputs($file_handle, "-- Zrzut danych z tabeli" . $structure['Table'] . "\n"); while($rows = $this->getData("SELECT * FROM $table LIMIT $start, $amount", false)) { fputs($file_handle, "INS" . "ERT INTO $table ($columns_string) VALUES \n"); /** @var konstrukcja wyrażenia */ for($i = 0; $i < count($rows); $i++) { $row_str = '('; for($j = 0; $j < count($columns); $j++) { if($j < count($columns) - 1) { $row_str .= "'" . $rows[$i][$columns[$j]['Field']] . "',"; } else { $row_str .= "'" . $rows[$i][$columns[$j]['Field']] . "'"; } } if($i < count($rows) - 1) { $row_str .= "),\n"; } else { $row_str .= ");\n"; } fputs($file_handle, $row_str); } $start += $amount; } } } else { fclose($file_handle); unlink($this->backupDirPath . '/' . $filename . '.sql'); view::setAlertPanel('Nieznana tabela jako parametr funkcji','danger'); return false; } } fclose($file_handle); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFile ();", "public function getFile();", "public function getFile();", "public function getFile() {}", "public function getFile() {}", "public function downloadFile();", "public function getFilepath();", "function download_lampiran_surat_keluar($id_sk)\n {\n $data = $this->db->get_where('surat_keluar', ['id_sk' => $id_sk])->row();\n force_download('../assets/uploads/admin/lampiran_sk/' . $data->lampiran, NULL);\n }", "function subirImagen($id_patalla) {\n // MODIFICAR RUTA AL SUBIR AL HOSTING\n $dir_subida = '/home/c0990002/public_html/TB/imagenes_pantallas/';\n\n if (isset($_FILES['imagen']) && !$_FILES['imagen']['error'] > 0) {\n //GUARDADO DE IMAGEN\n if (move_uploaded_file($_FILES['imagen']['tmp_name'], $dir_subida . 'imagen_pantalla_id_' . $id_patalla)) {\n //return $dir_subida.'imagen_pantalla_id_'.$id_patalla;\n return 'https://www.rockerapp.com/TB/imagenes_pantallas/' . 'imagen_pantalla_id_' . $id_patalla;\n }\n }\n}", "public static function getFile() {}", "public function download() {\t\t}", "public function getFile(): string;", "public function getFile(): string;", "public function getFile(): string;", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "function download_lampiran_surat_masuk($id_sm)\n {\n $data = $this->db->get_where('surat_masuk', ['id_sm' => $id_sm])->row();\n force_download('../assets/uploads/admin/lampiran_sm/' . $data->lampiran, NULL);\n }", "public function downloadFile()\n {\n $file= public_path(). \"/images/MRS_OLUREMI_ABIMBOLA_NEW ++.pdf\";\n \n $headers = array(\n 'Content-Type: application/pdf',\n );\n \n return \\Response::download($file, 'funeral_for_mrs_oluremilekun_abimbola.pdf', $headers);\n }", "public function index()\n\t{ \n\t\t$mail_path = base64_url($path, 'decode');\n\t}", "function download_suket_019()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_019/template_surat_pernyataan_penyerahan_tanah.docx', NULL);\n\t}", "public function download($id_pelapor)\n {\n // $id = 0;\n // $noTiket = 0;\n // foreach ($query as $key) {\n // $id = $key['id_pelapor'];\n // $noTiket = $key['no_tiket'];\n // }\n\n // $query2 = $this->detailLaporanModel->where('report_id', $id)->findAll();\n\n\n // foreach ($query2 as $key) {\n // # code...\n // // $url = ROOTPATH . \"public/uploads/\" . $key['gambar'];\n // $url = ROOTPATH . \"public/uploads/\" . $key['gambar'];\n // // file_get_contents($url);\n // // print_r($url);\n // }\n // return $this->response->download($key['gambar'], $url);\n // session()->setFlashdata('pesan', 'Gambar berhasil diunduh.');\n // return redirect()->to(base_url('/admin/reportLaporan'));\n $query = $this->load->library('zip');\n }", "public function filePath();", "Function send_file($session_id,$dokument_id,$file) {\n if (!$dokument_id) return VratChybu($session_id,'send_file','Není zadán dokument_id');\n $stav=$GLOBALS[\"KONEKTOR\"][$software_id][\"STAV\"]+2; //stav+1 = pozaduje se k vyrizeni v ext. programu\n $q=new DB_POSTA;\n if ($dokument_id) $sql=\"SELECT * FROM posta WHERE id = '\".$dokument_id.\"'\";\n// $sql.=\" AND stav in (\".$stav.\")\";\n $q->query($sql);\n $pocet=$q->Num_Rows();\n if ($pocet<1) return VratChybu($session_id,'send_file','Nenalezen odpovídající dokument_id');\n $q->Next_Record();\n// if ($q->Record[\"STAV\"]<>$stav) return VratChybu($session_id,'send_files','Nemáte přístup k tomuto souboru (stav není 2)');\n\n $counter=0;\n $counter2=0;\n $uplobj=Upload(array('create_only_objects'=>true,'agenda'=>'POSTA','noshowheader'=>true));\n //if (is_array($files[soubor][0])) $soubory=$files[soubor];\n //else \n if ($file['item']['FILE_NAME']) $soubory['item'][0]=$file['item']; else $soubory['item'][0]=$file;\n //$soubory=$files[soubor];\n while (list($key,$val)=each($soubory['item']))\n {\n if (!$val[\"FILE_NAME\"]) return VratChybu($session_id,'send_file','Není zadán název souboru');\n $upload_records = $uplobj['table']->GetRecordsUploadForAgenda($q->Record[\"ID\"]);\n $tmp_soubor = $GLOBALS[CONFIG_POSTA][HLAVNI][tmp_adresar].$val[\"FILE_NAME\"]; \n $GLOBALS['DESCRIPTION'] = TxtEncodingFromSoap($val[FILE_DESC]);\n $GLOBALS['LAST_USER_ID'] = $GLOBALS[\"KONEKTOR\"][$software_id][\"LAST_USER_ID\"];\n\n while (list($key1,$val1)=each($upload_records))\n {\n if ($val[FILE_ID]==$val1[ID]) \n {\n $val[FILE_NAME]=$val1[NAME];\n $GLOBALS[\"ID\"]=$val1[ID];\n $GLOBALS[\"FILE_ID\"]=$val1[ID];\n $GLOBALS[\"UPL_FILE\"]=$val[FILE_NAME];\n $GLOBALS[\"LAST_DATE\"]=Date('Y-m-d');\n $GLOBALS[\"UPL_DIR\"]='.';\n $GLOBALS['archiv_file_system']=true;\n $tmp_soubor='/tmp/upload/'.$val[FILE_NAME];\n $GLOBALS['COSTIM']='archiv_a'; //archivuj puvodni\n $GLOBALS['show_typ']=2;\n $GLOBALS['EDIT_ID']=$val[FILE_ID];\n\n }\n }\n\n //$tmp_soubor=TxtEcondingFromSoap(FileSystemConvertFNToFS($tmp_soubor));\n if (is_file($tmp_soubor)) unlink($tmp_soubor);\n $data=base64_decode($val[\"FILE_DATA\"]);\n if (strlen($data)<1) return VratChybu($session_id,'send_file','Není k dispozici obsah souboru '.$val[\"FILE_NAME\"]);\n if (!$fp=fopen($tmp_soubor,'w')) return VratChybu($session_id,'send_file','Chyba pri ulozeni tmp souboru '.$tmp_soubor);\n fwrite($fp,$data);\n fclose($fp);\n \n if (JePodepsanyDokument($data, 0)) {\n $GLOBALS['DESCRIPTION'] = 'el. podepsano';\n }\n \n $tmp_soubor_2=TxtEncodingFromSoap($tmp_soubor);\n //$tmp_soubor_2=$tmp_soubor;\n //echo $tmp_soubor_2;\n $ret = $uplobj['table']->SaveFileToAgendaRecord($tmp_soubor_2, $dokument_id);\n if ($ret[err_msg]>0) return VratChybu($session_id,'send_file','Chyba pri ulozeni souboru '.$val[\"FILE_NAME\"].': '.$ret[err_msg]);\n //print_r($ret);\n $file_ident=$ret[file_id];\n $text='(SEND_FILE) - k dokumentu ('.$dokument_id.') byl vložen soubor '.$val[\"FILE_NAME\"].' - ID: ('.$file_ident.')';\n WriteLog($software_id,$text,$session_id);\n $file[$counter2][FILE_ID]=$file_ident;\n $file[$counter2][FILE_NAME]=$val[\"FILE_NAME\"];\n $file[$counter2][FILE_DESC]=TxtEncoding4Soap($GLOBALS['DESCRIPTION']);\n $file[$counter2][FILE_SIZE]=' ';\n $file[$counter2][BIND_TYPE]=' ';\n $file[$counter2][FILE_DATA]=' ';\n if (is_file($tmp_soubor)) unlink($tmp_soubor);\n\n $counter2++;\n \n }\n// print_r($file);\n $text='Operace proběhla v pořádku';\n $value = array('RESULT'=>'OK','DESCRIPTION'=>TxtEncoding4Soap($text));\n $vysledek = array(\n 'return'=>new soapval('Result', 'tns:Result', $value),\n 'soubory'=>new soapval('soubor', 'tns:soubory',$file),\n );\n return VratVysledek($vysledek);\n}", "public function files();", "public function files();", "public function files();", "public function getDownloadPath() {}", "protected function actionDownloadPublicFile($params){\n\t\t$file = new \\GO\\Base\\Fs\\File(GO::config()->file_storage_path.'public/'.$params['path']);\n\t\t\n\t\tif($file->exists()){\n\t\t\t\\GO\\Base\\Util\\Http::outputDownloadHeaders($file,false,!empty($params['cache']));\n\t\t\t$file->output();\t\t\n\t\t}else\n\t\t{\n\t\t\techo \"File not found!\";\n\t\t}\n\t}", "function hapusfile(){\n\t\t$previllage = 1;\n\t\tcheck_super_user($this->session->tipe_user,$previllage);\n\n\t \t$id = $this->uri->segment(3);\n\t\t//Action\t\t \n\t\t$itemfile = $this->tugas_m->get($id)->row();\n \t\tif ($itemfile->file != null) {\n \t\t\t$target_file = 'assets/dist/files/tugas/'.$itemfile->file;\n \t\t\tunlink($target_file);\n \t\t}\n \t\t$params['file'] = \"\";\n \t\t$this->db->where('id',$id);\n\t \t$this->db->update('tb_tugas',$params);\n\t \tredirect('tugas/edit/'.$id);\t \n\t}", "function cargar($sender, $param)\n {\n if($sender->HasFile) \t \n $carpeta=$this->t1->text;\n $ruta=\"attach/archivo/\".$carpeta.\"/\";//ruta donde se guardan los adjuntos que se han subido \n $this->t2->text=$this->t2->text.\"$ruta$sender->FileName\".\"\\n\";\n $sender->saveAs($ruta.$sender->FileName);\n }", "public function Download(){\n\t\t\n\t\t\n\t}", "public function getFilePath(): string;", "public function getFilePath(): string;", "public function downloadpresskitveue($file_name)\n {\n // echo $file_name;die;\n $filennmdownload = base64_decode($file_name);\n // echo $filennm;die;\n //********its working for single file\n $download_path = ( public_path() . '/upload/venue-press-kit/source-file/' . $filennmdownload );\n return( Response::download( $download_path ) );\n \n }", "function download_suket_016()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_016/template_surat_pernyataan_penyerahan_waris.docx', NULL);\n\t}", "function download_suket_018_perempuan()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_018/template_surat_pengantar_nikah_perempuan.docx', NULL);\n\t}", "final function getFile();", "public function getFileUrl(){\n $url = config('kontaktformular.fileDownloadUrl');\n //Prüfen ob $url auf / endet\n if(substr($url, -1) != '/'){\n $url .= '/';\n }\n return $url . $this->file_hash .'/' . $this->file_name .'/'. $this->id;\n }", "function download_suket_015()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_015/template_surat_keterangan_kepemilikan_tanah.docx', NULL);\n\t}", "function download_suket_020()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_020/template_surat_rekomendasi_izin_mendirikan_bangunan.docx', NULL);\n\t}", "function download_suket_018_laki()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_018/template_surat_pengantar_nikah_laki_laki.docx', NULL);\n\t}", "function ciniki_events_web_fileDownload($ciniki, $tnid, $event_permalink, $file_permalink) {\n\n //\n // Get the tenant storage directory\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'hooks', 'storageDir');\n $rc = ciniki_tenants_hooks_storageDir($ciniki, $tnid, array());\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $tenant_storage_dir = $rc['storage_dir'];\n\n //\n // Get the file details\n //\n $strsql = \"SELECT ciniki_event_files.id, \"\n . \"ciniki_event_files.uuid, \"\n . \"ciniki_event_files.name, \"\n . \"ciniki_event_files.permalink, \"\n . \"ciniki_event_files.extension, \"\n . \"ciniki_event_files.binary_content \"\n . \"FROM ciniki_events, ciniki_event_files \"\n . \"WHERE ciniki_events.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_events.permalink = '\" . ciniki_core_dbQuote($ciniki, $event_permalink) . \"' \"\n . \"AND ciniki_events.id = ciniki_event_files.event_id \"\n . \"AND (ciniki_events.flags&0x01) = 0x01 \"\n . \"AND ciniki_event_files.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND CONCAT_WS('.', ciniki_event_files.permalink, ciniki_event_files.extension) = '\" . ciniki_core_dbQuote($ciniki, $file_permalink) . \"' \"\n . \"AND (ciniki_event_files.webflags&0x01) = 0 \" // Make sure file is to be visible\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.events', 'file');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['file']) ) {\n return array('stat'=>'noexist', 'err'=>array('code'=>'ciniki.events.62', 'msg'=>'Unable to find requested file'));\n }\n $rc['file']['filename'] = $rc['file']['name'] . '.' . $rc['file']['extension'];\n\n //\n // Get the storage filename\n //\n $storage_filename = $tenant_storage_dir . '/ciniki.events/files/' . $rc['file']['uuid'][0] . '/' . $rc['file']['uuid'];\n if( file_exists($storage_filename) ) {\n $rc['file']['binary_content'] = file_get_contents($storage_filename); \n }\n\n return array('stat'=>'ok', 'file'=>$rc['file']);\n}", "function _file() {\n\t\t$path = implode('/', $this->params['pass']);\n\t\tif ( !empty($this->params['url']['ext']) ) {\n\t\t\t$path .= '.' . $this->params['url']['ext'];\n\t\t}\n\t\treturn array(MEDIA . $path, $path);\n\t}", "public function downloadAction() {\r\n $file_id = $this->getRequest()->getParam('file_id');\r\n $chanelphoto = Engine_Api::_()->getItem('sesvideo_chanelphoto', $this->getRequest()->getParam('photo_id'));\r\n if (!$chanelphoto)\r\n return;\r\n $chanelphoto->download_count = $chanelphoto->download_count + 1;\r\n $chanelphoto->save();\r\n $file_id = $chanelphoto->file_id;\r\n if ($file_id == '' || intval($file_id) == 0)\r\n return;\r\n $storageTable = Engine_Api::_()->getDbTable('files', 'storage');\r\n $select = $storageTable->select()->from($storageTable->info('name'), array('storage_path', 'name'))->where('file_id = ?', $file_id);\r\n $storageData = $storageTable->fetchRow($select);\r\n $storageData = (object) $storageData->toArray();\r\n if (empty($storageData->name) || $storageData->name == '' || empty($storageData->storage_path) || $storageData->storage_path == '')\r\n return;\r\n //Get base path\r\n $basePath = APPLICATION_PATH . '/' . $storageData->storage_path;\r\n @chmod($basePath, 0777);\r\n header(\"Content-Disposition: attachment; filename=\" . urlencode(basename($storageData->name)), true);\r\n header(\"Content-Transfer-Encoding: Binary\", true);\r\n header(\"Content-Type: application/force-download\", true);\r\n header(\"Content-Type: application/octet-stream\", true);\r\n header(\"Content-Type: application/download\", true);\r\n header(\"Content-Description: File Transfer\", true);\r\n header(\"Content-Length: \" . filesize($basePath), true);\r\n readfile(\"$basePath\");\r\n exit();\r\n // for safety resason double check\r\n return;\r\n }", "public function getPathToFile(): string;", "function download_suket_021()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_021/template_surat_recomendasi_usaha_mikro_kecil.docx', NULL);\n\t}", "public function download()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('id'));\n $type = $this->getPost('type');\n $storage = $this->services['backup']->setStoragePath($this->settings['working_directory']);\n if($type == 'files')\n {\n $file = $storage->getStorage()->getFileBackupNamePath($file_name);\n }\n else\n {\n $file = $storage->getStorage()->getDbBackupNamePath($file_name);\n }\n \n \n $backup_info = $this->services['backups']->setLocations($this->settings['storage_details'])->getBackupData($file);\n $download_file_path = false;\n if( !empty($backup_info['storage_locations']) && is_array($backup_info['storage_locations']) )\n {\n foreach($backup_info['storage_locations'] AS $storage_location)\n {\n if( $storage_location['obj']->canDownload() )\n {\n $download_file_path = $storage_location['obj']->getFilePath($backup_info['file_name'], $backup_info['backup_type']); //next, get file path\n break;\n }\n }\n }\n \n if($download_file_path && file_exists($download_file_path))\n {\n $this->services['files']->fileDownload($download_file_path);\n exit;\n }\n }", "public function subir_datos() {\n $datos = array(\n 'nombre' => $this->helper->cleanInput($_POST['cname']),\n 'email' => $this->helper->cleanInput($_POST['email']),\n 'telefono' => $this->helper->cleanInput($_POST['phone']),\n 'message' => $this->helper->cleanInput($_POST['message'])\n );\n $insert = $this->model->subir_datos($datos);\n $id = $insert['id'];\n #SUBIMOS EL ARCHIVO\n $dir = 'public/archivos/cv/';\n $serverdir = $dir;\n $filename = \"\";\n foreach ($_FILES as $inputname => $file) {\n $newname = $this->helper->cleanUrl($_POST[$inputname . '_name']);\n //$extension = strtolower(end(explode('.', $file['name'])));\n $ext = explode('.', $file['name']);\n $extension = strtolower(end($ext));\n $fname = $id . '_' . $newname . '.' . $extension;\n $contents = file_get_contents($file['tmp_name']);\n\n $handle = fopen($serverdir . $fname, 'w');\n fwrite($handle, $contents);\n fclose($handle);\n\n $filename = $fname;\n var_dump($filename);\n }\n $update = array(\n 'id' => $id,\n 'archivo' => $filename\n );\n $updateTrabaja = $this->model->updateTrabaja($update);\n if (!empty($id)) {\n $data = array(\n 'type' => 'succes',\n 'message' => $this->helper->messageAlert('success', 'Gracias, tu C.V. se ha agregado correctamente a nuestra Base de Datos.')\n );\n } else {\n $data = array(\n 'type' => 'error',\n 'message' => $this->helper->messageAlert('error', 'Lo sentimos ha ocurrido un error, por favor vuelva a intertarlo')\n );\n }\n Session::set('result', $data);\n header('Location: ' . URL . 'trabaja_con_nosotros/');\n }", "function download_suket_018_janda()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_018/template_surat_pengantar_nikah_janda.docx', NULL);\n\t}", "public function actionDownload($id){\n $model = $this->findModel($id);\n $file = $model->file_surat;\n $path = Yii::getAlias('@webroot').'/'.$file;\n if(file_exists($path)){\n Yii::$app->response->sendFile($path);\n }else{\n $this->render('download404');\n }\n }", "private function getFile(){\n if($this->checkStatus()){\n chdir('..');\n $filePos = $this->sanitizeInt($this->json->filePos);\n $fileName = $this->sanitizeString($this->json->fileName);\n $fileContents = file_get_contents('aud/'.$fileName);\n $fileMime = mime_content_type('aud/'.$fileName);\n $fileEncode = base64_encode($fileContents);\n $fileArray = array(\n 'fileName' => $fileName,\n 'fileMime' => $fileMime,\n 'fileEncode' => $fileEncode,\n 'filePos' => $filePos\n );\n header('content-type: application/json');\n echo json_encode($fileArray);\n } else {\n $this->notFound404();\n } \n }", "abstract protected function getFileWithPath();", "private function getFileUrl() {\n return Storage::disk('public')->url('/uploads/' . $this->file_name);\n }", "public function path() {}", "public function path() {}", "public function path();", "function dosya_indir($link,$name=null)\n{\n$link_info = pathinfo($link); //Yol bilgilerini deðiþkene atýyoruz.\n$uzanti = strtolower($link_info['extension']); //Dosyanýn uzantýsýný deðiþkene atýyoruz.\n$file = ($name) ? $name.'.'.$uzanti : $link_info['basename'];\n$yolcuk = \"capsler/\".$file; // Dosya/ buradan cektigimiz dosyanin kaydedilecegi yeri seciyoruz, sonunda / isareti olmak zorunda ve klasorun yazma izni (777) olmali.\n$curl = curl_init($link);\n$fopen = fopen($yolcuk,'w');\ncurl_setopt($curl, CURLOPT_HEADER,0);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER,1);\ncurl_setopt($curl, CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_0);\ncurl_setopt($curl, CURLOPT_FILE, $fopen);\ncurl_exec($curl);\ncurl_close($curl);\nfclose($fopen);\n$email = $_SESSION[\"email\"];\n$tarihcekbugun = date('d.m.Y H:i:s');\n\n\n$tarihsirala = date('Ymd');\n\n\n\nmysql_query(\"INSERT INTO `mezdeke_gonderi`(`id`, `email`, `icerik`, `resim`, `begeni`, `yorum`,`sabit`,`tarih`,`tarihler`,gosterim) VALUES ('','$email','','$yolcuk','0','0','0','$tarihcekbugun','$tarihsirala','0')\");\n\n}", "public function download() {\n $this->autoRender = false;\n $filename = $this->request->params['pass'][3];\n $orgfilename = $this->request->params['pass'][4];\n// pr($this->request->params); exit;\n $this->response->file(\n 'webroot/uploads/post/files/' . $filename, array(\n 'download' => true,\n 'name' => $orgfilename\n )\n );\n// return $this->response;\n }", "function ouvrirListeMembres() {\n $fichier = fopen(\"admin/membres.json\", \"w\") ;\n return $fichier ;\n}", "protected function fileName() {}", "public function downloadAction() {}", "public function downloadAction()\n {\n $url = $this->getRequest()->REQUEST_URI;\n $url = str_replace('/stream/download/', '/', '../data/uploads/images' . $url);\n $this->download($url, null, 'application/jpg');\n $this->view->message = \"Download erfolgreich.\";\n }", "public function descargarAction()\n {\n\t\t$security = $this->get('security');\n\t\tif(!$security->authentication()){ return $this->redirect($this->generateUrl('login'));} \n\t\tif(!$security->authorization($this->getRequest()->get('_route'))){ throw $this->createNotFoundException($this->get('translator')->trans(\"Acceso denegado\"));}\n\t\t\n\t\t$ruta_certificado = $security->getParameter('ruta_certificados').'user'.$security->getSessionValue('id').'.png';\n\t\t$response = $this->get('file')->downloadCertificado($ruta_certificado);\n return $response;\n\t}", "public function getFile()\n {\n header('Content-type: ' . $this->mime_type);\n header('Content-Disposition: attachment; filename=' . $this->original_name);\n \n echo gzuncompress(base64_decode($this->content));\n \n die();\n }", "public function getFilename() {}", "public function DownoadFile()\r\n\t{\r\n\t\theader(\"download.php?key=\".$this->secretKey);\r\n\t}", "public function menudownloadvenue($file_name)\n {\n // echo $file_name;die;\n $filennmdownload = base64_decode($file_name);\n // echo $filennm;die;\n //********its working for single file\n $download_path = ( public_path() . '/upload/venue-menu/source-file/' . $filennmdownload );\n return( Response::download( $download_path ) );\n }", "function download_suket_017()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_017/template_surat_keterangan_ahli_waris.docx', NULL);\n\t}", "function saveuploadfile($campo,$namefilesaved='XXXXX')\n\t{\n\t\t$pathfinal=\"\";\n\t\tif($_FILES[$campo]['name'] != \"\"){ // El campo contiene algo... \n\t\t // Primero, hay que validar que se trata de un CRT/KEY\n\t\t $allowedExts = array(\"crt\", \"key\",\"CRT\",\"KEY\");\n\t\t $tmp=explode(\".\", $_FILES[$campo][\"name\"]);\n\t\t $extension = end($tmp);\n\t\t if (in_array($extension, $allowedExts)) {\n\t\t // el archivo es un CRT/KEY, entonces... \n\t\t $tmp=explode('.', $_FILES[$campo]['name']);\n\t\t $extension = end($tmp);\n\t\t $certificado = $namefilesaved.\"_\".substr(md5(uniqid(rand())),0,6).\".\".$extension;\n\t\t $directorio = realpath(__DIR__ . '/../../').\"/files/cert\"; // directorio de tu elección\t \n\t\t // almacenar imagen en el servidor\n\t\t move_uploaded_file($_FILES[$campo]['tmp_name'], $directorio.'/'.$certificado);\t\t\n\t\t //unlink($directorio.'/'.$certificado);\n\t\t $pathfinal=\"files/cert/\".$certificado;\n\t\t \n\t\t }\n\t\t }//campo imagen\n\t\treturn $pathfinal;\n\t}", "public function path(): string;", "public function path(): string;", "public function download()\n {\n $hashids = new Hashids(Configure::read('Security.salt'));\n $pk = $hashids->decode($this->request->query['i'])[0];\n $this->loadModel($this->request->query['m']);\n $data = $this->{$this->request->query['m']}->find('first', array(\n 'recursive' => -1,\n 'conditions' => array(\n \"{$this->request->query['m']}.\" . $this->{$this->request->query['m']}->primaryKey => $pk\n ),\n 'fields' => array(\n \"{$this->request->query['m']}.{$this->request->query['f']}\"\n )\n ));\n $file = json_decode($data[$this->request->query['m']][$this->request->query['f']], true);\n\n header('Content-length: ' . $file['size']);\n header('Content-type: ' . $file['type']);\n header('Content-Disposition: inline; filename=' . $file['name']);\n echo base64_decode($file['content']);\n\n die();\n }", "public function getFilename();", "public function getFilename();", "function copy_fichier($file, $path) {\n\t\t if (!$id_erreur=copy(\"vide.htm\", $path . $file . \".htm\")) echo(\"Erreur d'ouverture du fichier\");\n\t\t else return(1);\n}", "public function create_file($file){\n\n // handle ekstensi\n if (empty($this->mime[$file['type']])) {\n // jika extensi tidak terdaftar, ambil dari nama file\n $path = $_FILES['image']['name'];\n $ext = pathinfo($path, PATHINFO_EXTENSION);\n } else {\n $ext = '.'.$this->mime[$file['type']]; // tambah titik sebelum ekstensi\n }\n\n $folder = $this->folder.'/'.$this->user['folder'].'/'; // path folder user\n $file_path = $folder.$this->encrypt_name();// encrypt nama \n $this->confirm_folder($folder); // pastikan folder ada\n $this->ck->putObjectFile($file['tmp_name'], \n $this->bucket,\n $file_path.$ext, // tambah ekstensi\n $this->ck::ACL_PUBLIC_READ // izin dibaca publik\n );\n // upload thumb\n if (isset($file['tmp_name_thumb'])){\n $this->ck->putObjectFile($file['tmp_name_thumb'], \n $this->bucket,\n $file_path.'_thumb'.$ext, // tambah suffix dan ekstensi\n $this->ck::ACL_PUBLIC_READ // izin dibaca publik\n );\n }\n\n $result = array(\n 'url'=>$this->create_url($file_path.$ext),\n 'error'=>false,\n 'success'=>true\n );\n return $result;\n }", "function file_download($file, $pre=''){\n \n if (file_exists($file)) {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename='.$pre.basename($file));\n header('Expires: 0');\n header('Cache-Control: must-revalidate');\n header('Pragma: public');\n header('Content-Length: ' . filesize($file));\n ob_clean();\n flush();\n readfile($file);\n exit;\n }\n \n}", "public function getImageFile() \n {\n return isset($this->imagen) ? Yii::$app->basePath . '/web/img/producto/'. $this->imagen : null;\n }", "public function getFileBaseUrl()\n {\n return Mage::getBaseUrl('media').'invitationstatus'.'/'.'file';\n }", "public function get_files()\n {\n }", "public function downloadImages(){\n if(Auth::user()->statut_id != 3) return back();\n $this->createZip();\n return response()->download(public_path('allImages.zip'));\n }", "public function getFullPath(): string;", "public function getAbsolutePath() {}", "public function getAbsolutePath() {}", "function get_file(){\n extract($this->_url_params);\n /**\n * @var string $file_name\n * @var int $project_id\n */\n $this->load_view(false);\n if(!isset($file_name, $project_id)) goto redirect;\n /**\n * @var \\AWorDS\\App\\Models\\Project $project\n */\n $project = $this->set_model();\n $logged_in = $project->login_check();\n if($logged_in AND $project->verify($project_id)){\n $file_type = null;\n switch($file_name){\n case 'SpeciesRelation.txt': $file_type = Constants::EXPORT_SPECIES_RELATION; break;\n case 'DistantMatrix.txt' : $file_type = Constants::EXPORT_DISTANT_MATRIX; break;\n case 'NeighbourTree.jpg' : $file_type = Constants::EXPORT_NEIGHBOUR_TREE; break;\n case 'UPGMATree.jpg' : $file_type = Constants::EXPORT_UPGMA_TREE;\n }\n if($file_type == null) goto redirect;\n $file = $project->export($project_id, $file_type);\n if($file == null){\n redirect:\n $this->redirect(isset($_SERVER['HTTP_REFERER']) ?\n $_SERVER['HTTP_REFERER'] :\n Config::WEB_DIRECTORY . 'projects');\n exit();\n }\n header('Content-Type: ' . $file['mime']);\n header('Content-Disposition: attachment; filename=\"' . $file['name'] . '\"');\n readfile($file['path']);\n exit();\n }\n goto redirect;\n }", "public function get_file_file($id)\n\t{\n\t\tif (!$this->is_allowed('dokumentasi_bendungan_update', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => 'Image not loaded, you do not have permission to access'\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$dokumentasi_bendungan = $this->model_dokumentasi_bendungan->find($id);\n\n\t\techo $this->get_file([\n 'uuid' => $id, \n 'delete_by' => 'id', \n 'field_name' => 'file', \n 'table_name' => 'dokumentasi_bendungan',\n 'primary_key' => 'kode_dbd',\n 'upload_path' => 'uploads/dokumentasi_bendungan/',\n 'delete_endpoint' => 'administrator/dokumentasi_bendungan/delete_file_file'\n ]);\n\t}", "abstract protected function getFile(): File;", "public function getResource() {}", "protected static function file()\n {\n }", "public function actionDownloadRelatorio($filename, $idproger){\n global $tipoProger;\n if(\\Yii::$app->user->can('gerenciamento-cadastros-avançados')){\n $storagePath = Yii::$app->params['caminhoRelatorio'];\n $folder = \"$tipoProger$idproger\";\n // check filename for allowed chars (do not allow ../ to avoid security issue: downloading arbitrary files)\n if (!is_file(\"$storagePath/$folder/$filename\")) {\n throw new \\yii\\web\\NotFoundHttpException('The file does not exists.');\n }\n return Yii::$app->response->sendFile(\"$storagePath/$folder/$filename\", $filename); \n }else {\n throw new \\yii\\web\\ForbiddenHttpException('Você não está autorizado a realizar essa ação.');\n }\n }", "abstract protected function getFilesDestination();", "abstract protected function _getFileName();", "public function getFile()\r\n {\r\n // check permission\r\n $this->_check_group_permission();\r\n\r\n $access_full_path = $this->_get_access_full_path();\r\n $filename = $this->input->get_post('filename');\r\n $alt = $this->input->get_post('alt');\r\n\r\n // insert userlog\r\n if (empty($alt))\r\n {\r\n $this->_insert_userlog(Userlog_model::FILE_PREVIEW);\r\n }\r\n\r\n if ($this->files_model->is_document($filename))\r\n {\r\n header('Location: /files/preview?'. $_SERVER['QUERY_STRING']);\r\n return;\r\n }\r\n if ($this->files_model->is_extension($filename, 'nes'))\r\n {\r\n header('Location: /files/jsnes?'. $_SERVER['QUERY_STRING']);\r\n return;\r\n }\r\n if ( ! $this->files_model->is_browser_viewable($filename))\r\n {\r\n header('Location: /files/show_download?'. $_SERVER['QUERY_STRING']);\r\n return;\r\n }\r\n\r\n $this->files_model->get_file($access_full_path, $filename, $alt);\r\n }", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;" ]
[ "0.639199", "0.63614154", "0.63614154", "0.6337063", "0.63362867", "0.6272049", "0.6249494", "0.6152773", "0.60841537", "0.6077122", "0.60715663", "0.60022604", "0.60022604", "0.60022604", "0.59802437", "0.59802437", "0.59802437", "0.59802437", "0.5946574", "0.59350204", "0.5933926", "0.591688", "0.5894076", "0.58894897", "0.58856994", "0.5879909", "0.5879909", "0.5879909", "0.5878626", "0.5873641", "0.58608675", "0.5828483", "0.58220315", "0.57859653", "0.57859653", "0.5762612", "0.57623166", "0.576188", "0.5757451", "0.5745655", "0.57442576", "0.57389754", "0.5726052", "0.5716475", "0.5714008", "0.5712285", "0.5710801", "0.57093805", "0.5709169", "0.57012993", "0.56945866", "0.56881905", "0.5683079", "0.5680202", "0.5672832", "0.5670295", "0.566957", "0.56580037", "0.56499225", "0.56454855", "0.564212", "0.56395346", "0.5632078", "0.5611484", "0.5587922", "0.558411", "0.5573152", "0.5567405", "0.55571634", "0.5555453", "0.5547182", "0.5535379", "0.5535379", "0.5530105", "0.5525274", "0.5525274", "0.5519689", "0.5511188", "0.5491335", "0.5471012", "0.5469056", "0.54658556", "0.5464315", "0.5453763", "0.5452506", "0.5452506", "0.5449534", "0.54466945", "0.5426948", "0.54190487", "0.54151094", "0.5407989", "0.5405138", "0.54021645", "0.5399338", "0.53991264", "0.53991264", "0.53991264", "0.53991264", "0.53991264", "0.53991264" ]
0.0
-1
Duplicate of $wpdb::esc_like. Can be replaced once we bump WordPress version dependency to 4.0+
function esc_like($text) { return addcslashes($text, '_%\\'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function esc_like($text)\n {\n }", "public static function safe_sql_like($string){\n global $wpdb;\n\n // safe\n $string = $wpdb->prepare(\"%s\", $string);\n // trim '\n $tmp = explode(\"'\", $string);\n array_shift($tmp);\n array_pop($tmp);\n $string = implode(\"'\", $tmp);\n\n // Safe for LIKE'...'\n $string = str_replace( array(\"%\", \"[\", \"]\", \"^\", \"_\"), array(\"\\%\", \"\\[\", \"\\]\", \"\\^\", \"\\_\"), $string);\n\n return $string;\n }", "function like_escape($text)\n {\n }", "function title_like_posts_where( $where, $wp_query ) {\n global $wpdb;\n if ( $post_title_like = $wp_query->get( 'post_title_like' ) ) {\n $where .= ' AND ' . $wpdb->posts . '.post_title LIKE \\'%' . esc_sql( $wpdb->esc_like( $post_title_like ) ) . '%\\'';\n }\n return $where;\n}", "function like ($value) {\n return ' like \\''.$value.'\\'';\n }", "public function escapeLike($string);", "function esc_attr($text)\n {\n }", "function zp_post_like( $atts, $content = null ) {\n\textract( shortcode_atts( array(\n\t\t'text' => __( 'Like this post', 'novo' ),\n\t ), $atts ) );\n\t global $post;\n\t$likes = get_post_meta($post->ID,'zp_like',true);\n\t$like = ( $likes ) ? $likes: '0';\t\n\t\n\t$output = '<span class=\"post_like\"><span class=\"likes text-right '.$post->ID.'\"><span class=\"icon-heart '.$post->ID.'\">R</span><span class= \"textLike\">'.$text.'</span><span class=\"likes_value\"><em>( '.$like.')</em></span></span></span>';\t\n\treturn $output;\n}", "function esc_attr($value) {\n return $value;\n}", "function esc_sql($data)\n {\n }", "public function escape($s)\n {\n return $this->wpdb->escape($s);\n }", "function esc_attr( $text ) {\r\n\t$safe_text = wp_check_invalid_utf8( $text );\r\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\r\n\t/**\r\n\t * Filters a string cleaned and escaped for output in an HTML attribute.\r\n\t *\r\n\t * Text passed to esc_attr() is stripped of invalid or special characters\r\n\t * before output.\r\n\t *\r\n\t * @since 2.0.6\r\n\t *\r\n\t * @param string $safe_text The text after it has been escaped.\r\n\t * @param string $text The text prior to being escaped.\r\n\t */\r\n\treturn apply_filters( 'attribute_escape', $safe_text, $text );\r\n}", "function esc_html($text)\n {\n }", "function my_action_callback() {\n check_ajax_referer( 'my-special-string', 'security' );\n $postid = intval( $_POST['postid'] );\n $user = get_current_user_id();\n $like=0;\n $dislike=0;\n $like_count=0;\n //check if post id and userid present\n global $wpdb;\n $row = $wpdb->get_results( \"SELECT id FROM $wpdb->post_like_table WHERE postid = '$postid' AND userid = '$user' AND userid != 0\");\n if ( is_user_logged_in() ) {\n if(empty($row)){\n //insert row\n $wpdb->insert( $wpdb->post_like_table, array( 'postid' => $postid, 'userid' => $user ), array( '%d', '%d' ) );\n //echo $wpdb->insert_id;\n $like=1;\n } else {\n //delete row\n $wpdb->delete( $wpdb->post_like_table, array( 'postid' => $postid, 'userid'=> $user ), array( '%d','%s' ) );\n $dislike=1;\n }\n }\n\n //calculate like count from db.\n $totalrow = $wpdb->get_results( \"SELECT id FROM $wpdb->post_like_table WHERE postid = '$postid'\");\n $total_like=$wpdb->num_rows;\n $data=array( 'postid'=>$postid,'likecount'=>$total_like,'userid'=>$user,'like'=>$like,'dislike'=>$dislike);\n echo json_encode($data);\n die(); // this is required to return a proper result\n}", "public function escapeLikeStringDirect($str)\n\t{\n\t\t//log_message('error', 'escapeLikeStringDirect');\n\n\t\tif (is_array($str))\n\t\t{\n\t\t\tforeach ($str as $key => $val)\n\t\t\t{\n\t\t\t\t$str[$key] = $this->escapeLikeStringDirect($val);\n\t\t\t}\n\n\t\t\treturn $str;\n\t\t}\n\n\t\t$str = $this->_escapeString($str);\n\n\t\t// Escape LIKE condition wildcards\n\t\treturn str_replace([\n\t\t\t$this->likeEscapeChar,\n\t\t\t'%',\n\t\t\t'_',\n\t\t], [\n\t\t\t'\\\\' . $this->likeEscapeChar,\n\t\t\t'\\\\' . '%',\n\t\t\t'\\\\' . '_',\n\t\t], $str\n\t\t);\n\t}", "abstract public function escapeStr($str, $like = false);", "function esc_html($value) {\n return $value;\n}", "function esc_html( $text ) {\n\t$safe_text = wp_check_invalid_utf8( $text );\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n\t/**\n\t * Filter a string cleaned and escaped for output in HTML.\n\t *\n\t * Text passed to esc_html() is stripped of invalid or special characters\n\t * before output.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $safe_text The text after it has been escaped.\n \t * @param string $text The text prior to being escaped.\n\t */\n\treturn apply_filters( 'esc_html', $safe_text, $text );\n}", "public static function escapeLikePattern($text){\r\n\t\t\t$text = str_replace('\\\\', '', $text);//apparently a backslash is ignored when using the LIKE operator\r\n\t\t\t$text = self::escape($text);\r\n\t\t\tif($text !==false){\r\n\t\t\t\t$text = str_replace('%', '\\%', $text);\r\n\t\t\t\t$text = str_replace('_', '\\_', $text);\r\n\t\t\t\tif(mb_strlen($text)>=3) $text .= '%';\r\n\t\t\t}\r\n\t\t\treturn $text;\r\n\t\t}", "function bbloomer_translate_may_also_like() {\n\t $translated = esc_html__( 'Customers also purchased... ');\n\t return $translated;\n\t}", "public\r\n\tfunction buildLike( $string ) {\r\n\t\treturn $string . '%';\r\n\t}", "function _xss_sanitization_esc_html( $text ) {\n $safe_text = wp_check_invalid_utf8( $text );\n $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n return $safe_text;\n}", "function esc_attr($value) {\n return htmlspecialchars($value, ENT_QUOTES);\n }", "function _xss_sanitization_esc_attr( $text ) {\n $safe_text = wp_check_invalid_utf8( $text );\n $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n return $safe_text;\n}", "function lp_show_frontend( $attr, $content='' ){\r\n\t$attributes = shortcode_atts(array(\r\n\t\t\t\t\t'post_id'\t=> get_the_ID()\r\n\t\t\t\t),$attr);\r\n\tglobal $wpdb;\r\n\t$table_name = $wpdb->prefix.'like_post';\r\n\t$id = $attributes['post_id'];\r\n\t$cookie_like = 'lp_'.$id;\r\n\tif(!isset($_COOKIE[$cookie_like])){\r\n\t\t$lp_like_text = 'Like';\r\n\t}else{\r\n\t\t$lp_like_text = 'LIKED';\r\n\t}\r\n\t$selected_time = get_option('lp_showing_year');\r\n\t$selected_date_time = date('Y-m-d', strtotime(\"-$selected_time days\"));\r\n\t$like_time = date('Y-m-d',time());\r\n\t$wpdb->show_errors( true );\r\n\t$total_like = $wpdb->get_var(\"SELECT count(POST_ID) FROM $table_name WHERE POST_ID = $id AND STATUS = 1 AND LIKE_TIME BETWEEN '$selected_date_time' AND '$like_time' \");\r\n\r\n\t$output = \"<p class='li_like'>\";\r\n\t$output .= \"<a class='lp_like_btn' href='javascript:void(0)' data-total-like='\".$total_like.\"' data-post-id='\".$id.\"' >\".$lp_like_text.\"</a> \";\r\n\t$output .= \"<span class='lp_like_count'><strong>\".$total_like.\"</strong> Like</span>\";\r\n\t$output .= \"</p>\";\r\n\treturn $output;\r\n}", "public function buildLike() {\n\t\t$params = func_get_args();\n\n\t\tif ( count( $params ) > 0 && is_array( $params[0] ) ) {\n\t\t\t$params = $params[0];\n\t\t}\n\n\t\t$s = '';\n\n\t\tforeach ( $params as $value ) {\n\t\t\tif ( $value instanceof LikeMatch ) {\n\t\t\t\t$s .= $value->toString();\n\t\t\t} else {\n\t\t\t\t$s .= $this->escapeLikeInternal( $value );\n\t\t\t}\n\t\t}\n\n\t\treturn \" LIKE '\" . $s . \"' \";\n\t}", "function wp_magic_quotes()\n {\n }", "function esc_html($text) {\n return htmlspecialchars($text);\n }", "function wp_specialchars($text, $quote_style = \\ENT_NOQUOTES, $charset = \\false, $double_encode = \\false)\n {\n }", "function html_escape($value)\n{\n return apply_filters('html_escape', $value);\n}", "function esc_attr( $text ) {\n\t$safe_text = wp_check_invalid_utf8( $text );\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n\t/**\n\t * Filter a string cleaned and escaped for output in an HTML attribute.\n\t *\n\t * Text passed to esc_attr() is stripped of invalid or special characters\n\t * before output.\n\t *\n\t * @since 2.0.6\n\t *\n\t * @param string $safe_text The text after it has been escaped.\n \t * @param string $text The text prior to being escaped.\n\t */\n\treturn apply_filters( 'attribute_escape', $safe_text, $text );\n}", "public function getLike($likeString);", "function capital_P_dangit( $text ) {\n\t$current_filter = current_filter();\n\tif ( 'the_title' === $current_filter || 'wp_title' === $current_filter )\n\t\treturn str_replace( 'Wordpress', 'WordPress', $text );\n\t// Still here? Use the more judicious replacement\n\tstatic $dblq = false;\n\tif ( false === $dblq ) {\n\t\t$dblq = _x( '&#8220;', 'opening curly double quote' );\n\t}\n\treturn str_replace(\n\t\tarray( ' Wordpress', '&#8216;Wordpress', $dblq . 'Wordpress', '>Wordpress', '(Wordpress' ),\n\t\tarray( ' WordPress', '&#8216;WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ),\n\t$text );\n}", "function format_sql( $value, $like = NULL ){\n/*************************************************************************\n * format vars for insertion into mysql\n * add %'s when needed for LIKE clauses\n */\n // Stripslashes\n if ( get_magic_quotes_gpc() ) {\n $value = stripslashes( $value );\n }\n\n // Quote if not a number or a numeric string\n if ( !is_numeric( $value ) ) {\n $value = \"'\". ( $like ? '%' : '' ) . mysql_real_escape_string( $value ) . ( $like ? '%' : '' ) .\"'\";\n }\n\n return $value;\n}", "function _wp_specialchars($text, $quote_style = \\ENT_NOQUOTES, $charset = \\false, $double_encode = \\false)\n {\n }", "function getPostLikeLink( $post_id, $btn_info = true ) {\n\n\t$like_count = get_post_meta( $post_id, \"_post_like_count\", true ); // get post likes\n\t$count = ( empty( $like_count ) || $like_count == \"0\" ) ? '0' : esc_attr( $like_count );\n\tif ( AlreadyLiked( $post_id ) ) {\n\t\t$class = esc_attr( ' liked' );\n\t\t$title = esc_attr( 'Unlike' );\n\t\t$heart = '<i class=\"fa fa-heart\"></i>';\n\t} else {\n\t\t$class = esc_attr( '' );\n\t\t$title = esc_attr( 'Like' );\n\t\t$heart = '<i class=\"fa fa-heart-o\"></i>';\n\t}\n\tif ( $btn_info ) {\n\t\t$count = '<span class=\"btn-info\">'.$count.'</span>';\n\t}\n\t$output = '<a href=\"#\" class=\"infinity-post-like'.$class.'\" data-post_id=\"'.$post_id.'\" title=\"'.esc_attr( $title ).'\">'.$heart.$count.'</a>';\n\treturn $output;\n}", "protected function escapeLike(string $str): string {\n return addcslashes($str, '_%');\n }", "function addslashes_mssql($str,$inlike=false,$escape='!')\n\t{\n\n\t\tif (is_array($str))\n\t\t{\n\t\t\tforeach($str AS $id => $value) {\n\t\t\t\t$str[$id] = addslashes_mssql($value,$inlike);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$str\t= str_replace(\"'\", \"''\", $str);\n\n\t\t\tif ($inlike)\n\t\t\t{\n\t\t\t\t$str\t= str_replace($escape, $escape.$escape, $str);\n\t\t\t\t$str\t= str_replace('%', $escape.'%', $str);\n\t\t\t\t$str\t= str_replace('[', $escape.'[', $str);\n\t\t\t\t$str\t= str_replace(']', $escape.']', $str);\n\t\t\t\t$str\t= str_replace('_', $escape.'_', $str);\n\t\t\t}\n\n\t\t}\n\n\t\treturn $str;\n\n\t}", "function plugin_suggest_callback() {\r\n\t\t\tglobal $wpdb, $post;\r\n\t\t\t\r\n\t\t\t$posttype = $wpdb->escape($_GET['type']);\r\n\t\t\t$in = $wpdb->escape($_GET['q']);\r\n\r\n\t\t\t$query = \"SELECT ID from $wpdb->posts where post_type = '$posttype' AND post_title like '%$in%' \";\r\n\t\t\t$mypostids = $wpdb->get_col($query);\r\n\r\n\t\t\tforeach ($mypostids as $key => $value) {\r\n\t\t\t\tprint get_the_title($value) . \" [#\" . $value . \"]\" . \"\\n\";\r\n\t\t\t}\r\n\t\t\tdie(); // this is required to return a proper result\r\n\t\t}", "protected function quote_escaped()\n {\n }", "public function like($value);", "function _zb_ulp_this_post_like( $user_id, $post_id ) {\n\tglobal $wpdb;\n\n\t$table_name = $wpdb->prefix . ZB_ULP_PLUGIN_TABLE_NAME;\n\t$check_query = \"SELECT * FROM $table_name WHERE user_id= $user_id AND post_id = $post_id\";\n\t$check_data_exist = $wpdb->get_var( $check_query );\n\n\treturn ( ! empty( $check_data_exist ) ) ? true : false;\n\n}", "function escape_sq($str)\n{\n $esc_str = str_replace(\"'\", \"''\", $str);\n return $esc_str;\n}", "function the_slug_exists($post_name) {\n global $wpdb;\n\n if($wpdb->get_results(\"SELECT * FROM $wpdb->posts WHERE post_name like '%\" . $post_name . \"%'\", 'ARRAY_A')) {\n return true;\n } else {\n return false;\n }\n}", "function esc(String $value)\n{\n\t// bring the global db connect object into function\n\tglobal $conn;\n\n\t$val = trim($value); // remove empty space sorrounding string\n\t$data = stripslashes($val);\n\t$data = htmlspecialchars($data);\n\t$val = mysqli_real_escape_string($conn, $value);\n\n\treturn $data;\n}", "function suggestcomment_add_comment($text){\n global $wpdb;\n $table_name = $wpdb->prefix . \"suggestcomment\";\n $sql=\"INSERT INTO \" . $table_name .\" (comment_text) \" .\"VALUES ('\" . $wpdb->escape($text) . \"');\";\n $results = $wpdb->query($sql);\n}", "function esc(String $value){\n\t// bring the global db connect object into function\n\tglobal $connection;\n\t// remove empty space sorrounding string\n\t$val = trim($value); \n\t$val = mysqli_real_escape_string($connection, $value);\n\treturn $val;\n}", "function privDisableMagicQuotes()\n {\n }", "function escape($data){\r\n\t\t\tglobal $link;\r\n\t\t\treturn mysqli_real_escape_string($link, $data);\r\n\t\t}", "function esc($value)\n{\n return htmlentities($value);\n}", "public function like_text() {\n\t\trequire HS_DOCS_API_DIR_PATH . 'admin/views/like-box.php';\n\t}", "function escs(String $value)\n{\n // bring the global db connect object into function\n global $conn;\n\n $val = trim($value); // remove empty space sorrounding string\n $data = stripslashes($val);\n $data = htmlspecialchars($data);\n $val = mysqli_real_escape_string($conn, $value);\n\n return $data;\n}", "function wp_encode_emoji($content)\n {\n }", "function yourls_esc_attr__( $text, $domain = 'default' ) {\n\treturn yourls_esc_attr( yourls_translate( $text, $domain ) );\n}", "abstract protected function _escape($s);", "function esc(String $value){\n global $conn;\n $val = trim($value); // remove empty space sorrounding string\n $val = mysqli_real_escape_string($conn, $value);\n return $val;\n }", "public function getLikeOperator()\n {\n $grammar = $this->query->getGrammar();\n\n if ($grammar instanceof PostgresGrammar) {\n return 'ilike';\n }\n\n return 'like';\n }", "function acf_esc_html($string = '')\n{\n}", "public function _real_escape($data)\n {\n }", "function esc_url($url) {\n\n if ('' == $url) {\n return $url;\n }\n\n $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\\'()\\\\x80-\\\\xff]|i', '', $url);\n\n $strip = array('%0d', '%0a', '%0D', '%0A');\n $url = (string) $url;\n\n $count = 1;\n while ($count) {\n $url = str_replace($strip, '', $url, $count);\n }\n\n $url = str_replace(';//', '://', $url);\n\n $url = htmlentities($url);\n\n $url = str_replace('&amp;', '&#038;', $url);\n $url = str_replace(\"'\", '&#039;', $url);\n\n if ($url[0] !== '/') {\n // We're only interested in relative links from $_SERVER['PHP_SELF']\n return '';\n } else {\n return $url;\n }\n }", "public function likeEscape(string $keyword): string;", "public function getShortcodeReplace();", "function wrapper_escape($string) {\n\t\treturn str_replace(\"'\", \"''\", $string);\n\t}", "function yourls_esc_attr_x( $single, $context, $domain = 'default' ) {\n\treturn yourls_esc_attr( yourls_translate_with_context( $single, $context, $domain ) );\n}", "function fb_like( $atts, $content=null ){\n extract(shortcode_atts(array( \n 'send' => 'false',\n 'layout' => 'standard',\n 'show_faces' => 'true',\n 'width' => '400px',\n 'action' => 'like',\n 'font' => '',\n 'colorscheme' => 'light',\n 'ref' => '',\n 'locale' => 'en_US',\n 'appId' => '' // Put your AppId here is you have one\n ), $atts));\n \n $fb_like_code = <<<HTML\n <div id=\"fb-root\"></div><script src=\"http://connect.facebook.net/$locale/all.js#appId=$appId&amp;xfbml=1\"></script>\n <fb:like ref=\"$ref\" href=\"$content\" layout=\"$layout\" colorscheme=\"$colorscheme\" action=\"$action\" send=\"$send\" width=\"$width\" show_faces=\"$show_faces\" font=\"$font\"></fb:like>\nHTML;\n \n return $fb_like_code;\n}", "function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {\n if ( $double_encode ) {\n $string = @htmlspecialchars( $string, $quote_style, $charset );\n } else {\n // Decode &amp; into &\n $string = wp_specialchars_decode( $string, $quote_style );\n\n // Guarantee every &entity; is valid or re-encode the &\n $string = kses_normalize_entities( $string );\n\n // Now re-encode everything except &entity;\n $string = preg_split( '/(&#?x?[0-9a-z]+;)/i', $string, -1, PREG_SPLIT_DELIM_CAPTURE );\n\n for ( $i = 0; $i < count( $string ); $i += 2 )\n $string[$i ] = @htmlspecialchars( $string[$i], $quote_style, 'UTF-8' );\n\n $string = implode( '', $string );\n }\n\n return $string;\n\n}", "function replace_long_by_shorten_links($postId, $replacingList) \r\n{\r\n global $wpdb;\r\n\r\n $post = get_post($postId);\r\n $post_content = $post->post_content;\r\n\r\n foreach ($replacingList as $replaceContent) {\r\n $post_content = str_replace($replaceContent['source_link'], $replaceContent['result_link'], $post_content);\r\n } \r\n $wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_content = %s WHERE ID = %d\", $post_content, $postId ) );\r\n}", "function lp_create_table(){\r\n\tglobal $wpdb;\r\n\t$charset_collation = $wpdb->get_charset_collate();\r\n\t$table_name = $wpdb->prefix.'like_post';\r\n\r\n\tif( $wpdb->get_var(\"show tables like '$table_name'\") != $table_name){\r\n\t\t$sql = \"CREATE TABLE $table_name (\r\n\t\t\t\t\tID \t\t\t\tINT(9)\t\t\t\t\t\t\t\tNOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tPOST_ID\t\t\tINT(9) \t\t\t\t\t\t\t\tNOT NULL,\r\n\t\t\t\t\tSTATUS \t\t\tINT(1) \t\t\t\t\t\t\t\tNOT NULL,\r\n\t\t\t\t\tLIKE_TIME\t\tDATE\t\t\t\t\t\t\t\tNOT NULL,\r\n\t\t\t\t\tPRIMARY KEY (ID)\r\n\t\t\t\t) $charset_collation;\";\r\n\r\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n\t\tdbDelta($sql);\r\n\t}\r\n\tadd_option('lp_showing_year','');\r\n\r\n}", "private function _escape($data)\n {\n return htmlspecialchars($data, ENT_QUOTES);\n }", "function convertToSqlLikeValue($input) {\n $result = $input;\n\n // escape special chars\n $replace_Step1 = array(\n '%' => '\\%',\n '_' => '\\_',\n );\n // replace chars given by surfer\n $replace_Step2 = array(\n '?' => '_',\n '*' => '%',\n );\n\n $result = strtr($result, $replace_Step1);\n $result = strtr($result, $replace_Step2);\n\n return $result;\n }", "function the_author($deprecated = '', $deprecated_echo = \\true)\n {\n }", "public function escape_like_str($str) {\n\t\treturn $this->escape_str($str, TRUE);\n\t}", "function the_author_posts_link($deprecated = '')\n {\n }", "function quote_smart($value)\r\n{\r\n // Stripslashes\r\n if (get_magic_quotes_gpc()) {\r\n\t $value = stripslashes($value);\r\n }\r\n // Quote if not integer\r\n if (!is_numeric($value)) {\r\n\t $value = \"'\" . ((isset($GLOBALS[\"___mysqli_ston\"]) && is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_real_escape_string($GLOBALS[\"___mysqli_ston\"], $value) : ((trigger_error(\"[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.\", E_USER_ERROR)) ? \"\" : \"\")) . \"'\";\r\n }\r\n return $value;\r\n}", "private function escape($arg, $meta = true)\n {\n if (!defined('PHP_WINDOWS_VERSION_BUILD')) {\n return escapeshellarg($arg);\n }\n\n $quote = strpbrk($arg, \" \\t\") !== false || $arg === '';\n $arg = preg_replace('/(\\\\\\\\*)\"/', '$1$1\\\\\"', $arg, -1, $dquotes);\n\n if ($meta) {\n $meta = $dquotes || preg_match('/%[^%]+%/', $arg);\n\n if (!$meta && !$quote) {\n $quote = strpbrk($arg, '^&|<>()') !== false;\n }\n }\n\n if ($quote) {\n $arg = preg_replace('/(\\\\\\\\*)$/', '$1$1', $arg);\n $arg = '\"'.$arg.'\"';\n }\n\n if ($meta) {\n $arg = preg_replace('/([\"^&|<>()%])/', '^$1', $arg);\n }\n\n return $arg;\n }", "function wp_slash_strings_only($value)\n {\n }", "function lp_increment_like(){\r\n\tglobal $wpdb;\r\n\t$table_name = $wpdb->prefix.'like_post';\r\n\t$id = $_POST['post_id'];\r\n\t$like_time = date('Y-m-d',time());\r\n\t$selected_time = get_option('lp_showing_year');\r\n\t$selected_date_time = date('Y-m-d', strtotime(\"-$selected_time days\"));\r\n\t$wpdb->show_errors( true );\r\n\t$insert_like = $wpdb->insert(\r\n\t\t\t\t\t\t$table_name,\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t'POST_ID'\t=>\t$id,\r\n\t\t\t\t\t\t\t'STATUS'\t=>\t1,\r\n\t\t\t\t\t\t\t'LIKE_TIME' =>\t$like_time\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t'%d',\r\n\t\t\t\t\t\t\t'%d',\r\n\t\t\t\t\t\t\t'%s'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\t$total_like = $wpdb->get_var(\"SELECT count(POST_ID) FROM $table_name WHERE POST_ID = $id AND STATUS = 1 AND LIKE_TIME BETWEEN '$selected_date_time' AND '$like_time' \");\r\n\r\n\techo $total_like;\r\n\r\n\twp_die();\r\n}", "function _xss_sanitization_esc_url( $url, $_context = 'display' ) {\n\n // URL protocols\n $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn');\n \n // Init\n $original_url = $url;\n \n // If blank, then no harm\n if ( '' == $url ) {\n return $url;\n }\n\n //Start cleaning\n $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\\'()\\\\x80-\\\\xff]|i', '', $url);\n \n $strip = array('%0d', '%0a', '%0D', '%0A');\n $url = wp_deep_replace($strip, $url);\n\n // Make sure its not a ;//\n $url = str_replace(';//', '://', $url);\n \n /* If the URL doesn't appear to contain a scheme, we\n * presume it needs http:// appended (unless a relative\n * link starting with /, # or ? or a php file).\n */\n if ( strpos($url, ':') === false && \n ! in_array( $url[0], array( '/', '#', '?' ) ) &&\n ! preg_match('/^[a-z0-9-]+?\\.php/i', $url) \n ){\n $url = 'http://' . $url;\n }\n\n // Replace ampersands and single quotes only when displaying.\n if ( 'display' == $_context ) {\n $url = kses_normalize_entities( $url );\n $url = str_replace( '&amp;', '&#038;', $url );\n $url = str_replace( \"'\", '&#039;', $url );\n }\n\n if ( kses_bad_protocol( $url, $protocols ) != $url ){\n return '';\n }\n\n return $url;\n}", "abstract protected function platformPrepareLikeStatement(\n $prefix = null,\n $column,\n $not = null,\n $bind,\n $caseSensitive = false\n );", "function _culturefeed_search_ui_sanitize_query_term($term) {\n // Replace special characters with normal ones.\n $term = culturefeed_search_transliterate($term);\n\n // Replace AND to a space.\n $term = str_replace(' AND ', ' ', $term);\n\n $query_parts = explode(' OR ', $term);\n array_walk($query_parts, function(&$search_string) {\n\n // Strip of words between quotes. The spaces don't need to be replaced to AND for them.\n preg_match_all('/\".*?\"/', $search_string, $matches);\n foreach ($matches[0] as $match) {\n $search_string = str_replace($match, '', $search_string);\n }\n\n $search_string = str_replace(' ', ' ', $search_string);\n\n // Put words with a special character between quotes.\n $words = explode(' ', trim($search_string));\n $parts = array();\n $special_characters = '-!?&/';\n foreach ($words as $word) {\n if (strpbrk($word, $special_characters)) {\n $word = '\"' . $word . '\"';\n }\n $parts[] = $word;\n }\n\n // Replace spaces between multiple search words by 'AND'.\n $search_string = implode(' AND ', $parts);\n\n // Add back the words between quotes.\n if (!empty($matches[0])) {\n if (empty($search_string)) {\n $search_string .= implode(' AND ', $matches[0]);\n }\n else {\n $search_string .= ' AND ' . implode(' AND ', $matches[0]);\n }\n }\n\n });\n\n return implode(' OR ', $query_parts);\n}", "function wpcom_vip_enable_likes() {\n\tadd_filter( 'wpl_is_likes_visible', '__return_true', 999 );\n}", "function Dwoo_Plugin_escape(Dwoo_Core $dwoo, $value='', $format='html', $charset=null)\n{\n\tif ($charset === null) {\n\t\t$charset = $dwoo->getCharset();\n\t}\n\n\tswitch($format)\n\t{\n\n\tcase 'html':\n\t\treturn htmlspecialchars((string) $value, ENT_QUOTES, $charset);\n\tcase 'htmlall':\n\t\treturn htmlentities((string) $value, ENT_QUOTES, $charset);\n\tcase 'url':\n\t\treturn rawurlencode((string) $value);\n\tcase 'urlpathinfo':\n\t\treturn str_replace('%2F', '/', rawurlencode((string) $value));\n\tcase 'quotes':\n\t\treturn preg_replace(\"#(?<!\\\\\\\\)'#\", \"\\\\'\", (string) $value);\n\tcase 'hex':\n\t\t$out = '';\n\t\t$cnt = strlen((string) $value);\n\t\tfor ($i=0; $i < $cnt; $i++) {\n\t\t\t$out .= '%' . bin2hex((string) $value[$i]);\n\t\t}\n\t\treturn $out;\n\tcase 'hexentity':\n\t\t$out = '';\n\t\t$cnt = strlen((string) $value);\n\t\tfor ($i=0; $i < $cnt; $i++)\n\t\t\t$out .= '&#x' . bin2hex((string) $value[$i]) . ';';\n\t\treturn $out;\n\tcase 'javascript':\n\t\treturn strtr((string) $value, array('\\\\'=>'\\\\\\\\',\"'\"=>\"\\\\'\",'\"'=>'\\\\\"',\"\\r\"=>'\\\\r',\"\\n\"=>'\\\\n','</'=>'<\\/'));\n\tcase 'mail':\n\t\treturn str_replace(array('@', '.'), array('&nbsp;(AT)&nbsp;', '&nbsp;(DOT)&nbsp;'), (string) $value);\n\tdefault:\n\t\treturn $dwoo->triggerError('Escape\\'s format argument must be one of : html, htmlall, url, urlpathinfo, hex, hexentity, javascript or mail, \"'.$format.'\" given.', E_USER_WARNING);\n\n\t}\n}", "function wp_staticize_emoji($text)\n {\n }", "function search_excerpt_highlight() {\n $excerpt = get_the_excerpt();\n $keys = implode('|', explode(' ', get_search_query()));\n $excerpt = preg_replace('/(' . $keys . ')/iu', '<strong class=\"search-highlight\">\\0</strong>', $excerpt);\n\n echo '<p>' . $excerpt . '</p>';\n}", "public function bindLikeValue($value)\n {\n return '%' . $value . '%';\n }", "public function escape($input)\n {\n // phpcs:ignore PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved\n return mysql_real_escape_string($input, $this->wpdb->dbh);\n }", "function yz_esc_url( $url ) {\n $url = esc_url( $url );\n $disallowed = array( 'http://', 'https://' );\n foreach( $disallowed as $protocole ) {\n if ( strpos( $url, $protocole ) === 0 ) {\n return str_replace( $protocole, '', $url );\n }\n }\n return $url;\n}", "function build_like($liker_id,$post_type,$post_id)\n{\t\n\t$CI =& get_instance(); \n\t\n\t//check if the liker is the author of the content\n\t$q=mysql_query(\"SELECT * FROM posts WHERE account_id='$liker_id' AND type_id='$post_type' AND ref_id='$post_id' \")or die(\" Error: \".mysql_error());\n\tif (mysql_num_rows($q) == 0) {\n\t\t$like['can_like'] = true;\n\t\t$query=mysql_query(\"SELECT * FROM likes WHERE liker_id='$liker_id' AND post_type='$post_type' AND post_id='$post_id' \")or die(\" Error: \".mysql_error());\n\t\tif (mysql_num_rows($query) > 0) {\n\t\t\t$like['has_like'] = true;\n\t\t}else{\n\t\t\t$like['has_like'] = false;\n\t\t}\n\t\t$like['post_type'] = $post_type;\n\t\t$like['id'] = $post_id;\n\t\t//$data['like_bar'] = $this->load->view('includes/like_bar.php',$like,true); \n\t}else{\n\t\t$like['can_like'] = false;\n\t}\n\treturn $CI->load->view('includes/like_bar.php',$like,true);\n}", "function update_likecount() {\n\n\t$sql = 'SELECT wp_postmeta.meta_value, wp_postmeta.post_ID, wp_posts.likecount_old\n \t\tFROM wp_postmeta, wp_posts\n \t\tWHERE wp_postmeta.post_ID=wp_posts.ID\n \t\tAND\n \t\tmeta_key = \"likecount\"';\n\n\t$db_result = mysql_query($sql);\n\t$data_set = mysql_num_rows($db_result);\n\n\t$i = 0;\n\twhile ($i < $data_set) {\n\n\t\tmysql_data_seek($db_result, $i);\n\t\t$row = mysql_fetch_object($db_result);\n\n\t\t$post_ID = $row->post_ID;\n\t\t$likecount = (int) $row->meta_value;\n\t\t$likecount_old = (int) $row->likecount_old;\n\n\t\tif ($likecount > $likecount_old) {\n\n\t\t\t$like_difference = $likecount - $likecount_old;\n\t\t\t$like_difference_unixtime = pow(($like_difference*3600), 1.05);\n\t\t\t$like_difference_unixtime = (int) $like_difference_unixtime;\n\n\t\t\tmysql_query('UPDATE wp_posts SET popularity_score = popularity_score + '. $like_difference_unixtime .' WHERE ID = \"'. $post_ID .'\"');\n\t\t\tmysql_query('UPDATE wp_posts SET likecount_old = '. $likecount .' WHERE ID = \"'. $post_ID .'\"');\n\t\t} \n\t\t$i++;\n\t}\n}", "private function _wp_magic_quotes() {\n // If already slashed, strip.\n if (function_exists('get_magic_quotes_gpc')) {\n $reflection = new \\ReflectionFunction('get_magic_quotes_gpc');\n if ( ! $reflection->isDeprecated()) {\n if ( get_magic_quotes_gpc() ) {\n $_GET = RevSliderFunctions::stripslashes_deep( $_GET );\n $_POST = RevSliderFunctions::stripslashes_deep( $_POST );\n $_COOKIE = RevSliderFunctions::stripslashes_deep( $_COOKIE );\n }\n }\n }\n\n // Escape with wpdb.\n $_GET = $this->_add_magic_quotes( $_GET );\n $_POST = $this->_add_magic_quotes( $_POST );\n $_COOKIE = $this->_add_magic_quotes( $_COOKIE );\n $_SERVER = $this->_add_magic_quotes( $_SERVER );\n\n // Force REQUEST to be GET + POST.\n $_REQUEST = array_merge( $_GET, $_POST );\n }", "function qoute_replacment($phrase){\r\n\t$find = array(\"\\’\", \"’\", \"\\‘\", \"‘\", \"\\'\", \"'\", \"—\", '\\”', '”', '\\“', '“', '\\\"', '\"',\"\\n\",\"\\r\",\"…\");\r\n\t//defince what to replace the find array with\r\n\t$replace = array(\"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"-\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\",\"&nbsp;\",\"&nbsp;\",\"...\");\r\n\t//html entities code incase you want that\r\n\t#$replace = array(\"&#39\", \"&#39\", \"&#39\", \"&#39\", \"&#39\", \"&#39\",\"—\", \"&#34\", \"&#34\", \"&#34\", \"&#34\", \"&#34\", \"&#34\");\r\n\t//do the replacing\r\n\t$newphrase = str_replace($find, $replace, $phrase);\r\n \t//return the replacing for output\r\n\treturn $newphrase;\r\n}", "function wp_install_maybe_enable_pretty_permalinks()\n {\n }", "function post_like() {\n\t\n$like = '<iframe src=\"http://www.facebook.com/plugins/like.php?href=' . get_permalink() .'&amp;layout=button_count&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" style=\"border:none; overflow:hidden; width:450px; height:60px;\"></iframe>';\necho $like;\n $twwite='<a href=\"http://twitter.com/share\" class=\"twitter-share-button\" data-text=\"<?php the_title(); ?>\" data-url=\"' . get_permalink() .'\" data-via=\"diythemes\">Tweet</a>\n <script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script>';\necho $twwite;\n\t\t\n}", "function privDisableMagicQuotes()\n {\n $v_result=1;\n\n // ----- Look if function exists\n if ( (!function_exists(\"get_magic_quotes_runtime\"))\n\t || (!function_exists(\"set_magic_quotes_runtime\"))) {\n return $v_result;\n\t}\n\n // ----- Look if already done\n if ($this->magic_quotes_status != -1) {\n return $v_result;\n\t}\n\n\t// ----- Get and memorize the magic_quote value\n\t$this->magic_quotes_status = @get_magic_quotes_runtime();\n\n\t// ----- Disable magic_quotes\n\tif ($this->magic_quotes_status == 1) {\n\t @set_magic_quotes_runtime(0);\n\t}\n\n // ----- Return\n return $v_result;\n }", "function apostrophe() {\n global $lang;\n $this->doc .= $lang['apostrophe'];\n }", "public function _escape($data)\n {\n }", "function tag_escape($tag_name)\n {\n }", "public function _weak_escape($data)\n {\n }", "function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {\n\t$string = (string) $string;\n\n\tif ( 0 === strlen( $string ) )\n\t\treturn '';\n\n\t// Don't bother if there are no specialchars - saves some processing\n\tif ( ! preg_match( '/[&<>\"\\']/', $string ) )\n\t\treturn $string;\n\n\t// Account for the previous behaviour of the function when the $quote_style is not an accepted value\n\tif ( empty( $quote_style ) )\n\t\t$quote_style = ENT_NOQUOTES;\n\telseif ( ! in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) )\n\t\t$quote_style = ENT_QUOTES;\n\n\t// Store the site charset as a static to avoid multiple calls to wp_load_alloptions()\n\tif ( ! $charset ) {\n\t\tstatic $_charset;\n\t\tif ( ! isset( $_charset ) ) {\n\t\t\t$alloptions = wp_load_alloptions();\n\t\t\t$_charset = isset( $alloptions['blog_charset'] ) ? $alloptions['blog_charset'] : '';\n\t\t}\n\t\t$charset = $_charset;\n\t}\n\n\tif ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ) ) )\n\t\t$charset = 'UTF-8';\n\n\t$_quote_style = $quote_style;\n\n\tif ( $quote_style === 'double' ) {\n\t\t$quote_style = ENT_COMPAT;\n\t\t$_quote_style = ENT_COMPAT;\n\t} elseif ( $quote_style === 'single' ) {\n\t\t$quote_style = ENT_NOQUOTES;\n\t}\n\n\t// Handle double encoding ourselves\n\tif ( $double_encode ) {\n\t\t$string = @htmlspecialchars( $string, $quote_style, $charset );\n\t} else {\n\t\t// Decode &amp; into &\n\t\t$string = wp_specialchars_decode( $string, $_quote_style );\n\n\t\t// Guarantee every &entity; is valid or re-encode the &\n\t\t$string = wp_kses_normalize_entities( $string );\n\n\t\t// Now re-encode everything except &entity;\n\t\t$string = preg_split( '/(&#?x?[0-9a-z]+;)/i', $string, -1, PREG_SPLIT_DELIM_CAPTURE );\n\n\t\tfor ( $i = 0; $i < count( $string ); $i += 2 )\n\t\t\t$string[$i] = @htmlspecialchars( $string[$i], $quote_style, $charset );\n\n\t\t$string = implode( '', $string );\n\t}\n\n\t// Backwards compatibility\n\tif ( 'single' === $_quote_style )\n\t\t$string = str_replace( \"'\", '&#039;', $string );\n\n\treturn $string;\n}", "function comment_connection($comment) {\nglobal $wpdb;\n\n//replace new lines \\n with line breaks <br /> in order to detect comment reference\n$comment = nl2br($comment);\n\n//replace extra spaces after @\n$r = \"@\";\n$s = \"@ \";\n$i = 1;\n$blank = substr_count($comment, $s);\nif ($blank > 0) \n\t$comment = str_replace($s, $r, $comment, $i);\n\n\t//determine if someone is referencing a comment\n\t$count = substr_count($comment, \"@\");\n\n\tif ($count > 0) {\n\n\t\t//find the post ID without printing to screen\n\t\t$pid = get_the_ID();\n\n\t\t//find the comment ID without printing to screen\n\t\t$cid = get_comment_ID();\n\t\n\t\t//this is the big change\n\t\t//determine all occurances of @ and their following authors\n\t\t//then loads into array\n\t\tpreg_match_all(\"/@(.*)(:|\\<br \\/\\>|,|-)/\", $comment, $out);\n\n\t\tforeach ($out[1] as $ref) {\n\t\t\t//solves little problem with colon usage\n\t\t\tif (substr_count($ref, ':') > 0) \n\t\t\t\t$ref = substr($ref, 0, strpos($ref, ':'));\n\t\t\t//solves other little problem with extra spaces\n\t\t\tif (substr_count($ref, ' ') <= 2)\n\t\t\t\t$array[$x] = $ref;\n\n\t\t\t//retrieve comment info from database\n\t\t\t$d = db_query($pid, $cid, $array[$x]);\n\n\t\t\t//replace the authors with their comment IDs\n\t\t\t//don't worry, that extra i there isn't a spelling mistake\n\t\t\t//it simply means that references with the wrong case are still replaced\n\t\t\tif ($d != NULL) {\n\t\t\t\t$replacement = preg_replace('/\\s$/', '', $array[$x]);\n\t\t\t\t$comment = str_ireplace('@' . $replacement, '@<a href=#comment-' . $d . '>' . $replacement . '</a>', $comment);\n\t\t}\n\t}\n}\nreturn $comment; //print the modified comments\n}" ]
[ "0.6816773", "0.65232337", "0.6176501", "0.60905325", "0.6058176", "0.59971786", "0.5912803", "0.58647007", "0.5745022", "0.5730965", "0.571829", "0.57169956", "0.5683524", "0.5646241", "0.56397337", "0.5632102", "0.56103677", "0.55994177", "0.5580921", "0.5564723", "0.55140424", "0.5495936", "0.5478731", "0.54662985", "0.5449805", "0.54493415", "0.5384929", "0.5340573", "0.53397", "0.5337055", "0.5334823", "0.53231996", "0.5304383", "0.5281608", "0.52807504", "0.527403", "0.52677715", "0.52525187", "0.52204305", "0.5208697", "0.5182174", "0.51397717", "0.51230055", "0.50943244", "0.50938135", "0.5071883", "0.50631946", "0.5053626", "0.50413024", "0.5038552", "0.50198513", "0.5011376", "0.49845618", "0.4981135", "0.49732774", "0.496753", "0.49570635", "0.49556977", "0.4953569", "0.49502927", "0.49471706", "0.49376917", "0.49281466", "0.49222323", "0.49051228", "0.48856863", "0.48846042", "0.48830023", "0.4879366", "0.487787", "0.48761877", "0.4872086", "0.48618418", "0.4852651", "0.4847605", "0.484697", "0.48452577", "0.48424274", "0.48389262", "0.48384878", "0.4832381", "0.48306346", "0.48193237", "0.4818575", "0.48121575", "0.48047334", "0.4804194", "0.48008725", "0.47978845", "0.47968945", "0.4792684", "0.4791647", "0.4777291", "0.4775169", "0.47696668", "0.47660887", "0.47641122", "0.4754087", "0.47512707", "0.4746274" ]
0.6382939
2
Checks if given file is an image based on mime type.
function is_image($file) { $type = get_image_type($file); $mime = get_image_mime_type($type); return substr($mime, 0, 5) == 'image'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isImage()\n {\n return strtolower(substr($this->getMimeType(), 0, 5)) == 'image';\n }", "public function isImage()\n {\n return str_contains($this->mimetype, 'image/');\n }", "public function isImage()\n {\n $mime_type = $this->getMimeType() ?: $this->detectMimeType();\n\n return (strpos($mime_type, 'image') === 0);\n }", "function checkimage($img)\r\n{\r\n $imageMimeTypes = array(\r\n 'image/png',\r\n 'image/gif',\r\n 'image/jpeg');\r\n\r\n $img = mime_content_type($img);\r\n $imgcheck = false;\r\n if (in_array ($img, $imageMimeTypes))\r\n {\r\n $imgcheck = true;\r\n }\r\n return $imgcheck;\r\n}", "public static function check($file){\n if(\\File::exists($file)){\n $mime = mime_content_type($file);\n if(substr($mime, 0, 5) == 'image') {\n // this is an image\n return true;\n }else{\n return false;\n }\n }else{\n return false;\n }\n }", "function file_is_image($filename) {\n return in_array(get_file_extension($filename), get_image_file_types());\n }", "public function isImage()\n\t{\n\t\treturn in_array($this->getMimetype(), $this->imagesMimeTypes);\n\t}", "public function checkImageType()\n {\n if (empty($this->checkImageType)) {\n return true;\n }\n\n if (('image' == substr($this->mediaType, 0, strpos($this->mediaType, '/')))\n || (!empty($this->mediaRealType)\n && 'image' == substr($this->mediaRealType, 0, strpos($this->mediaRealType, '/')))\n ) {\n if (!@getimagesize($this->mediaTmpName)) {\n $this->setErrors(\\XoopsLocale::E_INVALID_IMAGE_FILE);\n return false;\n }\n }\n return true;\n }", "public function is_image($mime)\n\t{\n\t\tee()->load->library('mime_type');\n\t\treturn ee()->mime_type->isImage($mime);\n\t}", "public static function isImage($file){\n if(is_file($file)){\n $info = getimagesize($file);\n if(isset($info) && $info[2] > 0)\n return true;\n }\n return false;\n }", "function is_file_an_image($filepath)\n{\n\t$a = getimagesize($filepath);\n\t$image_type = $a[2];\n\t \n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t return true;\n\t}\n\treturn false;\n}", "function isImage(string $filename) : bool {\n return (bool) preg_match(\"/(png|gif|jpg|jpeg)/\", pathinfo($filename, PATHINFO_EXTENSION));\n}", "function check_image_type($source_pic)\n{\n $image_info = check_mime_type($source_pic);\n\n switch ($image_info) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "function is_image($path)\n{\n\t$controle_type_mime_autorises = ['image/gif', 'image/jpeg', 'image/pjpeg', 'image/png'];\n\t$fichier_mime_type = mime_content_type($path);\n\t//echo $fichier_mime_type;\n\n\tif(in_array($fichier_mime_type, $controle_type_mime_autorises)){\n\t return TRUE;\n\t}else{\n\t return FALSE;\n\t}\n}", "public function isFileImage ($image) \n {\n if (!in_array(mime_content_type($image), ALLOWED_IMAGE_TYPES) ) {\n return false;\n }\n return true;\n }", "private function is_image( $extension = null, $mime_type = null )\n\t{\n\t\tif ( ! is_null($extension) ) {\n\t\t\t$image_extensions = array(\n\t\t\t\t'jpg',\n\t\t\t\t'jpeg',\n\t\t\t\t'gif',\n\t\t\t\t'png',\n\t\t\t\t'bmp',\n\t\t\t);\n\n\t\t\treturn in_array(strtolower($extension), $image_extensions) ? 'true' : 'false';\n\t\t} else if ( ! is_null($mime_type) ) {\n\t\t\t$mime_type_parts = explode('/', $body['ContentType']);\n\t\t\treturn ( strtolower(reset($mime_type_parts)) === 'image' ) ? 'true' : 'false';\n\t\t}\n\n\t\treturn false;\n\t}", "function isImage( $filepath, $arr_types=array( \".gif\", \".jpeg\", \".png\", \".bmp\" ) )\n\t{\n\t\tif(file_exists($filepath)) {\n\t\t\t$info = getimagesize($filepath);\n\t\t\t$ext = image_type_to_extension($info['2']);\n\t\t\treturn in_array($ext,$arr_types);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function is_image($path)\n{\n\t$a = getimagesize($path);\n\t$image_type = $a[2];\n\n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function testTypeImage($file)\n {\n $size = getimagesize($file);\n $is = '';\n\n switch ($size['mime']) {\n case \"image/gif\":\n $is = imagecreatefromgif($file);\n break;\n case \"image/jpeg\":\n $is = imagecreatefromjpeg($file);\n break;\n case \"image/png\":\n $is = imagecreatefrompng($file);\n break;\n }\n return $is;\n }", "function is_image( string $path ):bool\r\n {\r\n $a = getimagesize($path);\r\n $image_type = $a[2];\r\n\r\n if( in_array( $image_type , array( IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP) ) )\r\n {\r\n return true;\r\n }\r\n return false;\r\n }", "public function isImage() {\n\t\treturn MimeType::isImage($this);\n\t}", "function isImage(string $path): bool\n{\n $ext = getExtension($path);\n return ($ext === \"jpg\" || $ext === \"jpeg\" || $ext === \"png\");\n}", "function wp_is_file_image( $file ) {\n\tif ( @getimagesize( $file ) )\n\t\treturn true;\n\n\treturn false;\n\n}", "public function is_image()\n\t\t{\n\t\t\treturn !is_null($f = $this->format()) && $f;\n\t\t}", "public function isImage($file = '')\n\t{\n\t\treturn in_array(strtolower(File::extension($file)), array_merge($this->imageExtensions, ['svg']));\n\t}", "public function isTransformableImage() {\n // with support for only some file types, so it might be able to handle\n // PNG but not JPEG. Try to generate thumbnails for whatever we can. Setup\n // warns you if you don't have complete support.\n\n $matches = null;\n $ok = preg_match(\n '@^image/(gif|png|jpe?g)@',\n $this->getViewableMimeType(),\n $matches);\n if (!$ok) {\n return false;\n }\n\n switch ($matches[1]) {\n case 'jpg';\n case 'jpeg':\n return function_exists('imagejpeg');\n break;\n case 'png':\n return function_exists('imagepng');\n break;\n case 'gif':\n return function_exists('imagegif');\n break;\n default:\n throw new Exception(pht('Unknown type matched as image MIME type.'));\n }\n }", "public function isSupportedImage()\n\t{\n\t\t$mime = $this->getMimeType();\n\t\tif (in_array($mime, array('image/jpeg', 'image/gif', 'image/png')))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private function isValidImageType(string $file)\r\n {\r\n return in_array(pathinfo($file, PATHINFO_EXTENSION), $this->supported);\r\n }", "public function isImage( $contentType=null ) \r\n {\r\n if (empty($contentType)) {\r\n $contentType = $this->contentType;\r\n }\r\n \r\n if (empty($contentType)) \r\n {\r\n return false;\r\n }\r\n \r\n if (substr(strtolower($contentType), 0, 5) == \"image\") {\r\n return true;\r\n }\r\n \r\n return false;\r\n }", "function isImage($path) {\n global $CONFIG;\n return (is_file($path) && in_array(strtolower(pathinfo($path, PATHINFO_EXTENSION)), $CONFIG->extensions->images));\n}", "public function checkImageTrue($file)\n {\n $fileInfo = finfo_open(FILEINFO_MIME_TYPE);\n $mimeType = finfo_file($fileInfo, $file['tmp_name']);\n finfo_close($fileInfo);\n if(strpos($mimeType, 'image/') !== 0) {\n $this->alert->set('error', 'normal', 'main', \"Le fichier n'est pas une image.\");\n }\n return (strpos($mimeType, 'image/') !== 0)? false : true;\n }", "function check_image_type($ftype)\n{\n$ext = strtolower(end(explode('.',$ftype)));\n$img_array = array('jpeg','jpg','gif','png');\n\n//\tif($ftype == \"image/jpeg\" || $ftype == \"image/jpg\" || $ftype == \"image/gif\" || $ftype == \"image/png\" )\n\tif(in_array($ext,$img_array))\n\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n}", "protected function isImage($fileInfo)\n {\n // Maybe array with file info came in\n if (is_array($fileInfo)) {\n return strstr($fileInfo['type'], 'image/');\n }\n\n // File path came in - check the physical file\n if (!$this->rootDirectory->isReadable($this->rootDirectory->getRelativePath($fileInfo))) {\n return false;\n }\n $imageInfo = getimagesize($fileInfo);\n if (!$imageInfo) {\n return false;\n }\n return true;\n }", "function validate_picture_file($path) {\n $acceptableTypes = array(IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_GIF);\n $detectedType = exif_imagetype($path); // WARNING: This will only work if the\n // EXIF extension is enabled.\n return in_array($detectedType, $acceptableTypes);\n}", "function getImageTypeByFile($file)\n {\n if (is_file($file))\n {\n // file exists\n\n // get image type\n $info = getimagesize($file);\n $type = null; // set to null per default for unsupported types\n if ($info[2] == 1) $type = 'gif';\n if ($info[2] == 2) $type = 'jpg';\n if ($info[2] == 3) $type = 'png';\n\n // getimagesize cannot read type\n // fallback to getting type by file extension\n if ($type===null) $type = strtolower(substr($file,-3));\n\n return $type;\n }\n else\n {\n $this->error[] = 'InstantImage: file does not exist ('.$file.')';\n return false;\n }\n }", "function validateMimeType($file_name){\r\n // array of acceptable MIME types\r\n $mime_types = [\r\n 'image/png',\r\n 'image/jpeg'\r\n ];\r\n \r\n // determines MIME type\r\n $type = mime_content_type($file_name);\r\n \r\n // check if MIME type is in array of acceptable types\r\n return in_array($type, $mime_types, true);\r\n}", "public function isImage($ext=null){\n global $VALID_IMAGES;\n if (!$ext)\n $ext = $this->ext; \n return (in_Array( $ext, $VALID_IMAGES )); \n }", "function isImageType($tempFileName)\n{\n\t$isImage = true;\n\t\n\t// Check if image file is actual image type\n $check = exif_imagetype($tempFileName);\n\t\n if ($check === false) \n\t{\n $isImage = false;\n\t}\n\t\n\treturn $isImage;\n}", "public function isImage(){\n if($this->imageFileType != \"jpg\" && $this->imageFileType != \"png\" && $this->imageFileType != \"jpeg\"\n && $this->imageFileType != \"gif\" ) {\n echo \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.<br>\";\n $this->uploadOk = 0;\n }\n return $this->uploadOk;\n }", "public function test_supports_mime_type() {\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( null );\n\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/jpeg' ), 'Does not support image/jpeg' );\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/png' ), 'Does not support image/png' );\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/gif' ), 'Does not support image/gif' );\n\t}", "private function isValidImage() {\r\n\t\t\treturn in_array($this->extension, $this->extAllowed) ? true : false;\r\n\t\t}", "public static function detect($file)\n {\n if ($file instanceof File) {\n $file = $file->getPath();\n }\n if (file_exists($file) && is_file($file)) {\n return mime_content_type($file);\n }\n\n return false;\n }", "public function test_supports_mime_type() {\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( null );\n\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/jpeg' ), 'Does not support image/jpeg' );\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/png' ), 'Does not support image/png' );\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/gif' ), 'Does not support image/gif' );\n\t}", "function isSupportedType($type, $src_file) {\n if ($type !== \"jpg\" && $type !== \"jpeg\" && $type !== \"png\") {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Source file is not an image or image type is not supported.');\n }\n return true;\n }", "function validateTypeOfFile($type){\n\t$arrFile = ['image/png', 'image/jpg', 'image/jpeg', 'image/gif'];\n\tif(in_array($type, $arrFile)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function hasImage(): bool\n {\n return $this->hasImageType(\n $this->getMimeType()\n );\n }", "public function isValidImage()\n\t{\n\t\t$src = $this->source_path;\n\t\t$extension = \\strtolower(\\substr($src, (\\strrpos($src, '.') + 1)));\n\n\t\tif (!\\in_array($extension, $this->image_extensions)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$r = @\\imagecreatefromstring(\\file_get_contents($src));\n\n\t\treturn \\is_resource($r) && \\get_resource_type($r) === 'gd';\n\t}", "function checkType($type){\n\n $allowed = array('jpg', 'jpeg', 'png');\n $fileExt = explode('/', $type);\n $fileExt = strtolower(end($fileExt));\n return in_array($fileExt, $allowed) ? true : false ;\n\n }", "public static function isImage($data) : bool\n {\n return is_resource($data) and get_resource_type($data) === 'gd';\n }", "function isImage($path)\n {\n return is_array(getimagesize($path));\n }", "function validateFile($file){\n\n $check = getimagesize($file[\"tmp_name\"]);\n if($check !== false) {\n $err = \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n $err = \"File is not an image.\";\n $uploadOk = 0;\n }\n// Allow certain file formats\nif($file[\"type\"] != \"jpg\" && $file[\"type\"] != \"png\" && $file[\"type\"] != \"jpeg\"\n&& $file[\"type\"] != \"gif\" ) {\n $err = \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n $uploadOk = 0;\n}\n return ($uploadOk==1)? true : false;\n}", "function file_is_an_image($temporary_path, $new_path)\n {\n $allowed_mime_types = ['image/gif', 'image/jpeg', 'image/png'];\n $allowed_file_extensions = ['gif', 'jpg', 'jpeg', 'png'];\n\n $actual_file_extension = pathinfo($new_path, PATHINFO_EXTENSION);\n $actual_mime_type = getimagesize($temporary_path)['mime'];\n\n $file_extension_is_valid = in_array($actual_file_extension, $allowed_file_extensions);\n $mime_type_is_valid = in_array($actual_mime_type, $allowed_mime_types);\n\n return $file_extension_is_valid && $mime_type_is_valid;\n }", "protected function is_valid_image_file($file_path) {\n \treturn false;\n }", "function file_is_valid_image($path)\n {\n }", "public static function isImage($route)\r\n {\r\n $extensions = array('.png', '.gif', '.jpg', '.jpeg');\r\n $extension = self::getExtension($route);\r\n \r\n return in_array($extension, $extensions);\r\n }", "function check_image_type_array($source_pic)\n{\n switch ($source_pic) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "public function IsImage($CheckMimeType=false) {\n\n $ImageExtensions= array('jpg', 'jpe', 'jpeg', 'gif', 'png');\n if (!in_array(strtolower($this->GetExtension()), $ImageExtensions)) {\n return false;\n }\n if ($CheckMimeType) {\n $MimeTypes= array('image/jpeg', 'image/gif', 'image/png');\n if (!in_array($this->GetMimeType(), $MimeTypes)) {\n return false;\n }\n }\n return true;\n }", "public static function supports_mime_type( $mime_type )\n {\n return in_array( $mime_type, [\n 'image/gif',\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/vnd.wap.wbmp',\n ] );\n }", "public function imageCheck($extension)\n {\n $allowedTypes = [\n 'image/gif',\n 'image/jpg',\n 'image/png',\n 'image/bmp',\n 'image/jpeg',\n 'image/x-icon'\n ];\n\n return in_array($extension, $allowedTypes);\n }", "public function isPNG( $filePath ){\n $mime = mime_content_type($filePath);\n return ( $mime === 'image/png' );\n }", "function Is_image($filename){\n \n $size = getimagesize($filename);\nif($size==FALSE){\n $er=FALSE; \n\n}else{\n $er=TRUE; \n}\nreturn $er;\n}", "private function checkSourceMimeType()\n {\n $fileMimeType = $this->getMimeTypeOfSource();\n if (is_null($fileMimeType)) {\n throw new InvalidImageTypeException('Image type could not be detected');\n } elseif ($fileMimeType === false) {\n throw new InvalidImageTypeException('File seems not to be an image.');\n } elseif (!in_array($fileMimeType, self::$allowedMimeTypes)) {\n throw new InvalidImageTypeException('Unsupported mime type: ' . $fileMimeType);\n }\n }", "protected function isImage(Media $media)\n {\n return (new ImageGenerator())->canHandleMime($media->mime_type);\n }", "public static function fromFile($file) {\n\t\tif (!is_file($file)) {\n\t\t\tthrow new \\InvalidArgumentException(\"File '\" . $file . \"' not found.\");\n\t\t}\n\n\t\t$info = @getimagesize($file); // @ - files smaller than 12 bytes causes read error\n\t\tif (isset($info['mime'])) {\n\t\t\treturn $info['mime'];\n\n\t\t} elseif (extension_loaded('fileinfo')) {\n\t\t\t$type = preg_replace('#[\\s;].*\\z#', '', finfo_file(finfo_open(FILEINFO_MIME), $file));\n\n\t\t} elseif (function_exists('mime_content_type')) {\n\t\t\t$type = mime_content_type($file);\n\t\t}\n\n\t\treturn isset($type) && preg_match('#^\\S+/\\S+\\z#', $type)\n\t\t\t? $type : 'application/octet-stream';\n\t}", "public static function supports_mime_type( $mime_type ) {\n\t\t$image_types = imagetypes();\n\t\tswitch( $mime_type ) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\treturn ($image_types & IMG_JPG) != 0;\n\t\t\tcase 'image/png':\n\t\t\t\treturn ($image_types & IMG_PNG) != 0;\n\t\t\tcase 'image/gif':\n\t\t\t\treturn ($image_types & IMG_GIF) != 0;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isImage(){\n if(isset($_POST[\"submit\"])) {\n $check = getimagesize($_FILES[\"fileToUpload\"][\"tmp_name\"]);\n if($check !== false) {\n echo \"File is an image - \" . $check[\"mime\"] . \".<br>\";\n $this->uploadOk = 1;\n } else {\n echo \"File is not an image.<br>\";\n $this->uploadOk = 0;\n }\n }\n return $this->uploadOk;\n }", "function check_image_type(&$type, &$error, &$error_msg)\n{\n\tglobal $lang;\n\n\tswitch( $type )\n\t{\n\t\tcase 'jpeg':\n\t\tcase 'pjpeg':\n\t\tcase 'jpg':\n\t\t\treturn '.jpg';\n\t\t\tbreak;\n\t\tcase 'gif':\n\t\t\treturn '.gif';\n\t\t\tbreak;\n\t\tcase 'png':\n\t\t\treturn '.png';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$error = true;\n\t\t\t$error_msg = (!empty($error_msg)) ? $error_msg . '<br />' . $lang['Avatar_filetype'] : $lang['Avatar_filetype'];\n\t\t\tbreak;\n\t}\n\n\treturn false;\n}", "private function isImage($url)\n {\n $pos = strrpos($url, '.');\n if ($pos === false) {\n return false;\n }\n\n\n $ext = explode(\"?\",strtolower(trim(substr($url, $pos))))[0];\n\n $imgExts = [\n '.gif',\n '.jpg',\n '.jpeg',\n '.png',\n '.tiff',\n '.tif',\n ];\n\n // this is far from complete but that's always going to be the case...\n if (in_array($ext, $imgExts)) {\n return true;\n }\n\n return false;\n }", "function checkimagetype($imagetype){\n\n\t\t$filetype = array(\n\t\t 'image/bmp', \n\t\t 'image/gif', \n\t\t 'image/icon', \n\t\t 'image/jpeg',\n\t\t 'image/jpg', \n\t\t 'image/png', \n\t\t 'image/tiff', \n\t\t );\n if( in_array($imagetype,$filetype))\n\t\t\treturn true;\n\t\telse \n\t\t\treturn 0;\n\n}", "public function imageCheck($extension)\n {\n $allowedTypes = $this->imageTypes;\n return in_array($extension, $allowedTypes);\n }", "function isImage($filename) {\n \tglobal $synAbsolutePath;\n if (file_exists($synAbsolutePath.$filename)) {\n if (getimagesize($synAbsolutePath.$filename)!==false) $ret=true;\n else $ret=false;\n } else $ret=false;\n return $ret;\n }", "function exif_imagetype( $filename ) {\n\t\tif ( ! is_dir( $filename ) && ( list( $width, $height, $type, $attr ) = getimagesize( $filename ) ) !== false ) {\n\t\t\treturn $type;\n\t\t}\n\n\t\treturn false;\n\t}", "function is_editable_image($file_path, $mime)\n\t{\n\t\tif ( ! $this->is_image($mime))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif (function_exists('getimagesize'))\n\t\t{\n\t\t\tif (FALSE === @getimagesize($file_path))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function testIsImageFile()\n {\n $this->assertTrue(Tinebase_ImageHelper::isImageFile($this->_testImagePath));\n $this->assertFalse(Tinebase_ImageHelper::isImageFile(__FILE__));\n }", "function check_file_type($source)\n{\n $file_info = check_mime_type($source);\n\n switch ($file_info) {\n case 'application/pdf':\n return true;\n break;\n\n case 'application/msword':\n return true;\n break;\n\n case 'application/rtf':\n return true;\n break;\n case 'application/vnd.ms-excel':\n return true;\n break;\n\n case 'application/vnd.ms-powerpoint':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.text':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.spreadsheet':\n return true;\n break;\n \n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n return true;\n break;\n\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return true;\n break;\n \n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "public static function isImage($source)\n {\n return getimagesize($source);\n }", "public function checkMimeType()\n {\n if (empty($this->mediaRealType) && empty($this->allowUnknownTypes)) {\n $this->setErrors(\\XoopsLocale::E_FILE_TYPE_REJECTED);\n return false;\n }\n\n if ((!empty($this->allowedMimeTypes)\n && !in_array($this->mediaRealType, $this->allowedMimeTypes))\n || (!empty($this->deniedMimeTypes)\n && in_array($this->mediaRealType, $this->deniedMimeTypes))\n ) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_FILE_MIME_TYPE_NOT_ALLOWED, $this->mediaType));\n return false;\n }\n return true;\n }", "function _mime_content_type($filename) {\n if (!file_exists($filename) || !is_readable($filename)) return false;\n if(class_exists('finfo')){\n $result = new finfo();\n if (is_resource($result) === true) {\n return $result->file($filename, FILEINFO_MIME_TYPE);\n }\n }\n \n // Trying finfo\n if (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimeType = finfo_file($finfo, $filename);\n finfo_close($finfo);\n // Mimetype can come in text/plain; charset=us-ascii form\n if (strpos($mimeType, ';')) list($mimeType,) = explode(';', $mimeType);\n return $mimeType;\n }\n \n // Trying mime_content_type\n if (function_exists('mime_content_type')) {\n return mime_content_type($filename);\n }\n \n\n // Trying to get mimetype from images\n $imageData = getimagesize($filename);\n if (!empty($imageData['mime'])) {\n return $imageData['mime'];\n }\n // Trying exec\n if (function_exists('exec')) {\n $mimeType = exec(\"/usr/bin/file -i -b $filename\");\n if(strpos($mimeType,';')){\n $mimeTypes = explode(';',$mimeType);\n return $mimeTypes[0];\n }\n if (!empty($mimeType)) return $mimeType;\n }\n return false;\n }", "public function isAllowedMIMEType()\n {\n if (!empty($this->allowed_upload_mime_type)) {\n if (!is_array($this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(MIME_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['type'], $this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_MIME_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }", "function isPic($type){\r\n\t//1 = GIF,2 = JPG,3 = PNG,4 = SWF,5 = PSD,6 = BMP,7 = TIFF(intel byte order),8 = TIFF(motorola byte order),9 = JPC,10 = JP2,11 = JPX,12 = JB2,13 = SWC,14 = IFF,15 = WBMP,16 = XBM;\r\n\tswitch($type){\r\n\tcase 1: case 2: case 3: case 7: case 8:\r\n\t\treturn true;\r\n\tdefault:\r\n\t\treturn false;\r\n\t}\r\n}", "protected function checkTrueImg()\n {\n\n if($this->imgFlag){\n\n if(!getimagesize($this->fileInfo['tmp_name'])){\n\n $this->error = 'The file is not image.';\n\n return false;\n\n }\n\n }\n\n return true;\n\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}", "public function isRasterImage($file = '')\n\t{\n\t\treturn in_array(strtolower(File::extension($file)), $this->imageExtensions);\n\t}", "public static function isPngFile($filename)\n {\n try {\n $image = new ImageFile($filename);\n if (strtolower($image->getMime()) !== @image_type_to_mime_type(IMAGETYPE_PNG)) {\n return false;\n }\n\n return true;\n } catch (\\RuntimeException $ex) {\n return false;\n }\n }", "protected function _validateMimeType()\n\t{\n\t\t$this->_fileType = \\MimeType\\MimeType::getType($this->getFilePath());\n\n\t\tif (!in_array($this->_fileType, $this->_allowedMimeType)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function isImage( $url ){\r\n $pos = strrpos( $url, \".\");\r\n if ($pos === false)\r\n return false;\r\n $ext = strtolower(trim(substr( $url, $pos)));\r\n $imgExts = array(\".gif\", \".jpg\", \".jpeg\", \".png\", \".tiff\", \".tif\"); // this is far from complete but that's always going to be the case...\r\n if ( in_array($ext, $imgExts) )\r\n return true;\r\nreturn false;\r\n}", "public function checkFormatAllowed() {\n\t\t$imageFileType = pathinfo(basename($this->value[\"name\"]),PATHINFO_EXTENSION);\n\t\tif((($this->extension == \"\") && ($imageFileType == \"jpg\" || $imageFileType == \"png\" || $imageFileType == \"jpeg\"\n\t\t|| $imageFileType == \"gif\")) || ($this->extension == \"pdf\" && $imageFileType == \"pdf\" )) {\n\t\t return true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isImage() {\n return $this->_is_image;\n }", "private function isFileViewableImage($filename)\n {\n $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));\n $viewableExtensions = array(\"jpeg\", \"jpg\", \"gif\", \"png\");\n return in_array($ext, $viewableExtensions);\n }", "public static function post_image_validation($type,$size){\n\t\t\t$check_type = Posts_image::get_image_type($type);\n\t\t\t$check_size = $size;\n\t\t\t$check_ext = Posts_image::get_image_ext($type);\n\t\t\t\n\t\t\tif($check_type !== \"image\"){\n\t\t\t\tself::$_errors['imagetype'] = \"Your file must be image.\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif($check_ext !== \".jpg\" && $check_ext !== \".png\" && $check_ext !== \".gif\"){\n\t\t\t\tself::$_errors['imageext'] = \"Only <b>JPG, PNG and GIF</b> format are allowed.\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif($check_size > 4000000){\n\t\t\t\tself::$_errors['imagesize'] = \"Image can't be larger then 4MB.\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif(empty(self::$_errors)){return true;}else{return false;}\n\t\t\t\n\t\t}", "function getValidMimeImageType($mime)\n{\n\t// These are the only valid image types.\n\t$validImageTypes = array(\n\t\t-1 => 'jpg',\n\t\t// Starting from here are the IMAGETYPE_* constants\n\t\tIMAGETYPE_GIF => 'gif',\n\t\tIMAGETYPE_JPEG => 'jpeg',\n\t\tIMAGETYPE_PNG => 'png',\n\t\tIMAGETYPE_PSD => 'psd',\n\t\tIMAGETYPE_BMP => 'bmp',\n\t\tIMAGETYPE_TIFF_II => 'tiff',\n\t\tIMAGETYPE_TIFF_MM => 'tiff',\n\t\tIMAGETYPE_JPC => 'jpeg',\n\t\tIMAGETYPE_IFF => 'iff',\n\t\tIMAGETYPE_WBMP => 'bmp',\n\t\tIMAGETYPE_WEBP => 'webp'\n\t);\n\n\t$ext = (int) $mime > 0 && isset($validImageTypes[(int) $mime]) ? $validImageTypes[(int) $mime] : '';\n\tif (empty($ext))\n\t{\n\t\t$ext = strtolower(trim(substr($mime, strpos($mime, '/')), '/'));\n\t}\n\n\treturn in_array($ext, $validImageTypes) ? 'image/' . $ext : '';\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 }", "public static function isSupportedImageType($internetMediaType) {\n $types = explode('/', $internetMediaType);\n if (count($types) == 2) { //if valid MIME type...\n if (strtolower($types[0]) == 'image') { //if image MIME type...\n if (preg_match('/^PJPE?G$|^JPE?G$|^GIF$|^PNG|^BMP$/i', $types[1])) { //if PJP(E)G, JP(E)G, GIF, PNG, BMP...\n return true;\n }\n }\n }\n return false;\n }", "public static function checkImage($image)\n {\n jimport('joomla.filesystem.file');\n jimport('joomla.filesystem.folder');\n $mimes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png');\n //get mime type\n $mime = getimagesize($image);\n $mime = $mime ['mime'];\n\n $extensions = array('jpg','jpeg','png','gif');\n $extension = strtolower(pathinfo($image, PATHINFO_EXTENSION));\n\n if (in_array($extension, $extensions) and in_array($mime, $mimes))\n return TRUE;\n else\n JFile::delete($image);\n return 'application/octet-stream';\n }", "public function checkFile($filename){\n $ext = substr($filename, strrpos($filename, '.') + 1);\n if($ext==\"jpg\"||$ext==\"png\"||$ext==\"svg\"||$ext==\"jpeg\"){\n return true;\n }else{\n return false;\n }\n }", "function checkImg(){\n global $postpath;\n return getimagesize($postpath) !== false;\n }", "function file_is_displayable_image($path)\n {\n }", "public function getImageType($file) {\n\t\t$info = getimagesize($file);\n\t\tswitch ($info['mime']) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$type = 'jpg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$type = 'png';\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$type = 'gif';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->errorMessage = sprintf('Image file \"%s\" has an unknown or unsupported image file type (%s)', $file, $info['mime']);\n\t\t\t\t$type = null;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $type;\n\t}", "protected function isExternalImage() {}", "public function checkFileType($fileType){\n \t\tif ($fileType == \"application/octet-stream\"){\n \t\t\treturn true;\n \t\t}else{\n \t\t\treturn false;\n \t\t}\n \t}" ]
[ "0.7998941", "0.798145", "0.7931971", "0.78337795", "0.7780923", "0.77540976", "0.77496356", "0.77299255", "0.77058524", "0.76602066", "0.76510376", "0.7542194", "0.75233656", "0.74584746", "0.7403115", "0.73764265", "0.737469", "0.7367184", "0.7351188", "0.7326479", "0.73247784", "0.7297999", "0.7269653", "0.7238605", "0.7236881", "0.72265375", "0.71807766", "0.7122746", "0.7079779", "0.7056735", "0.7010651", "0.7009699", "0.69906366", "0.698692", "0.6947725", "0.69330496", "0.6932095", "0.6925217", "0.6912031", "0.68929654", "0.68800974", "0.68641424", "0.6832439", "0.68230826", "0.6807902", "0.6796375", "0.6756373", "0.6714083", "0.6706035", "0.6705532", "0.6693253", "0.6652899", "0.6646294", "0.66414046", "0.6600235", "0.65976346", "0.65833867", "0.6578572", "0.65752363", "0.65666616", "0.6566194", "0.6554049", "0.65364295", "0.653347", "0.6531219", "0.6510075", "0.6498359", "0.64930785", "0.64864725", "0.6471802", "0.647029", "0.6424932", "0.64197856", "0.63772583", "0.637321", "0.636143", "0.6352801", "0.63418597", "0.6315011", "0.63113284", "0.6306607", "0.629347", "0.62898624", "0.6288522", "0.62867004", "0.62343127", "0.623134", "0.62167346", "0.62148833", "0.6209777", "0.6204873", "0.6204803", "0.6199101", "0.61988217", "0.6194287", "0.617204", "0.6146976", "0.61359465", "0.6135479", "0.6134797" ]
0.83122104
0
Are we on the WordPress Settings API save page? DO NOT USE filter_input here. There seems to be a PHP bug that on some systems prevents filter_input to work for INPUT_SERVER and INPUT_ENV.
function is_options_save_page() { $self = $_SERVER['PHP_SELF']; $request = $_SERVER['REQUEST_URI']; return stripos($self, 'options.php') !== false || stripos($request, 'options.php') !== false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ffw_port_settings_sanitize( $input = array() ) {\n\n global $ffw_port_settings;\n\n parse_str( $_POST['_wp_http_referer'], $referrer );\n\n $output = array();\n $settings = ffw_port_get_registered_settings();\n $tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';\n $post_data = isset( $_POST[ 'ffw_port_settings_' . $tab ] ) ? $_POST[ 'ffw_port_settings_' . $tab ] : array();\n\n $input = apply_filters( 'ffw_port_settings_' . $tab . '_sanitize', $post_data );\n\n // Loop through each setting being saved and pass it through a sanitization filter\n foreach( $input as $key => $value ) {\n\n // Get the setting type (checkbox, select, etc)\n $type = isset( $settings[ $key ][ 'type' ] ) ? $settings[ $key ][ 'type' ] : false;\n\n if( $type ) {\n // Field type specific filter\n $output[ $key ] = apply_filters( 'ffw_port_settings_sanitize_' . $type, $value, $key );\n }\n\n // General filter\n $output[ $key ] = apply_filters( 'ffw_port_settings_sanitize', $value, $key );\n }\n\n\n // Loop through the whitelist and unset any that are empty for the tab being saved\n if( ! empty( $settings[ $tab ] ) ) {\n foreach( $settings[ $tab ] as $key => $value ) {\n\n // settings used to have numeric keys, now they have keys that match the option ID. This ensures both methods work\n if( is_numeric( $key ) ) {\n $key = $value['id'];\n }\n\n if( empty( $_POST[ 'ffw_port_settings_' . $tab ][ $key ] ) ) {\n unset( $ffw_port_settings[ $key ] );\n }\n\n }\n }\n\n // Merge our new settings with the existing\n $output = array_merge( $ffw_port_settings, $output );\n\n // @TODO: Get Notices Working in the backend.\n add_settings_error( 'ffw_port-notices', '', __( 'Settings Updated', 'ffw_port' ), 'updated' );\n\n return $output;\n\n}", "function is_settings() {\n\t\t\t\tglobal $pagenow;\n\t\t\t\treturn is_admin() && $pagenow == $this->settings_parent && $_GET['page'] == $this->slug;\n\t\t\t}", "function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }", "public function sanitize_setting_filter( $input ) {\n\t\treturn $input;\n\t}", "function bdpp_validate_settings( $input ) {\n\t\n\tglobal $bdpp_options;\n\t\n\tif ( empty( $_POST['_wp_http_referer'] ) ) {\n\t\treturn $input;\n\t}\n\t\n\t$input = $input ? $input : array();\n\t\n\tparse_str( $_POST['_wp_http_referer'], $referrer );\n\t$tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';\n\t\n\t// Sanitize filter according to tab\n\tif( $tab ) {\n\t\t$input = apply_filters( 'bdpp_validate_settings_' . $tab, $input );\n\t}\n\t\n\t// General sanitize filter\n\t$input = apply_filters( 'bdpp_validate_settings', $input );\n\t\n\t// Merge our new settings with the existing\n\t$output = array_merge( $bdpp_options, $input );\n\n\tdo_action( 'bdpp_validate_settings', $input, $tab );\n\tdo_action( 'bdpp_validate_common_settings', $input, $tab, 'bdpp' );\n\n\treturn $output;\n}", "public function is_plugin_settings() {\n\n\t\treturn isset( $_GET['page'], $_GET['tab'] ) && 'wc-settings' === $_GET['page'] && 'pip' === $_GET['tab'];\n\t}", "public function sanitize_module_input( $input ) {\n\n\t\tglobal $itsec_globals;\n\n\t\t//Process hide backend settings\n\t\t$input['enabled'] = ( isset( $input['enabled'] ) && intval( $input['enabled'] == 1 ) ? true : false );\n\t\t$input['theme_compat'] = ( isset( $input['theme_compat'] ) && intval( $input['theme_compat'] == 1 ) ? true : false );\n\t\t$input['show-tooltip'] = ( isset( $this->settings['show-tooltip'] ) ? $this->settings['show-tooltip'] : false );\n\n\t\tif ( isset( $input['slug'] ) ) {\n\n\t\t\t$input['slug'] = sanitize_title( $input['slug'] );\n\n\t\t} else {\n\n\t\t\t$input['slug'] = 'wplogin';\n\n\t\t}\n\n\t\tif ( isset( $input['post_logout_slug'] ) ) {\n\n\t\t\t$input['post_logout_slug'] = sanitize_title( $input['post_logout_slug'] );\n\n\t\t} else {\n\n\t\t\t$input['post_logout_slug'] = '';\n\n\t\t}\n\n\t\tif ( $input['slug'] != $this->settings['slug'] && $input['enabled'] === true ) {\n\t\t\tadd_site_option( 'itsec_hide_backend_new_slug', $input['slug'] );\n\t\t}\n\n\t\tif ( isset( $input['register'] ) && $input['register'] !== 'wp-register.php' ) {\n\t\t\t$input['register'] = sanitize_title( $input['register'] );\n\t\t} else {\n\t\t\t$input['register'] = 'wp-register.php';\n\t\t}\n\n\t\tif ( isset( $input['theme_compat_slug'] ) ) {\n\t\t\t$input['theme_compat_slug'] = sanitize_title( $input['theme_compat_slug'] );\n\t\t} else {\n\t\t\t$input['theme_compat_slug'] = 'not_found';\n\t\t}\n\n\t\t$forbidden_slugs = array( 'admin', 'login', 'wp-login.php', 'dashboard', 'wp-admin', '' );\n\n\t\tif ( in_array( trim( $input['slug'] ), $forbidden_slugs ) && $input['enabled'] === true ) {\n\n\t\t\t$invalid_login_slug = true;\n\n\t\t\t$type = 'error';\n\t\t\t$message = __( 'Invalid hide login slug used. The login url slug cannot be \\\"login,\\\" \\\"admin,\\\" \\\"dashboard,\\\" or \\\"wp-login.php\\\" or \\\"\\\" (blank) as these are use by default in WordPress.', 'it-l10n-ithemes-security-pro' );\n\n\t\t\tadd_settings_error( 'itsec', esc_attr( 'settings_updated' ), $message, $type );\n\n\t\t} else {\n\n\t\t\t$invalid_login_slug = false;\n\n\t\t}\n\n\t\tif ( $invalid_login_slug === false ) {\n\n\t\t\tif (\n\t\t\t\t! isset( $type ) &&\n\t\t\t\t(\n\t\t\t\t\t$input['slug'] !== $this->settings['slug'] ||\n\t\t\t\t\t$input['register'] !== $this->settings['register'] ||\n\t\t\t\t\t$input['enabled'] !== $this->settings['enabled']\n\t\t\t\t) ||\n\t\t\t\tisset( $itsec_globals['settings']['write_files'] ) && $itsec_globals['settings']['write_files'] === true\n\t\t\t) {\n\n\t\t\t\tadd_site_option( 'itsec_rewrites_changed', true );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( is_multisite() ) {\n\n\t\t\tif ( isset( $type ) ) {\n\n\t\t\t\t$error_handler = new WP_Error();\n\n\t\t\t\t$error_handler->add( $type, $message );\n\n\t\t\t\t$this->core->show_network_admin_notice( $error_handler );\n\n\t\t\t} else {\n\n\t\t\t\t$this->core->show_network_admin_notice( false );\n\n\t\t\t}\n\n\t\t\t$this->settings = $input;\n\n\t\t}\n\n\t\treturn $input;\n\n\t}", "public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] &&\n\t\t isset( $_GET['tab'] ) && 'products' === $_GET['tab'] &&\n\t\t isset( $_GET['section'] ) && 'inventory' === $_GET['section'];\n\t}", "function wp_check_site_meta_support_prefilter($check)\n {\n }", "public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) &&\n\t\t\t'wc-settings' == $_GET['page'] &&\n\t\t\tisset( $_GET['tab'] ) &&\n\t\t\t'tax' == $_GET['tab'] &&\n\t\t\tisset( $_GET['section'] ) &&\n\t\t\t'avatax' == $_GET['section'];\n\t}", "public function save_settings() {\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-settings' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'vfb_settings' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tcheck_admin_referer( 'vfb-update-settings' );\n\n\t\t$data = array();\n\n\t\tforeach ( $_POST['vfb-settings'] as $key => $val ) {\n\t\t\t$data[ $key ] = esc_html( $val );\n\t\t}\n\n\t\tupdate_option( 'vfb-settings', $data );\n\t}", "public function sanitize_module_input( $input ) {\n\n\t\t$input['enabled'] = ( isset( $input['enabled'] ) && intval( $input['enabled'] == 1 ) ? true : false );\n\n\t\tif ( is_multisite() ) {\n\n\t\t\t$this->core->show_network_admin_notice( false );\n\n\t\t\t$this->settings = $input;\n\n\t\t}\n\n\t\treturn $input;\n\n\t}", "function gssettings_sanitize_inputs() {\n genesis_add_option_filter( 'one_zero', GSSETTINGS_SETTINGS_FIELD, array( 'gssettings_move_primary_nav', 'gssettings_move_subnav' ) );\n }", "public function save_settings() {\n\n if (!isset($_REQUEST['action']) || !isset($_GET['page']))\n return;\n\n if ('swpm-settings' !== $_GET['page'])\n return;\n\n if ('swpm_settings' !== $_REQUEST['action'])\n return;\n\n check_admin_referer('swpm-update-settings');\n\n $data = array();\n\n foreach ($_POST['swpm-settings'] as $key => $val) {\n $data[$key] = esc_html($val);\n }\n\n update_option('swpm-settings', $data);\n }", "function bdpp_validate_general_settings( $input ) {\n\n\t$input['post_types'] = isset( $input['post_types'] ) ? bdpp_clean( $input['post_types'] ) : array();\n\n\t// check default post type\n\tif( ! in_array('post', $input['post_types']) ) {\n\t\t$input['post_types'][] = 'post';\n\t}\n\n\treturn $input;\n}", "public function security_check() {\n\t\t\tif ( current_user_can( 'activate_plugins' ) ) {\n\t\t\t\t//Conditionally adding the function for database context for \n\t\t\t\tadd_filter( 'clean_url', array( $this, 'save_shortcode' ), 99, 3 );\n\t\t\t}\n\t\t}", "function sanitised() {\n\t$sanitised = true;\n\n\tif (!file_exists(dirname(dirname(__FILE__)) . \"/settings.php\")) {\n\t\t// See if we are being asked to save the file\n\t\t$save_vars = get_input('db_install_vars');\n\t\t$result = \"\";\n\t\tif ($save_vars) {\n\t\t\t$rtn = db_check_settings($save_vars['CONFIG_DBUSER'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBPASS'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBNAME'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBHOST'] );\n\t\t\tif ($rtn == FALSE) {\n\t\t\t\tregister_error(elgg_view(\"messages/sanitisation/dbsettings_error\"));\n\t\t\t\tregister_error(elgg_view(\"messages/sanitisation/settings\",\n\t\t\t\t\t\t\t\tarray(\t'settings.php' => $result,\n\t\t\t\t\t\t\t\t\t\t'sticky' => $save_vars)));\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$result = create_settings($save_vars, dirname(dirname(__FILE__)) . \"/settings.example.php\");\n\n\n\t\t\tif (file_put_contents(dirname(dirname(__FILE__)) . \"/settings.php\", $result)) {\n\t\t\t\t// blank result to stop it being displayed in textarea\n\t\t\t\t$result = \"\";\n\t\t\t}\n\t\t}\n\n\t\t// Recheck to see if the file is still missing\n\t\tif (!file_exists(dirname(dirname(__FILE__)) . \"/settings.php\")) {\n\t\t\tregister_error(elgg_view(\"messages/sanitisation/settings\", array('settings.php' => $result)));\n\t\t\t$sanitised = false;\n\t\t}\n\t}\n\n\tif (!file_exists(dirname(dirname(dirname(__FILE__))) . \"/.htaccess\")) {\n\t\tif (!@copy(dirname(dirname(dirname(__FILE__))) . \"/htaccess_dist\", dirname(dirname(dirname(__FILE__))) . \"/.htaccess\")) {\n\t\t\tregister_error(elgg_view(\"messages/sanitisation/htaccess\", array('.htaccess' => file_get_contents(dirname(dirname(dirname(__FILE__))) . \"/htaccess_dist\"))));\n\t\t\t$sanitised = false;\n\t\t}\n\t}\n\n\treturn $sanitised;\n}", "private function _validate_settings()\n\t{\n\n\t\treturn TRUE;\n\t}", "public function save_settings()\n {\n if(isset($_POST) && isset($_POST['api_settings'])) {\n $data = $_POST['api_settings'];\n update_option('api_settings', json_encode($data));\n }\n }", "function handle_opt_in_form() {\n\tif ( isset( $_POST['altis_telemetry_opt_in'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( true );\n\t}\n\tif ( isset( $_POST['altis_telemetry_opt_out'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( false );\n\t}\n}", "function ghactivity_settings_validate( $input ) {\n\t$input['username'] = sanitize_text_field( $input['username'] );\n\t$input['access_token'] = sanitize_key( $input['access_token'] );\n\t$input['display_private'] = (bool) $input['display_private'];\n\t$input['repos'] = sanitize_text_field( $input['repos'] );\n\treturn $input;\n}", "function wp_is_ini_value_changeable($setting)\n {\n }", "public static function sanitize() {\n\n $new_input = self::get_options();\n $default_options = self::default_options();\n $parts = parse_url($_POST['_wp_http_referer']);\n parse_str($parts['query'], $query);\n $tab = (array_key_exists('tab', $query)) ? $query['tab'] : 'general';\n\n switch ($tab) {\n case 'general':\n default:\n $new_input['cris_org_nr'] = isset($_POST[self::option_name]['cris_org_nr']) ? sanitize_text_field($_POST[self::option_name]['cris_org_nr']) : 0;\n break;\n\n case 'layout':\n $new_input['cris_pub_order'] = isset($_POST[self::option_name]['cris_pub_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_pub_order'])) : $default_options['cris_pub_order'];\n $new_input['cris_pub_subtypes_order'] = isset($_POST[self::option_name]['cris_pub_subtypes_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_pub_subtypes_order'])) : $default_options['cris_pub_subtypes_order'];\n $new_input['cris_univis'] = in_array($_POST[self::option_name]['cris_univis'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_univis'] : $default_options['cris_univis'];\n $new_input['cris_bibtex'] = isset($_POST[self::option_name]['cris_bibtex']) ? 1 : 0;\n $new_input['cris_url'] = isset($_POST[self::option_name]['cris_url']) ? 1 : 0;\n $new_input['cris_doi'] = isset($_POST[self::option_name]['cris_doi']) ? 1 : 0;\n $new_input['cris_oa'] = isset($_POST[self::option_name]['cris_oa']) ? 1 : 0;\n $new_input['cris_name_order_plugin'] = (isset($_POST[self::option_name]['cris_name_order_plugin'])\n && $_POST[self::option_name]['cris_name_order_plugin'] == 'lastname-firstname') ? 'lastname-firstname' : 'firstname-lastname';\n $new_input['cris_award_order'] = isset($_POST[self::option_name]['cris_award_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_award_order'])) : $default_options['cris_award_order'];\n $new_input['cris_award_link'] = in_array($_POST[self::option_name]['cris_award_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_award_link'] : $default_options['cris_award_link'];\n $new_input['cris_fields_num_pub'] = isset($_POST[self::option_name]['cris_fields_num_pub']) ? sanitize_text_field($_POST[self::option_name]['cris_fields_num_pub']) : 0;\n\t $new_input['cris_field_link'] = in_array($_POST[self::option_name]['cris_field_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_field_link'] : $default_options['cris_field_link'];\n\t $new_input['cris_project_order'] = isset($_POST[self::option_name]['cris_project_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_project_order'])) : $default_options['cris_project_order'];\n $new_input['cris_project_link'] = in_array($_POST[self::option_name]['cris_project_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_project_link'] : $default_options['cris_project_link'];\n $new_input['cris_patent_order'] = isset($_POST[self::option_name]['cris_patent_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_patent_order'])) : $default_options['cris_patent_order'];\n $new_input['cris_patent_link'] = in_array($_POST[self::option_name]['cris_patent_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_patent_link'] : $default_options['cris_patent_link'];\n $new_input['cris_activities_order'] = isset($_POST[self::option_name]['cris_activities_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_activities_order'])) : $default_options['cris_activities_order'];\n $new_input['cris_activities_link'] = in_array($_POST[self::option_name]['cris_activities_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_activities_link'] : $default_options['cris_activities_link'];\n $new_input['cris_standardizations_order'] = isset($_POST[self::option_name]['cris_standardizations_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_standardizations_order'])) : $default_options['cris_standardizations_order'];\n $new_input['cris_standardizations_link'] = in_array($_POST[self::option_name]['cris_standardizations_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_standardizations_link'] : $default_options['cris_standardizations_link'];\n break;\n case 'sync':\n $new_input['cris_sync_check'] = isset($_POST[self::option_name]['cris_sync_check']) ? 1 : 0;\n if(is_array($_POST[self::option_name]['cris_sync_shortcode_format'])) {\n /*foreach ($_POST[self::option_name]['cris_sync_shortcode_format'] as $_check){\n foreach ($_check as $_k => $_v) {\n $new_input['cris_sync_shortcode_format'][$_k] = $_v;\n }\n }*/\n $new_input['cris_sync_shortcode_format'] = $_POST[self::option_name]['cris_sync_shortcode_format'];\n }\n break;\n }\n return $new_input;\n }", "public function validate_settings( $input ) {\r\n\t\t$valid_input = array();\r\n\t\t\r\n\t\t/* General Settings */\r\n\t\t$valid_input['options']['timeline_nav'] = ( $input['options']['timeline_nav'] == 1 ? 1 : 0 );\r\n\t\t$valid_input['db_version'] = $input['db_version'];\r\n\t\t\r\n\t\t/* Wordpress */\r\n\t\tif( !empty( $input['options']['wp']['content'] ) || !empty( $input['options']['wp']['filter'] ) ) {\r\n\t\t\t// Content\r\n\t\t\tforeach( $input['options']['wp']['content'] as $key=>$value ) {\r\n\t\t\t\t$valid_input['options']['wp']['content'][$key] = (int) ( $value == 1 ? 1 : 0 );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Filters\r\n\t\t\tforeach( $input['options']['wp']['filter'] as $filter=>$value ) {\r\n\t\t\t\tforeach( $value as $id=>$val ) {\r\n\t\t\t\t\tswitch( $filter ) {\r\n\t\t\t\t\t\tcase 'taxonomy' :\r\n\t\t\t\t\t\t\t$valid_input['options']['wp']['filter']['taxonomy'][$id] = (int) ( $val == 1 ? 1 : 0 );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t\t$valid_input['options']['wp']['filter'][$filter][$id] = wp_filter_nohtml_kses( $val );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/* Twitter */\r\n\t\tif( !empty( $input['options']['twitter']['content']) || !empty($input['options']['twitter']['filter'] ) ) {\r\n\t\t\t// Content\r\n\t\t\tforeach( $input['options']['twitter']['content'] as $key=>$value ) {\r\n\t\t\t\tswitch( $key ) {\r\n\t\t\t\t\tcase 'username' :\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['content']['username'] = wp_filter_nohtml_kses( str_replace( '@', '', $value ) );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase 'timeline' :\r\n\t\t\t\t\t\t$valid_options = array( '1', '2' );\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['content']['timeline'] = ( in_array( $value, $valid_options ) == true ? $value : null );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['content'][$key] = wp_filter_nohtml_kses( $value );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Filters\r\n\t\t\tforeach( $input['options']['twitter']['filter'] as $filter=>$value ) {\r\n\t\t\t\tswitch($filter) {\r\n\t\t\t\t\tcase 'tags' :\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['filter']['tags'] = wp_filter_nohtml_kses( str_replace('#', '', $value ) );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $valid_input;\r\n\t}", "function handle_app_notifier_settings() {\n $ips = ( get_option('restriction_allowed_ips') ) ? get_option('restriction_allowed_ips') : [];\n update_option('notifier_endpoint', $_POST['endpoint']);\n update_option('enable_notification', $_POST['enable_notification']);\n update_option( 'enable_api_restriction', $_POST['enable_api_restriction'] );\n\n if ( isset( $_POST['restriction_allowed_ips'] ) && !empty( $_POST['restriction_allowed_ips'] ) ) {\n array_push($ips, $_POST['restriction_allowed_ips'] );\n update_option('restriction_allowed_ips', $ips);\n }\n wp_redirect(admin_url('/admin.php?page=notifier'));\n}", "public function sanitizeValueOnSave(): bool\n {\n return true;\n }", "function wfc_is_dev(){\n if( isset($_COOKIE['wfc_admin_cake']) ){\n if( $_COOKIE['wfc_admin_cake'] == base64_encode( 'show_all' ) ){\n return true;\n }\n return false;\n }\n return false;\n }", "public function sanitize_settings($input) {\n $output = $input;\n $output['db_version'] = $this->plugin->db_version();\n $output['debug'] = (bool) $input['debug'];\n\n return $output;\n }", "private static function _is_internal() {\n\t\t// Skip for preview, 404 calls, feed, search, favicon and sitemap access.\n\t\treturn is_preview() || is_404() || is_feed() || is_search()\n\t\t\t|| ( function_exists( 'is_favicon' ) && is_favicon() )\n\t\t\t|| '' !== get_query_var( 'sitemap' ) || '' !== get_query_var( 'sitemap-stylesheet' );\n\t}", "function action_save ($group = 'default') {\n $input = $_POST;\n $settings = settings_get($group);\n \n foreach ($input as $key => $value) {\n $input[$key] = array(\n 'exist' => isset($settings[$key]),\n 'value' => strip_tags($value)\n );\n \n if (isset($settings[$key]) && $value === $settings[$key]) {\n unset($input[$key]);\n }\n }\n \n json_result(settings_save($group, $input));\n}", "public function before_filter(){\n\t\t$config = Config::read(\"config.ini\");\n\t\t$active_app = Kumbia::$active_app;\n\t\tif(!$config->$active_app->interactive){\n\t\t\t$this->redirect(\"\");\n\t\t\treturn false;\n\t\t}\n\t}", "function skcw_request_handler() {\n\tif (current_user_can('manage_options') && !empty($_POST['sk_action'])) {\n\t\tswitch ($_POST['sk_action']) {\n\t\t\tcase 'update_code_widget':\n\t\t\t\tif (check_admin_referer('skcw_update_settings')) {\n\t\t\t\t\tupdate_option('skcw_template_directory', stripslashes($_POST['skcw_template_directory']));\n\t\t\t\t\twp_redirect(admin_url('options-general.php?page=code-to-widget&skcw_message=updated'));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\twp_redirect(admin_url('options-general.php?page=code-to-widget&skcw_message=failure'));\n\t\t\t\t}\n\t\t\t\tdie();\n\t\t\t\tbreak;\n\t\t\tcase 'check_directory':\n\t\t\t\tif (!empty($_POST['directory'])) {\n\t\t\t\t\techo intval(skcw_check_directory(stripslashes($_POST['directory'])));\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t\techo intval(false);\n\t\t\t\tdie();\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "function update_ms_settings() {\n\t\t\t/*print( \"\\n<pre><code>\\n\" );*/\n\t\t\t\n\t\t\tif( !array_key_exists( 'dpn_reviewers', $_POST ) )\n\t\t\t\treturn false;\n\t\t\t$r = $this->sanitize_settings( $_POST['dpn_reviewers'] );\n\t\t\t\n\t\t\t/*var_dump( $r );\n\t\t\tdie( \"\\n</code></pre>\\n\" );*/\n\t\t\t\n\t\t\tif( false === $r )\n\t\t\t\treturn delete_site_option( 'dpn_reviewers' );\n\t\t\telse\n\t\t\t\treturn update_site_option( 'dpn_reviewers', $r );\n\t\t}", "function _owp_process_save() { // cause I really like function named \"%process%\", so accurate...\n\n\t$opt = (int) get_option( 'owp_toggle_offline_mod' );\n\n\t/**\n\t * You could say, what the hell !\n\t * offline mod && nonce ?\n\t * Yes Sir. Don't ask don't tell !\n\t */\n\tif ( isset( $_GET['toggle-offline-nonce'] ) && wp_verify_nonce( $_GET['toggle-offline-nonce'], 'toggle-offline' ) ) {\n\t\tswitch ( $opt ) {\n\t\t\tcase 0:\n\t\t\t\tupdate_option( 'owp_toggle_offline_mod', 1, 'no' );\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tupdate_option( 'owp_toggle_offline_mod', 0, 'no' );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\n\t\t$params = [ 'toggle-offline', 'toggle-offline-nonce' ]; // avoid the annoying part, like if you have to reload page for other purpose\n\t\twp_safe_redirect( remove_query_arg( $params ) );\n\t\texit;\n\t}\n\n\treturn false;\n}", "function is_user_option_local($key, $user_id = 0, $blog_id = 0)\n {\n }", "function wtr_validate_options( $input ) {\r\n\r\n\t\t\tswitch( $_POST['submitControl'] ){\r\n\r\n\t\t\t\t//restore default settings\r\n\t\t\t\tcase 'default-settings':\r\n\t\t\t\t\tupdate_option( $this->settings->get_WP_ERROR(), 'default' );\r\n\t\t\t\t\tupdate_option( $this->settings->get_WP_REWRITE_FLUSH(), 1 );\r\n\t\t\t\t\tdo_action( 'wtr_default_settings' );\r\n\t\t\t\t\treturn null;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t// writing by ajax\r\n\t\t\t\tcase 'ajax':\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t// restore settings from the backup system\r\n\t\t\t\tcase 'import-auto':\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\t\t$input = wtr_get_export_theme_settings( $_POST[ 'wtr_export_theme_settings' ] );\r\n\t\t\t\t\t$status = 'import_data' ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t// restore settings from text\r\n\t\t\t\tcase 'import-text':\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\t\t$input = wtr_decode_theme_settings( wp_remote_fopen( $_POST[ 'wtr_admin_import_settings_text' ] ) );\r\n\t\t\t\t\t$status = 'import_data' ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t$flaga\t\t\t= false;\r\n\t\t\t$new_opt\t\t= array();\r\n\t\t\t$status_flush\t= 0;\r\n\t\t\t$opt\t\t\t= $this->settings->get( 'opt' );\r\n\r\n\r\n\t\t\tforeach ( $opt as $group ) {\r\n\t\t\t\tforeach ( (array ) $group->get('sections') as $section ) {\r\n\t\t\t\t\tforeach ( ( array ) $section->get('fields') as $field ) {\r\n\r\n\t\t\t\t\t\t$id_field\t= $field->get( 'id' );\r\n\t\t\t\t\t\t$allow\t\t= $field->get( 'allow' );\r\n\t\t\t\t\t\t$value\t\t= $field->get( 'value' );\r\n\r\n\t\t\t\t\t\tif( isset( $input[ $id_field ] ) ){\r\n\t\t\t\t\t\t\t$new_value = ( ! is_array( $input[ $id_field ] ) ) ? trim ( $input[ $id_field ] ) : $input[ $id_field ];\r\n\r\n\t\t\t\t\t\t\tif( $allow == 'between' ){\r\n\t\t\t\t\t\t\t\t$min\t\t\t= $field->get( 'min' );\r\n\t\t\t\t\t\t\t\t$max\t\t\t= $field->get( 'max' );\r\n\t\t\t\t\t\t\t\t$has_attr\t\t= $field->get( 'has_attr' );\r\n\t\t\t\t\t\t\t\t//$input[ $key ]\t= trim( $input[ $key ] );\r\n\r\n\t\t\t\t\t\t\t\t$flaga = WTR_Validate::check( $allow, $new_value, $max, $min, $has_attr );\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$flaga = WTR_Validate::check( $allow, $new_value ) ;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//default value\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$new_value\t= $field->get( 'default_value' );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$new_opt[ $id_field ]\t= $new_value;\r\n\t\t\t\t\t\t$new_opt\t\t\t\t= $this->settings->set_opt_a( $new_opt, $field, $new_value );\r\n\r\n\t\t\t\t\t\t//checking slug\r\n\t\t\t\t\t\tif( $status_flush != 1 AND strpos( $id_field, '_Slug' ) AND $value != $new_value ){\r\n\t\t\t\t\t\t\t$status_flush = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( ! $flaga ){\r\n\t\t\t\t\t\t\tbreak 3;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif( ! $flaga ){\r\n\r\n\t\t\t\t$new_opt = $this->settings->get( 'opt_a' );\r\n\r\n\t\t\t\tif( isset( $status ) AND 'import_data' == $status ) {\r\n\t\t\t\t\tupdate_option( $this->settings->get_WP_ERROR(), 'import_error' );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif( empty( $status ) OR 'import_data' != $status ){\r\n\t\t\t\t\techo 'wtr_save_option_error';\r\n\t\t\t\t\texit;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ( isset( $status ) ){\r\n\r\n\t\t\t\tupdate_option( $this->settings->get_WP_ERROR(), $status );\r\n\t\t\t\tdo_action( 'wtr_import_data', $input );\r\n\t\t\t}\r\n\r\n\t\t\tif( $flaga AND isset( $status_flush ) ){\r\n\t\t\t\tupdate_option( $this->settings->get_WP_REWRITE_FLUSH(), $status_flush );\r\n\t\t\t}\r\n\r\n\t\t\treturn base64_encode( serialize( $new_opt ) );\r\n\t\t}", "function submit_paycoingateway_wpsc() {\n if ($_POST['paycoingateway_wpe_api_secret'] != null && $_POST['paycoingateway_wpe_api_secret'] != '[REDACTED]') {\n update_option(\"paycoingateway_wpe_api_key\", $_POST['paycoingateway_wpe_api_key']);\n update_option(\"paycoingateway_wpe_api_secret\", $_POST['paycoingateway_wpe_api_secret']);\n }\n\n return true;\n}", "function afap_form_action() {\n\n if (!empty($_POST) && wp_verify_nonce($_POST['afap_form_nonce'], 'afap_form_action')) {\n\n include('inc/cores/save-settings.php');\n\n } else {\n\n die('No script kiddies please!!');\n\n }\n\n }", "function validate_cpjr3_settings( $input ) {\n \n $output = array(); \n \n foreach( $input as $key => $value ) { \n \n if( isset( $input[$key] ) ) { \n \n $output[$key] = strip_tags( stripslashes( $input[ $key ] ) ); \n \n } \n \n } \n \n return apply_filters( 'validate_cpjr3_settings', $output, $input ); \n\n}", "function save_settings($input) {\n $options = array();\n $buttonOptions = $this->_followOptions->getButtonOptions();\n $allowedKeys = array_merge(array_keys($buttonOptions), array('style', 'title'));\n foreach ($input as $key => $value) {\n if (in_array($key, $allowedKeys)) {\n $value = sanitize_text_field($value);\n if ($value == '' && $buttonOptions[$key]['placeholder'] != '') {\n $value = $buttonOptions[$key]['placeholder'];\n }\n $options[$key] = $value;\n }\n }\n return $options;\n }", "public static function get_allowed_settings()\n {\n }", "function adace_before_content_slot_option_save_validator( $input_sanitized, $input ) {\n\tif ( isset( $input['wrap_the_content'] ) ) {\n\t\t$input_sanitized['wrap_the_content'] = filter_var( $input['wrap_the_content'], FILTER_VALIDATE_BOOLEAN );\n\t} else {\n\t\t$input_sanitized['wrap_the_content'] = false;\n\t}\n\treturn $input_sanitized;\n}", "function is_request(): bool\n{\n return isset($_REQUEST);\n}", "function siteorigin_panels_save_options(){\n\tif( !current_user_can('manage_options') ) return;\n\tif( empty($_POST['_wpnonce']) || !wp_verify_nonce( $_POST['_wpnonce'], 'save_panels_settings' ) ) return;\n\n\t// Save the post types settings\n\t$post_types = isset( $_POST['siteorigin_panels_post_types'] ) ? array_keys( $_POST['siteorigin_panels_post_types'] ) : array();\n\n\t$settings = isset( $_POST['siteorigin_panels_settings'] ) ? $_POST['siteorigin_panels_settings'] : array();\n\tforeach($settings as $f => $v){\n\t\tswitch($f){\n\t\t\tcase 'inline-css' :\n\t\t\tcase 'responsive' :\n\t\t\tcase 'copy-content' :\n\t\t\tcase 'animations' :\n\t\t\tcase 'bundled-widgets' :\n\t\t\t$settings[$f] = !empty($settings[$f]);\n\t\t\t\tbreak;\n\t\t\tcase 'margin-bottom' :\n\t\t\tcase 'margin-sides' :\n\t\t\tcase 'mobile-width' :\n\t\t\t$settings[$f] = intval($settings[$f]);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Checkbox settings\n\t$settings['responsive'] = !empty($settings['responsive']);\n\t$settings['copy-content'] = !empty($settings['copy-content']);\n\t$settings['animations'] = !empty($settings['animations']);\n\t$settings['inline-css'] = !empty($settings['inline-css']);\n\t$settings['bundled-widgets'] = !empty($settings['bundled-widgets']);\n\n\t// Post type settings\n\t$settings['post-types'] = $post_types;\n\n\tupdate_option('siteorigin_panels_settings', $settings);\n\n\tglobal $siteorigin_panels_settings;\n\t$siteorigin_panels_settings = false;\n}", "function ks_save_options_page($post_id) {\n // check if this is an options page\n if ($post_id == 'options') {\n // check if this site is hosted on a Kinsta production environment with caching\n if (wp_get_environment_type() == 'production' && class_exists('Kinsta\\Cache')) {\n wp_remote_get('https://localhost/kinsta-clear-cache-all', [\n 'sslverify' => false, \n 'timeout' => 5\n ]); // purge the cache\n }\n }\n}", "function the_champ_settings_saved_notification(){\r\n\tif(isset($_GET['settings-updated']) && sanitize_text_field($_GET['settings-updated']) == 'true'){\r\n\t\treturn '<div class=\"notice notice-success is-dismissible\"><p><strong>'.__('Settings saved', 'super-socializer').'</strong></p></div>';\r\n\t}\r\n}", "public static function optionsframework_fields_saved_settings_filter( $settings ) {\n\t\t\treturn optionsframework_presets_data( 'wizard01' );\n\t\t}", "function save_meta_options( $postID ){\n\t\t$post = $_POST;\n\t\tif((isset($post['update']) || isset($post['save']) || isset($post['publish']))){\n\n\n\t\t\t$user_template = (isset($post['pagelines_template'])) ? $post['pagelines_template'] : '';\n\n\t\t\tif($user_template != ''){\n\n\t\t\t\t$set = pl_meta($postID, PL_SETTINGS);\n\t\t\t\t\n\t\t\t\t$set['draft']['page-template'] = $user_template; \n\t\t\t\t$set['live']['page-template'] = $user_template; \n\t\t\t\t\n\t\t\t\tpl_meta_update($postID, PL_SETTINGS, $set);\n\t\t\t}\n\n\n\t\t}\n\t}", "function ecapi_admin_intercept() {\r\n\tif( $_SERVER['REQUEST_METHOD'] === 'POST' \r\n\t\t&& array_key_exists('page', $_POST) && 'ecapi-config' === $_POST['page'] ) \r\n\t\tecapi_config_page();\r\n}", "function bdpp_validate_misc_settings( $input ) {\n\n\t$input['disable_font_awsm_css'] = !empty($input['disable_font_awsm_css']) \t? 1 : 0;\n\t$input['disable_owl_css'] \t\t= !empty($input['disable_owl_css']) \t\t? 1 : 0;\n\n\treturn $input;\n}", "function bdpp_validate_sharing_settings( $input ) {\n\n\t// Taking some default value\n\t$sharing_service = array();\n\n\t// Validate Sharing Services\n\tif( !empty( $input['sharing'] ) ) {\n\t\tforeach ($input['sharing'] as $sharing_key => $sharing_val) {\n\t\t\tif( !empty( $sharing_val ) ) {\n\t\t\t\t$sharing_service[] = $sharing_val;\n\t\t\t}\n\t\t}\n\t}\n\t$input['sharing']\t\t\t\t= array_unique( $sharing_service );\n\t$input['sharing_enable'] \t\t= !empty( $input['sharing_enable'] ) ? 1 : 0;\n\t$input['sharing_post_types']\t= isset( $input['sharing_post_types'] ) ? bdpp_clean( $input['sharing_post_types'] ) : array();\n\n\treturn $input;\n}", "function EditOwnSettings()\n\t{\n\t\tif ($this->Admin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->editownsettings;\n\t}", "function filter_input($type, $variable_name, $filter = /* .constant 'FILTER_DEFAULT' */, $options = /* .constant 'FILTER_FLAG_NONE' */) {\r\n if(is_array($options)) {\r\n \t$flags = 0;\r\n \t\r\n foreach((array) $options['flags'] as $option)\r\n $flags |= $option;\r\n } else\r\n $flags = $options;\r\n \r\n // Get variable\r\n switch($type) {\r\n case /* .constant 'INPUT_GET' */:\r\n $GET = Pancake\\vars::$Pancake_request->getGETParams(); \r\n if(!array_key_exists($variable_name, $GET))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $GET[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_POST' */:\r\n $POST = Pancake\\vars::$Pancake_request->getPOSTParams(); \r\n if(!array_key_exists($variable_name, $POST))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $POST[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_COOKIE' */:\r\n $COOKIE = Pancake\\vars::$Pancake_request->getCookies(); \r\n if(!array_key_exists($variable_name, $COOKIE))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $COOKIE[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_SERVER' */:\r\n $SERVER = Pancake\\vars::$Pancake_request->createSERVER(); \r\n if(!array_key_exists($variable_name, $SERVER))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $SERVER[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_ENV' */:\r\n if(!array_key_exists($variable_name, $_ENV))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $_ENV[$variable_name];\r\n break;\r\n }\r\n \r\n return filter_var($var, $filter, $options); \r\n }", "public function sanitize ( $input )\n\t\t{\n\t\t\t$new_input = array();\n\n\t\t\t$options = get_option('hs_settings');\n\n\t\t\tif ( isset($input['hs_portal']) )\n\t\t\t\t$new_input['hs_portal'] = $input['hs_portal'];\n\n\t\t\tif ( isset($input['hs_installed']) )\n\t\t\t\t\t$new_input['hs_installed'] = $input['hs_installed'];\n\n\t\t\tif ( isset($input['hs_version']) )\n\t\t\t\t$new_input['hs_version'] = $input['hs_version'];\n\n\t\t\treturn $new_input;\n\t\t}", "function storeHTTPInput( &$process )\n {\n return true;\n }", "function getSettings()\n\t{\n\t\treturn false;\n\t}", "function clix_uppe_save_postdata( $post_id ){\r\n \t// use nonces to ensure the values came from our own edit screen.\r\n\tif ( !wp_verify_nonce( $_POST['clix_uppe_nonce'], plugin_basename(__FILE__) ) ){\r\n\t\treturn $post_id;\r\n\t\t}\r\n\t// see if this is a page, if so then get out.\r\n\tif( 'page'==$_POST['post_type'] ){\r\n \treturn $post_id;\r\n \t\t}\r\n\t// check to see if the current user has edit authority.\r\n \telseif( !current_user_can( 'edit_post',$post_id ) ){\r\n \treturn $post_id;\r\n \t\t}\r\n\r\n \t// It makes no sense to have both of these set, because disable_unlesslogin will always override.\r\n\tif( !empty( $_POST[_clix_uppe_disable_unlesslogin] ) && !empty( $_POST[_clix_uppe_disable_unlessshow] ) ){\r\n\t\tunset( $_POST[_clix_uppe_disable_unlessshow] );\r\n\t\t}\r\n\r\n \t// all the option fields we are checking...\r\n\t$fields=array(\r\n\t\t'disable_home',\r\n\t\t'disable_tag',\r\n\t\t'disable_archive',\r\n\t\t'disable_search',\r\n\t\t'disable_unlesslogin',\r\n\t\t'disable_unlessshow'\r\n\t\t);\r\n\r\n\t// update/create or remove post_meta data for the specific exclusion specified by the author.\r\n\tforeach($fields as $field){\r\n \t \tif( !empty($_POST['_clix_uppe_'.$field]) ){\r\n\t\t\tupdate_post_meta( $post_id, \"_clix_uppe_$field\", '1' );\r\n\t \t\t}\r\n\t \telse{\r\n\t\t\tdelete_post_meta( $post_id, \"_clix_uppe_$field\" );\r\n\t \t\t}\r\n\t\t}\r\n\treturn true;\r\n}", "function lgmac_save_options() {\n\n//var_dump($_POST); die();\n\tif(!current_user_can('publish_pages')) {\n\t\twp_die('Vous n\\'êtes pas autorisé à effectuer cette opération');\n\t}\n\n\tcheck_admin_referer('lgmac_options_verify');\n\n\t$opts = get_option('lgmac_opts');\n\n\t//sauvegarde légende\n\t$opts['legend_01'] = sanitize_text_field($_POST['lgmac_legend_01']);\n\n\t//sauvegarde image\n\t$opts['image_01_url'] = sanitize_text_field($_POST['lgmac_image_url_01']);\n\n\t//valeur de legende dans la bdd\n\tupdate_option('lgmac_opts', $opts);\n\n\t// redirection vers la page des options avec l'url de la page\n\twp_redirect(admin_url('admin.php?page=lgmac_theme_opts&status=1'));\n\texit;\n\n}", "function api_mode($ask_mode) {\n\tif(trim(strtolower(chevereto_config('api_mode'))) == $ask_mode) return true;\n}", "function wpclients_settings() {\r\n if ( isset( $_GET['tab'] ) && 'addons' == $_GET['tab'] )\r\n include 'forms/lite_form.php';\r\n elseif ( isset( $_GET['tab'] ) && 'pages' == $_GET['tab'] )\r\n include 'forms/settings_pages.php';\r\n elseif ( isset( $_GET['tab'] ) && 'capabilities' == $_GET['tab'] )\r\n include 'forms/lite_form.php';\r\n else\r\n include 'forms/settings.php';\r\n }", "private function test()\n {\n return (bool) Mage::getStoreConfig('actions/settings/test');\n }", "function asp_save_option($key, $global = false) {\r\r\n if ( !isset(wd_asp()->o[$key]) )\r\r\n return false;\r\r\n\r\r\n if ( $global ) {\r\r\n return update_site_option($key, wd_asp()->o[$key]);\r\r\n } else {\r\r\n return update_option($key, wd_asp()->o[$key]);\r\r\n }\r\r\n}", "function allow_configured_filters() {\n return TRUE;\n }", "function is_podlove_settings_screen()\n{\n $screen = get_current_screen();\n\n return stripos($screen->id, 'podlove') !== false && $screen->id != 'settings_page_podlove-web-player-settings';\n}", "function acf_has_setting($name = '')\n{\n}", "function was_filter_forced() {\r\n\r\n\t\treturn parent::$forced_filter;\r\n\r\n\t}", "protected function checkAlwaysPopulateRawPostDataSetting() {}", "function isPostRequest() {\r\n return ( filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'POST' );\r\n}", "function isPostRequest() {\r\n return ( filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'POST' );\r\n}", "function isPostRequest() {\r\n return ( filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'POST' );\r\n}", "function page_show_sidebar_save($post_id, $post) {\n /*if ( !wp_verify_nonce( $_POST['page_show_sidebar_nonce'], plugin_basename(__FILE__) )) {\n return $post_id;\n }\n\n //is the user allowed to edit the post or page?\n if ( !current_user_can( 'edit_post', $post_id ))\n return $post_id;\n //@TODO:figur eout why thi is causing save to fail\n */\n\n $sidebar_checkbox_value = ( isset( $_POST['_show_sidebar'] ) && '1' === $_POST['_show_sidebar'] ) ? 1 : 0; //input var okay.\n update_post_meta( $post_id, '_show_sidebar', esc_attr( $sidebar_checkbox_value ) );\n}", "function wheels_request_filter( $query_vars ) {\n\tif ( isset( $_GET['s'] ) && empty( $_GET['s'] ) && ! is_admin() ) {\n\t\t$query_vars['s'] = ' ';\n\t}\n\n\treturn $query_vars;\n}", "public function isCDEnabledAndRequestNonLocalNonAdmin()\n {\n $settings = $this->getSettings();\n return !Mage::app()->getRequest()->getPost('is_local_request')\n && !Mage::app()->getStore()->isAdmin()\n && $settings['enabled'];\n }", "function wp_fix_server_vars()\n {\n }", "static function is_requested()\n {\n $retval = FALSE;\n if (self::is_requested_page()) {\n $retval = self::is_requested_page();\n } elseif (self::is_requested_post_type()) {\n $retval = self::is_requested_post_type();\n }\n return apply_filters('is_ngg_admin_page', $retval);\n }", "function dp_config_update_option() {\n $in = $_POST['fallback_url'];\n\n if( $in ) {\n // Validate test_option. ALWAYS validate and sanitize user input.\n // Here, we want an string\n $in = strval( $in);\n\n // Update value in database\n yourls_update_option( 'fallback_url', $in );\n }\n}", "function cfwprapi_can_user_have_access( WP_REST_Request $request ) {\n return current_user_can( 'manage_options' );\n}", "function tc_is_customizing() {\r\n //checks if is customizing : two contexts, admin and front (preview frame)\r\n global $pagenow;\r\n $is_customizing = false;\r\n if ( is_admin() && isset( $pagenow ) && 'customize.php' == $pagenow ) {\r\n $is_customizing = true;\r\n } else if ( ! is_admin() && isset($_REQUEST['wp_customize']) ) {\r\n $is_customizing = true;\r\n }\r\n return $is_customizing;\r\n }", "function save_option() {\n\t\t\tcheck_ajax_referer('ajax-nonce', 'nonce');\n\t\t\tif (isset($_POST['option']) && isset($_POST['value'])) {\n\t\t\t\tupdate_option($_POST['option'], stripslashes($_POST['value']));\n\t\t\t\techo 'saved';\n\t\t\t} else {\n\t\t\t\techo 'notsaved';\n\t\t\t}\n\t\t\tdie();\n\t\t}", "function checkSaveCall()\n{\tif ( !wp_verify_nonce( $_POST['smille_fields_nonce'], plugin_basename(__FILE__) )) {\n\t\treturn false;\n\t}\n\t\n\t// verify if this is an auto save routine. If it is our form has not been submitted, so we dont want to do anything\n\tif ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { return false; }\n\t\n\t return true;\n}", "function tf_is_real_post_save($post_id)\r\n {\r\n return !(\r\n wp_is_post_revision($post_id)\r\n || wp_is_post_autosave($post_id)\r\n || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)\r\n || (defined('DOING_AJAX') && DOING_AJAX)\r\n );\r\n }", "function saveSettings() {\n\t\t//# convert class variables into an array and save using\n\t\t//# Wordpress functions, \"update_option\" or \"add_option\"\n\t\t//#convert class into array...\n\t\t$settings_array = array();\n\t\t$obj = $this;\n\t\tforeach (array_keys(get_class_vars(get_class($obj))) as $k){\n\t\t\tif (is_array($obj->$k)) {\n\t\t\t\t//serialize any arrays within $obj\n\t\t\t\tif (count($obj->$k)>0) {\n\t\t\t\t\t$settings_array[$k] = esc_attr(serialize($obj->$k));\n\t\t\t\t} else {\n\t\t\t\t\t$settings_array[$k] = \"\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$settings_array[$k] = \"{$obj->$k}\";\n\t\t\t}\n\t\t}\n\t\t//#save array to options table...\n\t\t$options_check = get_option('wassup_settings');\n\t\tif (!empty($options_check)) {\n\t\t\tupdate_option('wassup_settings', $settings_array);\n\t\t} else {\n\t\t\tadd_option('wassup_settings', $settings_array, 'Options for WassUp');\n\t\t}\n\t\treturn true;\n\t}", "function wp_is_recovery_mode()\n {\n }", "private function isChangingOnlyThisForm()\n {\n /** @var \\Symfony\\Component\\HttpFoundation\\Request $request */\n $request = \\Zend_Registry::get('iris_container')->get('request');\n\n if ($request->query->has('changeOnlyThisForm')) {\n return (bool)$request->query->get('changeOnlyThisForm');\n }\n\n return false;\n }", "private function _isEnvisSet(){\n\t\t/* Variable initialization */\n\t\t$blnIsSet\t= true;\n\t\t\n\t\t/* if setup configuration is not done then then do needful */\n\t\tif($this->getEnvSetupConfigured() == 0){\n\t\t\t/* value overriding */\n\t\t\t$blnIsSet\t= false;\n\t\t}\n\t\t\n\t\t/* Redirect to set-up module */\n\t\tif((!$blnIsSet) && ($this->uri->segment(1) != 'settings' && $this->uri->segment(1) != 'mod' && $this->uri->segment(1) != 'manage_widgets' && $this->uri->segment(1) != 'manage-widgets' && $this->uri->segment(1) != 'social_wall' && $this->uri->segment(1) != 'social-wall')){\n\t\t\t/* redirecting to login */\n\t\t\tredirect(SITE_URL.'settings/setup');\n\t\t}\n\t}", "public function savePreferences()\n {\n $result = false;\n $request = request()->toArray();\n $changes = array();\n \n if($request['description'] !== \"\"){\n $changes['description'] = $request['description'];\n }\n \n $params = array_slice($request, 2);\n foreach(array_keys($params) as $key){\n if($params[$key]!==null && $params[$key]>0){\n $changes[$key] = $params[$key];\n }\n }\n\n if($changes){\n $this->update($changes);\n $result = true;\n }\n return $result;\n }", "function portfolio_web_is_edit_page() {\r\n\t//make sure we are on the backend\r\n\tif ( !is_admin() ){\r\n\t\treturn false;\r\n\t}\r\n\tglobal $pagenow;\r\n\treturn in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\r\n}", "function sanitize_settings( $input ) {\n\t\t\tif( empty( $input ) )\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tif( !is_array( $input ) )\n\t\t\t\t/**\n\t\t\t\t * For some reason, the sanitize callback runs twice, so we don't want to \n\t\t\t\t * \t\texplode something that's already an array \n\t\t\t\t */\n\t\t\t\t$input = explode( ';', $input );\n\t\t\t\n\t\t\t/* Split the list and trim whitespace around each item */\n\t\t\t$input = array_map( 'trim', $input );\n\t\t\t\n\t\t\t/* Turn it into an array if it's not already */\n\t\t\tif( !is_array( $input ) )\n\t\t\t\t$input = array( $input );\n\t\t\t\n\t\t\t/* Make sure all of the addresses are valid emails */\n\t\t\t$input = array_filter( $input, 'is_email' );\n\t\t\t\n\t\t\tif( empty( $input ) )\n\t\t\t\treturn false;\n\t\t\t\n\t\t\treturn $input;\n\t\t}", "function wpse45436_posts_filter( $query ){\n global $pagenow;\n $type = 'policy';\n if (isset($_GET['post_type'])) {\n $type = $_GET['post_type'];\n }\n if ( 'policy' == $type && is_admin() && $pagenow=='edit.php' && isset($_GET['ADMIN_FILTER_FIELD_VALUE']) && $_GET['ADMIN_FILTER_FIELD_VALUE'] != '') {\n $query->query_vars['meta_key'] = 'responsible_office';\n $query->query_vars['meta_value'] = $_GET['ADMIN_FILTER_FIELD_VALUE'];\n }\n}", "private function filter_settings(&$value, $key)\n {\n if ($value === TRUE OR $value === FALSE)\n {\n $value = ($value === TRUE) ? 'true' : 'false';\n }\n }", "public function global_filtering()\n {\n // filtering $_GET\n if (is_array(ctx()->getRequest()->get()) && ! empty(ctx()->getRequest()->get()))\n {\n foreach (ctx()->getRequest()->get() as $key => $val)\n ctx()->getRequest()->get($this->_clean_input_keys($key) , $this->_clean_input_data($val));\n }\n\n // filtering $_POST\n if (is_array(ctx()->getRequest()->post()) && ! empty(ctx()->getRequest()->post()))\n {\n foreach (ctx()->getRequest()->post() as $key => $val){\n ctx()->getRequest()->post($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n\n\n // filtering $_COOKIE\n if (is_array(ctx()->getRequest()->cookie()) && ! empty(ctx()->getRequest()->cookie()))\n {\n foreach (ctx()->getRequest()->cookie() as $key => $val)\n ctx()->getRequest()->cookie($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n\n // filtering $_REQUEST\n if (is_array(ctx()->getRequest()->request()) && ! empty(ctx()->getRequest()->request()))\n {\n foreach (ctx()->getRequest()->request() as $key => $val){\n ctx()->getRequest()->request($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n }", "public function process(ServerRequest $request): bool\n {\n $this->populate($this->settingsRepo->fetchArray(false));\n\n // Handle submission.\n if ('POST' === $request->getMethod() && $this->isValid($request->getParsedBody())) {\n $data = $this->getValues();\n $this->settingsRepo->setSettings($data);\n return true;\n }\n\n return false;\n }", "function acf_is_filter_enabled($name = '')\n{\n}", "static public function save_setup_settings() {\n\n $data = WPP_F::parse_str( $_REQUEST[ 'data' ] );\n\n $_setup = array(\n 'api' => WPP_API_URL_STANDARDS,\n 'data' => $data,\n 'schema' => self::get_settings_schema()\n );\n\n $_current_settings = get_option('wpp_settings');\n\n $_modified_settings = WPP_F::extend( $_current_settings, $_setup['schema'] );\n\n //die( '<pre>' . print_r( $_modified_settings['field_alias'], true ) . '</pre>' );\n\n if( is_array( $_modified_settings['property_stats_groups'] ) ) {\n // $_modified_settings['property_stats_groups'] = array_unique( $_modified_settings['property_stats_groups'] );\n }\n\n // @note This kills c.rabbit.ci response via Varnish, perhaps some sort of log output somewhere.\n if( is_array( $_modified_settings['searchable_attributes'] ) ) {\n // $_modified_settings[ 'searchable_attributes' ] = array_unique( $_modified_settings[ 'searchable_attributes' ] );\n }\n\n // preserve field aliases\n $_modified_settings['field_alias'] = $_current_settings['field_alias'];\n\n $_modified_settings['_updated'] = time();\n\n update_option( 'wpp_settings', $_modified_settings );\n\n $posts_array = get_posts( array(\n 'posts_per_page' => 1,\n 'orderby' => 'date',\n 'order' => 'DESC',\n 'post_type' => 'property',\n 'post_status' => 'publish',\n 'suppress_filters' => true\n ) );\n\n $return[ 'props_single' ] = get_permalink( $posts_array[ 0 ]->ID );\n\n $return[ '_settings' ] = $data[ 'wpp_settings' ];\n\n self::flush_cache();\n\n wp_send_json( $return );\n\n }", "function gboutique_validate_options($input) {\r\n\t // strip html from textboxes\r\n\t$input['email'] = wp_filter_nohtml_kses($input['email']); // Sanitize textarea input (strip html tags, and escape characters)\r\n\t$input['pass'] = wp_filter_nohtml_kses($input['pass']); // Sanitize textbox input (strip html tags, and escape characters)\r\n\t$input['spreadsheetKey'] = wp_filter_nohtml_kses($input['spreadsheetKey']);\r\n\t$input['apiKey'] = wp_filter_nohtml_kses($input['apiKey']);\r\n\t$input['emailapiKey'] = wp_filter_nohtml_kses($input['emailapiKey']);\r\n\treturn $input;\r\n}", "function sanitize_settings($options)\n\t\t{\n\t\t\t// Setup array of valid options for return\n\t\t\t$valid_options = array();\n\t\t\t\n\t\t\t// Establish defaults\n\t\t\t$option_defaults = array(\n\t\t\t\t'analytics' => '',\n\t\t\t\t'google' => '',\n\t\t\t\t'pinterest' => ''\n\t\t\t);\n\t\t\t\n\t\t\t$option_types = array(\n\t\t\t\t'analytics' => 'html',\n\t\t\t\t'google' => 'text',\n\t\t\t\t'pinterest' => 'text'\n\t\t\t);\n\t\t\t\n\t\t\t// Merge pass options and the defaults\n\t\t\t$options = (array) wp_parse_args($options, $option_defaults);\n\t\t\t\n\t\t\t// Sanitize each value\n\t\t\tforeach ($option_types as $key => $type) {\n\t\t\t\t$valid_options[$key] = $this->sanitize_an_option($options[$key], $type);\n\t\t\t}\n\n\t\t\treturn $valid_options;\n\t\t}", "private function getUseRawTestUrlForBizApi()\n {\n return (bool) Mage::getStoreConfig(\n 'actions/settings/use_raw_test_url_for_biz_api'\n );\n }", "public function wcpc_general_settings_sanitize( $input ) {\n global $WCPc;\n $new_input = array();\n \n $hasError = false;\n \n if( isset( $input['id'] ) )\n $new_input['id'] = absint( $input['id'] );\n \n if( isset( $input['id_number'] ) && absint( $input['id_number'] ) != 0 ) {\n $new_input['id_number'] = absint( $input['id_number'] );\n } else {\n add_settings_error(\n \"wcpc_{$this->tab}_settings_name\",\n esc_attr( \"wcpc_{$this->tab}_settings_admin_error\" ),\n __('Item ID should be an intiger.', $WCPc->text_domain),\n 'error'\n );\n $hasError = true;\n }\n\n if( isset( $input['demo_test'] ) )\n $new_input['demo_test'] = sanitize_text_field( $input['demo_test'] );\n \n if( isset( $input['about'] ) )\n $new_input['about'] = sanitize_text_field( $input['about'] );\n\n if( isset( $input['is_enable'] ) )\n $new_input['is_enable'] = sanitize_text_field( $input['is_enable'] );\n \n if( isset( $input['preference'] ) )\n $new_input['preference'] = sanitize_text_field( $input['preference'] );\n \n if( isset( $input['logo'] ) && !empty($input['logo']) ) {\n $new_input['logo'] = sanitize_text_field( $input['logo'] );\n } else {\n add_settings_error(\n \"wcpc_{$this->tab}_settings_name\",\n esc_attr( \"wcpc_{$this->tab}_settings_admin_error\" ),\n __('Please upload your unique logo.', $WCPc->text_domain),\n 'error'\n );\n $hasError = true;\n }\n \n if( isset( $input['dc_colorpicker'] ) )\n $new_input['dc_colorpicker'] = sanitize_text_field( $input['dc_colorpicker'] );\n \n if( isset( $input['dc_datepicker'] ) )\n $new_input['dc_datepicker'] = sanitize_text_field( $input['dc_datepicker'] );\n \n if( isset( $input['offday'] ) )\n $new_input['offday'] = sanitize_text_field( $input['offday'] );\n \n if( isset( $input['location'] ) )\n $new_input['location'] = sanitize_text_field( $input['location'] );\n \n if( isset( $input['role'] ) )\n $new_input['role'] = sanitize_text_field( $input['role'] );\n \n if( isset( $input['slider'] ) )\n $new_input['slider'] = ( $input['slider'] );\n \n if(!$hasError) {\n add_settings_error(\n \"wcpc_{$this->tab}_settings_name\",\n esc_attr( \"wcpc_{$this->tab}_settings_admin_updated\" ),\n __('General settings updated', $WCPc->text_domain),\n 'updated'\n );\n }\n\n return $new_input;\n }", "public function acf_wpi_ui() {\n\t\tif ( ! get_field( 'acf_wpi_ui_enable', 'option' ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function settings_page_callback() {\n\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (!current_user_can('edit_pages')) {\n\t\t\t\twp_die('Unauthorized user!');\n\t\t\t}\n\n\t\t\tcheck_admin_referer( 'mfsn_nonce' );\n\t\t\t\n\t\t\t$value = $_POST['mfsn_enable'] === 'on' ? 'on' : '';\n\t\t\tupdate_option( 'mfsn_enable', $value );\n\n\t\t\tif (isset($_POST['mfsn_message'])) {\n\t\t\t\t$value = wp_kses_post( $_POST['mfsn_message'] );\n\t\t\t\tupdate_option( 'mfsn_message', $value );\n\t\t\t}\n\t\t\tif (isset($_POST['mfsn_source'])) {\n\t\t\t\t$value = $_POST['mfsn_source'] !== '0' ? intval($_POST['mfsn_source']) : '' ;\n\t\t\t\tupdate_option( 'mfsn_source', $value );\n\t\t\t}\n\t\t}\n\t\t?>\n\t\t<form method='post'>\n\t\t\t<?php wp_nonce_field( 'mfsn_nonce' ); ?>\n\t\t\t<h2>Sitewide Notice Settings</h2>\n\t\t\t<table class=\"form-table\" role=\"presentation\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\"><label for='mfsn_enable'>Notice Sitewide?</label></th>\n\t\t\t\t\t\t<td scope=\"row\">\n\t\t\t\t\t\t\t<input type='checkbox' id=\"mfsn_enable\" name=\"mfsn_enable\" <?php echo get_option( 'mfsn_enable' ) === 'on' ? 'checked' : ''; ?>>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\"><label for='mfsn_message'>Notice Text</label></th>\n\t\t\t\t\t\t<td scope=\"row\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\twp_editor(\n\t\t\t\t\t\t\t\tstripslashes( get_option( 'mfsn_message' ) ),\n\t\t\t\t\t\t\t\t'mfsn_message',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'textarea_name' => 'mfsn_message',\n\t\t\t\t\t\t\t\t\t'wpautop' => true,\n\t\t\t\t\t\t\t\t\t'tinymce' => array(\n\t\t\t\t\t\t\t\t\t\t'quicktags' => array( 'buttons' => 'strong,em,del,ul,ol,li,close' ),\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\"><label for='mfsn_source'>Source Site ID (optional)</label></th>\n\t\t\t\t\t\t<td scope=\"row\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$sites = get_sites(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'number' => '10000', //Arbitrary high number of sites.\n\t\t\t\t\t\t\t\t\t'orderby' => 'path',\n\t\t\t\t\t\t\t\t\t'public' => 1,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<select id=\"mfsn_source\" name=\"mfsn_source\">\n\t\t\t\t\t\t\t\t<option value='' <?php echo '' === get_option( 'mfsn_source' ) ? 'selected=\"true\"' : '' ?>>[none]</option>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tforeach( $sites as $site ) {\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<option value='<?php echo $site->blog_id ?>' <?php echo $site->blog_id === (string)get_option( 'mfsn_source' ) ? 'selected=\"true\"' : '' ?>><?php echo $site->path ?></option>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t<td><input type=\"submit\" value=\"Save\" class=\"button button-primary button-large\"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</form>\n\t\t<?php\n\t}" ]
[ "0.6685326", "0.61415553", "0.61356187", "0.61083996", "0.608565", "0.60469514", "0.5985365", "0.5934731", "0.5927271", "0.5926812", "0.5841302", "0.5813109", "0.57908696", "0.5787945", "0.5781255", "0.5730901", "0.57296836", "0.57162905", "0.57050765", "0.56980973", "0.56966543", "0.567977", "0.56664735", "0.56447905", "0.5624951", "0.5614692", "0.56053007", "0.5601763", "0.5586343", "0.55559146", "0.55507797", "0.55492616", "0.5540737", "0.5534074", "0.5522227", "0.5517547", "0.55174345", "0.5476063", "0.54738474", "0.54670966", "0.5451932", "0.545049", "0.54313064", "0.54300344", "0.54254156", "0.5423579", "0.54165494", "0.54100835", "0.5404873", "0.53964436", "0.5392198", "0.5391966", "0.5387622", "0.5375827", "0.53744125", "0.53718185", "0.5371715", "0.53645504", "0.53590405", "0.5358997", "0.5358783", "0.53577423", "0.5357501", "0.5356983", "0.53527015", "0.53513163", "0.53428453", "0.5336376", "0.5336376", "0.5336376", "0.53111106", "0.5305587", "0.53014064", "0.5297065", "0.5296332", "0.5291614", "0.5291377", "0.5285189", "0.52753955", "0.52676255", "0.5264889", "0.5251558", "0.5250616", "0.5244349", "0.5244311", "0.524026", "0.5239543", "0.52344704", "0.5232489", "0.5230232", "0.5226806", "0.52243775", "0.5222339", "0.52212256", "0.52206403", "0.5220285", "0.5216536", "0.5209396", "0.5208597", "0.52056026" ]
0.6341265
1
Are we on a Podlove Settings screen?
function is_podlove_settings_screen() { $screen = get_current_screen(); return stripos($screen->id, 'podlove') !== false && $screen->id != 'settings_page_podlove-web-player-settings'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_settings() {\n\t\t\t\tglobal $pagenow;\n\t\t\t\treturn is_admin() && $pagenow == $this->settings_parent && $_GET['page'] == $this->slug;\n\t\t\t}", "public function is_plugin_settings() {\n\n\t\treturn isset( $_GET['page'], $_GET['tab'] ) && 'wc-settings' === $_GET['page'] && 'pip' === $_GET['tab'];\n\t}", "public function canLikesettings() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\t$like_profile_show = Engine_Api::_()->getApi( 'settings' , 'core' )->getSetting( 'like.profile.show' ) ;\n $like_setting_show = Engine_Api::_()->getApi( 'settings' , 'core' )->getSetting( 'like.setting.show' ) ;\n\t\tif ( empty( $like_profile_show ) || empty( $like_setting_show ) ) {\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n }", "public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) &&\n\t\t\t'wc-settings' == $_GET['page'] &&\n\t\t\tisset( $_GET['tab'] ) &&\n\t\t\t'tax' == $_GET['tab'] &&\n\t\t\tisset( $_GET['section'] ) &&\n\t\t\t'avatax' == $_GET['section'];\n\t}", "public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] &&\n\t\t isset( $_GET['tab'] ) && 'products' === $_GET['tab'] &&\n\t\t isset( $_GET['section'] ) && 'inventory' === $_GET['section'];\n\t}", "function EditOwnSettings()\n\t{\n\t\tif ($this->Admin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->editownsettings;\n\t}", "function ts_check_if_control_panel()\r\n{\r\n\t$control_panel = ot_get_option('control_panel');\r\n\t\r\n\tif ($control_panel == 'enabled_admin' && current_user_can('manage_options') || $control_panel == 'enabled_all')\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "function isSettings($type) {\n\tif (strlen($type) > 8) {\n\t\tif (substr($type, -8) === \"settings\") {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function test_settings($settings)\n {\n //can even register results, so you can give errors or whatever if you want..\n geoAdmin::m('I\\'m sure the settings are just fine. (CHANGE THIS! FOR DEMONSTRATION ONLY)');\n\n return true;\n }", "private function comprueba_pantalla () {\r\r\n\r\r\n\t\t\t$pantalla = get_current_screen();\r\r\n\r\r\n\t\t\treturn ('plugins' == $pantalla->base) ? true : false;\r\r\n\t\t\t}", "public function canShow(){\n\t\tif (Mage::getStoreConfig('logicbroker_edi_section/logicbroker_edi_group1/notificationstatus') == 0) {\n\t\t\t$this->setConfigValue(array(\n\t\t\t\t'scope' => 'default',\n\t\t\t\t'scope_id' => '0',\n\t\t\t\t'path' => 'logicbroker_edi_section/logicbroker_edi_group1/notificationstatus',\n\t\t\t\t'value' => '1',\n\t\t\n\t\t\t\t));\n\t\t\treturn true;\n }else{\n \treturn false;\n }\n\t}", "private function showAdminHint(): bool\n {\n return $this->getWordpressConfig()->atAdminPanel() === false\n && $this->getMainConfig()->blogAdminHint() === true;\n }", "public function acf_wpi_ui() {\n\t\tif ( ! get_field( 'acf_wpi_ui_enable', 'option' ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "static function has_edit_screen(): bool { return true; }", "private function is_show() {\n\n\t\tif ( 'avada-fusion-patcher' === $this->current_screen || ( ( 'avada-registration' === $this->current_screen || 'avada-plugins' === $this->current_screen || 'avada-demos' === $this->current_screen ) && class_exists( 'Avada' ) && Avada()->registration->is_registered() ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function showSettings()\n\t{\n\n\t\treturn $this->showDefaultSettings();\n\t}", "function checkPanelMode()\n\t{\n\t\tswitch ($this->display_mode)\n\t\t{\n\t\t\tcase \"view\":\n\t\t\t\t$this->displayStatusPanel();\n\t\t\t\tbreak;\n\n\t\t\tcase \"setup\":\n\t\t\t\t$this->displayProcessPanel();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function isVisible(): bool\n {\n return $this->scopeConfig->getValue('helloworld/general/enable');\n }", "function has_setting($name)\n {\n }", "public function isEnabled()\n {\n return Mage::getStoreConfig('quickview/settings/enabled', Mage::app()->getStore());\n }", "function bp_get_admin_bar_pref( $context, $user = 0 ) {\n\t$pref = get_user_option( \"show_admin_bar_{$context}\", $user );\n\tif ( false === $pref )\n\t\treturn true;\n\n\treturn 'true' === $pref;\n}", "function check_plugin_mainscreen_name()\r\r\n{\r\r\n $screen = get_current_screen();\r\r\n if (is_object($screen) && $screen->id == 'toplevel_page_oneclick-google-map') {\r\r\n return true;\r\r\n }\r\r\n else {\r\r\n return false;\r\r\n }\r\r\n}", "function is_user_preference_short_url() {\n\treturn (isset($_COOKIE['doShort'])) ? true : false;\n}", "private function _validate_settings()\n\t{\n\n\t\treturn TRUE;\n\t}", "function is_primary() {\n\n\t\tif ( !empty( $this->get_post_types() ) ) {\n\n\t\t\tforeach ( TPL_FW()->registered_settings_pages as $key => $settings_page ) {\n\n\t\t\t\tif ( $settings_page->get_post_type() && $this->has_post_type( $settings_page->get_post_type() ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "private function test()\n {\n return (bool) Mage::getStoreConfig('actions/settings/test');\n }", "public function hasSetting( $name );", "public function isDisplayed()\n {\n if (!$this->scopeConfig->getValue('magentomobileshop/secure/key')) {\n return true;\n }\n }", "function is_episode_edit_screen()\n{\n $screen = get_current_screen();\n\n return in_array($screen->base, ['edit', 'post']) && $screen->post_type == 'podcast';\n}", "function is_options_save_page()\n{\n $self = $_SERVER['PHP_SELF'];\n $request = $_SERVER['REQUEST_URI'];\n\n return stripos($self, 'options.php') !== false || stripos($request, 'options.php') !== false;\n}", "public function useSetting()\n\t{\n\t\treturn count($this->settingConfig()) ? true : false;\n\t}", "public function isShowActivator() {\n\t\t$cache = WP_Helper::getCache();\n\t\tif ( $cache->get( 'wdf_isActivated', false ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\tif ( get_site_transient( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tif ( get_site_option( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$keys = [\n\t\t\t'wp_defender',\n\t\t\t'wd_scan_settings',\n\t\t\t'wd_hardener_settings',\n\t\t\t'wd_audit_settings',\n\t\t\t'wd_2auth_settings',\n\t\t\t'wd_masking_login_settings'\n\t\t];\n\t\tforeach ( $keys as $key ) {\n\t\t\t$option = get_site_option( $key );\n\t\t\tif ( is_array( $option ) ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 1;\n\t}", "public function checkAccess()\n {\n $list = $this->getPages();\n\n /**\n * Settings controller is available directly if the $page request variable is provided\n * if the $page is omitted, the controller must be the subclass of Settings main one.\n *\n * The inner $page variable must be in the getPages() array\n */\n return parent::checkAccess()\n && isset($list[$this->page])\n && (\n ($this instanceof \\XLite\\Controller\\Admin\\Settings && isset(\\XLite\\Core\\Request::getInstance()->page))\n || is_subclass_of($this, '\\XLite\\Controller\\Admin\\Settings')\n );\n }", "function have_profile(){\n\treturn ( get_profile('enabled') === true && get_profile() !== -1 );\n}", "public function isInformationVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_OPTIONS_DISPLAY_INFORMATION);\n }", "public function showInMenu()\n {\n $ctrs = PageCom::ctrs();\n return $ctrs && (count($ctrs) > 1);\n }", "public function is_on_our_own_pages( $hook = '' ) {\n\t\t$current_screen = Helpers::get_current_screen();\n\n\t\t$basePrefix = apply_filters( 'simple_history/admin_location', 'index' );\n\t\t$basePrefix = $basePrefix === 'index' ? 'dashboard' : $basePrefix;\n\n\t\tif ( $current_screen && $current_screen->base == 'settings_page_' . self::SETTINGS_MENU_SLUG ) {\n\t\t\treturn true;\n\t\t} elseif ( $current_screen && $current_screen->base === $basePrefix . '_page_simple_history_page' ) {\n\t\t\treturn true;\n\t\t} elseif (\n\t\t\t$hook == 'settings_page_' . self::SETTINGS_MENU_SLUG ||\n\t\t\t( $this->setting_show_on_dashboard() && $hook == 'index.php' ) ||\n\t\t\t( $this->setting_show_as_page() && $hook == $basePrefix . '_page_simple_history_page' )\n\t\t) {\n\t\t\treturn true;\n\t\t} elseif ( $current_screen && $current_screen->base == 'dashboard' && $this->setting_show_on_dashboard() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "private function isEnableOpenPlatform()\n {\n return $this->config()->has('wechat.open_platform');\n }", "public function canShowTab()\n {\n $integrationData = $this->_coreRegistry->registry(\n Integration::REGISTRY_KEY_CURRENT_INTEGRATION\n );\n\n if (isset($integrationData['integration_id']) &&\n isset($integrationData['endpoint']) &&\n (str_contains($integrationData['endpoint'], 'extend.com') &&\n str_contains($integrationData['endpoint'], 'integ-mage'))\n ) {\n return true;\n }\n }", "function userSettingVisible($setting)\n\t{\n\t\t$result = TRUE;\n\t\tif (isset($this->settings[\"usr_settings_hide_\".$setting]) &&\n\t\t\t$this->settings[\"usr_settings_hide_\".$setting] == 1)\n\t\t{\n\t\t\t$result = FALSE;\n\t\t}\n\t\treturn $result;\n\t}", "function settings_section() {\n\t\t}", "function wfc_is_dev(){\n if( isset($_COOKIE['wfc_admin_cake']) ){\n if( $_COOKIE['wfc_admin_cake'] == base64_encode( 'show_all' ) ){\n return true;\n }\n return false;\n }\n return false;\n }", "function plugin_satisfactionsmiley_check_config() {\n return true;\n}", "function isRHULApp() {\n\n\tif (isset($_GET['RHUL_App'])) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}", "function acf_has_setting($name = '')\n{\n}", "function getSettings()\n\t{\n\t\treturn false;\n\t}", "function get_settings()\n\t{\n\t\t$this->settings = array();\n\t\t\n\t\treturn true;\n\t}", "function simple_history_setting_show_on_dashboard() {\n\t$show_on_dashboard = get_option(\"simple_history_show_on_dashboard\", 0);\n\t$show_on_dashboard = apply_filters(\"simple_history_show_on_dashboard\", $show_on_dashboard);\n\treturn (bool) $show_on_dashboard;\n}", "function siteorigin_panels_is_preview(){\n\tglobal $siteorigin_panels_is_preview;\n\treturn (bool) $siteorigin_panels_is_preview;\n}", "public function hasModuleSettings()\n {\n return true;\n }", "public function KemiSitemap_is_admin_page()\n {\n if (get_current_screen()->base == 'settings_page_'.KEMISITEMAP_SLUG) {\n return 'true';\n }\n return 'false';\n }", "private function _isEnvisSet(){\n\t\t/* Variable initialization */\n\t\t$blnIsSet\t= true;\n\t\t\n\t\t/* if setup configuration is not done then then do needful */\n\t\tif($this->getEnvSetupConfigured() == 0){\n\t\t\t/* value overriding */\n\t\t\t$blnIsSet\t= false;\n\t\t}\n\t\t\n\t\t/* Redirect to set-up module */\n\t\tif((!$blnIsSet) && ($this->uri->segment(1) != 'settings' && $this->uri->segment(1) != 'mod' && $this->uri->segment(1) != 'manage_widgets' && $this->uri->segment(1) != 'manage-widgets' && $this->uri->segment(1) != 'social_wall' && $this->uri->segment(1) != 'social-wall')){\n\t\t\t/* redirecting to login */\n\t\t\tredirect(SITE_URL.'settings/setup');\n\t\t}\n\t}", "function cosmetro_is_top_panel_visible() {\n\n\t$message = get_theme_mod( 'top_panel_text', cosmetro_theme()->customizer->get_default( 'top_panel_text' ) );\n\t$search = get_theme_mod( 'top_panel_search', cosmetro_theme()->customizer->get_default( 'top_panel_search' ) );\n\t$menu = has_nav_menu( 'top' );\n\n\t$conditions = apply_filters( 'cosmetro_top_panel_visibility_conditions', array( $message, $search, $menu ) );\n\n\t$is_visible = false;\n\n\tforeach ( $conditions as $condition ) {\n\t\tif ( ! empty( $condition ) ) {\n\t\t\t$is_visible = true;\n\t\t}\n\t}\n\n\treturn $is_visible;\n}", "function wpvideocoach_show_help_tabs() {\r\n\tglobal $wpvideocoach_help_tabs;\r\n\tif($wpvideocoach_help_tabs == 0){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "function wrmp_is_installed()\n{\n\treturn wrmp_get_settingsgroup();\n}", "function isAdmin(){\n\t\treturn (isset($this->params['admin']) && $this->params['admin']);\n\t}", "function showspace_settings_complete() {\n return showspace_api_key() != \"\" && showspace_terms_accepted();\n}", "public function should_display_sandwitch_menu() {\n if ($this->page->pagelayout == 'frontpage' || !isloggedin() || isguestuser()) {\n return false;\n }\n return true;\n }", "public function setting_show_on_dashboard() {\n\t\t$show_on_dashboard = get_option( 'simple_history_show_on_dashboard', 1 );\n\t\t$show_on_dashboard = apply_filters( 'simple_history_show_on_dashboard', $show_on_dashboard );\n\t\treturn (bool) $show_on_dashboard;\n\t}", "public function isAdminPanelVisible() {}", "public function IsInMaintenanceMode(){\n\n\t\t// Obtain maintenance_mode index from config file\n $config_maintenance = $this->instance->config->item(\"maintenance_mode\");\n\n // validate if it's true\n if( $config_maintenance ){\n\n \t// load view and terminate output\n echo $this->instance->load->view('system/maintenance_mode', false, true);\n die();\n }\n }", "function facebook_enabled()\r\n{\r\n\tglobal $settings;\r\n\t\r\n\treturn !empty($settings['facebook_app_id']) && !empty($settings['facebook_app_secret']);\r\n}", "function tc_is_customizing() {\r\n //checks if is customizing : two contexts, admin and front (preview frame)\r\n global $pagenow;\r\n $is_customizing = false;\r\n if ( is_admin() && isset( $pagenow ) && 'customize.php' == $pagenow ) {\r\n $is_customizing = true;\r\n } else if ( ! is_admin() && isset($_REQUEST['wp_customize']) ) {\r\n $is_customizing = true;\r\n }\r\n return $is_customizing;\r\n }", "public function testSettingsForm() {\n $account = $this->drupalCreateUser([\n 'access administration pages',\n 'administer media',\n ]);\n $this->drupalLogin($account);\n\n $page = $this->getSession()->getPage();\n $assert_session = $this->assertSession();\n\n $this->drupalGet('/admin/config');\n $page->clickLink('Media Library settings');\n $page->checkField('Enable advanced UI');\n $page->pressButton('Save configuration');\n $assert_session->checkboxChecked('Enable advanced UI');\n $page->uncheckField('Enable advanced UI');\n $page->pressButton('Save configuration');\n $assert_session->checkboxNotChecked('Enable advanced UI');\n }", "function isAdmin() {\n\t\t$me = $_SESSION[\"me\"];\n\t\t$check = mf(mq(\"select `id`,`url` from `[p]musicplayer` where `id`='{$me}' limit 1\"));\n\t\tif ($check[\"url\"] == \"admin\") {\n\t\t\treturn true;\n\t\t}\n\t}", "function is_preview_only() {\n\tif ( class_exists( 'Fusion_App' ) ) {\n\t\t$fusion_app = Fusion_App::get_instance();\n\t\treturn $fusion_app->get_preview_only_status();\n\t}\n\treturn false;\n}", "function thrive_dashboard_is_thrive_theme()\n{\n global $is_thrive_theme;\n if (isset($is_thrive_theme) && $is_thrive_theme == true) {\n return true;\n } else {\n return false;\n }\n}", "private function is_ate_console_tab() {\n\t\t$sm = filter_input( INPUT_GET, 'sm', FILTER_SANITIZE_STRING );\n\t\t$page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING );\n\n\t\treturn $sm && $page && self::SLUG === $sm && WPML_TM_FOLDER . '/menu/main.php' === $page;\n\t}", "private function is_install_screen() {\n\t\t$screen = get_current_screen();\n\n\t\tif ( ! $screen ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn 'update' === $screen->id;\n\t}", "public function settings()\n {\n if ($_SESSION['role'] == 1)\n { \n $this->view('AdminDashboard/settings', ['viewName' => 'Dashboard - Settings']);\n }\n else\n {\n header('location: '.URL.'Login');\n }\n }", "public function settings_screen() {\n\t\tglobal ${class_name};\n\t\tdo_action( ${class_name}->token . '_before_settings' );\n\t\tdo_action( $this->token . '_before_settings' );\n\t\tsettings_fields( $this->token );\n\t\tdo_settings_sections( $this->token );\n\t\tdo_action( $this->token . '_after_settings' );\n\t\tdo_action( ${class_name}->token . '_after_settings' );\n\t\tsubmit_button();\n\t}", "public function canManageRadioLandingPage();", "public function show_settings_page() : void {\n\t\t\t$categories = self::get_categories();\n\n\t\t\tSFWD_LMS::get_view(\n\t\t\t\t'support/help',\n\t\t\t\tarray(\n\t\t\t\t\t'categories' => $categories,\n\t\t\t\t),\n\t\t\t\ttrue\n\t\t\t);\n\t\t}", "public function settings_screen () {\n \n $this->ui->get_header();\n\n $screen = $this->ui->get_current_screen();\n\n switch ( $screen ) {\n //** Products screen. */\n case 'more_products':\n $this->more_products = $this->get_more_products();\n require_once( $this->screens_path . 'screen-more.php' );\n break;\n //** Licenses screen. */\n case 'licenses':\n default:\n $this->ensure_keys_are_actually_active();\n $this->installed_products = $this->get_detected_products();\n $this->pending_products = $this->get_pending_products();\n require_once( $this->screens_path . 'screen-manage-' . $this->type . '.php' );\n break;\n }\n\n $this->ui->get_footer();\n }", "function is_active_addons($key)\r\n{\r\n $act_key = get_option($key);\r\n if ($act_key != '')\r\n {\r\n return true;\r\n }\r\n}", "function isVisible() {\n\t\t$worker = CerberusApplication::getActiveWorker();\n\t\t\n\t\tif(empty($worker)) {\n\t\t\treturn false;\n\t\t} elseif($worker->is_superuser) {\n\t\t\treturn true;\n\t\t}\n\t}", "public static function isSecretary()\n {\n $permissions = [\"Segreteria\", \"Vice direzione\", \"Direzione\"];\n return in_array($_SESSION[\"permission\"], $permissions);\n }", "function settings_page() { include($this->plugin_basename . '/core/admin/settings.php'); }", "protected function is_current_screen_page() {\n\n\t\tif ( Settings::PAGE_ID !== Framework\\SV_WC_Helper::get_requested_value( 'page' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// assume we are on the Connection tab by default because the link under Marketing doesn't include the tab query arg\n\t\t$tab = Framework\\SV_WC_Helper::get_requested_value( 'tab', 'connection' );\n\n\t\treturn ! empty( $tab ) && $tab === $this->get_id();\n\t}", "function acf_settings_show_admin( $setting ) {\n\t\t\n\t\t// 5.0.0 - removed ACF_LITE\n\t\treturn ( defined('ACF_LITE') && ACF_LITE ) ? false : $setting;\n\t\t\n\t}", "public static function isEnabled()\n {\n $app_model = new waAppSettingsModel();\n $is_enabled = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID . '-profile');\n $profile_cookie = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID_SHORT . '-profile-cookie');\n $cookie_enabled = $profile_cookie && waRequest::cookie($profile_cookie, '');\n return $is_enabled && $cookie_enabled;\n }", "public function setting_show_as_page() {\n\t\t$setting = get_option( 'simple_history_show_as_page', 1 );\n\t\t$setting = apply_filters( 'simple_history_show_as_page', $setting );\n\n\t\treturn (bool) $setting;\n\t}", "public function show_in_admin_bar()\n\t{\n\t\treturn !( self::const_value( 'DEVDEBUG_NO_ADMIN_BAR' ) );\n\t}", "function rssmi_is_plugin_page() {\n\t$screen = get_current_screen();\n\tif ( ( isset( $_GET['post_type'] ) ) && ( strpos( $_GET['post_type'], 'rssmi_feed', 0 ) !== false ) || ( isset( $_GET['page'] ) ) && ( ( strpos( $_GET['page'], 'wprssmi', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options2', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options3', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options4', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options9', 0 ) !== false ) || ( isset( $_GET['post_type'] ) ) && ( strpos( $_GET['post_type'], 'rssmi_feed_item', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options5', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options8', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options7', 0 ) !== false ) ) ) {\n\t\t$msg = 1;\n\t}\n\telse {\n\t\t$msg = 0;\n\t}\n\n\treturn $msg;\n}", "public function is_screen() {\n\t\treturn ! empty( $this->ID ) && Tribe__Admin__Helpers::instance()->is_screen( $this->ID );\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('MagicToolbox_MagicZoomPlus::magiczoomplus_settings_edit');\n }", "public function isOptions(): bool {}", "private function isPluginsPage()\n {\n global $pagenow;\n return ( $pagenow === 'plugins.php' );\n }", "public function isActive() \n {\t\n \t// if PIWIK tracking is activated return TRUE\n \tif (Mage::getStoreConfig('piwik/piwik/active')) {\n \t\treturn true;\n \t}\n \t// return FALSE otherwise\n \treturn false;\n }", "function the_champ_social_login_enabled(){\r\n\tglobal $theChampLoginOptions;\r\n\tif(isset($theChampLoginOptions['enable']) && $theChampLoginOptions['enable'] == 1){\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "static function enable_role_settings() {\r\n\t\t\t$settings = WPPostsRateKeys_Settings::get_options();\r\n\t\t\t\r\n\t\t\tif ($settings['enable_role_settings']=='0') {\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn TRUE;\r\n\t\t\t}\r\n\t\t}", "public function has($key){\n return (array_key_exists($key,$this->settings));\n }", "public function displayInAdmin()\n {\n return self::_enabled();\n }", "public function settings(){\n\t\t$this->verify();\n\t\t$data['title']=\"Settings\";\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('settings', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public function loadSettings() {\n $this->serverURL = Yii::$app->getModule('rocketchat')->settings->get('serverURL');\n return true;\n }", "function wpcron_display_settings_page() {\n\n\t// check if user is allowed access\n\tif ( ! current_user_can( 'manage_options' ) ) return;\n\n\t?>\n\n\t<div class=\"wrap\">\n\n\t\t<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\n\t\t<?php echo wpcron_log(); ?>\n\n\t</div>\n\n<?php\n\n}", "public function isAdmin()\n {\n $quarkCookie = Mage::getModel('core/cookie')->get('quark_bar');\n\n $quarkSession = $this->getCollection()\n ->addFieldToFilter('identifier', $quarkCookie)\n ->getData();\n\n if (count($quarkSession)) {\n return true;\n }\n\n return false;\n }", "public function have_settings_been_saved() {\n\t\treturn self::$settings_saved;\n\t}", "public function is_edit_page() {\n\t\t\tglobal $current_screen;\n\n\t\t\treturn in_array( $current_screen->id, (array) $this->_meta_box['pages'] );\n\t\t}", "function admin()\n{\n return current_user_can('manage_options');\n}" ]
[ "0.7601792", "0.71732724", "0.71638584", "0.7098602", "0.7015568", "0.66845447", "0.6675503", "0.6599174", "0.64648736", "0.6446677", "0.6445697", "0.64327866", "0.6432238", "0.6379396", "0.6368239", "0.63527364", "0.62000245", "0.61750424", "0.6094654", "0.6089445", "0.60812736", "0.60735744", "0.60277104", "0.6023634", "0.5993152", "0.5984524", "0.5967079", "0.59564686", "0.5944306", "0.5929239", "0.5922978", "0.5906156", "0.5890755", "0.58897996", "0.588428", "0.5873539", "0.58734447", "0.58695394", "0.5867296", "0.58657146", "0.58653706", "0.5861549", "0.5856321", "0.58518016", "0.5846337", "0.5844379", "0.5837629", "0.5833865", "0.582775", "0.5819054", "0.58162254", "0.5814206", "0.5800953", "0.5799324", "0.57946223", "0.5791295", "0.57912093", "0.57879406", "0.5787663", "0.5786787", "0.5774373", "0.57529974", "0.5752489", "0.57459784", "0.5740584", "0.57376814", "0.57359666", "0.5733001", "0.572723", "0.5726728", "0.5719018", "0.5708313", "0.5698007", "0.5694768", "0.56826335", "0.56772506", "0.566941", "0.5667904", "0.5651602", "0.5649319", "0.5645183", "0.5643606", "0.5642849", "0.56421435", "0.5634426", "0.56248486", "0.5622924", "0.56151736", "0.5614287", "0.5614144", "0.5612564", "0.56103134", "0.5608106", "0.5606291", "0.56054926", "0.5601037", "0.5599988", "0.55997586", "0.55941516", "0.5593866" ]
0.848778
0
Are we on an edit screen for episodes?
function is_episode_edit_screen() { $screen = get_current_screen(); return in_array($screen->base, ['edit', 'post']) && $screen->post_type == 'podcast'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function has_edit_screen(): bool { return true; }", "public function isEditFormShown() {}", "public function is_edit_page() {\n\t\t\tglobal $current_screen;\n\n\t\t\treturn in_array( $current_screen->id, (array) $this->_meta_box['pages'] );\n\t\t}", "protected function is_edit_page() {\n\t\treturn false;\n\t}", "public function isEditAction() {}", "public function is_editing() {\n\n\t\tif ( 'edit' !== Param::get( 'action' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn Param::get( 'redirection', false, FILTER_VALIDATE_INT );\n\t}", "protected function isFrontendEditActive() {}", "protected function isFrontendEditActive() {}", "public function getEditMode()\n {\n $page = $this->getPage();\n\n if (!$page->canEdit()) {\n $this->endEditing();\n return false;\n }\n\n $stage = Versioned::get_stage();\n if ($stage != Versioned::DRAFT) {\n return false;\n }\n\n // one-off preview that does _not_ stop edit mode\n if ($this->getRequest()->getVar('preview')) {\n return false;\n }\n\n return true;\n }", "public function isFrontendEditingActive() {}", "function is_edit_page($new_edit = null)\n{\n global $pagenow;\n //make sure we are on the backend\n if (!is_admin()) return false;\n\n\n if ($new_edit == \"edit\")\n return in_array($pagenow, array('post.php',));\n elseif ($new_edit == \"new\") //check for new post page\n return in_array($pagenow, array('post-new.php'));\n else //check for either new or edit\n return in_array($pagenow, array('post.php', 'post-new.php'));\n}", "function is_edit_page( $new_edit = null ) {\n\tglobal $pagenow;\n\tif ( !is_admin() ) return false;\n\tif ( $new_edit == \"edit\" )\n\t\treturn in_array( $pagenow, array( 'post.php', ) );\n\telseif ($new_edit == \"new\")\n\t\treturn in_array( $pagenow, array( 'post-new.php' ) );\n\telse\n\t\treturn in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\n}", "public function isSwitchToEditEnabled();", "public function is_screen() {\n\t\treturn ! empty( $this->ID ) && Tribe__Admin__Helpers::instance()->is_screen( $this->ID );\n\t}", "public function isEditOnlyMode();", "function is_edit_page($new_edit = null){\n global $pagenow;\n //make sure we are on the backend\n if (!is_admin()) return false;\n\n\n if($new_edit == \"edit\")\n return in_array( $pagenow, array( 'post.php', ) );\n elseif($new_edit == \"new\") //check for new post page\n return in_array( $pagenow, array( 'post-new.php' ) );\n else //check for either new or edit\n return in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\n}", "function fa_is_theme_edit_preview(){\n\tif( fa_is_preview() ){\n\t\tif( isset( $_GET['action'] ) && 'theme_edit' == $_GET['action'] ){\n\t\t\treturn true;\n\t\t}\n\t}\t\n\treturn false;\n}", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && !parent::isEnabled();\n }", "public function isEditable()\n\t{\n\t\tif (($this->getName() === 'publicid') || ($this->getName() === 'posturl')) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "protected function canEdit() {}", "function fusion_should_add_fe_edit_link() {\n\tif ( 0 === fusion_library()->get_page_id() || false === fusion_library()->get_page_id() || '0-archive' === fusion_library()->get_page_id() || is_preview_only() ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function canEdit()\n {\n return true;\n }", "function isVisible() {\n return ($this->entry->staff_id || $this->entry->user_id)\n && $this->entry->type != 'R' && $this->isEnabled();\n }", "public function in_edit_display_mode($mode = null) {\n if (!$submission = $this->submission_settings) {\n return false;\n }\n if (empty($submission['display'])) {\n return false;\n }\n if (!$mode) {\n return true;\n }\n return ($submission['display'] == $mode);\n }", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && $this->isEnabled();\n }", "function is_edit_page( $new_edit = null )\n {\n global $pagenow;\n\n if ( ! is_admin() ) {\n return false;\n } elseif ( $new_edit === 'edit' ) {\n return in_array( $pagenow, [ 'post.php' ] );\n } elseif ( $new_edit === 'new' ) {\n /** Check for new post page */\n return in_array( $pagenow, [ 'post-new.php' ] );\n } else {\n /** Check for either new or edit */\n return in_array( $pagenow, [ 'post.php', 'post-new.php' ] );\n }\n }", "private function is_show() {\n\n\t\tif ( 'avada-fusion-patcher' === $this->current_screen || ( ( 'avada-registration' === $this->current_screen || 'avada-plugins' === $this->current_screen || 'avada-demos' === $this->current_screen ) && class_exists( 'Avada' ) && Avada()->registration->is_registered() ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function portfolio_web_is_edit_page() {\r\n\t//make sure we are on the backend\r\n\tif ( !is_admin() ){\r\n\t\treturn false;\r\n\t}\r\n\tglobal $pagenow;\r\n\treturn in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\r\n}", "function valid_action() {\n # of pages that are about that page (i.e. not admin\n # or recent changes)\n global $ACT;\n if($ACT == 'show') { return true; }\n if($ACT == 'edit') { return true; }\n if($ACT == 'revisions') { return true; }\n return false;\n }", "public function is_admin_editor_page() {\n\t\tif ( ! is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\t\tglobal $pagenow, $wp_version;\n\t\t$allowed_pagenow_array = array( 'post.php', 'post-new.php', 'term.php', 'user-new.php', 'user-edit.php', 'profile.php' );\n\t\t$allowed_page_array = array( 'views-editor', 'ct-editor', 'view-archives-editor', 'dd_layouts_edit' );\n\t\t// @todo maybe add a filter here for future Toolset admin pages...\n\t\tif (\n\t\t\tin_array( $pagenow, $allowed_pagenow_array )\n\t\t\t|| (\n\t\t\t\t$pagenow == 'admin.php'\n\t\t\t\t&& isset( $_GET['page'] )\n\t\t\t\t&& in_array( $_GET['page'], $allowed_page_array )\n\t\t\t)\n\t\t\t|| (\n\t\t\t\t// In WordPress < 4.5, the edit tag admin page is edit-tags.php?action=edit&taxonomy=category&tag_ID=X\n\t\t\t\tversion_compare( $wp_version, '4.5', '<' )\n\t\t\t\t&& $pagenow == 'edit-tags.php'\n\t\t\t\t&& isset( $_GET['action'] )\n\t\t\t\t&& $_GET['action'] == 'edit'\n\t\t\t)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }", "function canEdit() {\n\t\t\treturn true;\n\t\t}", "public function can_edit() {\n return true;\n }", "public function is_edit_or_new_admin_page() {\n\t\tglobal $pagenow;\n\t\t// phpcs:ignore\n\t\treturn ( is_admin() && ( $pagenow === 'post.php' || $pagenow === 'post-new.php' ) );\n\t}", "function is_elementor_editor() {\n\t\treturn is_admin() && ( isset( $_GET['action'] ) && sanitize_text_field( $_GET['action'] ) === 'elementor' );\n\t}", "public function isEditor()\n {\n $int;\n foreach ( $this->u_r_id as $int )\n {\n if($int==2)\n return true;\n }\n return false;\n }", "function get_is_upcoming_event_display($view): bool {\n $display = $view->current_display;\n\n switch ($display) {\n // Set the past events link for a topic filtered display.\n case 'page_1': // Event all display\n case 'page_3': // Event topic display\n case 'page_4': // Past topic display\n return TRUE;\n default:\n return FALSE;\n }\n}", "private function isEditMode(){\n\t\tif(isset($this->AddRecordInsertData) and count($this->AddRecordInsertData) > 0 )\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public function canEdit()\n {\n return $this->is_locked == 0;\n }", "public static function getEditMode(): bool\n\t{\n\t\treturn self::$editMode;\n\t}", "public function isEditorial()\n {\n return $this->getData('isEditorial', false) === true;\n }", "function isVisible() {\n return $this->entry->flags & ThreadEntry::FLAG_EDITED;\n }", "protected function isCurrentPageEditableByUser() {\n\n\t\t$title = $this->getTitle();\n\t\t$user = $this->getUser();\n\t\treturn $title->quickUserCan( 'edit', $user )\n\t\t\t&& ( $title->exists() || $title->quickUserCan( 'create', $user ) );\n\t}", "function checkVisual($contentId=0) {\r\n\t\tglobal $option;\r\n\r\n\t\t$func = JRequest::getVar('view');\r\n\r\n\t\treturn ( $option == 'com_eventlist'\r\n\t\t&& $func == 'details'\r\n\t\t);\r\n\t}", "public function canShow()\n {\n return $this->_authSession->isFirstPageAfterLogin() && $this->_getLatestItem();\n }", "function is_podlove_settings_screen()\n{\n $screen = get_current_screen();\n\n return stripos($screen->id, 'podlove') !== false && $screen->id != 'settings_page_podlove-web-player-settings';\n}", "function rich_edit_exists()\n {\n }", "private function is_elementor_editor()\n {\n if ((isset($_REQUEST['action']) && 'elementor' == $_REQUEST['action']) ||\n isset($_REQUEST['elementor-preview'])\n ) {\n return true;\n }\n\n return false;\n }", "public function isEditable()\n {\n // Need to be able to save the DataObject if this is being called during PublishTargetJob.\n if ($this->owner->getIsPublishJobRunning()) {\n return true;\n }\n\n // Need to be able to save the DataObject if this is being called during UnPublishTargetJob.\n if ($this->owner->getIsUnPublishJobRunning()) {\n return true;\n }\n\n if ($this->owner->config()->get('allow_embargoed_editing')) {\n return true;\n }\n\n if ($this->owner->getIsPublishScheduled()) {\n return false;\n }\n\n $embargoRecordIsEditable = $this->owner->invokeWithExtensions('embargoRecordIsEditable');\n if (in_array(false, $embargoRecordIsEditable)) {\n return false;\n }\n\n return true;\n }", "function eman_post_editable( $post )\n{\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! is_object($post) ) return false;\n\n\t// Settings area always editable\n\tif ( emanager_post::is_settings($post) ) return true;\n\n\t$status = emanager_post::status($post, 'slug');\n\n\t// If no status yet or is in draft or revise, it is editable\n\tif ( 'draft' == $status || 'revise' == $status ) return true;\n\n\treturn false;\n}", "public function isViewed() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->viewDate) ? false: true;\r\n\t}", "public function canEdit() {\n\t\treturn $this->_perms->checkModuleItem ( $this->_tbl_module, 'edit' );\n\t}", "public function canEditCaption()\n {\n return in_array('edit_caption', $this->actions);\n }", "public function isEditor(){\n\t\tif($_SESSION['waf_user']['editor']==1)return true;\n\t\telse return false;\n\t}", "public static function isEditPage($type = null)\n {\n global $pagenow;\n //make sure we are on the backend\n if (!is_admin()) {\n return false;\n }\n\n if (is_null($type)) {\n return in_array($pagenow, array('post.php', 'post-new.php'));\n } elseif (is_array($type)) {\n return in_array($pagenow, array_map(function ($item) {\n return $item . '.php';\n }, $type));\n } else {\n return in_array($pagenow, array($type . '.php'));\n }\n }", "public function isPreview()\n {\n return !$this->exists();\n }", "public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }", "function fa_is_preview(){\n\tif( isset( $_GET['fa_slider_preview'] ) ){\n\t\tif( current_user_can('edit_fa_items') ){\n\t\t\treturn true;\n\t\t}\n\t}\t\n\treturn false;\t\n}", "public function isShowInput() {\n\t\t$this->getShowInput();\n\t}", "function can_do_edit() {\n // ends\n $association_id = $this->required_param('association_id', PARAM_INT);\n $record = new clustertrack($association_id);\n $clusterid = $record->clusterid;\n $trackid = $record->trackid;\n\n return clusterpage::_has_capability('block/curr_admin:associate', $clusterid)\n && trackpage::_has_capability('block/curr_admin:associate', $trackid);\n }", "public function isEditor()\n {\n return $this->role()->where('id', $this->roles['EDITOR'])->exists();\n }", "function canEditPage(Page $page) {\n return ($this->isAdmin() || ($this->id == $page->getCreatorId()));\n }", "public function hasEpisodes()\n {\n $this->getEpisodes();\n if ($this->episodes !== null && !empty($this->episodes))\n return true;\n return false;\n }", "protected function is_course_editor() {\n if (!$this->getSession()->getPage()->findLink(get_string('turneditingoff')) &&\n !$this->getSession()->getPage()->findLink(get_string('turneditingon'))) {\n return false;\n }\n\n return true;\n }", "public function isEditable()\n\t{\n\t\tif(Auth::check())\n\t\t{\n\t\t\tif(Auth::user()->id == $this->author_id)\n\t\t\t{\n\t\t\t\tif ($this->created_at->diffInMinutes(Carbon::now()) < 30)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(Auth::user()->hasRole(['moderator', 'administrator', 'super user'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function showEdit()\n {\n\n }", "public function isViewsExposedForm() {\n return (isset($this->form['form_id']) &&\n $this->form['form_id']['#value'] == 'views_exposed_form');\n }", "function can_do_edit() {\n global $USER;\n\n if (has_capability('block/php_report:manageschedules', get_context_instance(CONTEXT_SYSTEM))) {\n //user can manage schedules globally, so allow access\n return true;\n }\n\n $report_shortname = '';\n\n //try to obtain the report shortname from the report schedule id\n //(applies only during first step of wizard interface)\n $id = $this->optional_param('id', 0, PARAM_INT);\n if ($id !== 0) {\n if ($record = get_record('php_report_schedule', 'id', $id)) {\n if ($record->userid != $USER->id) {\n //disallow access to another user's schedule\n return false;\n }\n $config = unserialize($record->config);\n if (isset($config['report'])) {\n $report_shortname = $config['report'];\n }\n } else {\n //wrong id, so disallow\n return false;\n }\n }\n\n //try to obtain the report shortname from the workflow information\n //(applies only after the first step of the wizard interface)\n if ($report_shortname == '' && isset($this->workflow)) {\n $data = $this->workflow->unserialize_data();\n if ($data !== NULL && isset($data['report'])) {\n $report_shortname = $data['report'];\n }\n }\n\n if ($report_shortname === '') {\n //report info not found, so disallow\n return false;\n }\n\n //check permissions via the report\n $report_instance = php_report::get_default_instance($report_shortname, NULL, php_report::EXECUTION_MODE_SCHEDULED);\n return $report_instance !== false;\n }", "function isPreview()\t{\n\t\treturn ($this->conf[$this->conf['cmdKey'].'.']['preview'] && $this->preview);\n\t}", "function can_edit() {\n\n if ( ! strpos( $_SERVER['REQUEST_URI'], 'index.php') ) return false;\n\n $what = isset($_GET['what']) ? $_GET['what'] : false;\n $add = isset($_GET['add']) ? $_GET['add'] : false;\n\n // this is the rule for add posts\n return $what === 'bryndzoveHalusky' && $add == 1;\n}", "function inspiry_is_edit_property() {\n\t\tif ( isset( $_GET['edit_property'] ) && ! empty( $_GET['edit_property'] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isLivePreview()\n\t{\n\t\treturn (\n\t\t\t$this->isSiteRequest() &&\n\t\t\t$this->isActionRequest() &&\n\t\t\tcraft()->request->getPost('livePreview')\n\t\t);\n\t}", "function userCanEditPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageEdit(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}", "public function edit(User $user)\n {\n return $user->role->can_edit_post == 1;\n }", "function canEdit() {\r\n\t\tif($this->owner->ID == Member::currentUserID())\r\n\t\t\treturn true;\r\n\r\n\t\t$member = Member::currentUser();\r\n\t\tif($member)\r\n\t\t\treturn $member->isAdmin();\r\n\r\n\t\treturn false;\r\n\t}", "public function isNeedUpdate()\n {\n if (is_null($this['episode_update_date'])){\n return true;\n }\n if (Carbon::now()->diffInDays(new Carbon($this['episode_update_date'])) > 3){\n return true;\n }\n return false;\n }", "public function is_upgrade_screen() {\n\t\t$retval = false;\n\t\tif ( bp_is_action_variable( 'upgrade' ) ) {\n\t\t\t$retval = true;\n\t\t}\n\t\treturn $retval;\n\t}", "private function is_install_screen() {\n\t\t$screen = get_current_screen();\n\n\t\tif ( ! $screen ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn 'update' === $screen->id;\n\t}", "function visible () {\n\t\treturn isadmin();\n\t}", "public function isValidEditingStatus()\n {\n return ($this->ID == 0 || $this->Status == self::STATUS_NEW || $this->Status == self::STATUS_FAILED);\n }", "function displayEditScreen()\t{\t \n\t\t// We handle here Edit mode or Preview Mode\n\t\t// Edit Mode : User can edit fields\n\t\t// Preview Mode : user can only see fields\t\n\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('displayEditScreen'=>'on'));\n\t\t$exporttype=$this->piVars['exporttype'];\n\t\t$print=$this->piVars['print'];\n\t\t$printerName=$this->piVars['printername'];\n\t\t$printServerName=$this->piVars['printservename'];\n\t\tif ($exporttype == 'PDF') $exporttype = \"PDFDET\";\n\t\t$this->conf['cmdmode']='edit';\t\n\t\t// We handle here Edit mode or Preview Mode\n\t \t// Edit Mode : User can edit fields\n\t \t// Preview Mode : user can only see fields\t \n\t \t//$this->markerArray['###BACK_URL###'] = \"\";\n\t \t\n\t\t//We handle backurl...\n\t\t/*if ($this->conf['edit.']['backPagePid'] && !$this->conf['no_action']) {\n\t\t\t$this->backURL=$this->pi_getPageLink($this->conf['edit.']['backPagePid']);\n\t\t\tif (!strpos($this->backURL,'?')) $this->backURL.='?';\n\t\t\t$this->markerArray['###BACK_URL###'] = $this->backURL;\n\t\t}*/\n\t\t// If editing is enabled\n\t\tif ($this->conf['edit'] || $this->preview || $this->conf['list'] )\t{\t\n\t\t\t// hack for lists in second plugin ... to be checked.., Will not work if we want to edit in second plugin ...\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('Edit or preview'=>'on'));\n\t\t\t$uid=$this->dataArr[$this->conf['uidField']]?$this->dataArr[$this->conf['uidField']]:$this->recUid;\n \t\t\tif ($this->conf['list.']['rUJoinField']=='uid' && $uid){\n \t\t\t\t\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('UIDFIELD'=>$this->conf['uidField'].' : '.$this->recUid));\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('dataArr'=>$this->dataArr[$this->conf['uidField']]));\n\t\t\t\t$origArr = $this->metafeeditlib->getRawRecord($this->theTable,$uid,$this->conf);\n\t\t\t\tif (!$origArr) die(__METHOD__.\":Detail mode and no id given for $this->theTable,$uid\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('editMode'=>'on'));\n\n\t\t\t// here we handle foreign tables not the best way , we should work on join tables especially if we handle lists...\n\t\t\t\n\t\t\tif ($this->conf['foreignTables'] && is_array($origArr)) {\n\t\t\t\t\n\t\t\t\t//MM not implemented\n\t\t\t\t//Not MM\n\t\t\t\t\n\t\t\t\t$FTRels=t3lib_div::trimexplode(',',$this->conf['foreignTables']);\n\t\t\t\tforeach($FTRels as $FTRel) {\n\t\t\t\t\t$FTable=$GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['foreign_table'];\n\t\t\t\t\t$FTUid=$origArr[$FTRel];\n\t\t\t\t\t// what if multiple ???\n\t\t\t\t\t// what if editmenu list ???\n\t\t\t\t\tif ($FTUid) {\n\t\t\t\t\t\t //on recup l'id de l'enregistrement a associer\n\t\t\t\t\t\tif ($GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['MM']) { //si on est dans une MM faut d'abord recup les id de la table MM\n\t\t\t\t\t\t\t$MMT = $GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['MM'];\n\t\t\t\t\t\t\t$LTUid=$origArr[\"uid\"];\n\t\t\t\t\t\t\t$MMTreq = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('*',$this->theTable,$MMT,$FTable,'AND '.$this->theTable.'.uid='.$origArr['uid']);\n\t\t\t\t\t\t\t$resu=$GLOBALS['TYPO3_DB']->sql_num_rows($MMTreq);\n\t\t\t\t\t\t\tif ($resu>=1) {\n\t\t\t\t\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($MMTreq)) {\n\t\t\t\t\t\t\t\t\tforeach($row as $key =>$val) $origArr[$FTRel.'.'.$key]=$val;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// originally there only these 2 lines in this condition (if ($FTUid) )\n\t\t\t\t\t\t\t$FTorigArr = $GLOBALS['TSFE']->sys_page->getRawRecord($FTable, $FTUid);\n\t\t\t\t\t\t\tif (is_array($FTorigArr)) foreach($FTorigArr as $key =>$val) $origArr[$FTRel.'.'.$key]=$val;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$FTCA=$GLOBALS['TCA'][$FTable]['columns'];\n\t\t\t\t\t\t//krumo ($FTCA);\n\t\t\t\t\t\tif (is_array($FCTA)) foreach($FTCA as $key=>$val) {\n\t\t\t\t\t\t\tif (in_array(substr($FTCA,0,11),array('--div--;Tab','--fsb--;FSB','--fse--;FSE'))) continue;\n\t\t\t\t\t\t\t$this->markerArray['###FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###FIELD_EVAL_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$FTRel.'_'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$FTRel.'_'.$key.'###']='';\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//<CBY> We go to detail mode directly if editUnique is true and there is only one elment to edit.\n\t\t\t$DBSELECT=$this->metafeeditlib->DBmayFEUserEditSelectMM($this->theTable,$GLOBALS['TSFE']->fe_user->user, $this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$mmTable,$this->conf).$GLOBALS['TSFE']->sys_page->deleteClause($this->theTable);\n\n\t\t\t$TABLES=$mmTable?$this->theTable.','.$mmTable:$this->theTable;\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>$origArr));\n\t\t\tif (!is_array($origArr)&&$this->conf['editUnique']) {\n\t\t\t\t$lockPid = ($this->conf['edit.']['menuLockPid'] && $this->conf['pid'])? ' AND pid='.intval($this->thePid) : '';\n\t\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $TABLES, '1 '.$lockPid.$DBSELECT);\n\t\t\t\tif ($this->conf['debug']) \techo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDITUNIQUE TEST'=>$GLOBALS['TYPO3_DB']->SELECTquery('*', $TABLES, '1 '.$lockPid.$DBSELECT)));\n\t\t\t\t$resu=$GLOBALS['TYPO3_DB']->sql_num_rows($res);\n\t\t\t\tif ($resu>=1)\t{\n \t\t\t\t\twhile($menuRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $menuRow[$this->conf['uidField']]);\n\t\t\t\t\t\t$this->recUid=$menuRow[$this->conf['uidField']];\n\t\t\t\t\t\t$this->conf['recUid']=$this->recUid;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t\t// <CBY>\n\t\t\t$this->markerArray['###REC_UID###']=$this->recUid;\n\t\t\t//if ($GLOBALS['TSFE']->loginUser || $this->aCAuth($origArr))\t{\t// Must be logged in OR be authenticated by the aC code in order to edit\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ( $this->aCAuth($origArr)&& $this->conf['requireLogin'])||!$this->conf['requireLogin'])\t{\n\t\t\t\t// Must be logged in OR be authenticated by the aC code in order to edit\n\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>\"No login\"));\n\t\t\t\n\t\t\t\t// We come from ??\n\t\t\t\tif (is_array($origArr) && !($this->conf['inputvar.']['BACK'] && $this->conf['inputvar.']['cameFromBlog']))\t{\n\t\t\t\t\tif ($this->conf['blogData']) $this->preview=1; \n\t\t\t\t\t// we check if edit or preview mode is allowed ...\n\t\t\t\t\tif (!$this->conf['edit'] && !$this->preview )\t{\t// If editing is enabled\n\t\t\t\t\t\t$content.='meta_feedit : feadminlib.inc, Edit-option is not set and Preview-option is not set in TypoScript';\n\t\t\t\t\t\treturn $content;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($this->conf['disableEdit'] && !$this->preview )\t{\t// If editing is enabled\n\t\t\t\t\t\t$content.='meta_feedit : feadminlib.inc, Edit-option disabled and Preview-option is not set in TypoScript';\n\t\t\t\t\t\treturn $content;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t\n\t\t\t\t\t\t// Display the form, if access granted.\n\t\t\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>\"User may edit\"));\n\t\t\t\t\t\tif \t($this->conf['evalFunc'])\t{\n\t\t\t\t\t\t\t$origArr = $this->userProcess('evalFunc',$origArr);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->markerArray = $this->setfixed($this->markerArray, $this->conf['setfixed.'], $origArr);\n\t\t\t\t\t\t$content=$this->displayEditForm($origArr,$this->conf,$exporttype,$print,$printerName,$printServerName);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Else display error, that you could not edit that particular record...\t\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_NO_PERMISSIONS###');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If the recUid did not select a record, we display a menu of records. (eg. if no recUid)\n\t\t\t\t\t// we check if list mode is allowed ...\n\t\t\t\t\tif (!$this->conf['list'])\t{\t// If editing is enabled\n\t\t\t\t\t\t\t$content.='List-option is not set in TypoScript';\n\t\t\t\t\t\t return $content;\n\t\t\t\t\t}\n\t\t\t\t\t//$content=($this->conf['general.']['listMode']==2)?$this->metafeeditgrid->displayGridScreen($TABLES,$DBSELECT,$this->conf):$this->displayListScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\tswitch($this->conf['general.']['listMode']) {\n\t\t\t\t\t\tcase 2 :\n\t\t\t\t\t\t\t$content=$this->metafeeditgrid->displayGridScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1 :\n\t\t\t\t\t\t\t\t//$content=$this->metafecalendar->displayCalendarScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\t$cal=t3lib_div::makeInstance('tx_metafeedit_calendar');\n\t\t\t\t\t\t $cal->initObj($this->metafeeditlib,$this->cObj);\n\t\t\t\t\t\t\t$content=$cal->displayCalendarScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t$content=$this->displayListScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Finally this is if there is no login user. This must tell that you must login. Perhaps link to a page with create-user or login information.\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_AUTH###');\n\t\t\t}\n\t\t} else {\n\t\t\t$content.='Display Edit Screen : Edit-option , Preview-option or List-option is not set in TypoScript';\n\t\t}\n\t\treturn $content;\n\t}", "function CheckForEditableFields($ScreenName){\n $Screen = &$this->getScreen($ScreenName);\n //$Screen = &$this->Screens[$ScreenName];\n $nEditableFields = 0;\n foreach($Screen->Fields as $sf){\n if ($sf->isEditable()){\n $nEditableFields += 1;\n }\n }\n if ($nEditableFields > 0){\n return true;\n } else {\n return false;\n }\n }", "function lb_show_edit_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'edit',\n\t\t\t'this_cafe' => lb_get_this_cafe_from_cafe( $_GET['edit-id'] ),\n\t\t)\n\t);\n}", "public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }", "private function isEditor() : bool\n {\n return $this->role('editor');\n }", "protected function isCurrentPageContentModelEditable() {\n\t\t$contentHandler = $this->getContentHandler();\n\n\t\treturn $contentHandler->supportsDirectEditing()\n\t\t\t&& $contentHandler->supportsDirectApiEditing();\n\t}", "function eme_is_events_page() {\n $events_page_id = get_option('eme_events_page' );\n if ($events_page_id) {\n return is_page ( $events_page_id );\n } else {\n return false;\n }\n}", "public function canShowTab()\n {\n $integrationData = $this->_coreRegistry->registry(\n Integration::REGISTRY_KEY_CURRENT_INTEGRATION\n );\n\n if (isset($integrationData['integration_id']) &&\n isset($integrationData['endpoint']) &&\n (str_contains($integrationData['endpoint'], 'extend.com') &&\n str_contains($integrationData['endpoint'], 'integ-mage'))\n ) {\n return true;\n }\n }", "public function isShow_title() {\n\t\t$this->getShow_title();\n\t}", "public function isEditable() {}", "public function showInMenu()\n {\n $ctrs = PageCom::ctrs();\n return $ctrs && (count($ctrs) > 1);\n }", "function is_preview_only() {\n\tif ( class_exists( 'Fusion_App' ) ) {\n\t\t$fusion_app = Fusion_App::get_instance();\n\t\treturn $fusion_app->get_preview_only_status();\n\t}\n\treturn false;\n}", "function eman_can_edit( $post, $user_id=false )\n{\n\t/**\n\t * If you can't view this post, then you can't edit it...\n\t */\n\tif ( ! eman_can_view($post, $user_id) ) return false;\n\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! is_object($post) ) return false;\n\tif ( ! $user_id ) $user_id = get_current_user_id();\n\t$user = get_user_by('id', $user_id);\n\t$status = emanager_post::status($post, 'slug');\n\t$bic_userlogin = emanager_bic::get_bic($post, 'user_login');\n\n\t/**\n\t * Test if user has capability to edit\n\t */\n\n\t// Issues have different criteria\n\tif ( 'em_issue' == $post->post_type )\n\t{\n\t\t// Original author\n\t\tif ( emanager_post::is_author($post) || emanager_post::same_company_as_post($post) || eman_check_role('turner') ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// PCO Request exception for allowances. Allow user to edit if in their court and status is before sent to owner.\n\tif ( 'em_noc' == $post->post_type )\n\t{\n\t\tif (($bic_userlogin === $user->user_login) && in_array($status, array('draft','manager','ready'))) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (eman_check_role('turner') && in_array($status, array('draft'))) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// If the post is editable\n\tif ( eman_post_editable($post) )\n\t{\n\t\t// Original author\n\t\tif ( emanager_post::is_author($post) ) {\n\t\t\treturn true;\n\t\t}\n\t\t// Same company as original author\n\t\telseif ( emanager_post::same_company_as_post($post) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "public function editAction() {\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //GET SITEREVIEW SUBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->core()->getSubject();\n\n $this->view->listingtype_id = $listingtype_id = $this->_listingType->listingtype_id;\n\n $this->view->slideShowEnanle = $this->slideShowEnable($listingtype_id);\n\n $this->view->listing_singular_uc = ucfirst($this->_listingType->title_singular);\n $this->view->listing_singular_lc = strtolower($this->_listingType->title_singular);\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n }\n\n $this->view->content_id = Engine_Api::_()->sitereview()->getTabId($listingtype_id, 'sitereview.video-sitereview');\n\n //SELECTED TAB\n $this->view->TabActive = \"video\";\n\n if (!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_videoedit_edit_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n }\n\n //GET VIDEOS\n $this->view->type_video = $type_video = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview.show.video');\n\n if ($type_video && isset($sitereview->main_video['corevideo_id'])) {\n $this->view->main_video_id = $sitereview->main_video['corevideo_id'];\n } elseif (isset($sitereview->main_video['reviewvideo_id'])) {\n $this->view->main_video_id = $sitereview->main_video['reviewvideo_id'];\n }\n\n $this->view->videos = $videos = array();\n $this->view->integratedWithVideo = false;\n $sitevideoEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitevideo');\n if ($sitevideoEnabled && (Engine_Api::_()->getDbtable('modules', 'sitevideo')->getIntegratedModules(array('enabled' => 1, 'item_type' => \"sitereview_listing_$sitereview->listingtype_id\", 'item_module' => 'sitereview')))) {\n $params = array();\n $params['parent_type'] = $sitereview->getType() . '_' . $sitereview->listingtype_id;\n $params['parent_id'] = $sitereview->listing_id;\n $this->view->videos = $videos = Engine_Api::_()->getDbTable('videos', 'sitevideo')->getVideoPaginator($params);\n $this->view->integratedWithVideo = true;\n } else {\n if (Engine_Api::_()->sitereview()->enableVideoPlugin() && !empty($type_video)) {\n $this->view->videos = $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 1);\n } elseif (empty($type_video)) {\n $this->view->videos = $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 0);\n }\n }\n\n $allowed_upload_video = Engine_Api::_()->sitereview()->allowVideo($sitereview, $viewer, count($videos), $uploadVideo = 1);\n $this->view->upload_video = 1;\n if (Engine_Api::_()->sitereview()->hasPackageEnable()) {\n $this->view->upload_video = $allowed_upload_video;\n } else {\n if (empty($allowed_upload_video)) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n }\n\n $this->view->count = count($videos);\n\n //MAKE FORM\n $this->view->form = $form = new Sitereview_Form_Video_Editvideo();\n\n foreach ($videos as $video) {\n\n $subform = new Sitereview_Form_Video_Edit(array('elementsBelongTo' => $video->getGuid()));\n\n if ($video->status != 1) {\n if ($video->status == 0 || $video->status == 2):\n $msg = $this->view->translate(\"Your video is currently being processed - you will be notified when it is ready to be viewed.\");\n elseif ($video->status == 3):\n $msg = $this->view->translate(\"Video conversion failed. Please try again.\");\n elseif ($video->status == 4):\n $msg = $this->view->translate(\"Video conversion failed. Video format is not supported by FFMPEG. Please try again.\");\n elseif ($video->status == 5):\n $msg = $this->view->translate(\"Video conversion failed. Audio files are not supported. Please try again.\");\n elseif ($video->status == 7):\n $msg = $this->view->translate(\"Video conversion failed. You may be over the site upload limit. Try a smaller file, or delete some files to free up space.\");\n endif;\n\n $subform->addElement('dummy', 'mssg' . $video->video_id, array(\n 'description' => $msg,\n 'decorators' => array(\n 'ViewHelper',\n array('HtmlTag', array('tag' => 'div', 'class' => 'tip')),\n array('Description', array('tag' => 'span', 'placement' => 'APPEND')),\n array('Description', array('placement' => 'APPEND')),\n ),\n ));\n $t = 'mssg' . $video->video_id;\n $subform->$t->getDecorator(\"Description\")->setOption(\"placement\", \"append\");\n }\n $subform->populate($video->toArray());\n $form->addSubForm($subform, $video->getGuid());\n }\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //GET FORM VALUES\n $values = $form->getValues();\n\n if (isset($_POST['corevideo_cover']) && !empty($_POST['corevideo_cover'])) {\n if (isset($sitereview->main_video) && !empty($sitereview->main_video)) {\n $sitereview->main_video = array_merge((array) $sitereview->main_video, array('corevideo_id' => $_POST['corevideo_cover']));\n } else {\n $sitereview->main_video = array('corevideo_id' => $_POST['corevideo_cover']);\n }\n } elseif (isset($_POST['reviewvideo_cover']) && $_POST['reviewvideo_cover']) {\n if (isset($sitereview->main_video) && !empty($sitereview->main_video)) {\n $sitereview->main_video = array_merge((array) $sitereview->main_video, array('reviewvideo_id' => $_POST['reviewvideo_cover']));\n } else {\n $sitereview->main_video = array('reviewvideo_id' => $_POST['reviewvideo_cover']);\n }\n }\n\n $sitereview->save();\n\n //VIDEO SUBFORM PROCESS IN EDITING\n foreach ($videos as $video) {\n $subform = $form->getSubForm($video->getGuid());\n\n $values = $subform->getValues();\n $values = $values[$video->getGuid()];\n if (isset($values['delete']) && $values['delete'] == '1') {\n Engine_Api::_()->getDbtable('videos', 'sitereview')->delete(array('video_id = ?' => $video->video_id, 'listing_id = ?' => $sitereview->listing_id));\n Engine_Api::_()->getDbtable('actions', 'activity')->delete(array('type = ?' => 'video_sitereview_listtype_' . $listingtype_id, 'object_id = ?' => $sitereview->listing_id));\n } else {\n $video->setFromArray($values);\n $video->save();\n }\n }\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'edit', 'listing_id' => $sitereview->listing_id), \"sitereview_videospecific_listtype_$listingtype_id\", true);\n }", "public function hasShowDisplay()\n {\n return $this->show_display !== null;\n }", "function show_edit()\n\t{\n\t\treturn '';\n\t}", "public function isUseInPreview() {\r\n\t\treturn $this->getUseInPreview();\r\n\t}", "protected function isPageEditable()\n {\n if ($this->getBackendUser()->isAdmin()) {\n return true;\n }\n return !$this->pageinfo['editlock'] && $this->getBackendUser()->doesUserHaveAccess($this->pageinfo, Permission::PAGE_EDIT);\n }", "private function showAdminHint(): bool\n {\n return $this->getWordpressConfig()->atAdminPanel() === false\n && $this->getMainConfig()->blogAdminHint() === true;\n }", "public function isDraft() {\n return $this->getEditingStatus() != '';\n }" ]
[ "0.791495", "0.7261454", "0.7122002", "0.68549705", "0.68472046", "0.6609266", "0.65801805", "0.65801805", "0.65569115", "0.64714736", "0.644012", "0.6424129", "0.64155513", "0.64130676", "0.6375586", "0.6364731", "0.6350217", "0.63103384", "0.6307443", "0.63019407", "0.62914854", "0.6273193", "0.6265976", "0.62389946", "0.6234673", "0.6234589", "0.62323946", "0.6218725", "0.6203503", "0.61847806", "0.618473", "0.61620265", "0.6161004", "0.61523134", "0.61521703", "0.61227536", "0.6121827", "0.6111472", "0.60826486", "0.6030045", "0.60239387", "0.60232556", "0.60181653", "0.6017757", "0.59838957", "0.5981841", "0.59743696", "0.59651697", "0.5947393", "0.5926299", "0.5925035", "0.59052736", "0.58834296", "0.5881778", "0.5880966", "0.5871183", "0.58532", "0.5810875", "0.58032966", "0.57897633", "0.5783303", "0.5783191", "0.5771382", "0.57666165", "0.576248", "0.5756143", "0.5749114", "0.57451797", "0.5738851", "0.5732349", "0.57288885", "0.5726173", "0.57241124", "0.5720843", "0.57038265", "0.5703401", "0.56981766", "0.56975025", "0.56960905", "0.56869185", "0.5654197", "0.56514174", "0.56512815", "0.5650805", "0.56505096", "0.5648878", "0.56320995", "0.5611251", "0.56111217", "0.55977243", "0.5595641", "0.55916107", "0.5590746", "0.55857867", "0.55840796", "0.5583609", "0.5578719", "0.5573585", "0.55708534", "0.5560402" ]
0.8592952
0
Podcast Landing Page URL.
function get_landing_page_url() { $landing_page = \Podlove\get_setting('website', 'landing_page'); switch ($landing_page) { case 'homepage': return home_url(); break; case 'archive': if ('on' == \Podlove\get_setting('website', 'episode_archive')) { $archive_slug = trim(\Podlove\get_setting('website', 'episode_archive_slug'), '/'); $blog_prefix = \Podlove\get_blog_prefix(); $blog_prefix = $blog_prefix ? trim($blog_prefix, '/').'/' : ''; return trailingslashit(get_option('home').$blog_prefix).$archive_slug; } break; default: if (is_numeric($landing_page)) { if ($link = get_permalink($landing_page)) { return $link; } } break; } // always default to home page return home_url(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLandingPageUrl(): string\n {\n return $this->landingPageUrl;\n }", "function url()\n {\n return $this->peopletag->homeUrl();\n }", "public function getFrontPageUrl();", "public function getUrlForSplashPage(): string\n {\n return $this->generateChoiceUrl(true);\n }", "public function url()\n\t{\n\t\t\n\t\t$lang = Config::get('app.locale');\n\t\t$route_prefix = ($lang == \"ar\" ? \"ar/\" : \"\");\t\t\n\t\treturn Url::to($route_prefix .'page/' .$this->link);\n\t}", "public static function top_page_url () {\n\t\treturn self::$video_url_base;\n\t}", "function homeURL() {\n return 'mist.ac.bd';\n }", "public function startPageUrl()\n {\n return $this->structure->getUrl(\n $this->currentPage,\n $this->structure->getStartPage()\n );\n }", "public function getPageUrl()\n {\n if ($this->hasData(static::REGISTRATION_URL)) {\n return $this->getData(static::REGISTRATION_URL);\n } elseif ($this->hasData(static::CONFIGURATION_URI)) {\n return $this->getData(static::CONFIGURATION_URI);\n } elseif ($this->hasData(static::REGISTRATION_URI)) {\n return $this->getData(static::REGISTRATION_URI);\n }\n\n return '';\n }", "public function URL()\n\t{\n\t\treturn $this->isHomePage() ? \\URL::to('/') : \\URL::to($this->uri);\n\t}", "function url()\n\t{\n\t\t$id\t\t= $this->attribute('id');\n\t\t$page\t= $this->pyrocache->model('pages_m', 'get', array($id));\n\n\t\treturn site_url($page ? $page->uri : '');\n\t}", "function date_views_page_url($view) {\r\n if ($view->build_type == 'page') {\r\n return date_views_real_url($view, $view->date_info->real_args);\r\n }\r\n else {\r\n $block_identifier = isset($view->date_info->block_identifier) ? $view->date_info->block_identifier : 'mini';\r\n return url($_GET['q'], date_views_querystring($view, array($block_identifier => NULL)), NULL, TRUE);\r\n }\r\n}", "protected function pageURI(): string\n {\n $ssl = (@$_SERVER['HTTPS'] == 'on');\n $link = ($ssl? 'https://' : 'http://') .$_SERVER['HTTP_HOST'];\n if ($_SERVER['SERVER_PORT'] != ($ssl? '443' : '80')) {\n $link .= ':' .$_SERVER[\"SERVER_PORT\"];\n }\n return $link .urldecode($_SERVER['REQUEST_URI']);\n }", "public function get_post_page_url() {\n\t\tif ( 'page' == get_option( 'show_on_front' ) ) {\n\t\t\treturn get_permalink( get_option( 'page_for_posts' ) );\n\t\t}\n\n\t\treturn home_url();\n\t}", "protected function _getDefaultLandingPath()\n {\n return '/';\n }", "function url($page='') {\n return $this->base_url . $page;\n }", "function href() {\n\t\t$usemodrewrite = polarbear_setting('usemodrewrite');\n\t\tif ($usemodrewrite) {\n\t\t\treturn $this->fullpath();\n\t\t} else {\n\t\t\treturn $this->templateToUse() . '?polarbear-page=' . $this->getId();\n\t\t}\n\t}", "public function getHomeUrl()\n {\n return url('');\n }", "public function getLoginPageUri()\n {\n return $this->login_page_uri;\n }", "public static function _url() {\n\t\treturn self::pw('pages')->get('pw_template=mpm')->url;\n\t}", "function CurrPageURL() {\n $pageURL = 'http';\n if ($_SERVER[\"HTTPS\"] == \"on\") {\n $pageURL .= \"s\";\n }\n $pageURL .= \"://\";\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n $pageURL .= $_SERVER[\"SERVER_NAME\"] . \":\" . $_SERVER[\"SERVER_PORT\"] . $_SERVER[\"REQUEST_URI\"];\n } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\n }\n return $pageURL;\n }", "public function url()\n {\n return route('page-item', ['page' => $this->wrappedObject->slug]);\n }", "public function getHomepageUrl()\n {\n $homepage = Mage::getModel('mzeis_documentation/page');\n $homepage->setName(Mage::helper('mzeis_documentation')->getHomepageName());\n return Mage::helper('mzeis_documentation/page')->getViewUrl($homepage);\n }", "function site_url ($page) {\n return \"/assignment/Student Companion/pages/\" . $page;\n }", "public function RedirectURL(){\n //echo Director::baseURL();exit(); \n return urlencode(Director::baseURL().$this->request->getURL(true));\n }", "public function getPublicUrlAttribute()\n {\n $year = $this->date->format('Y');\n $month = $this->date->format('m');\n $day = $this->date->format('d');\n\n return url(\"/noticias/{$year}/{$month}/{$day}/{$this->slug}\");\n }", "static public function connect_url() {\n\t\treturn Controller::join_links(\"facebook\", \"connect\");\n\t}", "public function jumpUrl() {}", "function public_url() {\n return url(\"/\");\n }", "private function curPageURL() {\r\n $pageURL = 'http';\r\n if ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\r\n $pageURL .= \"://\";\r\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\r\n } else {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\r\n }\r\n return $pageURL;\r\n }", "protected function getRedirectUrl()\n\t{\n if ($customURL = $this->input->getBase64('returnurl', ''))\n {\n $customURL = base64_decode($customURL);\n }\n\n $url = !empty($customURL) ? $customURL : 'index.php?option='\n . $this->container->componentName\n . '&view='\n . $this->container->inflector->pluralize($this->view)\n . $this->getItemidURLSuffix(); // e.g. '&Itemid=123' or an empty string if no Itemid\n\n return $url;\n }", "public function get_subscribe_url() {\n\n\t\t$podcast = \\Podlove\\Model\\Podcast::get_instance();\n\n\t\t$url = sprintf(\n\t\t\t'%s/feed/%s/',\n\t\t\tget_bloginfo( 'url' ),\n\t\t\t$this->slug\n\t\t);\n\n\t\treturn apply_filters( 'podlove_subscribe_url', $url );\n\t}", "public function getDefaultURLSegment()\n {\n return $this->generateURLSegment(\n _t(\n 'SilverStripe\\CMS\\Controllers\\CMSMain.NEWPAGE',\n 'New {pagetype}',\n [\n 'pagetype' => $this->i18n_singular_name()\n ]\n )\n );\n }", "protected function _getUrl()\n {\n return Router::url([\n '_name' => 'wikiPages',\n 'id' => $this->id,\n 'slug' => Inflector::slug($this->title)\n ]);\n }", "public function getStartupPageUrl()\n {\n $menuItem = $this->_getMenu()->get(\n $this->_scopeConfig->getValue(self::XML_PATH_VENDOR_STARTUP_MENU_ITEM, $this->_scopeType)\n );\n if ($menuItem !== null) {\n if ($menuItem->isAllowed() && $menuItem->getAction()) {\n return $this->getUrl($menuItem->getAction());\n }\n }\n return $this->getUrl($this->findFirstAvailableMenu());\n }", "public static function current_page_url() {\n\t\t$pageURL = 'http';\n\t\tif (!empty($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n\t\t$pageURL .= \"://\";\n\t\tif ($_SERVER[\"SERVER_PORT\"] != \"80\" && $_SERVER[\"SERVER_PORT\"] != \"443\" ) {\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n\t\t} else {\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n\t\t}\n\t\treturn $pageURL;\t\t\n\t}", "function currentPageURL()\n{\n $pageURL = 'http';\n if (array_key_exists('HTTPS', $_SERVER) && $_SERVER['HTTPS'] == 'on') {\n $pageURL .= 's';\n }\n $pageURL .= '://';\n if ($_SERVER['SERVER_PORT'] != '80') {\n $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n } else {\n $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n }\n return $pageURL;\n}", "function main_url(){\n return \"http://\".$this->imdbsite.\"/name/nm\".$this->imdbid().\"/\";\n }", "function current_page_url() {\n\tglobal $CONFIG;\n\n\t$url = parse_url($CONFIG->wwwroot);\n\n\t$page = $url['scheme'] . \"://\";\n\n\t// user/pass\n\tif ((isset($url['user'])) && ($url['user'])) {\n\t\t$page .= $url['user'];\n\t}\n\tif ((isset($url['pass'])) && ($url['pass'])) {\n\t\t$page .= \":\".$url['pass'];\n\t}\n\tif ((isset($url['user']) && $url['user']) ||\n\t\t(isset($url['pass']) && $url['pass'])) {\n\t\t$page .=\"@\";\n\t}\n\n\t$page .= $url['host'];\n\n\tif ((isset($url['port'])) && ($url['port'])) {\n\t\t$page .= \":\" . $url['port'];\n\t}\n\n\t//$page.=\"/\";\n\t$page = trim($page, \"/\");\n\n\t$page .= $_SERVER['REQUEST_URI'];\n\n\treturn $page;\n}", "protected function ___url() {\n\t\treturn $this->pagefiles->url . $this->basename;\n\t}", "function pweb_login_url() { return home_url(); }", "function url_para($pagina){\n return vazio($pagina) ? URL : URL.\"index.php/\".$pagina;\n }", "public function set_login_url()\n {\n return home_url();\n }", "function thrive_get_redirect_page_url() {\n\n\t$selected_login_post_id = intval( get_option( 'thrive_login_page' ) );\n\n\tif ( $selected_login_post_id === 0 ) {\n\n\t\treturn;\n\n\t}\n\n\t$login_post = get_post( $selected_login_post_id );\n\n\tif ( ! empty( $login_post ) ) {\n\n\t\treturn get_permalink( $login_post->ID );\n\n\t}\n\n\treturn false;\n\n}", "public function get_redirect() {\n return new \\moodle_url('/');\n }", "public static function arprocUrl() {\n\t\treturn self::pw('pages')->get('pw_template=arproc')->url;\n\t}", "function page_url($slash = TRUE)\n{\n\t$CI =& get_instance();\n\t$CI->load->library('fs_navigation');\n\t\n\tif($slash == TRUE)\n\t{\n\t\treturn $CI->config->slash_item('base_url').variable($CI->config->unslash_item('url_parts')).$CI->fs_navigation->current('path').'/';\n\t}\n\telse\n\t{\n\t\treturn $CI->config->slash_item('base_url').variable($CI->config->unslash_item('url_parts')).$CI->fs_navigation->current('path');\n\t}\n}", "private function pageUrl($page_id) {\n\t\t$url = \"pages/\";\n\t\tif (is_string($page_id) && $page_id !== 'home') {\n\t\t\t$url .= '=';\n\t\t}\n\t\t$url .= $page_id;\n\t\treturn $url;\n\t}", "function padma_url() {\r\n\r\n\treturn apply_filters('padma_url', get_template_directory_uri());\r\n\r\n}", "public function url() {\n if ($this->no_results)\n return false;\n\n $config = Config::current();\n\n return url(\"view/\".$this->url, ExtendController::current());\n }", "function get_past_event_view_url($view) {\n $display = $view->current_display;\n $parameters = $view->getUrl()->getRouteParameters();\n\n switch ($display) {\n // Set the past events link for a topic filtered display.\n case 'page_3': // Event topic display\n case 'page_5': // Past topic display\n return Url::fromRoute('view.events.page_5', $parameters)->toString();\n\n // Set the past events link for a department filtered display.\n case 'page_4': // Event department display\n case 'page_6': // Past department display\n return Url::fromRoute('view.events.page_6', $parameters)->toString();\n\n // Set the past events link for the all events display.\n case 'page_1': // Event all display\n case 'page_2': // Past all display\n default:\n return '/past-events';\n }\n}", "public function getViewLink() {\n return getConfig(\"public_url\").\"?\".$this->shareID;\n }", "public function getRedirectUrl()\r\n {\r\n return \"{$this->data['redirect_url']}?session={$this->data['session']}\";\r\n }", "function get_login_url() {\r\n $login_url = ( '' != wpc_client_get_slug( 'login_page_id' ) ) ? wpc_client_get_slug( 'login_page_id' ) : wp_login_url();\r\n return $login_url;\r\n }", "public function getURL()\n {\n return Config::get('URL') . 'auth/unl/';\n }", "function curPageURL() {\n $pageURL = 'http';\n if (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n $pageURL .= \"://\";\n \n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n }\n return $pageURL;\n }", "function get_upcoming_event_view_url($view) {\n $display = $view->current_display;\n $parameters = $view->getUrl()->getRouteParameters();\n\n switch ($display) {\n // Set the upcoming events link for a topic filtered display.\n case 'page_3': // Event topic display\n case 'page_5': // Past topic display\n return Url::fromRoute('view.events.page_3', $parameters)->toString();\n\n // Set the upcoming events link for a department filtered display.\n case 'page_4': // Event department display\n case 'page_6': // Past department display\n return Url::fromRoute('view.events.page_4', $parameters)->toString();\n\n // Set the upcoming events link for the all events display.\n case 'page_1': // Event all display\n case 'page_2': // Past all display\n default:\n return '/events';\n }\n}", "public function buildFrontendUri() {}", "public function getPermalink();", "function dev_get_tickets_list_page_url() {\n\n\t$list = dev_get_option( 'ticket_list' );\n\n\tif ( empty( $list ) ) {\n\t\treturn '';\n\t}\n\n\tif ( is_array( $list ) && ! empty( $list ) ) {\n\t\t$list = $list[0];\n\t}\n\n\treturn wp_sanitize_redirect( get_permalink( (int) $list ) );\n\n}", "function spartan_login_url() {\n\n\treturn home_url();\n\n}", "abstract protected function get_redirect_page();", "public function GetViewAllURL();", "public function getCurrentPageURL() {\n\t\t\t$pageURL = 'http';\n\t\t\tif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == \"on\") {\n\t\t\t\t$pageURL .= \"s\";\n\t\t\t}\n\t\t\t$pageURL .= \"://\";\n\t\t\tif ($_SERVER['SERVER_PORT'] != 80) {\n\t\t\t\t$pageURL .= $_SERVER['SERVER_NAME'] . \":\" . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n\t\t\t}\n\t\t\treturn $pageURL;\n\t\t}", "public function getRedirectUrl()\n {\n }", "private function get_current_page_url() {\n $url = (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == 'on') ? 'https://' : 'http://';\n $url .= $_SERVER['SERVER_NAME'];\n $url .= $_SERVER['SERVER_PORT'] == 80 ? $_SERVER['REQUEST_URI'] : ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n\n return $url;\n }", "public function url()\n\t{\n\t\treturn Url::to(\"review/\".$this->id.\"/\".$this->slug.\"/\".Session::get('Lang'));\n\t}", "function home_url($taal = null)\n{\n if (IS_MEERTALIG) :\n return pll_home_url($taal);\n else :\n return get_site_url();\n endif;\n}", "public function url() {\n\t\tif ( ! isset( $this->url ) ) {\n\t\t\t$url = add_query_arg( 'page', $this->page_slug, 'sites.php' );\n\t\t\t$this->url = network_admin_url( $url );\n\t\t}\n\n\t\treturn $this->url;\n\t}", "public function show_path()\n\t{\n\t\treturn url::site($this->id . '/' . $this->title);\n\t}", "function cldcwhitehallURL() {\n return \"./?page=cl_dc_whitehall\";\n}", "public function getRedirectUrl() : string\n {\n return '';\n }", "protected function _getUrl(): string\n {\n property_exists_or_fail($this, ['id', 'album']);\n\n return Router::url(['_name' => 'photo', 'slug' => $this->get('album')->get('slug'), 'id' => (string)$this->get('id')], true);\n }", "public function url()\n {\n return '/dashboard';\n }", "public function home_url()\n\t{\n\t\treturn Route::url('home');\n\t}", "public function setUrl($pageName, $controller)\n {\n\n $params = [\n 'calendarSlug' => $this->slug,\n ];\n\n $this->url = $controller->pageUrl($pageName, $params);\n return $this->url;\n }", "function realanswers_current_page_url() {\r\n $pageURL = (@$_SERVER[\"HTTPS\"] == \"on\") ? \"https://\" : \"http://\";\r\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"] . \":\" . $_SERVER[\"SERVER_PORT\"] . $_SERVER[\"REQUEST_URI\"];\r\n }\r\n else\r\n {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\r\n }\r\n return $pageURL;\r\n}", "public function getFullMagazineUrl()\n {\n $url = $this->storeManager->getStore()->getBaseUrl() . $this->getConfiguredRouteName();\n\n return $url;\n }", "public function url(): string\n {\n return '/user/article/' . $this->slug . '/view';\n }", "public function firstPageUrl(): string\n {\n if (empty($this->query_without_page_key)) {\n return $this->request->url();\n }\n\n return $this->urlWithoutPageKey();\n }", "function curPageURL() {\n $pageURL = 'http';\n if (isset($_SERVER[\"HTTPS\"]) AND $_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n $pageURL .= \"://\";\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n }\n return $pageURL;\n}", "public function getFirstPageUrl();", "public function dumpUrl()\n {\n print $this->getSession()->getCurrentUrl().\"\\r\\n\";\n\n }", "public function getPageviewUrl () {\n $urlPixel = 'https://www.google-analytics.com/collect?v=1'\n . '&tid=' . $this->GAtrackingID\n . '&t=pageview'\n . '&dp=' . $this->getPath()\n . '&dt=' . urlencode($this->title)\n . '&cn=' . urlencode($this->campaign)\n . '&cs=' . urlencode($this->source)\n . '&cm=' . urlencode($this->medium)\n . '&cc=' . urlencode($this->content)\n . '&cid=' . $this->supporterID; \n return $urlPixel;\n }", "function DvNavigate($payload, $pageName)\n{\n $pagePath = url('/').'/service/'.$payload['service_name'].'/view/'.$pageName;\n\n return $pagePath;\n}", "function curPageURL() {\n\t $pageURL = 'http';\n\t if ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n\t $pageURL .= \"://\";\n\t if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n\t } else {\n\t $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n\t }\n\t return $pageURL;\n}", "private function getThisPageFullURL()\n {\n return 'http' . ( ! empty($_SERVER['HTTPS']) ? 's' : '' ) . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . ( ( empty($_GET) ) ? '' : '?' . http_build_query($_GET) );\n }", "function curPageURL() {\n $pageURL = 'http';\n if (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n $pageURL .= \"://\";\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n }\n return $pageURL;\n}", "public function getPageUri($entryId);", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getLanding()\n\t{\t\n\t\t\n\t\treturn View::make('page.landing');\n\t}", "public function url()\n {\n return '/' . $this->currlang();\n }", "function current_page_url() {\n\t$pageURL = 'http';\n\tif( isset($_SERVER[\"HTTPS\"]) ) {\n\t\tif ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n\t}\n\t$pageURL .= \"://\";\n\tif ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n\t} else {\n\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n\t}\n\treturn $pageURL;\n}", "function get_oembed_endpoint_url($permalink = '', $format = 'json')\n {\n }", "public function get_attached_page_url() {\n\t\t$required_pages_creator = new Required_Pages();\n\t\t\n\t\treturn get_permalink( $required_pages_creator->get_page_id_by_shortcode( $this->get_shortcode_name() ) );\n\t}", "public function url()\n {\n return route('documents.show', $this->uuid);\n }" ]
[ "0.6584945", "0.6266145", "0.6186224", "0.61148417", "0.60507625", "0.60458946", "0.6032207", "0.5905409", "0.58291656", "0.57758963", "0.5744705", "0.57112247", "0.5651217", "0.5646959", "0.5636691", "0.5613903", "0.5597919", "0.5595516", "0.55790645", "0.5565443", "0.55482715", "0.5539861", "0.5532034", "0.55218226", "0.5492284", "0.5471474", "0.5468634", "0.54412246", "0.5431555", "0.5427048", "0.54264313", "0.54143333", "0.54081833", "0.5408118", "0.5405182", "0.5398786", "0.53897005", "0.53862596", "0.53806996", "0.537806", "0.53768086", "0.5373442", "0.5367701", "0.53640646", "0.53597265", "0.53573143", "0.53547287", "0.53544044", "0.5349853", "0.53487056", "0.5345454", "0.53403986", "0.5334632", "0.5333826", "0.53289896", "0.5319344", "0.5317041", "0.5308378", "0.5308044", "0.53045374", "0.53043985", "0.52977955", "0.5290332", "0.52819246", "0.5272546", "0.52659655", "0.52645046", "0.5262192", "0.526029", "0.5223627", "0.52210355", "0.52209586", "0.5220332", "0.5214034", "0.5212155", "0.52094185", "0.52028096", "0.5201415", "0.5195056", "0.51931036", "0.51910216", "0.5188154", "0.5178704", "0.51737815", "0.517281", "0.5172552", "0.5170693", "0.51688296", "0.5167822", "0.5167112", "0.5167112", "0.5167112", "0.5167112", "0.5167112", "0.51653564", "0.51630604", "0.5162144", "0.5162108", "0.5161857", "0.51606846" ]
0.6026439
7
create slugs for text/titles
function slugify($slug) { $slug = trim($slug); // replace everything but unreserved characters (RFC 3986 section 2.3) and slashes by a hyphen $slug = preg_replace('~[^\\pL\d_\.\~/]~u', '-', $slug); $slug = rawurlencode($slug); $slug = str_replace('%2F', '/', $slug); return empty($slug) ? 'n-a' : $slug; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function slugs();", "function sf_create_slugs()\n{\n\tglobal $wpdb;\n\n\t# forums\n\t$records=$wpdb->get_results(\"SELECT forum_id, forum_name, forum_slug FROM \".SFFORUMS);\n\tif($records)\n\t{\n\t\tforeach($records as $record)\n\t\t{\n\t\t\t$title = sf_create_slug($record->forum_name, 'forum');\n\t\t\tif(empty($title))\n\t\t\t{\n\t\t\t\t$title = 'forum-'.$record->forum_id;\n\t\t\t}\n\t\t\t$wpdb->query(\"UPDATE \".SFFORUMS.\" SET forum_slug='\".$title.\"' WHERE forum_id=\".$record->forum_id);\n\t\t}\n\t}\n\n\t# topics\n\t$records=$wpdb->get_results(\"SELECT topic_id, topic_name, topic_slug FROM \".SFTOPICS);\n\tif($records)\n\t{\n\t\tforeach($records as $record)\n\t\t{\n\t\t\t$title = sf_create_slug($record->topic_name, 'topic');\n\t\t\tif(empty($title))\n\t\t\t{\n\t\t\t\t$title = 'topic-'.$record->topic_id;\n\t\t\t}\n\t\t\t$wpdb->query(\"UPDATE \".SFTOPICS.\" SET topic_slug='\".$title.\"' WHERE topic_id=\".$record->topic_id);\n\t\t}\n\t}\n\treturn;\n}", "public function generateSlug();", "public function makeSlug($text)\n {\n $slugs = [];\n\n $text = $this->setEmptySlugs($text);\n\n //Bind translated slugs\n foreach ($text as $key => $value) {\n $slugs[$key] = $this->toSlug($value);\n }\n\n //Checks if some of localized slugs in database exists in other rows\n $row = $this->getConnection()->table($this->getTable())->where(function ($query) use ($slugs) {\n //Multilanguages slug\n if ($this->hasLocalizedSlug()) {\n $i = 0;\n foreach ($slugs as $key => $value) {\n if (! $value) {\n continue;\n }\n\n $query->{ $i == 0 ? 'whereRaw' : 'orWhereRaw' }('JSON_EXTRACT(slug, \"$.'.$key.'\") = ?', $value);\n $i++;\n }\n\n }\n\n //If is simple string slug\n else {\n $query->where('slug', $slugs[0]);\n }\n })->limit(1);\n\n //If models exists, then skip slug owner\n if ($this->exists) {\n $row->where($this->getKeyName(), '!=', $this->getKey());\n }\n\n $row = $row->get(['slug']);\n\n //If new slugs does not exists, then return new generated slug\n if ($row->count() == 0) {\n return $this->castSlug(array_filter($slugs, function($item){\n return $this->isValidSlug($item);\n }));\n }\n\n //Generate new unique slug with increment\n $unique_slug = $this->makeUnique($slugs, $row->first()->slug);\n\n //If slug exists, then generate unique slug\n return $this->castSlug($unique_slug);\n }", "public function slug();", "public function slug();", "function sf_create_message_slugs()\n{\n\tglobal $wpdb;\n\n\t# remove all single quotes\n\t$messages = $wpdb->get_results(\"SELECT message_id, title FROM \".SFMESSAGES);\n\tif($messages)\n\t{\n\t\tforeach($messages as $message)\n\t\t{\n\t\t\t$title = stripslashes($message->title);\n\t\t\t$title = str_replace (\"'\", \"\", $title);\n\t\t\t$wpdb->query(\"UPDATE \".SFMESSAGES.\" SET title = '\".$title.\"' WHERE message_id=\".$message->message_id);\n\t\t}\n\t}\n\n\t# perform slug creation\n\t$found = true;\n\twhile($found)\n\t{\n\t\t$message = sf_grab_slugless_messages();\n\t\tif($message)\n\t\t{\n\t\t\t$slug = sf_create_slug($message->title, 'pm');\n\t\t\t# if not created force change of title\n\t\t\tif($slug)\n\t\t\t{\n\t\t\t\t$wpdb->query(\"UPDATE \".SFMESSAGES.\" SET message_slug = '\".$slug.\"' WHERE title='\".$message->title.\"';\");\n\t\t\t} else {\n\t\t\t\t$wpdb->query(\"UPDATE \".SFMESSAGES.\" SET title = 'Untitled' WHERE message_id = \".$message->message_id);\n\t\t\t}\n\t\t} else {\n\t\t\t$found = false;\n\t\t}\n\t}\n\n\treturn;\n}", "public function createSlug()\n {\n $slug = new Slugify();\n $this->slug = $slug->slugify($this->title);\n }", "private function createSlug() {\r\n \r\n $proposal = !empty($this->subject) ? substr(create_slug($this->subject), 0, 60) : $this->id;\r\n \r\n $result = $this->db->fetchAll(\"SELECT post_id FROM nuke_bbposts_text WHERE url_slug = ?\", $proposal); \r\n \r\n if (count($result)) {\r\n $proposal .= count($result);\r\n }\r\n \r\n $this->url_slug = $proposal;\r\n \r\n }", "function get_post_format_slugs()\n {\n }", "public function createSlug($text) {\n $text = sanitize_title($text);\n return $text;\n }", "public function createSlug($text) {\n $text = sanitize_title($text);\n return $text;\n }", "public function slugPattern();", "abstract public static function slug(): string;", "public function generateSlug()\n {\n $strategy = $this->slugStrategy();\n\n if (in_array($strategy, ['uuid', 'id'])) {\n $this->generateIdSlug();\n } elseif ($strategy != 'id') {\n $this->generateTitleSlug((array) $strategy);\n }\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'titre'\n ]\n ];\n }", "static public function create_slug($text){\n\t $text = preg_replace('~[^\\pL\\d]+~u', '-', $text);\n\t // transliterate\n\t $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);\n\t // remove unwanted characters\n\t $text = preg_replace('~[^-\\w]+~', '', $text);\n\t // trim\n\t $text = trim($text, '-');\n\t // remove duplicate -\n\t $text = preg_replace('~-+~', '-', $text);\n\t // lowercase\n\t $text = strtolower($text);\n\t if (empty($text)) {\n\t\treturn 'n-a';\n\t }\n\t return $text;\n\t}", "function slugify( $text ) {\n\n\t\t// replace non-alphanumeric characters with a hyphen\n\t\t$text = preg_replace('~[^\\\\pL\\d]+~u', '-', $text);\n\n\t\t// trim off any trailing or leading hyphens\n\t\t$text = trim($text, '-');\n\n\t\t// transliterate from UTF-8 to ASCII\n\t\tif (function_exists('iconv')) {\n\t\t\t$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);\n\t\t}\n\n\t\t// lowercase\n\t\t$text = strtolower($text);\n\n\t\t// remove unwanted characters\n\t\t$text = preg_replace('~[^-\\w]+~', '', $text);\n\n\t\t// ensure that this slug is unique\n\t\t$i=1;\n\t\twhile ( array_key_exists( $text, $this->dbs ) ) {\n\t\t\t$text .= \"-$i\";\n\t\t\t$i++;\n\t\t}\n\n\t\treturn $text;\n\t}", "public function makeslug()\n {\n echo $this->blog_articles_model->make_slug();\n }", "public function generateSlug()\n {\n if ($this->slug != str_slug($this->title)) {\n $this->slug = str_slug($this->title);\n }\n\n while ($count = self::where(['slug' => $this->slug])->where('id', '!=', $this->id)->count()) {\n $this->slug .= '-' . $count;\n }\n }", "public function sluggable(): array\n {\n return ['slug' => ['source' => 'title']];\n }", "public function initializeSlug()\n {\n if (empty($this->slug)) {\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->titre);\n }\n }", "public function slug(): string;", "public static function makeSlug($name);", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => ['title']\n ]\n ];\n }", "function upgrade_old_slugs()\n {\n }", "public function makeSlug () {\n\t\treturn UTF8::slugify($this->name);\n\t}", "public function slug($name);", "public function getLocalizedSlugs();", "public function sluggable() {\n return [\n 'slug_curso' => [\n 'source' => 'titulo'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'slug_or_title',\n\t\t\t],\n\t\t];\n\t}", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ]\n ];\n }", "public function sluggable() : array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function slug() {\n\t\treturn $this->createSlug($this->title);\n\t}", "protected function addSlug()\n {\n $slugSource = $this->generateSlugFrom();\n\n $slug = $this->generateUniqueSlug($slugSource);\n\n $this->slug = $slug;\n }", "public function calculateSlug() {\n $this->slug = strtolower(str_replace(array(\" \", \"_\"), array(\"-\", \"-\"), $this->nombre)).rand(1, 100);\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function test_slugify() {\n $this->assertEquals('normal_string', DynamicMenu_Menu::slugify('normal string'));\n // converts hyphen to underscore\n $this->assertEquals('hyphened_string', DynamicMenu_Menu::slugify('hyphened-string'));\n // converts caps to lowercase\n $this->assertEquals('normal_title', DynamicMenu_Menu::slugify('Normal Title'));\n // any other special character to no space\n $this->assertEquals('havingsymbol', DynamicMenu_Menu::slugify('having@symbol'));\n $this->assertEquals('quotedstring', DynamicMenu_Menu::slugify('quoted\\'string')); \n }", "public function sluggable()\n {\n return 'title';\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function initializeSlug(){\n if(empty($this->slug)){\n $slugify = Slugify::create();\n $this->slug = $slugify->slugify($this->title);\n }\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => ['seo_url', 'seo_url1']\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n 'onUpdate' => true\n ]\n ];\n }", "public function getSlug();", "public function getSlug();", "public function getSlug();", "public function getSlug();", "public function get_page_slugs()\n\t{\n\t\t// assign the slugs to the $options...\n\t\t$options = $this->db->select('title, url_title')->get($this->_table['pages'])->result();\n\n\t\t// there's a couple outside of normal possibilities in the db\n\t\t// so I add them here.\n\t\t$return[null] = lang('nav_form_choose_page');\n\t\t$return['pages/'] = lang('pages_index_controller_label');\n\n\t\t// foreach through them and add the url_title as key\n\t\t// and title as option text.\n\t\tforeach ($options as $opt)\n\t\t{\n\t\t\t$return[$opt->url_title] = $opt->title;\n\n\t\t}\n\n\t\t// return the obj\n\t\treturn $return;\n\t}", "function slugging($text = '')\n {\n $text = preg_replace('~[^\\\\pL\\d]+~u', '-', $text);\n \n // trim\n $text = trim($text, '-');\n \n // transliterate\n $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);\n \n // lowercase\n $text = strtolower($text);\n \n // remove unwanted characters\n $text = preg_replace('~[^-\\w]+~', '', $text);\n \n if (empty($text))\n {\n return 'n-a';\n }\n \n return $text;\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n 'onUpdate' => true,\n ]\n ];\n }", "private function createSlug($title) {\n\t\t\n \t$title = str_replace(array(\"&lt;\", \"&gt;\", '&amp;', '&#039;', '&quot;','&lt;', '&gt;'), array(\"<\", \">\",'&','\\'','\"','<','>'), htmlspecialchars_decode($title, ENT_NOQUOTES));\t\t\n\t\t$title = html_entity_decode(strtolower($title));\n\t\t\n\t\t$a = array('/[âãàáä]/'\t\t\t\t\t=>'a',\n\t\t\t\t '/[ÊÈÉË]/'\t\t\t\t\t=>'e',\n\t\t\t\t '/[êèéë]/'\t\t\t\t\t=>'e',\n\t\t\t\t '/[ÎÍÌÏ]/'\t\t\t\t\t=>'i',\n\t\t\t\t '/[îíìï]/'\t\t\t\t\t=>'i',\n\t\t\t\t '/[ÔÕÒÓÖ]/'\t\t\t\t\t=>'o',\n\t\t\t\t '/[ôõòóö]/'\t\t\t\t\t=>'o',\n\t\t\t\t '/[ÛÙÚÜ]/'\t\t\t\t\t=>'u',\n\t\t\t\t '/[ûúùü]/'\t\t\t\t\t=>'u',\n\t\t\t\t '/ç/'\t\t\t\t\t\t=>'c',\n\t\t\t\t '/Ç/'\t\t\t\t\t\t=>'c',\n\t\t\t\t '/ +/'\t\t\t\t\t\t=>'-',\n\t\t\t\t '/ \\(/'\t\t\t\t\t\t=>'-',\n\t\t\t\t '/\\) /'\t\t\t\t\t\t=>'-',\n\t\t\t\t '/_+/'\t\t\t\t\t\t=>'-',\n\t\t\t\t '/\\//'\t\t\t\t\t\t=>'-',\n\t\t\t\t '/^-/'\t\t\t\t\t\t=>'',\n\t\t\t\t '/-$/'\t\t\t\t\t\t=>'',\n\t\t\t\t \"/[^a-zA-Z0-9\\\\-_.+ ]/\" \t\t=>'',\n\t\t\t\t '/-+/'\t\t\t\t\t\t=>'-'\n\t\t\t\t );\n\t\treturn preg_replace(array_keys($a), array_values($a), $title);\n\t}", "function slugify ($str) { // turn name into slug for ID\r\n\t$slug = str_replace(' ','-',strtolower($str));\r\n\treturn $slug;\t\r\n}", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'slug_or_title',\n ],\n ];\n }", "public function generateSlug()\n {\n $this->slug = str_slug($this->name) . '-' . $this->id;\n\n $this->save();\n }", "public function sluggable()\n {\n return ['slug' =>\n ['source' => 'name',],\n ];\n }", "public static function bootSluggable()\n {\n static::creating(function ($model) {\n $model->generateSlug();\n });\n }", "protected function _slugify( $_text ) {\n\n $_slug = strtolower( $_text ); // convert to lowercase\n $_slug = preg_replace( '/\\s+/', '-', $_slug ); // convert all contiguous whitespace to a single hyphen\n $_slug = preg_replace( '/[^a-z0-9\\-]/', '', $_slug ); // Lowercase alphanumeric characters and dashes are allowed.\n $_slug = preg_replace( '/-+/', '-', $_slug ); // convert multiple contiguous hyphens to a single hyphen\n\n return $_slug;\n }", "public function makeSlug () {\n\t\tif(empty($this->slug)) {\n\t\t\t$this->slug = UTF8::slugify($this->name);\n\t\t}\n\t\treturn $this->slug;\n\t}", "public function blog_urlSlugGenerator()\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $slug = $this->input->post('title', true);\n $output['response'] = $this->common->_urlSlugGenerator('tbl_blog', 'id', 'slug', $slug);\n $output = html_escape($this->security->xss_clean($output));\n exit(json_encode($output));\n }", "private function slugify( $text ){\n\t\treturn sanitize_title_with_dashes( $text, '', 'save' );\n\t}", "public function sluggable()\n {\n return [\n 'page_slug' => [\n 'source' => 'page_title',\n 'maxLength' => null,\n 'maxLengthKeepWords' => true,\n 'method' => null,\n 'separator' => '-',\n 'unique' => true,\n 'uniqueSuffix' => null,\n 'includeTrashed' => false,\n 'reserved' => null,\n 'onUpdate' => false\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'job_title'\n ]\n ];\n }", "function getSlug($text) {\n $text = preg_replace('~[^\\\\pL\\d]+~u', '-', $text);\n // trim\n $text = trim($text, '-');\n // transliterate\n $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);\n // lowercase\n $text = strtolower($text);\n // remove unwanted characters\n $text = preg_replace('~[^-\\w]+~', '', $text);\n if (empty($text)) {\n return 'n-a';\n } else {\n\t return $text;\n }\n}", "public function initializeSlug(){\n if (empty($this->Nom_vis)) {\n \n $slugify = new Slugify();\n $this->Nom_vis = $slugify->Slugify($this->Nom_vis);\n \n }\n }", "function slugify($title) {\n $title = strip_tags($title);\n // Preserve escaped octets.\n $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);\n // Remove percent signs that are not part of an octet.\n $title = str_replace('%', '', $title);\n // Restore octets.\n $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);\n $title = remove_accents($title);\n if (seems_utf8($title)) {\n if (function_exists('mb_strtolower')) {\n $title = mb_strtolower($title, 'UTF-8');\n }\n $title = utf8_uri_encode($title, 200);\n }\n $title = strtolower($title);\n $title = preg_replace('/&.+?;/', '', $title); // kill entities\n $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);\n $title = preg_replace('/\\s+/', '-', $title);\n $title = preg_replace('|-+|', '-', $title);\n $title = trim($title, '-');\n return $title;\n}", "public function slugStrategy(): string\n {\n return 'name';\n }", "public function sluggable()\n {\n return [\n 'alias' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'name'\n\t\t\t]\n\t\t];\n\t}", "public function initializeSlug() {\n if(empty($this->slug)) {\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->nomhotel);\n }\n }", "public function makeSlug($text)\n {\n $slug = Str::slug( substr($text, 0, 150) );\n\n $latestSlug = \n Organization::whereRaw(\"slug RLIKE '^{$slug}(-[0-9]*)?$'\")\n ->latest('id')\n ->pluck('slug')->first();\n\n if( $latestSlug ){\n $pieces = explode('-', $latestSlug);\n $number = intval(end($pieces));\n $slug.='-'.($number + 1);\n } \n \n return $slug;\n }", "public static function bootSluggable()\n {\n static::creating(function (Model $model) {\n $model->attributes[$model->slugColumn] = str_slug($model->attributes[$model->slugValueColumn], '_');\n });\n }", "public function sluggable()\n {\n return [\n 'slug'=>[\n 'source' => 'name'\n ]\n ];\n }" ]
[ "0.7816112", "0.7352862", "0.7160249", "0.7108114", "0.7080944", "0.7080944", "0.70447624", "0.7031364", "0.69838536", "0.696407", "0.6940289", "0.6940289", "0.688546", "0.6710421", "0.6528363", "0.6488925", "0.6476467", "0.6476151", "0.6425183", "0.64208984", "0.6382831", "0.635898", "0.634911", "0.63434577", "0.63210773", "0.6305269", "0.62890685", "0.6284844", "0.62620676", "0.62451005", "0.6242116", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.62406254", "0.6240445", "0.6238713", "0.6233717", "0.6230164", "0.62269914", "0.622198", "0.62210786", "0.62210786", "0.62147546", "0.6214679", "0.6207358", "0.6207358", "0.6207358", "0.6207358", "0.6207358", "0.6207358", "0.6203814", "0.6201881", "0.61910486", "0.61881644", "0.6184767", "0.6184767", "0.6184767", "0.6184767", "0.6172696", "0.6166331", "0.6163005", "0.61498", "0.6139516", "0.61360836", "0.6130154", "0.6109995", "0.6107932", "0.60855544", "0.60831845", "0.6080581", "0.60689586", "0.6048163", "0.60311747", "0.6027531", "0.600625", "0.5988508", "0.59852964", "0.5983907", "0.59788156", "0.5965875", "0.59572107", "0.5950049", "0.5949295" ]
0.0
-1
prepare an existing episode slug for use in URL
function prepare_episode_slug_for_url($slug) { $slug = trim($slug); $slug = rawurlencode($slug); // allow directories in slug return str_replace('%2F', '/', $slug); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createSlug() {\r\n \r\n $proposal = !empty($this->subject) ? substr(create_slug($this->subject), 0, 60) : $this->id;\r\n \r\n $result = $this->db->fetchAll(\"SELECT post_id FROM nuke_bbposts_text WHERE url_slug = ?\", $proposal); \r\n \r\n if (count($result)) {\r\n $proposal .= count($result);\r\n }\r\n \r\n $this->url_slug = $proposal;\r\n \r\n }", "abstract public static function slug(): string;", "public function generateSlug();", "public function slug();", "public function slug();", "private function parseTitleUrl() {\n $posId = strpos($this->title, '-') + 1;\n $this->title = substr($this->title, $posId, strlen($this->title) - $posId);\n $this->title = $this->smoothenTitle($this->title);\n\n $sql = \"SELECT\n id,\n title\n FROM\n articles\";\n if(!$stmt = $this->db->prepare($sql)){return $this->db->error;}\n if(!$stmt->execute()) {return $result->error;}\n $stmt->bind_result($id, $title);\n while($stmt->fetch()) {\n if($this->title == $this->smoothenTitle($title)) {\n $this->articleId = $id;\n break;\n }\n }\n $stmt->close();\n if($this->articleId !== -1) {\n $this->parsedUrl = '/'.$this->articleId.'/'.$this->cat.'/'.$this->title;\n }\n }", "public function slug() {\n\t\treturn $this->createSlug($this->title);\n\t}", "public function slug(): string;", "public function initializeSlug(){\n if(empty($this->slug)){\n $slugify = Slugify::create();\n $this->slug = $slugify->slugify($this->title);\n }\n }", "public function initializeSlug() {\n if(empty($this->slug)) {\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->nomhotel);\n }\n }", "public function getSlug();", "public function getSlug();", "public function getSlug();", "public function getSlug();", "function slugify($title) {\n $title = strip_tags($title);\n // Preserve escaped octets.\n $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);\n // Remove percent signs that are not part of an octet.\n $title = str_replace('%', '', $title);\n // Restore octets.\n $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);\n $title = remove_accents($title);\n if (seems_utf8($title)) {\n if (function_exists('mb_strtolower')) {\n $title = mb_strtolower($title, 'UTF-8');\n }\n $title = utf8_uri_encode($title, 200);\n }\n $title = strtolower($title);\n $title = preg_replace('/&.+?;/', '', $title); // kill entities\n $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);\n $title = preg_replace('/\\s+/', '-', $title);\n $title = preg_replace('|-+|', '-', $title);\n $title = trim($title, '-');\n return $title;\n}", "public function generateSlug()\n {\n if ($this->slug != str_slug($this->title)) {\n $this->slug = str_slug($this->title);\n }\n\n while ($count = self::where(['slug' => $this->slug])->where('id', '!=', $this->id)->count()) {\n $this->slug .= '-' . $count;\n }\n }", "public function createSlug()\n {\n $slug = new Slugify();\n $this->slug = $slug->slugify($this->title);\n }", "protected function addSlug()\n {\n $slugSource = $this->generateSlugFrom();\n\n $slug = $this->generateUniqueSlug($slugSource);\n\n $this->slug = $slug;\n }", "function eme_permalink_convert ($val) {\n // called remove_accents, but we also want to replace spaces with \"-\"\n // and trim the last space. sanitize_title_with_dashes does all that\n // and then, add a trailing slash\n $val = sanitize_title_with_dashes(remove_accents($val));\n return trailingslashit($val);\n}", "public function calculateSlug() {\n $this->slug = strtolower(str_replace(array(\" \", \"_\"), array(\"-\", \"-\"), $this->nombre)).rand(1, 100);\n }", "function create_slug($string){\n $slug = preg_replace('/[^A-Za-z0-9-]+/', '-', $string);\n return $slug;\n}", "public function slug($slug);", "public function setSlugAttribute()\n {\n $title = $this->attributes['title'];\n $this->attributes['slug'] = Str::slug($title, '-');\n }", "public function makeSlug () {\n\t\tif(empty($this->slug)) {\n\t\t\t$this->slug = UTF8::slugify($this->name);\n\t\t}\n\t\treturn $this->slug;\n\t}", "function slugify($slug)\n{\n $slug = trim($slug);\n // replace everything but unreserved characters (RFC 3986 section 2.3) and slashes by a hyphen\n $slug = preg_replace('~[^\\\\pL\\d_\\.\\~/]~u', '-', $slug);\n $slug = rawurlencode($slug);\n $slug = str_replace('%2F', '/', $slug);\n\n return empty($slug) ? 'n-a' : $slug;\n}", "public function initializeSlug()\n {\n if (empty($this->slug)) {\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->titre);\n }\n }", "function slugify ($str) { // turn name into slug for ID\r\n\t$slug = str_replace(' ','-',strtolower($str));\r\n\treturn $slug;\t\r\n}", "public function getSlug(ContentfulEntry $contentfulEntry): string;", "public static function slug($slug);", "public function getSlug()\n\t{\n\t\treturn self::buildSlug();\n\t}", "protected function refreshSlug() {\n $slug = $this->slugify($this->getTitle());\n $this->setSlug($slug);\n }", "private static function createUniqueSlug($value) {\n\t\t$original = Str::slug($value);\n\t\t$slug = $original;\n\n\t\t$i = 2;\n\t\t// Check if there is any entry for the current slug.\n\t\twhile(News::where('slug', '=', $slug)->count() > 0) {\n\t\t\t// Concatenate the value with the incremental variable, so we may get a unique name\n\t\t\t$slug = $original .'-'. $i;\n\t\t\t$i++;\n\t\t}\n\n\t\t// Finally, we have a unique slug!\n\t\treturn $slug;\n\t}", "function iu_cleaner_url($title){\n\t$blogtitle = trim(strtolower($title)); //remove spaces before and after and lowercase\n\t$blogtitle = iconv('UTF-8', 'ASCII//TRANSLIT', $blogtitle); // replaces weird characters with normal/readable counterparts ie: à to a\n\t$blogtitle = preg_replace('/[^A-Za-z0-9_\\s]+/', '', $blogtitle); //get rid of non-url chars\n\t$blogtitle = preg_replace('/\\s/', '-', $blogtitle); //replace spaces with a dash -\n\t$blogtitle = preg_replace('/-([-]+)?/', '-', $blogtitle); // replace dashes with more than two dashes side by side into only a single dash\n\treturn $blogtitle;\n}", "public function createSlug($slug){\n $next = 1;\n while(Band::where('band_slug', '=', $slug)->first()) { \n $pos = strrpos($slug, \"_\");\n $digit = substr($slug, -1);\n $digit = intval($digit);\n if($digit == 0){\n $i = 1;\n $slug = $slug.'-'.$i;\n \n }else{\n $slug = substr($slug, 0, -2);\n $slug = $slug.'-'.$next;\n $next++;\n } \n }\n return $slug;\n }", "public static function createUrlSlug ($string)\r\n\t{\r\n\t\t# Trim the string\r\n\t\t$string = trim ($string);\r\n\t\t\r\n\t\t# Lower-case the string\r\n\t\t$string = strtolower ($string);\r\n\t\t\r\n\t\t# Conversion chart taken from http://bakery.cakephp.org/articles/view/slug-behavior\r\n\t\t$utf8Conversions = array (\r\n\t\t\t// Decompositions for Latin-1 Supplement\r\n\t\t\tchr(195).chr(128) => 'A',\r\n\t\t\tchr(195).chr(129) => 'A',\r\n\t\t\tchr(195).chr(130) => 'A',\r\n\t\t\tchr(195).chr(131) => 'A',\r\n\t\t\tchr(195).chr(132) => 'A',\r\n\t\t\tchr(195).chr(133) => 'A',\r\n\t\t\tchr(195).chr(135) => 'C',\r\n\t\t\tchr(195).chr(136) => 'E',\r\n\t\t\tchr(195).chr(137) => 'E',\r\n\t\t\tchr(195).chr(138) => 'E',\r\n\t\t\tchr(195).chr(139) => 'E',\r\n\t\t\tchr(195).chr(140) => 'I',\r\n\t\t\tchr(195).chr(141) => 'I',\r\n\t\t\tchr(195).chr(142) => 'I',\r\n\t\t\tchr(195).chr(143) => 'I',\r\n\t\t\tchr(195).chr(145) => 'N',\r\n\t\t\tchr(195).chr(146) => 'O',\r\n\t\t\tchr(195).chr(147) => 'O',\r\n\t\t\tchr(195).chr(148) => 'O',\r\n\t\t\tchr(195).chr(149) => 'O',\r\n\t\t\tchr(195).chr(150) => 'O',\r\n\t\t\tchr(195).chr(153) => 'U',\r\n\t\t\tchr(195).chr(154) => 'U',\r\n\t\t\tchr(195).chr(155) => 'U',\r\n\t\t\tchr(195).chr(156) => 'U',\r\n\t\t\tchr(195).chr(157) => 'Y',\r\n\t\t\tchr(195).chr(159) => 's',\r\n\t\t\tchr(195).chr(160) => 'a',\r\n\t\t\tchr(195).chr(161) => 'a',\r\n\t\t\tchr(195).chr(162) => 'a',\r\n\t\t\tchr(195).chr(163) => 'a',\r\n\t\t\tchr(195).chr(164) => 'a',\r\n\t\t\tchr(195).chr(165) => 'a',\r\n\t\t\tchr(195).chr(167) => 'c',\r\n\t\t\tchr(195).chr(168) => 'e',\r\n\t\t\tchr(195).chr(169) => 'e',\r\n\t\t\tchr(195).chr(170) => 'e',\r\n\t\t\tchr(195).chr(171) => 'e',\r\n\t\t\tchr(195).chr(172) => 'i',\r\n\t\t\tchr(195).chr(173) => 'i',\r\n\t\t\tchr(195).chr(174) => 'i',\r\n\t\t\tchr(195).chr(175) => 'i',\r\n\t\t\tchr(195).chr(177) => 'n',\r\n\t\t\tchr(195).chr(178) => 'o',\r\n\t\t\tchr(195).chr(179) => 'o',\r\n\t\t\tchr(195).chr(180) => 'o',\r\n\t\t\tchr(195).chr(181) => 'o',\r\n\t\t\tchr(195).chr(182) => 'o',\r\n\t\t\tchr(195).chr(182) => 'o',\r\n\t\t\tchr(195).chr(185) => 'u',\r\n\t\t\tchr(195).chr(186) => 'u',\r\n\t\t\tchr(195).chr(187) => 'u',\r\n\t\t\tchr(195).chr(188) => 'u',\r\n\t\t\tchr(195).chr(189) => 'y',\r\n\t\t\tchr(195).chr(191) => 'y',\r\n\t\t\t// Decompositions for Latin Extended-A\r\n\t\t\tchr(196).chr(128) => 'A',\r\n\t\t\tchr(196).chr(129) => 'a',\r\n\t\t\tchr(196).chr(130) => 'A',\r\n\t\t\tchr(196).chr(131) => 'a',\r\n\t\t\tchr(196).chr(132) => 'A',\r\n\t\t\tchr(196).chr(133) => 'a',\r\n\t\t\tchr(196).chr(134) => 'C',\r\n\t\t\tchr(196).chr(135) => 'c',\r\n\t\t\tchr(196).chr(136) => 'C',\r\n\t\t\tchr(196).chr(137) => 'c',\r\n\t\t\tchr(196).chr(138) => 'C',\r\n\t\t\tchr(196).chr(139) => 'c',\r\n\t\t\tchr(196).chr(140) => 'C',\r\n\t\t\tchr(196).chr(141) => 'c',\r\n\t\t\tchr(196).chr(142) => 'D',\r\n\t\t\tchr(196).chr(143) => 'd',\r\n\t\t\tchr(196).chr(144) => 'D',\r\n\t\t\tchr(196).chr(145) => 'd',\r\n\t\t\tchr(196).chr(146) => 'E',\r\n\t\t\tchr(196).chr(147) => 'e',\r\n\t\t\tchr(196).chr(148) => 'E',\r\n\t\t\tchr(196).chr(149) => 'e',\r\n\t\t\tchr(196).chr(150) => 'E',\r\n\t\t\tchr(196).chr(151) => 'e',\r\n\t\t\tchr(196).chr(152) => 'E',\r\n\t\t\tchr(196).chr(153) => 'e',\r\n\t\t\tchr(196).chr(154) => 'E',\r\n\t\t\tchr(196).chr(155) => 'e',\r\n\t\t\tchr(196).chr(156) => 'G',\r\n\t\t\tchr(196).chr(157) => 'g',\r\n\t\t\tchr(196).chr(158) => 'G',\r\n\t\t\tchr(196).chr(159) => 'g',\r\n\t\t\tchr(196).chr(160) => 'G',\r\n\t\t\tchr(196).chr(161) => 'g',\r\n\t\t\tchr(196).chr(162) => 'G',\r\n\t\t\tchr(196).chr(163) => 'g',\r\n\t\t\tchr(196).chr(164) => 'H',\r\n\t\t\tchr(196).chr(165) => 'h',\r\n\t\t\tchr(196).chr(166) => 'H',\r\n\t\t\tchr(196).chr(167) => 'h',\r\n\t\t\tchr(196).chr(168) => 'I',\r\n\t\t\tchr(196).chr(169) => 'i',\r\n\t\t\tchr(196).chr(170) => 'I',\r\n\t\t\tchr(196).chr(171) => 'i',\r\n\t\t\tchr(196).chr(172) => 'I',\r\n\t\t\tchr(196).chr(173) => 'i',\r\n\t\t\tchr(196).chr(174) => 'I',\r\n\t\t\tchr(196).chr(175) => 'i',\r\n\t\t\tchr(196).chr(176) => 'I',\r\n\t\t\tchr(196).chr(177) => 'i',\r\n\t\t\tchr(196).chr(178) => 'IJ',\r\n\t\t\tchr(196).chr(179) => 'ij',\r\n\t\t\tchr(196).chr(180) => 'J',\r\n\t\t\tchr(196).chr(181) => 'j',\r\n\t\t\tchr(196).chr(182) => 'K',\r\n\t\t\tchr(196).chr(183) => 'k',\r\n\t\t\tchr(196).chr(184) => 'k',\r\n\t\t\tchr(196).chr(185) => 'L',\r\n\t\t\tchr(196).chr(186) => 'l',\r\n\t\t\tchr(196).chr(187) => 'L',\r\n\t\t\tchr(196).chr(188) => 'l',\r\n\t\t\tchr(196).chr(189) => 'L',\r\n\t\t\tchr(196).chr(190) => 'l',\r\n\t\t\tchr(196).chr(191) => 'L',\r\n\t\t\tchr(197).chr(128) => 'l',\r\n\t\t\tchr(197).chr(129) => 'L',\r\n\t\t\tchr(197).chr(130) => 'l',\r\n\t\t\tchr(197).chr(131) => 'N',\r\n\t\t\tchr(197).chr(132) => 'n',\r\n\t\t\tchr(197).chr(133) => 'N',\r\n\t\t\tchr(197).chr(134) => 'n',\r\n\t\t\tchr(197).chr(135) => 'N',\r\n\t\t\tchr(197).chr(136) => 'n',\r\n\t\t\tchr(197).chr(137) => 'N',\r\n\t\t\tchr(197).chr(138) => 'n',\r\n\t\t\tchr(197).chr(139) => 'N',\r\n\t\t\tchr(197).chr(140) => 'O',\r\n\t\t\tchr(197).chr(141) => 'o',\r\n\t\t\tchr(197).chr(142) => 'O',\r\n\t\t\tchr(197).chr(143) => 'o',\r\n\t\t\tchr(197).chr(144) => 'O',\r\n\t\t\tchr(197).chr(145) => 'o',\r\n\t\t\tchr(197).chr(146) => 'OE',\r\n\t\t\tchr(197).chr(147) => 'oe',\r\n\t\t\tchr(197).chr(148) => 'R',\r\n\t\t\tchr(197).chr(149) => 'r',\r\n\t\t\tchr(197).chr(150) => 'R',\r\n\t\t\tchr(197).chr(151) => 'r',\r\n\t\t\tchr(197).chr(152) => 'R',\r\n\t\t\tchr(197).chr(153) => 'r',\r\n\t\t\tchr(197).chr(154) => 'S',\r\n\t\t\tchr(197).chr(155) => 's',\r\n\t\t\tchr(197).chr(156) => 'S',\r\n\t\t\tchr(197).chr(157) => 's',\r\n\t\t\tchr(197).chr(158) => 'S',\r\n\t\t\tchr(197).chr(159) => 's',\r\n\t\t\tchr(197).chr(160) => 'S',\r\n\t\t\tchr(197).chr(161) => 's',\r\n\t\t\tchr(197).chr(162) => 'T',\r\n\t\t\tchr(197).chr(163) => 't',\r\n\t\t\tchr(197).chr(164) => 'T',\r\n\t\t\tchr(197).chr(165) => 't',\r\n\t\t\tchr(197).chr(166) => 'T',\r\n\t\t\tchr(197).chr(167) => 't',\r\n\t\t\tchr(197).chr(168) => 'U',\r\n\t\t\tchr(197).chr(169) => 'u',\r\n\t\t\tchr(197).chr(170) => 'U',\r\n\t\t\tchr(197).chr(171) => 'u',\r\n\t\t\tchr(197).chr(172) => 'U',\r\n\t\t\tchr(197).chr(173) => 'u',\r\n\t\t\tchr(197).chr(174) => 'U',\r\n\t\t\tchr(197).chr(175) => 'u',\r\n\t\t\tchr(197).chr(176) => 'U',\r\n\t\t\tchr(197).chr(177) => 'u',\r\n\t\t\tchr(197).chr(178) => 'U',\r\n\t\t\tchr(197).chr(179) => 'u',\r\n\t\t\tchr(197).chr(180) => 'W',\r\n\t\t\tchr(197).chr(181) => 'w',\r\n\t\t\tchr(197).chr(182) => 'Y',\r\n\t\t\tchr(197).chr(183) => 'y',\r\n\t\t\tchr(197).chr(184) => 'Y',\r\n\t\t\tchr(197).chr(185) => 'Z',\r\n\t\t\tchr(197).chr(186) => 'z',\r\n\t\t\tchr(197).chr(187) => 'Z',\r\n\t\t\tchr(197).chr(188) => 'z',\r\n\t\t\tchr(197).chr(189) => 'Z',\r\n\t\t\tchr(197).chr(190) => 'z',\r\n\t\t\tchr(197).chr(191) => 's',\r\n\t\t\t// Euro Sign\r\n\t\t\tchr(226).chr(130).chr(172) => 'E'\r\n\t\t);\r\n\t\t$string = str_replace (array_keys ($utf8Conversions), array_keys ($utf8Conversions), $string);\r\n\t\t\r\n\t\t# Convert any remaining characters\r\n\t\t$string = preg_replace ('|[^a-z0-9-]|', '-', $string);\r\n\t\t\r\n\t\t# Replace double-hyphens\r\n\t\twhile (substr_count ($string, '--')) {\r\n\t\t\t$string = str_replace ('--', '-', $string);\r\n\t\t}\r\n\t\t\r\n\t\t# Convert -s- (resulting from \"'s \") to s-\r\n\t\t$string = str_replace ('-s-', 's-', $string);\r\n\t\t\r\n\t\t# Remove hyphens from the start or end\r\n\t\t$string = preg_replace ('/(^-|-$)/', '', $string);\r\n\t\t\r\n\t\t# Return the value\r\n\t\treturn $string;\r\n\t}", "function slug($object)\n {\n $id = isset($object->id)?$object->id:'';\n $title = isset($object->title)?$object->title:'';\n return str_slug($id.'-'.$title);\n }", "public function initializeSlug()\n {\n if (empty($this->slug)) {\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->name);\n }\n }", "public function initializeSlug(){\n $faker = Factory::create('FR-fr');\n \n if(empty($this->slug)){\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($faker->md5());\n }\n\n }", "public function get_source_slug();", "public function slug()\n\t{\n\t\t$explode = explode('/', $this->getField('key'));\n\n\t\t// Check if the page have a parent.\n\t\tif(!empty($explode[1])) {\n\t\t\treturn $explode[1];\n\t\t}\n\n\t\treturn $explode[0];\n\t}", "private function createSlug($title) {\n\t\t\n \t$title = str_replace(array(\"&lt;\", \"&gt;\", '&amp;', '&#039;', '&quot;','&lt;', '&gt;'), array(\"<\", \">\",'&','\\'','\"','<','>'), htmlspecialchars_decode($title, ENT_NOQUOTES));\t\t\n\t\t$title = html_entity_decode(strtolower($title));\n\t\t\n\t\t$a = array('/[âãàáä]/'\t\t\t\t\t=>'a',\n\t\t\t\t '/[ÊÈÉË]/'\t\t\t\t\t=>'e',\n\t\t\t\t '/[êèéë]/'\t\t\t\t\t=>'e',\n\t\t\t\t '/[ÎÍÌÏ]/'\t\t\t\t\t=>'i',\n\t\t\t\t '/[îíìï]/'\t\t\t\t\t=>'i',\n\t\t\t\t '/[ÔÕÒÓÖ]/'\t\t\t\t\t=>'o',\n\t\t\t\t '/[ôõòóö]/'\t\t\t\t\t=>'o',\n\t\t\t\t '/[ÛÙÚÜ]/'\t\t\t\t\t=>'u',\n\t\t\t\t '/[ûúùü]/'\t\t\t\t\t=>'u',\n\t\t\t\t '/ç/'\t\t\t\t\t\t=>'c',\n\t\t\t\t '/Ç/'\t\t\t\t\t\t=>'c',\n\t\t\t\t '/ +/'\t\t\t\t\t\t=>'-',\n\t\t\t\t '/ \\(/'\t\t\t\t\t\t=>'-',\n\t\t\t\t '/\\) /'\t\t\t\t\t\t=>'-',\n\t\t\t\t '/_+/'\t\t\t\t\t\t=>'-',\n\t\t\t\t '/\\//'\t\t\t\t\t\t=>'-',\n\t\t\t\t '/^-/'\t\t\t\t\t\t=>'',\n\t\t\t\t '/-$/'\t\t\t\t\t\t=>'',\n\t\t\t\t \"/[^a-zA-Z0-9\\\\-_.+ ]/\" \t\t=>'',\n\t\t\t\t '/-+/'\t\t\t\t\t\t=>'-'\n\t\t\t\t );\n\t\treturn preg_replace(array_keys($a), array_values($a), $title);\n\t}", "public function getSlug()\n {\n $slug = $this->cekUrl(str_slug($this->param));\n return $slug;\n }", "protected function generateSlugFrom()\n {\n $slugFields = static::$slugFieldsFrom;\n\n $slugSource = collect($slugFields)\n ->map(function (string $fieldName) {\n return data_get($this, $fieldName, '');\n })\n ->implode('-');\n\n return substr($slugSource, 0, 100);\n }", "protected function getSlug()\n {\n return trim(str_replace($this->website->domain, '', $this->getStrippedUrl()), '/') ?: '/';\n }", "public static function makeSlug($name);", "public function makeslug()\n {\n echo $this->blog_articles_model->make_slug();\n }", "static function wck_generate_slug( $string, $details = array() ){\r\n if( !empty( $details['slug'] ) )\r\n $slug = $details['slug'];\r\n else\r\n\t\t $slug = rawurldecode( sanitize_title_with_dashes( remove_accents( $string ) ) );\r\n\t\treturn $slug;\r\n\t}", "function sf_create_slugs()\n{\n\tglobal $wpdb;\n\n\t# forums\n\t$records=$wpdb->get_results(\"SELECT forum_id, forum_name, forum_slug FROM \".SFFORUMS);\n\tif($records)\n\t{\n\t\tforeach($records as $record)\n\t\t{\n\t\t\t$title = sf_create_slug($record->forum_name, 'forum');\n\t\t\tif(empty($title))\n\t\t\t{\n\t\t\t\t$title = 'forum-'.$record->forum_id;\n\t\t\t}\n\t\t\t$wpdb->query(\"UPDATE \".SFFORUMS.\" SET forum_slug='\".$title.\"' WHERE forum_id=\".$record->forum_id);\n\t\t}\n\t}\n\n\t# topics\n\t$records=$wpdb->get_results(\"SELECT topic_id, topic_name, topic_slug FROM \".SFTOPICS);\n\tif($records)\n\t{\n\t\tforeach($records as $record)\n\t\t{\n\t\t\t$title = sf_create_slug($record->topic_name, 'topic');\n\t\t\tif(empty($title))\n\t\t\t{\n\t\t\t\t$title = 'topic-'.$record->topic_id;\n\t\t\t}\n\t\t\t$wpdb->query(\"UPDATE \".SFTOPICS.\" SET topic_slug='\".$title.\"' WHERE topic_id=\".$record->topic_id);\n\t\t}\n\t}\n\treturn;\n}", "public function generateSlug()\n {\n $this->slug = str_slug($this->name) . '-' . $this->id;\n\n $this->save();\n }", "public function slugPattern();", "public static function toSlug\n\t(\n\t\t$value\t\t// <str> The value you'd like to change.\n\t)\t\t\t\t// RETURNS <str> a valid url slug.\n\t\n\t// echo URL::toSlug(\"The Best Blog Post\");\t\t// returns \"the-best-blog-post\"\n\t{\n\t\t// Transform the text into a friendly url\n\t\t$value = str_replace(\" & \", \" and \", trim($value));\n\t\t$value = str_replace(\" \", \"-\", strtolower(Sanitize::variable($value, \"- \")));\n\t\t\n\t\t// Cut the size of the url\n\t\tif(strlen($value) > 72)\n\t\t{\n\t\t\twhile(strrpos($value, '-') > 62)\n\t\t\t{\n\t\t\t\t$value = substr($value, 0, strrpos($value, \"-\"));\n\t\t\t}\n\t\t\t\n\t\t\t// Final cut, in case the above didn't work\n\t\t\tif(strlen($value) > 72)\n\t\t\t{\n\t\t\t\t$value = substr($value, 0, 72);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $value;\n\t}", "function rewrite_post_parmalink($original) {\n $parts = parse_url($original);\n $oparts = explode('/', preg_replace('/\\/$/', '', $parts['path']));\n $slug = end($oparts);\n\n $prefix = preg_replace('/\\/$/', '', $_SERVER[\"REQUEST_URI\"]);\n return \"//{$parts['host']}{$prefix}/{$slug}\";\n}", "public function initializeSlug()\n {\n if (empty($this->slug)) {\n\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->firstName . ' ' . $this->lastName);\n }\n }", "public function getSlug()\n {\n return $this->slug ?? $this->id;\n }", "function fs_to_slug($string){\r\n\treturn strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $string)));\r\n}", "function slug($value){\n//the pre_quote function is just used to quote regular expressions so that it doesn't get mixed up and result in an error\n //remove all characters not in the list(that what this means when we include \"empty string\")\n $value = preg_replace('![^'.preg_quote('_').'\\pL\\pN\\s]+!u','',mb_strtolower($value));\n\n //replace underscore with a dash\n $value = preg_replace('!['.preg_quote('_').'\\s]+!u','-',$value);\n\n //remove whitespace with the trim function\n //'-' was added as an argument so that the trim function does not remove it too\n\n return trim($value, '-');\n\n}", "function slug($str = '', $slug = '-')\n{\n return str_replace(\" \", $slug, trim($str));\n}", "public function createSlug($text) {\n $text = sanitize_title($text);\n return $text;\n }", "public function createSlug($text) {\n $text = sanitize_title($text);\n return $text;\n }", "protected function getSlug(){\n $this->Name = UrlUtils::getSlug($this->FriendlyName);\n return $this->Name;\n }", "function app_get_the_slug( $echo=true )\n\t\t{\n\t\t\t$slug = basename(get_permalink());\n\t\t\tdo_action('before_slug', $slug);\n\t\t\t$slug = apply_filters('slug_filter', $slug);\n\t\t\tif( $echo ) echo $slug;\n\t\t\tdo_action('after_slug', $slug);\n\t\t\treturn $slug;\n\t\t}", "public function slugTarget(){\n\t\treturn 'title';\n\t}", "public function getSlug()\n {\n return $this->provider .'-'. str_replace('_', '-', $this->postId);\n }", "private function createSlug(string $raw)\n {\n $slug = preg_replace('/[^a-z0-9]/i', '_', $raw);\n return strtolower(trim($slug, '_'));\n }", "function ss_get_slug( $id ) {\r\n\tif ( $id==null ) $id=$post->ID;\r\n\t$post_data = get_post( $id, ARRAY_A );\r\n\t$slug = $post_data['post_name'];\r\n\treturn $slug;\r\n}", "public function generateSlug()\n {\n $strategy = $this->slugStrategy();\n\n if (in_array($strategy, ['uuid', 'id'])) {\n $this->generateIdSlug();\n } elseif ($strategy != 'id') {\n $this->generateTitleSlug((array) $strategy);\n }\n }", "function create_slug( $string , $space ) {\n\t$string = rtrim( strtolower( trim( preg_replace( '/[^A-Za-z0-9-]+/' , $space , html_entity_decode( strip_tags( $string ) ) ) ) ) , $space );\n\treturn $string;\n}", "public function getStreamSlug();", "public function initializeSlug(){\n if (empty($this->Nom_vis)) {\n \n $slugify = new Slugify();\n $this->Nom_vis = $slugify->Slugify($this->Nom_vis);\n \n }\n }", "protected function _makeUniqueSlug(EntityManager $em, $entity)\n {\n $entityClass = get_class($entity);\n $meta = $em->getClassMetadata($entityClass);\n $config = $this->getConfiguration($em, $entityClass);\n $preferedSlug = $meta->getReflectionProperty($config['slug'])->getValue($entity);\n\n // search for similar slug\n $qb = $em->createQueryBuilder();\n $qb->select('rec.' . $config['slug'])\n ->from($entityClass, 'rec')\n ->add('where', $qb->expr()->like(\n 'rec.' . $config['slug'],\n $qb->expr()->literal($preferedSlug . '%'))\n );\n // include identifiers\n $entityIdentifiers = $meta->getIdentifierValues($entity);\n foreach ($entityIdentifiers as $field => $value) {\n if (strlen($value)) {\n $qb->add('where', 'rec.' . $field . ' <> ' . $value);\n }\n }\n $q = $qb->getQuery();\n $q->setHydrationMode(Query::HYDRATE_ARRAY);\n $result = $q->execute();\n\n if (is_array($result) && count($result)) {\n $generatedSlug = $preferedSlug;\n $sameSlugs = array();\n foreach ($result as $list) {\n $sameSlugs[] = $list['slug'];\n }\n\n $i = 0;\n if (preg_match(\"@{$config['separator']}\\d+$@sm\", $generatedSlug, $m)) {\n $i = abs(intval($m[0]));\n }\n while (in_array($generatedSlug, $sameSlugs)) {\n $generatedSlug = $preferedSlug . $config['separator'] . ++$i;\n }\n\n $mapping = $meta->getFieldMapping($config['slug']);\n $needRecursion = false;\n if (strlen($generatedSlug) > $mapping['length']) {\n $needRecursion = true;\n $generatedSlug = substr(\n $generatedSlug,\n 0,\n $mapping['length'] - (strlen($i) + strlen($config['separator']))\n );\n $generatedSlug .= $config['separator'] . $i;\n }\n\n $meta->getReflectionProperty($config['slug'])->setValue($entity, $generatedSlug);\n if ($needRecursion) {\n $generatedSlug = $this->_makeUniqueSlug($em, $entity);\n }\n $preferedSlug = $generatedSlug;\n }\n return $preferedSlug;\n }", "protected static function createNewSlug()\n {\n do {\n $slug = substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyz', 10)), 0, random_int(5, 10));\n } while (self::where('slug', $slug)->count());\n\n return $slug;\n }", "public function slug($string, $replacement = '_');", "public function url_slug($str) \n\t{ \n\t return strtolower(preg_replace(array('/[^a-zA-Z0-9 -]/', '/[ -]+/', '/^-|-$/'), \n\t \tarray('', '-', ''), without_accents($str))); \n\t}", "function updateSlug($table_name, $title, $id){\n\n\t\t$slug = str_slug($title, '-');\n\t\t//check current slug is exist\n\t\t$count_exist = DB::table($table_name)->where('slug', $slug)->where('id', '<>', $id)->get();\n\t\tif(count($count_exist) > 0){\n\t\t\t$related_post = getRelatedPostBySlug($table_name, $slug, $id);\n\t\t\tif(count($related_post) > 0){\n\t\t\t\tfor($i = 1; $i <= 10; $i++){\n\t\t\t\t\t$newSlug = $slug . '-' . $i;\n\t\t\t\t\t$releated_inLoop = getRelatedPostBySlug($table_name, $newSlug, $id);\n\t\t\t\t\tif(count($releated_inLoop) == 0){\n\t\t\t\t\t\t$slug = $newSlug;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tDB::table($table_name)->where('id', $id)->update(['slug' => $slug]);\n\t\treturn $slug;\n\t}", "function article_slug() {\n return Registry::prop('article', 'slug');\n}", "public function makeSlug () {\n\t\treturn UTF8::slugify($this->name);\n\t}", "public static function create_slug($string){\n $slug=preg_replace('/[^A-Za-z0-9-]+/', '-', $string);\n return $slug;\n }", "public function setSlug($slug);", "public function setSlug($slug);", "public function setSlug($slug);", "private function manageSlug(Competition $competition)\n {\n $slugify = $this->get('sonata.core.slugify.cocur');\n $title = $competition->getTitle();\n\n $competition->setSlug($slugify->slugify($title));\n }", "public function makeSlug($text)\n {\n $slug = Str::slug( substr($text, 0, 150) );\n\n $latestSlug = \n Organization::whereRaw(\"slug RLIKE '^{$slug}(-[0-9]*)?$'\")\n ->latest('id')\n ->pluck('slug')->first();\n\n if( $latestSlug ){\n $pieces = explode('-', $latestSlug);\n $number = intval(end($pieces));\n $slug.='-'.($number + 1);\n } \n \n return $slug;\n }", "function get_episode($id = null)\n{\n $post = get_post($id);\n\n if (!$post) {\n return null;\n }\n\n $episode = Model\\Episode::find_one_by_property('post_id', $post->ID);\n\n if (!$episode) {\n return null;\n }\n\n return new Template\\Episode($episode);\n}", "function the_slug($echo=false){\n\t$slug = basename(get_permalink());\n\tdo_action('before_slug', $slug);\n\t$slug = apply_filters('slug_filter', $slug);\n\tif( $echo ) echo $slug;\n\tdo_action('after_slug', $slug);\n\treturn $slug;\n}", "private function generateSlug($data) {\n\n $slug = Str::slug($data[\"title\"], '-'); // titolo-articolo-3\n\n // chiamata query al db, settiamo con la variabile existingslug il primo slug del db che non ammetterà duplicati\n $existingPost = Post::where('slug', $slug)->first();\n // dd($existingPost);\n\n // se lo slug esiste già, dobbiamo rigenerarlo. possiamo aggiungere allo slug doppione un trattino e un numero. per farlo usiamo un ciclo while che si interrompe quando la condizione di uscita viene soddisfatta\n $slugBase = $slug;\n $counter = 1;\n\n while($existingPost) {\n $slug = $slugBase . \"-\" . $counter;\n\n // istruzioni per terminare il ciclo, riverifico con una nuova query l'esistenza dello slug. Se esiste il ciclo riparte con l'incremento, se non esiste la condizione del while è falsa ed esco dal ciclo.\n $existingPost = Post::where('slug', $slug)->first(); \n // incremento \n $counter++;\n }\n\n // salvo lo slug\n return $slug;\n }", "public static function createSlug($title, $model, $field, $separator=\"-\")\n {\n $model = 'App\\Models\\\\'.$model;\n $id = 0;\n \n $title = str_replace(\"&\", \"and\", $title);\n\n $slug = preg_replace('/\\s+/', $separator, (trim(strtolower($title))));\n $slug = preg_replace('/\\?+/', $separator, (trim(strtolower($slug))));\n $slug = preg_replace('/\\#+/', $separator, (trim(strtolower($slug))));\n $slug = preg_replace('/\\/+/', $separator, (trim(strtolower($slug))));\n\n // $slug = preg_replace('!['.preg_quote($separator).']+!u', $separator, $title);\n\n // // Remove all characters that are not the separator, letters, numbers, or whitespace.\n // $slug = preg_replace('![^'.preg_quote($separator).'\\pL\\pN\\s]+!u', '', mb_strtolower($slug));\n\n // // Replace all separator characters and whitespace by a single separator\n $slug = preg_replace('!['.preg_quote($separator).'\\s]+!u', $separator, $slug);\n\n\n // Get any that could possibly be related.\n // This cuts the queries down by doing it once.\n $allSlugs = StringHelper::getRelatedSlugs($slug, $id, $model, $field);\n // If we haven't used it before then we are all good.\n if (! $allSlugs->contains(\"$field\", $slug)){\n return $slug;\n }\n // Just append numbers like a savage until we find not used.\n for ($i = 1; $i <= 10; $i++) {\n $newSlug = $slug.$separator.$i;\n if (! $allSlugs->contains(\"$field\", $newSlug)) {\n return $newSlug;\n }\n }\n throw new \\Exception('Can not create a unique slug');\n }", "function make_slug($string) {\n return preg_replace('/\\s+/u', '-', strtolower(trim($string)));\n }", "function makeSlug($str)\n{\n\t$str = preg_replace('~[^\\\\pL\\d]+~u', '-', $str);\n\n\t// trim\n\t$str = trim($str, '-');\n\n\t// transliterate\n\t$str = iconv('utf-8', 'us-ascii//TRANSLIT', $str);\n\n\t// lowercase\n\t$str = strtolower($str);\n\n\t// remove unwanted characters\n\t$str = preg_replace('~[^-\\w]+~', '', $str);\n\n\tif (empty($str))\n\t{\n\treturn 'n-a';\n\t}\n\n\treturn $str;\n}", "function acf_slugify($str = '', $glue = '-')\n{\n}", "public function slug($name);", "function filter_chapel_hour_page_title( $title, $id = NULL ) {\n if ( is_post_type_archive( 'chapel_hour' ) ) {\n $title = 'Chapel Hour Episodes';\n }\n\n return $title;\n}", "function upgrade_old_slugs()\n {\n }", "public function getSlug(): string\n {\n return $this->slug;\n }", "protected function getSlug($slug_data){\n return str_replace(' ', '-', $slug_data);\n }", "public function prepareForValidation()\n {\n if($this->slug) {\n $this->merge(['slug' => make_slug($this->slug)]);\n }else{\n $this->merge(['slug'=>make_slug($this->title)]);\n }\n}", "public function solution_urlSlugGenerator()\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $slug = $this->input->post('title', true);\n $output['response'] = $this->common->_urlSlugGenerator('tbl_solutions', 'id', 'slug', $slug);\n $output = html_escape($this->security->xss_clean($output));\n exit(json_encode($output));\n }", "function php_slug($string) \n { $slug = preg_replace('/[^a-z0-9-]+/', '-', trim(strtolower($string)));return $slug; }", "function metaslider_shortcode_slug( $atts ) {\n\tif ( isset( $atts['id'] ) && ! is_int( $atts['id'] ) ) {\n\t\t$slider = get_page_by_path( $atts['id'], OBJECT, 'ml-slider' );\n\t\tif ( $slider ) {\n\t\t\t$atts['id'] = $slider->ID;\n\t\t}\n\t}\n\treturn $atts;\n}", "function the_slug($echo=true){\n $slug = basename(get_permalink());\n do_action('before_slug', $slug);\n $slug = apply_filters('slug_filter', $slug);\n if( $echo ) echo $slug;\n do_action('after_slug', $slug);\n return $slug;\n}", "public function get_slug(){ return $this->slug; }" ]
[ "0.6596095", "0.64756995", "0.62256926", "0.62190425", "0.62190425", "0.61237764", "0.6093455", "0.59840983", "0.59807336", "0.597703", "0.5959924", "0.5959924", "0.5959924", "0.5959924", "0.5935384", "0.5917748", "0.5912548", "0.5829948", "0.5818715", "0.5817684", "0.57829666", "0.57430136", "0.57421964", "0.57292426", "0.5706832", "0.57038563", "0.5703844", "0.56816787", "0.56662405", "0.5650581", "0.56483924", "0.5644016", "0.5641009", "0.5629858", "0.56267065", "0.561714", "0.56120324", "0.560997", "0.55849546", "0.5581744", "0.5578238", "0.5567945", "0.5556962", "0.5555883", "0.5537159", "0.55197424", "0.5495438", "0.5493724", "0.54866564", "0.54780656", "0.54757005", "0.5469855", "0.54690015", "0.5467921", "0.54631364", "0.5456997", "0.5454221", "0.54508376", "0.54508376", "0.5438563", "0.54345024", "0.54327625", "0.54269075", "0.5426362", "0.5425129", "0.5416943", "0.54029", "0.53995264", "0.5394718", "0.538203", "0.5381493", "0.53798753", "0.53791666", "0.5377982", "0.5373012", "0.5370659", "0.5365641", "0.53519654", "0.53519654", "0.53519654", "0.5351364", "0.5349817", "0.53495127", "0.5342334", "0.5338764", "0.5332564", "0.5330021", "0.5329456", "0.53206986", "0.5319171", "0.5314498", "0.5302821", "0.5297233", "0.5297009", "0.52960294", "0.5295937", "0.52811176", "0.52764386", "0.5274323", "0.5270154" ]
0.81629515
0
iTunes category generator. Gratefully borrowed from powerpress.
function categories($prefix_subcategories = true) { $temp = []; $temp['01-00'] = 'Arts'; $temp['01-01'] = 'Design'; $temp['01-02'] = 'Fashion & Beauty'; $temp['01-03'] = 'Food'; $temp['01-04'] = 'Books'; $temp['01-05'] = 'Performing Arts'; $temp['01-06'] = 'Visual Arts'; $temp['02-00'] = 'Business'; $temp['02-02'] = 'Careers'; $temp['02-03'] = 'Investing'; $temp['02-04'] = 'Management'; $temp['02-06'] = 'Entrepreneurship'; $temp['02-07'] = 'Marketing'; $temp['02-08'] = 'Non-Profit'; $temp['03-00'] = 'Comedy'; $temp['03-01'] = 'Comedy Interviews'; $temp['03-02'] = 'Improv'; $temp['03-03'] = 'Stand-Up'; $temp['04-00'] = 'Education'; $temp['04-04'] = 'Language Learning'; $temp['04-05'] = 'Courses'; $temp['04-06'] = 'How To'; $temp['04-07'] = 'Self-Improvement'; $temp['20-00'] = 'Fiction'; $temp['20-01'] = 'Comedy Fiction'; $temp['20-02'] = 'Drama'; $temp['20-03'] = 'Science Fiction'; $temp['06-00'] = 'Government'; $temp['30-00'] = 'History'; $temp['07-00'] = 'Health & Fitness'; $temp['07-01'] = 'Alternative Health'; $temp['07-02'] = 'Fitness'; // $temp['07-03'] = 'Self-Help'; $temp['07-04'] = 'Sexuality'; $temp['07-05'] = 'Medicine'; $temp['07-06'] = 'Mental Health'; $temp['07-07'] = 'Nutrition'; $temp['08-00'] = 'Kids & Family'; $temp['08-01'] = 'Education for Kids'; $temp['08-02'] = 'Parenting'; $temp['08-03'] = 'Pets & Animals'; $temp['08-04'] = 'Stories for Kids'; $temp['40-00'] = 'Leisure'; $temp['40-01'] = 'Animation & Manga'; $temp['40-02'] = 'Automotive'; $temp['40-03'] = 'Aviation'; $temp['40-04'] = 'Crafts'; $temp['40-05'] = 'Games'; $temp['40-06'] = 'Hobbies'; $temp['40-07'] = 'Home & Garden'; $temp['40-08'] = 'Video Games'; $temp['09-00'] = 'Music'; $temp['09-01'] = 'Music Commentary'; $temp['09-02'] = 'Music History'; $temp['09-03'] = 'Music Interviews'; $temp['10-00'] = 'News'; $temp['10-01'] = 'Business News'; $temp['10-02'] = 'Daily News'; $temp['10-03'] = 'Entertainment News'; $temp['10-04'] = 'News Commentary'; $temp['10-05'] = 'Politics'; $temp['10-06'] = 'Sports News'; $temp['10-07'] = 'Tech News'; $temp['11-00'] = 'Religion & Spirituality'; $temp['11-01'] = 'Buddhism'; $temp['11-02'] = 'Christianity'; $temp['11-03'] = 'Hinduism'; $temp['11-04'] = 'Islam'; $temp['11-05'] = 'Judaism'; $temp['11-06'] = 'Religion'; $temp['11-07'] = 'Spirituality'; $temp['12-00'] = 'Science'; $temp['12-01'] = 'Medicine'; $temp['12-02'] = 'Natural Sciences'; $temp['12-03'] = 'Social Sciences'; $temp['12-04'] = 'Astronomy'; $temp['12-05'] = 'Chemistry'; $temp['12-06'] = 'Earth Sciences'; $temp['12-07'] = 'Life Sciences'; $temp['12-08'] = 'Mathematics'; $temp['12-09'] = 'Nature'; $temp['12-10'] = 'Physics'; $temp['13-00'] = 'Society & Culture'; // $temp['13-01'] = 'History'; $temp['13-02'] = 'Personal Journals'; $temp['13-03'] = 'Philosophy'; $temp['13-04'] = 'Places & Travel'; $temp['13-05'] = 'Relationships'; $temp['13-06'] = 'Documentary'; $temp['14-00'] = 'Sports'; $temp['14-05'] = 'Baseball'; $temp['14-06'] = 'Basketball'; $temp['14-07'] = 'Cricket'; $temp['14-08'] = 'Fantasy Sports'; $temp['14-09'] = 'Football'; $temp['14-10'] = 'Golf'; $temp['14-11'] = 'Hockey'; $temp['14-12'] = 'Rugby'; $temp['14-13'] = 'Running'; $temp['14-14'] = 'Soccer'; $temp['14-15'] = 'Swimming'; $temp['14-16'] = 'Tennis'; $temp['14-17'] = 'Volleyball'; $temp['14-18'] = 'Wilderness'; $temp['14-19'] = 'Wrestling'; $temp['15-00'] = 'Technology'; $temp['50-00'] = 'True Crime'; $temp['16-00'] = 'TV & Film'; $temp['16-01'] = 'After Shows'; $temp['16-02'] = 'Film History'; $temp['16-03'] = 'Film Interviews'; $temp['16-04'] = 'Film Reviews'; $temp['16-05'] = 'TV Reviews'; if ($prefix_subcategories) { foreach ($temp as $key => $val) { $parts = explode('-', $key); $cat = $parts[0]; $subcat = $parts[1]; if ($subcat != '00') { $temp[$key] = $temp[$cat.'-00'].' > '.$val; } } } return $temp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function issuu_document_categories() {\n return array(\n '000000' => 'Unknown',\n '001000' => 'Auto & Vehicles',\n '002000' => 'Business & Marketing',\n '003000' => 'Creative',\n '004000' => 'Film & Music',\n '005000' => 'Fun & Entertainment',\n '006000' => 'Hobby & Home',\n '007000' => 'Knowledge & Resources',\n '008000' => 'Nature & Animals',\n '009000' => 'News & Politics',\n '010000' => 'Nonprofits & Activism',\n '011000' => 'Religon & Philosophy',\n '012000' => 'Sports',\n '013000' => 'Technology & Internet',\n '014000' => 'Travel & Events',\n '015000' => 'Weird & Bizarre',\n '016000' => 'Other'\n );\n}", "public function run()\n {\n Category::truncate();\n \t$cateLists = ['Sportswear','Mens','Womens','Kids','Fashion','Households','Interiors','Clothing','Bags','Shoes'];\n \tforeach ($cateLists as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t]);\n \t}\n \t$list_sportswear = ['Nike','Under Armour','Adidas','Puma','Asics'];\n \tforeach ($list_sportswear as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t\t'category_id'=> 1\n \t\t\t]);\n \t}\n \t$list_mens=['Fendi','Guess','Valentino','Dior','Versace','Armani','Prada','Dolce And Gabbana','Chanel','Gucci'];\n \tforeach ($list_mens as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t\t'category_id'=> 11\n \t\t\t]);\n \t}\n \t$list_womens = ['Womens Fende','Womens Guess','Valentino','Womens Dior','Verace'];\n \tforeach ($list_womens as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t\t'category_id'=> 21\n \t\t\t]);\n \t}\n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public static function categories() {\n\t\t// can take a long time\n\t\tset_time_limit(0);\n\n\t\t// select all uncategorized monuments\n\t\t$monuments = ORM::factory('monument')->where('id_category','is',null)->or_where('id_category','=',12)->find_all();\n\t\t$i = 0;\n\t\tforeach($monuments as $monument) {\n\n\t\t\t$category = $monument->extractCategory();\n\n\t\t\t// save the extracted category to the database\n\t\t\t$monument->id_category = $category;\n\t\t\t$monument->category_extracted = 1;\n\t\t\tif($category > 0) {\n\t\t\t\t$i++;\n\t\t\t\t$monument->save();\n\t\t\t}\n\t\t}\n\n\t\treturn $i;\n\t}", "function ciniki_recipes_web_categories($ciniki, $settings, $tnid) {\n\n $strsql = \"SELECT DISTINCT category AS name \"\n . \"FROM ciniki_recipes \"\n . \"WHERE ciniki_recipes.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND (ciniki_recipes.webflags&0x01) = 1 \"\n . \"AND category <> '' \"\n . \"ORDER BY category \"\n . \"\";\n \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.recipes', array(\n array('container'=>'categories', 'fname'=>'name', 'name'=>'category',\n 'fields'=>array('name')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['categories']) ) {\n return array('stat'=>'ok');\n }\n $categories = $rc['categories'];\n\n //\n // Load highlight images\n //\n foreach($categories as $cnum => $cat) {\n //\n // Look for the highlight image, or the most recently added image\n //\n $strsql = \"SELECT ciniki_recipes.primary_image_id, ciniki_images.image \"\n . \"FROM ciniki_recipes, ciniki_images \"\n . \"WHERE ciniki_recipes.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND category = '\" . ciniki_core_dbQuote($ciniki, $cat['category']['name']) . \"' \"\n . \"AND ciniki_recipes.primary_image_id = ciniki_images.id \"\n . \"AND (ciniki_recipes.webflags&0x01) = 1 \"\n . \"ORDER BY (ciniki_recipes.webflags&0x10) DESC, \"\n . \"ciniki_recipes.date_added DESC \"\n . \"LIMIT 1\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.recipes', 'image');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['image']) ) {\n $categories[$cnum]['category']['image_id'] = $rc['image']['primary_image_id'];\n } else {\n $categories[$cnum]['category']['image_id'] = 0;\n }\n }\n\n return array('stat'=>'ok', 'categories'=>$categories); \n}", "function tep_show_category($counter) {\r\n\r\n// BoF - Contribution Category Box Enhancement 1.1\r\n global $tree, $categories_string, $cPath_array, $cat_name;\r\n\r\n for ($i=0; $i<$tree[$counter]['level']; $i++) {\r\n $categories_string .= \"&nbsp;&nbsp;\";\r\n }\r\n $cPath_new = 'cPath=' . $tree[$counter]['path'];\r\n if (isset($cPath_array) && in_array($counter, $cPath_array) && $cat_name == $tree[$counter]['name']) { //Link nicht anklickbar, wenn angewählt\r\n $categories_string .= '<a style=\"color:#874b5a;text-decoration:none\" href=\"';\r\n $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '\">';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t //Link nicht anklickbar, wenn angewählt\r\n } else {\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //Link nicht anklickbar, wenn angewählt\r\n $categories_string .= '<a href=\"';\r\n $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '\">';\r\n }\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //Link nicht anklickbar, wenn angewählt\r\n\r\n if (isset($cPath_array) && in_array($counter, $cPath_array)) {\r\n $categories_string .= '<b>';\r\n }\r\n\r\n if ($cat_name == $tree[$counter]['name']) {\r\n $categories_string .= '<span class=\"errorText\">';\r\n }\r\n\r\n// display category name\r\n $categories_string .= '<img src=\"'. DIR_WS_IMAGES .'m25.gif\" align=\"absmiddle\" border=0 hspace=\"5\" vspace=\"0\">' . $tree[$counter]['name'];\r\n\r\n\t\tif ($cat_name == $tree[$counter]['name']) {\r\n\t\t\t$categories_string .= '</span>';\r\n }\r\n\r\n if (isset($cPath_array) && in_array($counter, $cPath_array)) {\r\n $categories_string .= '</b>';\r\n }\r\n// \tEoF Category Box Enhancement\r\n\r\n $categories_string .= '</a>';\r\n\r\n if (SHOW_COUNTS == 'true') {\r\n $products_in_category = tep_count_products_in_category($counter);\r\n if ($products_in_category > 0) {\r\n $categories_string .= '&nbsp;(' . $products_in_category . ')';\r\n }\r\n }\r\n\r\n $categories_string .= '<br>';\r\n\r\n if ($tree[$counter]['next_id'] != false) {\r\n\t\t$categories_string .= '<div style=\"height:5px; line-height:5px; background: url('.DIR_WS_IMAGES .'m26.gif) center repeat-x;\"></div>';\r\n tep_show_category($tree[$counter]['next_id']);\r\n }\r\n }", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "function _make_cat_compat(&$category)\n {\n }", "function deeez_cats2($category){\n$space_holder = \"\";\n$cat_string = \"\";\n\tforeach ($category as $categorysingle) {\n\t$cat_string .= $space_holder . $categorysingle->name;\n\t$space_holder = \"_\";\n\t}\n\treturn $cat_string;\n}", "function makeCategory($ar_kat)\r\n\t{\r\n\t\tforeach($ar_kat as $val)\r\n\t\t{\r\n\t\t\t$this->trainNewCategory($val, $val);\r\n\t\t}\r\n\t\t\r\n\t\t/*isi word probability*/\r\n\t\tforeach($ar_kat as $val) //untuk setiap kategori\r\n\t\t{\r\n\t\t\tforeach ($this->arr_wc[$val]->vocab as $key => $row)\r\n\t\t\t{\r\n\t\t\t\t$prob = (1 + $row) / ($this->ctgrmgr->listCategory[$val]->jumWordInCategory + $this->arr_wc[$val]->jumVocab);\r\n\t\t\t\t//echo \"$row \";\r\n\t\t\t\t$this->ctgrmgr->listCategory[$val]->addWordProb($key, $prob);\r\n\t\t\t}\r\n\t\t\tif ($this->debug)\r\n\t\t\t{\r\n\t\t\t\techo \"<br/>\";\r\n\t\t\t\techo \"jum in category : \"; echo $this->ctgrmgr->listCategory[$val]->jumWordInCategory; echo \"<br/>\";\r\n\t\t\t\techo \"jum vocab : \"; echo $this->arr_wc[$val]->jumVocab; echo \"<br/>\";\r\n\t\t\t\techo \"get cat prob $val : \"; echo $this->ctgrmgr->getCatProb($val); echo \"<br/>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->serializeCat();\r\n\t}", "function unique_Category() {\n\t\t\n\t\tglobal $gesamt;\n\t\t\n\t\t$result = array_unique($gesamt);\n\t\tforeach ($result as $element){\n\t\t\techo \"<a href=\\\"load_page.php?cat=\" . $element .\"\\\">\". $element . \"</a><br>\";\n\t\t}\n\t}", "public function run()\n {\n $cates = [\n ['name' => 'iPhone'],\n ['name' => 'iPad'],\n ['name' => 'Macbook'],\n ['name' => 'Apple Watch'],\n ];\n\n try {\n foreach ($cates as $cate) {\n Category::create($cate);\n }\n } catch (\\Throwable $th) {\n\n }\n }", "function array_category($catalog, $category){\n // Declare an empty array to hold keys for given category\n $output = array();\n\n // Loop through the $catalog, adding item's ids to the array if they match the given category\n foreach ($catalog as $id => $item){\n // Checks to see if the passed in $category matches the category value for the current item from $catelog\n if ($category == null OR strtolower($category) == strtolower($item[\"category\"])) {\n // In order to sort items, a variable is created containing the current item's title\n $sort = $item[\"title\"];\n // ltrim is used to remove the,a or an from the start of any title where these words appear\n $sort = ltrim($sort,\"The \");\n $sort = ltrim($sort,\"A \");\n $sort = ltrim($sort,\"An \");\n // Title of current item is placed in $output array at the position $id\n $output[$id] = $sort;\n }\n }\n\n // asort is used to sort items in $output alphabetically\n asort($output);\n // return an array of the keys of the $output items\n return array_keys($output);\n}", "public function run()\n {\n //\n $categories = [\n \t'社交娱乐',\n \t'射击竞速',\n \t'冒险益智',\n \t'场景体验',\n \t'其他',\n ];\n\n foreach ($categories as $value) {\n \tAppCategory::create([\n\t \t'category'=>$value,\n \t]);\n }\n }", "function fillInCategories()\n {\n #echo \"eZNewsFlowerArticleCreator::fillInCategories()<br />\\n\";\n\n $name = $this->IniObject->GlobalIni->read_var( \"eZNewsCustomer\", \"Name\" );\n $itemType = new eZNewsItemType( \"flowercategory\" );\n $changeType = new eZNewsChangeType( \"publish\" );\n \n $categories = new eZNewsItem( $name );\n $categories->getChildren( &$childrenItems, $count );\n\n $canonicalParent = $this->Item->getIsCanonical();\n\n $i = 0;\n foreach( $childrenItems as $child )\n {\n $child->get( $outID );\n if( $child->ItemTypeID() == $itemType->ID() && $changeType->ID() == $child->status() )\n {\n $this->IniObject->set_var( \"item_id\", $child->ID() );\n $this->IniObject->set_var( \"item_name\", $child->name() );\n $this->IniObject->set_var( \"Selected\", \"\" );\n if( $i == 0 && empty( $canonicalParent ) )\n {\n $this->IniObject->set_var( \"Selected\", \"selected\" );\n }\n\n if( $child->ID() == $canonicalParent || $child->Name() == $canonicalParent ) \n {\n $this->IniObject->set_var( \"Selected\", \"selected\" );\n }\n \n $this->IniObject->parse( \"item\", \"item_template\", true );\n \n $i++;\n }\n }\n }", "function GenerateCategoryList($resultsOfVideoIDs)\r\n{\r\n\t// so i said that i should get the list of\r\n\t// go from result go upwards \r\n\t// what about results that are more than one ?\r\n\t\r\n\t// string \r\n\t$listofresultID =\"\";\r\n\twhile($row =mysql_fetch_array($resultsOfVideoIDs))\r\n\t{\r\n\t//$query = \"select Distinct ID, Name from categories where PrevName =\".$row[0];\r\n\t$listofresultID .=$row['ID'];\t\r\n\t//\r\n\t}\r\n\t// now i have a list of them \r\n\t\r\n\t$query = \"Select ID,Name from categories where PrevName = 'NULL'\";\r\n\t// selects all the categories to check if they are in the set \r\n\t// ...... Hold that thought.\r\n\t$results = ex_query($query);\r\n\twhile($row =mysql_fetch_array($results))\r\n\t{\r\n\t\t// now i have every category \r\n\t\t// now i drill down to the smallest\r\n\t\t$query = \"Select ID,Name from categories where PrevName='\".$row['ID'].\"'\";\r\n\t\t\r\n\t\t// this is to get the categories of the set \r\n\t\t// And provide a link that they can click \r\n\t}\r\n\t\r\n\t\r\n\t?>\r\n\t<div>\r\n\t\t<ul>\r\n\t\t<li>\r\n\t\t\t\r\n\t\t</li>\r\n\t\t</ul>\r\n\t</div>\r\n<?php\r\n\t}", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\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 }", "public function productCategoryName() {\n\t\treturn $this->generator->randomElement( static::$categories );\n\t}", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function __construct()\n {\n $cats = get_categories();\n if(class_exists('Category'))\n {\n if( is_array($cats) && count($cats)>0 ){\n $idC = 0;\n foreach($cats as &$cat)\n {\n $category = new Category($cat->term_id, $cat->name, $cat->slug, $cat->parent);\n $this->lstCat[$idC] = $category->convertToArray(array('id', 'name', 'slug', 'parent'));\n $this->lstCat[$idC]['aff']=true;\n $idC++;\n }unset($cat);\n }\n }\n }", "function htheme_woocategory_shortcode( $atts ) {\r\n\r\n\t\t#IF WOOCOMMERCE CLASS EXIST - ADD WOO VISUAL COMPOSER ELEMENTS\r\n\t\tif ( class_exists( 'WooCommerce' ) ){\r\n\t\t\t#SETUP WOO CONTENT CLASS\r\n\t\t\t$htheme_data = $this->htheme_woo_content->htheme_get_woo_product_category($atts);\r\n\r\n\t\t\t#RETURN DATA/HTML\r\n\t\t\treturn $htheme_data;\r\n\t\t} else {\r\n\t\t\treturn 'WooCommerce required!';\r\n\t\t}\r\n\r\n\t}", "function generate_from_text($cat,$ctgid) {\n $db = GetGlobal('db');\t \n\n //echo $cat;\n\t$tcat = explode('^',str_replace('<br>','',$cat));//br came from text processing at the end of string\n\t\n $sSQL = \"insert into categories (ctgid,cat1\";\n foreach ($tcat as $id=>$c) {\n\t $cid = $id+2;\n\t $sSQL .= ',cat'.$cid;\t\n\t} \n\t$sSQL.= \") values (\";\n\t$sSQL.= $ctgid . \",'ΚΑΤΗΓΟΡΙΕΣ ΕΙΔΩΝ'\";\n\t\n\treset($tcat);\n\tforeach ($tcat as $id=>$c)\n\t $sSQL .= \",'\".trim($c).\"'\";\n\t$sSQL .= ')';\n\t\n\t//echo $sSQL,'<br>'; \n\t\n\t$result = $db->Execute($sSQL,2);\n \tif (!$result) { \n\t echo $sSQL,' failed!<br>';\n\t}\t\n }", "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 getCategoryImage($categoryId)\n {\n //$AccentOpaque = array(\"15\",\"50\",\"51\",\"52\",\"57\");\n //$Williamsburg = array(\"26\",\"86\",\"87\",\"88\",\"93\"); \n //$Carolina = array(\"23\",\"59\",\"66\",\"274\"); \n //$Springhill = array(\"25\",\"77\",\"78\",\"79\",\"84\");\n\t $AccentOpaque = array(\"57\");\n\t\t$Hammermill = array(\"246\");\n\t\t$Williamsburg = array(\"93\"); \n\t\t$Carolina = array(\"66\"); \n\t\t$Springhill = array(\"84\");\n\t\t//$PPAllBrands = array(\"209\");\n\t\t$Envelope = array(\"131\");\n\t\t$Forms = array(\"262\", \"263\", \"264\", \"265\", \"266\", \"267\", \"269\", \"270\", \"271\");\n\t\t$Bristols = array(\"233\", \"234\", \"235\", \"236\", \"237\", \"238\", \"239\", \"240\", \"241\");\n\t\t$Specialty = array(\"152\");\n\t\t$HotCupsLids = array(\"182\", \"178\", \"179\", \"183\", \"181\", \"220\", \"228\", \"229\", \"230\");\n\t\t$ColdCupsLids = array(\"158\", \"154\", \"275\", \"276\", \"277\");\n\t\t$FoodPackaging = array(\"213\", \"172\", \"212\", \"221\", \"222\", \"223\", \"214\", \"278\");\n \n //For category logo\n if(in_array($categoryId, $AccentOpaque)){\n //$catImgLogo = \"logo-accentopaque.jpg\";\n $catImgLogo = \"Accent Opaque\";\n }\n\t\t else if(in_array($categoryId, $Hammermill)){\n $catImgLogo = \"Hammermill\";\n }\n else if(in_array($categoryId, $Williamsburg)){\n $catImgLogo = \"Williamsburg\";\n }\n else if(in_array($categoryId, $Carolina)){\n $catImgLogo = \"Carolina\";\n }\n else if(in_array($categoryId, $Springhill)){\n $catImgLogo = \"Springhill\";\n }\n\t\t else if(in_array($categoryId, $Envelope)){\n $catImgLogo = \"Envelope\";\n }\n\t\t else if(in_array($categoryId, $Forms)){\n $catImgLogo = \"Forms\";\n }\n\t\t else if(in_array($categoryId, $Bristols)){\n $catImgLogo = \"Bristols\";\n }\n\t\t else if(in_array($categoryId, $Specialty)){\n $catImgLogo = \"Specialty\";\n }\n\t\t else if(in_array($categoryId, $HotCupsLids)){\n $catImgLogo = \"Hot Cups and Lids\";\n }\n\t\t else if(in_array($categoryId, $ColdCupsLids)){\n $catImgLogo = \"Cold Cups and Lids\";\n }\n\t\t else if(in_array($categoryId, $FoodPackaging)){\n $catImgLogo = \"Food Packaging\";\n }\n return $catImgLogo;\n }", "function __construct() {\n $this->varName = 'cat' . self::$i++;\n }", "public function run()\n\t{\n\t\tDB::table('product_category')->where('id', '!=', 1)->delete();\n\n\t\t$now = date('Y-m-d H:i:s');\n\n\t\t$category['main'] = 'Art';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Art Zines';\n\t\t\t$sub_category[] = 'Collage & Mixed Media';\n\t\t\t$sub_category[] = 'Custom Portraits';\n\t\t\t$sub_category[] = 'Decorative Arts';\n\t\t\t$sub_category[] = 'Drawing & Illustration';\n\t\t\t$sub_category[] = 'Figurines & Art Objects';\n\t\t\t$sub_category[] = 'Painting';\n\t\t\t$sub_category[] = 'Photography';\n\t\t\t$sub_category[] = 'Printmaking';\n\t\t\t$sub_category[] = 'Prints & Posters';\n\t\t\t$sub_category[] = 'Sculpture';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Home & Living';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Bath & Beauty';\n\t\t\t$sub_category[] = 'Books, Music & Media';\n\t\t\t$sub_category[] = 'Collectables';\n\t\t\t$sub_category[] = 'Decor & Housewares';\n\t\t\t$sub_category[] = 'Dining & Entertaining';\n\t\t\t$sub_category[] = 'Electronics & Gadgets';\n\t\t\t$sub_category[] = 'Food Market';\n\t\t\t$sub_category[] = 'Furniture';\n\t\t\t$sub_category[] = 'Kitchen';\n\t\t\t$sub_category[] = 'Lighting';\n\t\t\t$sub_category[] = 'Musical Instruments';\n\t\t\t$sub_category[] = 'Outdoors & Garden';\n\t\t\t$sub_category[] = 'Pets';\n\t\t\t$sub_category[] = 'Stationery & Party';\n\t\t\t$sub_category[] = 'Storage & Organisation';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Mobile Accessories';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Decals';\n\t\t\t$sub_category[] = 'Docking Stations & Chargers';\n\t\t\t$sub_category[] = 'Flash Drives';\n\t\t\t$sub_category[] = 'Gear for Android';\n\t\t\t$sub_category[] = 'Gear for Kindle';\n\t\t\t$sub_category[] = 'Gear for iPad Mini';\n\t\t\t$sub_category[] = 'Gear for iPad';\n\t\t\t$sub_category[] = 'Gear for iPhone';\n\t\t\t$sub_category[] = 'Headphones';\n\t\t\t$sub_category[] = 'Keyboard Accessories';\n\t\t\t$sub_category[] = 'Laptop Bags';\n\t\t\t$sub_category[] = 'Laptop Cases';\n\t\t\t$sub_category[] = 'Phone Cases & Wallets';\n\t\t\t$sub_category[] = 'Phone Covers';\n\t\t\t$sub_category[] = 'Phone Plugs & Charms';\n\t\t\t$sub_category[] = 'Speakers';\n\t\t\t$sub_category[] = 'Stands';\n\t\t\t$sub_category[] = 'Styluses';\n\t\t\t$sub_category[] = 'Tablet Accessories';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Jewellery';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Body';\n\t\t\t$sub_category[] = 'Bracelets';\n\t\t\t$sub_category[] = 'Brooches';\n\t\t\t$sub_category[] = 'Earrings';\n\t\t\t$sub_category[] = 'Eco-Friendly';\n\t\t\t$sub_category[] = 'Fine Jewellery';\n\t\t\t$sub_category[] = 'Kids';\n\t\t\t$sub_category[] = 'Men';\n\t\t\t$sub_category[] = 'Necklaces';\n\t\t\t$sub_category[] = 'Personalised';\n\t\t\t$sub_category[] = 'Rings';\n\t\t\t$sub_category[] = 'Storage & Organisation';\n\t\t\t$sub_category[] = 'Watches';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Women';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Accessories';\n\t\t\t$sub_category[] = 'Bags & Purses';\n\t\t\t$sub_category[] = 'Bottoms';\n\t\t\t$sub_category[] = 'Costumes';\n\t\t\t$sub_category[] = 'Dresses';\n\t\t\t$sub_category[] = 'Outerwear';\n\t\t\t$sub_category[] = 'Shoes';\n\t\t\t$sub_category[] = 'Nightwear & Intimates';\n\t\t\t$sub_category[] = 'Specialty';\n\t\t\t$sub_category[] = 'Sizes';\n\t\t\t$sub_category[] = 'Swimwear & Coverups';\n\t\t\t$sub_category[] = 'Tops';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Men';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Tanks';\n\t\t\t$sub_category[] = 'Bags & Wallets';\n\t\t\t$sub_category[] = 'Belts & Buckles';\n\t\t\t$sub_category[] = 'Bottoms';\n\t\t\t$sub_category[] = 'Coats & Jackets';\n\t\t\t$sub_category[] = 'Costumes';\n\t\t\t$sub_category[] = 'Cufflinks';\n\t\t\t$sub_category[] = 'Hats';\n\t\t\t$sub_category[] = 'Hoodies & Sweatshirts';\n\t\t\t$sub_category[] = 'Shirts';\n\t\t\t$sub_category[] = 'Shoes';\n\t\t\t$sub_category[] = 'Suits';\n\t\t\t$sub_category[] = 'Jumpers';\n\t\t\t$sub_category[] = 'T-Shirts';\n\t\t\t$sub_category[] = 'Ties, Clips & Bow Ties';\n\t\t\t$sub_category[] = 'Other Clothing';\n\t\t\t$sub_category[] = 'Other Accessories';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Kids';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Baby & Toddler';\n\t\t\t$sub_category[] = 'Bath';\n\t\t\t$sub_category[] = 'Boys';\n\t\t\t$sub_category[] = 'Costumes';\n\t\t\t$sub_category[] = 'Eco-Friendly';\n\t\t\t$sub_category[] = 'Furniture & Decor';\n\t\t\t$sub_category[] = 'Girls';\n\t\t\t$sub_category[] = 'Personalised';\n\t\t\t$sub_category[] = 'School & Learning';\n\t\t\t$sub_category[] = 'Special Occasions';\n\t\t\t$sub_category[] = 'Toys';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Vintage';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Accessories';\n\t\t\t$sub_category[] = 'Antiques';\n\t\t\t$sub_category[] = 'Art';\n\t\t\t$sub_category[] = 'Bags & Purses';\n\t\t\t$sub_category[] = 'Books';\n\t\t\t$sub_category[] = 'Clothing';\n\t\t\t$sub_category[] = 'Collectables';\n\t\t\t$sub_category[] = 'Electronics';\n\t\t\t$sub_category[] = 'Furniture';\n\t\t\t$sub_category[] = 'Home Decor';\n\t\t\t$sub_category[] = 'Housewares';\n\t\t\t$sub_category[] = 'Jewellery';\n\t\t\t$sub_category[] = 'Paper Ephemera';\n\t\t\t$sub_category[] = 'Serving';\n\t\t\t$sub_category[] = 'Toys';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Weddings';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Bridal Accessories';\n\t\t\t$sub_category[] = 'Decor';\n\t\t\t$sub_category[] = 'Dresses';\n\t\t\t$sub_category[] = 'Groom\\'s Corner';\n\t\t\t$sub_category[] = 'Paper Goods';\n\t\t\t$sub_category[] = 'Rings';\n\t\t\t$sub_category[] = 'Wedding Party';\n\t\t\t$sub_category[] = 'Real Weddings';\n\t\t\t$sub_category[] = 'Registry';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Craft Supplies';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'DIY Weddings';\n\t\t\t$sub_category[] = 'Fine Arts';\n\t\t\t$sub_category[] = 'Floral & Gardening';\n\t\t\t$sub_category[] = 'Food Crafting';\n\t\t\t$sub_category[] = 'Framing';\n\t\t\t$sub_category[] = 'Gift Wrapping';\n\t\t\t$sub_category[] = 'Jewellery Making';\n\t\t\t$sub_category[] = 'Knitting & Crochet';\n\t\t\t$sub_category[] = 'Paper Crafts';\n\t\t\t$sub_category[] = 'Scrapbooking';\n\t\t\t$sub_category[] = 'Sewing, Quilting & Needle Crafts';\n\t\t\t$sub_category[] = 'Woodworking';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Gift Ideas';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'For Couples';\n\t\t\t$sub_category[] = 'For Her';\n\t\t\t$sub_category[] = 'For Him';\n\t\t\t$sub_category[] = 'Teens';\n\t\t\t$sub_category[] = 'Kids & Baby';\n\t\t\t$sub_category[] = 'DIYer';\n\t\t\t$sub_category[] = 'Friends & Coworkers';\n\t\t\t$sub_category[] = 'Gardener & Naturalist';\n\t\t\t$sub_category[] = 'Hostess & Gourmet';\n\t\t\t$sub_category[] = 'Outdoor & Sportsman';\n\t\t\t$sub_category[] = 'Pets & Pet Lovers';\n\t\t\t$sub_category[] = 'Tech Lover';\n\t\t\t$sub_category[] = 'Novelty & Gag Gifts';\n\t\t\t$sub_category[] = 'Stocking Stuffers';\n\t\t\t$sub_category[] = 'Cards & Wrap';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$template_id = $addresses_id = 1;\n\t\t$id = 2;\n\t\t$category_left = 2;\n\t\tforeach($categories as $main_category){\n\t\t\t//main category details\n\t\t\t$main = array();\n\t\t\t$main['id'] = $id;\n\t\t\t$main['seo_category_name'] = $this->slugify($main_category['main']);\n\t\t\t$main['category_name'] = $main_category['main'];\n\t\t\t$main['category_level'] = 1;\n\t\t\t$main['parent_category_id'] = 1;\n\t\t\t$main['category_left'] = $category_left;\n\t\t\t$main['category_right'] = $category_left + (count($main_category['sub']) * 2) + 1;\n\t\t\t$main['date_added'] = $now;\n\t\t\t$category_left++;\n\t\t\t$id++;\n\n\t\t\tDB::table('product_category')->insert($main);\n\t\t\t//echo '$main_category:'. $main_category['main']; echo \"\\n\";\n\t\t\tforeach($main_category['sub'] as $sub_category) {\n\t\t\t\t//sub category details\n\t\t\t\t$sub = array();\n\t\t\t\t$sub['id'] = $id;\n\t\t\t\t$sub['seo_category_name'] = $this->slugify($sub_category);\n\t\t\t\t$sub['category_name'] = $sub_category;\n\t\t\t\t$sub['category_level'] = 2;\n\t\t\t\t$sub['parent_category_id'] = $main['id'];\n\t\t\t\t$sub['category_left'] = $category_left;\n\t\t\t\t$sub['category_right'] = $category_left + 1;\n\t\t\t\t$sub['date_added'] = $now;\n\t\t\t\t$category_left++;\n\t\t\t\t$category_left++;\n\t\t\t\t$id++;\n\t\t\t\t//echo ' ****************************** $sub_category:'. $sub_category; echo \"\\n\";\n\t\t\t\tDB::table('product_category')->insert($sub);\n\t\t\t}\n\t\t\t$category_left++;\n\t\t}\n\t\tDB::table('product_category')->where('id', 1)->update(array('category_right' => $category_left));\n\t}", "private function createSampleCategory()\n {\n $cat = new Downloads_Entity_Categories();\n $cat->setTitle($this->__(\"SampleCategory\"));\n $cat->setDescription($this->__(\"This category is provided as a sample and can be safely deleted.\"));\n $cat->setPid(0);\n $this->entityManager->persist($cat);\n $this->entityManager->flush();\n return $cat;\n }", "public function createCategory();", "public static function getCategoryListing() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_CategoryTree, $lC_Vqmod, $cPath, $cPath_array, $current_category_id;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n if (isset($cPath) && strpos($cPath, '_')) {\n // check to see if there are deeper categories within the current category\n $category_links = array_reverse($cPath_array);\n for($i=0, $n=sizeof($category_links); $i<$n; $i++) {\n $Qcategories = $lC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n\n if ($Qcategories->valueInt('total') < 1) {\n // do nothing, go through the loop\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n break; // we've found the deepest category the customer is in\n }\n }\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $current_category_id);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n }\n $number_of_categories = $Qcategories->numberOfRows();\n $rows = 0;\n $output = '';\n while ($Qcategories->next()) {\n $rows++;\n $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';\n $exists = ($Qcategories->value('categories_image') != null) ? true : false;\n $output .= ' <td style=\"text-align:center;\" class=\"categoryListing\" width=\"' . $width . '\" valign=\"top\">';\n if ($Qcategories->value('categories_custom_url') != '') {\n $output .= lc_link_object(lc_href_link($Qcategories->value('categories_custom_url'), ''), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no-image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n } else {\n $output .= lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no_image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n }\n $output .= '</td>' . \"\\n\";\n if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {\n $output .= ' </tr>' . \"\\n\";\n $output .= ' <tr>' . \"\\n\";\n } \n } \n \n return $output;\n }", "public function run()\n {\n $categories = [\n [\n 'name' => 'Processor',\n 'description' => 'Otak komputer',\n ],\n [\n 'name' => 'VGA',\n 'description' => 'Untuk kebutuhan grafis',\n ],\n ];\n\n foreach ($categories as $key => $value) {\n Category::create($value);\n }\n }", "public function categoryName() {\n $categories = array(\n 'Fantasy',\n 'Technology',\n 'Thriller',\n 'Documentation',\n );\n\n return $categories[array_rand($categories)];\n }", "function category($categoryName, $categoryId, $page)\n {\n $sort = Input::get('sortOrder') == null ? \"BestMatch\" : Input::get('sortOrder');\n $checkedInput = $this->checkedChecked(Input::get());\n $breadCramb = $this->model->getBreadCramb($categoryId);\n\n $filterUrl = $this->generateFilterUrl(Input::get());\n $ebayData = $this->model->getProductsByCategory(\n $categoryId, 42, $page, Input::get(), $sort\n );\n $similarCategories = $this->model->getSimilarCategory($categoryId);\n $filterData = $this->model->getFiltersForCategory($categoryId);\n\n $resultsAmount = $ebayData->totalEntries;\n if ($ebayData->totalPages > 100) {\n $totalPages = 100;\n } else {\n $totalPages = $ebayData->totalPages;\n }\n $pagesAvailable = Util::getPaginationList($page, $totalPages);\n $paginationResult = Util::getLinksForPagination($pagesAvailable, \"category\", $categoryName, $page, $this->siteslug, $filterUrl, $categoryId);\n $filtersForTitle = $this->model->getFiltersForTitle($checkedInput);\n $pages = $paginationResult['pages'];\n $pageNext = $paginationResult['pageNext'];\n\n $categoryData['page'] = $page;\n $categoryData['id'] = $categoryId;\n $categoryData['title'] = $categoryName;\n $categoryData['totalResults'] = $resultsAmount;\n\n if ($page == 1) {\n $pageForTitle = '';\n } else {\n $pageForTitle = ' ' . 'עמוד' . ' ' . $page;\n }\n// $this->title = $categoryData['title'] . ' ' . $filtersForTitle . $pageForTitle . '- ' . \"אמזון בעברית\" . ' - ' . 'צי\\'פי קניות ברשת';\n /*if (is_null($sort)) {\n $sortForTitle = '';\n } else {\n $sortForTitle = '-' . $sort;\n }*/\n if (Lang::getLocale() == 'he') {\n $this->shopName = Lang::get('general.amazon');\n } elseif (Lang::getLocale() == 'en') {\n $this->shopName = 'amazon';\n };\n //dd($filtersForTitle);\n $this->title = $categoryData['title'] . ' - ' . $breadCramb['category'] . $filtersForTitle . ' - ' . $categoryData['page'] . ' - ' . $this->shopName;\n $this->description = $categoryData['title'] . ' ' . $filtersForTitle . $pageForTitle . '- ' . \"אמזון בעברית\" . ' - ' . \"שירות לקוחות בעברית,תשלום ללא כ.א בינלאומי,למעלה ממיליארד מוצרים בעברית\";\n //dd($categoryData);\n $productBaseRoute = \"/{$this->siteslug}/product\";\n return view(\"ebay.category\", [\n 'pagination' => $pages,\n 'pageNext' => $pageNext,\n 'categoryData' => $categoryData,\n 'categories' => $this->categories,\n 'productBase' => $productBaseRoute,\n 'siteslug' => $this->siteslug,\n 'ebayData' => $ebayData->products,\n 'filterData' => $filterData,\n 'checkedInput' => $checkedInput,\n 'breadCramb' => $breadCramb,\n 'title' => $this->title,\n 'description' => $this->description,\n 'page' => $page,\n 'similarCategories' => $similarCategories,\n ]);\n }", "public function run()\n {\n $categories = [\n ['name'=>'Android'],\n ['name'=>'前端'],\n ['name'=>'IOS'],\n ['name'=>'后台'],\n ['name'=>'产品'],\n ['name'=>'需求'],\n ['name'=>'设计']\n ];\n\n foreach ($categories as $key => $value) {\n Cat::create($value);\n }\n }", "public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\n }", "function category($title, $id, $page)\n {\n $sort = Input::get('sort');\n\n $aliexpressApi = new AliexpressAPI();\n\n $options = [\n \"sort\" => $sort,\n \"pageNo\" => $page\n ];\n if (Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort) == null) {\n Cache::put('aliCategory' . $id . '-' . $page . '-' . $sort, json_decode($aliexpressApi->getCategoryProducts($id,\n 39, \"USD\", App::getLocale(), $options)), Config::get('cache.storeAliHotProducts'));\n }\n $aliData = Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort);\n\n $similarCategories = $this->model->getSimilarCategory($id);\n $breadCramb = $this->model->getBreadCramb($id);\n $resultsAmount = isset($aliData->result->totalResults) ? $aliData->result->totalResults : 100;\n\n // pagination ( not the perfect of implementations, but it works )\n $totalPages = 100;\n $pagesAvailable = Util::getPaginationList($page, $totalPages);\n\n $categoryData = $this->makeCategoryData($page, $id, $title, $sort, $resultsAmount);\n\n // product forms action route base\n $productBaseRoute = \"/{$this->siteslug}/product\";\n $categoryBaseRoute = \"/{$this->siteslug}/category/$title/$id\";\n\n $paginationResult = Util::getLinksForPagination($pagesAvailable, \"category\", $title, $page, $this->siteslug, null, $id);\n\n $pages = $paginationResult['pages'];\n $pageNext = $paginationResult['pageNext'];\n\n if ($page == 1) {\n $pageForTitle = '';\n } else {\n $pageForTitle = ' ' . 'עמוד' . ' ' . $page;\n }\n /*if (is_null($categoryData['sort'])){\n $sortForTitle='';\n }else{\n $sortForTitle='-' . $categoryData['sort'];\n }*/\n // dd($categoryData);\n if (Lang::getLocale() == 'he') {\n $this->shopName = Lang::get('general.aliexpress');\n } elseif (Lang::getLocale() == 'en') {\n $this->shopName = 'aliexpress';\n };\n $this->title =$categoryData['title']. ' - ' . $breadCramb['category']. ' - ' . $this->shopName . ' - ' . $categoryData['page'] . ' - ' .'עליאקספרס' ;\n// $this->title = $categoryData['title'];\n $this->description = $categoryData['title'] . $pageForTitle . '- ' . \"עליאקספרס בעברית\" . ' - ' . \"שירות לקוחות בעברית,תשלום ללא כ.א בינלאומי,למעלה ממיליארד מוצרים בעברית\";\n return view(\"aliexpress.category\", [\n 'timerTime' => $this->timerTime,\n 'nextPageLink' => $pageNext,\n 'pageLinks' => $pages,\n 'pagination' => $pagesAvailable,\n 'categoryData' => $categoryData,\n 'productBase' => $productBaseRoute,\n 'categoryBase' => $categoryBaseRoute,\n 'aliData' => $this->model->parseCategoryData($aliData),\n 'categories' => $this->categories,\n 'siteslug' => $this->siteslug,\n 'breadCramb' => $breadCramb,\n 'title' => $this->title,\n 'description' => $this->description,\n 'page' => $page,\n 'similarCategories' => $similarCategories,\n ]);\n }", "function print_categories( $thisId ) { \n $thisCat = get_the_category( $thisId );\n foreach( $thisCat as $cat ) {\n echo $cat->slug . \" \";\n }\n}", "function get_all_category_ids()\n {\n }", "protected function setupCategories()\n {\n static $done;\n\n if (!empty($done)) {\n return;\n }\n\n $c = new Categories();\n $c->setContext('G_Access');\n $c->setIsActive(true);\n $c->save();\n\n $ci = new CategoriesI18n();\n $ci->setId($c->getId());\n $ci->setTitle('Girl Accessories');\n $ci->setLocale('da_DK');\n $ci->setContent('test 1.2.3');\n $ci->save();\n\n $c = new Categories();\n $c->setContext('LG_Access');\n $c->setIsActive(true);\n $c->save();\n\n $ci = new CategoriesI18n();\n $ci->setId($c->getId());\n $ci->setTitle('Little Girl Accessories');\n $ci->setLocale('da_DK');\n $ci->setContent('test 1.2.3');\n $ci->save();\n\n $done = true;\n }", "function parse_categories($html)\r\n {\r\n // truncate the html string for easier processing\r\n $html_start = '<ul class=\"org-cats-2\">';\r\n $html_start_pos = strpos($html, $html_start) + strlen($html_start);\r\n $html_end = '</ul>';\r\n $html = substr($html, $html_start_pos , strpos($html, $html_end, $html_start_pos) - $html_start_pos);\r\n \r\n // pull OSL category and the ID they assign to later add to tag table\r\n preg_match_all('#value=\"(\\d*?)\".*?>\\s*(.*?)\\s<#si', $html, $categories_all, PREG_SET_ORDER); \r\n foreach ($categories_all as $index => $tag)\r\n {\r\n $categories_all[$index][2] = substr($tag[2],0,-12);\r\n }\r\n return $categories_all; \r\n }", "private function runCategory()\n {\n $num = (int) $this->ask('How many records do you want to create for the categories table?');\n factory(Category::class, $num)->create();\n }", "public function run()\n {\n $this->uploadFiles('product-categories');\n\n $categories = [\n [\n 'name' => 'Hot Promotions',\n 'icon' => 'icon-star',\n ],\n [\n 'name' => 'Electronics',\n 'icon' => 'icon-laundry',\n 'image' => 'product-categories/1.jpg',\n 'is_featured' => true,\n 'children' => [\n [\n 'name' => 'Consumer Electronic',\n 'children' => [\n [\n 'name' => 'Home Audio & Theaters',\n ],\n [\n 'name' => 'TV & Videos',\n ],\n [\n 'name' => 'Camera, Photos & Videos',\n ],\n [\n 'name' => 'Cellphones & Accessories',\n ],\n [\n 'name' => 'Headphones',\n ],\n [\n 'name' => 'Videos games',\n ],\n [\n 'name' => 'Wireless Speakers',\n ],\n [\n 'name' => 'Office Electronic',\n ],\n ],\n ],\n [\n 'name' => 'Accessories & Parts',\n 'children' => [\n [\n 'name' => 'Digital Cables',\n ],\n [\n 'name' => 'Audio & Video Cables',\n ],\n [\n 'name' => 'Batteries',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Clothing',\n 'icon' => 'icon-shirt',\n 'image' => 'product-categories/2.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Computers',\n 'icon' => 'icon-desktop',\n 'image' => 'product-categories/3.jpg',\n 'is_featured' => true,\n 'children' => [\n [\n 'name' => 'Computer & Technologies',\n 'children' => [\n [\n 'name' => 'Computer & Tablets',\n ],\n [\n 'name' => 'Laptop',\n ],\n [\n 'name' => 'Monitors',\n ],\n [\n 'name' => 'Computer Components',\n ],\n ],\n ],\n [\n 'name' => 'Networking',\n 'children' => [\n [\n 'name' => 'Drive & Storages',\n ],\n [\n 'name' => 'Gaming Laptop',\n ],\n [\n 'name' => 'Security & Protection',\n ],\n [\n 'name' => 'Accessories',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Home & Kitchen',\n 'icon' => 'icon-lampshade',\n 'image' => 'product-categories/4.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Health & Beauty',\n 'icon' => 'icon-heart-pulse',\n 'image' => 'product-categories/5.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Jewelry & Watch',\n 'icon' => 'icon-diamond2',\n 'image' => 'product-categories/6.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Technology Toys',\n 'icon' => 'icon-desktop',\n 'image' => 'product-categories/7.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Phones',\n 'icon' => 'icon-smartphone',\n 'image' => 'product-categories/8.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Babies & Moms',\n 'icon' => 'icon-baby-bottle',\n ],\n [\n 'name' => 'Sport & Outdoor',\n 'icon' => 'icon-baseball',\n ],\n [\n 'name' => 'Books & Office',\n 'icon' => 'icon-book2',\n ],\n [\n 'name' => 'Cars & Motorcycles',\n 'icon' => 'icon-car-siren',\n ],\n [\n 'name' => 'Home Improvements',\n 'icon' => 'icon-wrench',\n ],\n ];\n\n ProductCategory::truncate();\n Slug::where('reference_type', ProductCategory::class)->delete();\n MetaBoxModel::where('reference_type', ProductCategory::class)->delete();\n\n foreach ($categories as $index => $item) {\n $this->createCategoryItem($index, $item);\n }\n\n // Translations\n DB::table('ec_product_categories_translations')->truncate();\n\n $translations = [\n [\n 'name' => 'Khuyến mãi hấp dẫn',\n ],\n [\n 'name' => 'Điện tử',\n 'children' => [\n [\n 'name' => 'Điện tử tiêu dùng',\n 'children' => [\n [\n 'name' => 'Thiết bị nghe nhìn',\n ],\n [\n 'name' => 'TV & Videos',\n ],\n [\n 'name' => 'Camera, Photos & Videos',\n ],\n [\n 'name' => 'Điện thoại di động & Phụ kiện',\n ],\n [\n 'name' => 'Tai nghe',\n ],\n [\n 'name' => 'Trò chơi video',\n ],\n [\n 'name' => 'Loa không dây',\n ],\n [\n 'name' => 'Điện tử văn phòng',\n ],\n ],\n ],\n [\n 'name' => 'Phụ kiện & Phụ tùng',\n 'children' => [\n [\n 'name' => 'Digital Cables',\n ],\n [\n 'name' => 'Audio & Video Cables',\n ],\n [\n 'name' => 'Pin',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Quần áo',\n ],\n [\n 'name' => 'Máy tính',\n 'children' => [\n [\n 'name' => 'Máy tính & Công nghệ',\n 'children' => [\n [\n 'name' => 'Máy tính & Máy tính bảng',\n ],\n [\n 'name' => 'Máy tính xách tay',\n ],\n [\n 'name' => 'Màn hình',\n ],\n [\n 'name' => 'Linh kiện Máy tính',\n ],\n ],\n ],\n [\n 'name' => 'Mạng máy tính',\n 'children' => [\n [\n 'name' => 'Thiết bị lưu trữ',\n ],\n [\n 'name' => 'Máy tính xách tay chơi game',\n ],\n [\n 'name' => 'Thiết bị bảo mật',\n ],\n [\n 'name' => 'Phụ kiện',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Đồ dùng làm bếp',\n ],\n [\n 'name' => 'Sức khỏe & làm đẹp',\n ],\n [\n 'name' => 'Trang sức & Đồng hồ',\n ],\n [\n 'name' => 'Đồ chơi công nghệ',\n ],\n [\n 'name' => 'Điện thoại',\n ],\n [\n 'name' => 'Mẹ và bé',\n ],\n [\n 'name' => 'Thể thao & ngoài trời',\n ],\n [\n 'name' => 'Sách & Văn phòng',\n ],\n [\n 'name' => 'Ô tô & Xe máy',\n ],\n [\n 'name' => 'Cải tiến nhà cửa',\n ],\n ];\n\n $count = 1;\n foreach ($translations as $translation) {\n\n $translation['lang_code'] = 'vi';\n $translation['ec_product_categories_id'] = $count;\n\n DB::table('ec_product_categories_translations')->insert(Arr::except($translation, ['children']));\n\n $count++;\n\n if (isset($translation['children'])) {\n foreach ($translation['children'] as $child) {\n\n $child['lang_code'] = 'vi';\n $child['ec_product_categories_id'] = $count;\n\n DB::table('ec_product_categories_translations')->insert(Arr::except($child, ['children']));\n\n $count++;\n\n if (isset($child['children'])) {\n foreach ($child['children'] as $item) {\n\n $item['lang_code'] = 'vi';\n $item['ec_product_categories_id'] = $count;\n\n DB::table('ec_product_categories_translations')->insert(Arr::except($item, ['children']));\n\n $count++;\n }\n }\n }\n }\n }\n }", "function wi_shop_link_markup(){\n\trequire_once \"components/shop_components/shop_catagory_markup.php\";\n\t $args = array(\n\t\t 'taxonomy' => 'product_cat',\n\t\t 'hide_empty' => true,\n\t\t 'meta_key' => 'thumbnail_id'\n\t );\n\t$categories = get_terms($args );\n\n\t//echo print_r($categories);\n\t$display = \"<section class='homepage-shop-link'>\";\n\t$display .= \"<h1>Find your darkness</h1>\";\n\techo $display;\n//\techo print_r(woocommerce_get_product_subcategories());\n\n\tforeach($categories as $category){\n\t\t//get_object_vars($category) ;\n\t\tshop_catagory($category);\n\t}\n \techo \"</section>\";\n\n //echo print_r(get_theme_mod(\"wi_hero_background_image\"));\n\n}", "public function convert_category_titles()\n\t{\n\t\t$category \t= $split_cat = ee()->TMPL->fetch_param('category');\n\n\t\tif (strtolower(substr($split_cat, 0, 3)) == 'not')\n\t\t{\n\t\t\t$split_cat = substr($split_cat, 3);\n\t\t}\n\n\t\t$categories = preg_split(\n\t\t\t'/' . preg_quote('&') . '|' . preg_quote('|') . '/',\n\t\t\t$split_cat,\n\t\t\t-1,\n\t\t\tPREG_SPLIT_NO_EMPTY\n\t\t);\n\n\t\t$to_fix = array();\n\n\t\tforeach ($categories as $cat)\n\t\t{\n\t\t\tif (preg_match('/\\w+/', trim($cat)))\n\t\t\t{\n\t\t\t\t$to_fix[trim($cat)] = 0;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty ($to_fix))\n\t\t{\n\t\t\t$cats = ee()->db->query(\n\t\t\t\t\"SELECT cat_id, cat_url_title\n\t\t\t\t FROM \texp_categories\n\t\t\t\t WHERE \tcat_url_title\n\t\t\t\t IN \t('\" . implode(\"','\", ee()->db->escape_str(array_keys($to_fix))) . \"')\"\n\t\t\t);\n\n\t\t\tforeach ($cats->result_array() as $row)\n\t\t\t{\n\t\t\t\t$to_fix[$row['cat_url_title']] = $row['cat_id'];\n\t\t\t}\n\n\t\t\tkrsort($to_fix);\n\n\t\t\tforeach ($to_fix as $cat => $id)\n\t\t\t{\n\t\t\t\tif ($id != 0)\n\t\t\t\t{\n\t\t\t\t\t$category = str_replace($cat, $id, $category);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tee()->TMPL->tagparams['category'] = $category;\n\t\t}\n\t}", "function get_cat_ID($cat_name)\n {\n }", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "function create_my_cat () {\r\n if (file_exists (ABSPATH.'/wp-admin/includes/taxonomy.php')) {\r\n require_once (ABSPATH.'/wp-admin/includes/taxonomy.php'); \r\n if ( ! get_cat_ID( 'News Articles' ) ) {\r\n wp_create_category( 'News Article' );\r\n }\r\n if ( ! get_cat_ID( 'Call To Action' ) ) {\r\n wp_create_category( 'Call To Action' );\r\n }\r\n if ( ! get_cat_ID( 'Latest Projects' ) ) {\r\n wp_create_category( 'Latest Projects' );\r\n }\r\n if ( ! get_cat_ID( 'Sliders' ) ) {\r\n wp_create_category( 'Sliders' );\r\n }\r\n if ( ! get_cat_ID( 'Reviews and Whitepapers' ) ) {\r\n wp_create_category( 'Reviews and Whitepapers' );\r\n }\r\n if ( ! get_cat_ID( 'Bottom Row' ) ) {\r\n wp_create_category( 'Bottom Row' );\r\n }\r\n if ( ! get_cat_ID( 'Blog' ) ) {\r\n wp_create_category( 'Blog' );\r\n }\r\n }\r\n}", "public function _get_category($cat){\n\t\t$jumlah_category = substr_count($cat,\",\");\n\t\t$cat_a = explode(',',$cat);\n\t\t$j_cat = 0;\n\t\t$cat_result = \"\";\n\t\twhile ($j_cat <= $jumlah_category){\n\t\t$cat_me = $cat_a[\"$j_cat\"];\n\t\t$cat_link2 = strtolower($cat_me);\n\t\t$cat_link2 = str_replace(\" \", \"-\", $cat_link2);\n\t\t$cat_result .= \"<a href='\".APP_URL.\"/\".uri_category.\"/$cat_link2'> $cat_me</a> , \";\n\t\t$j_cat++;\n\t\t}\n\t\treturn $cat_result;\n\t}", "function getCategoriesSimple($id, $prefix, &$entries, $admin=0, $dropdown=0, $itid='')\r\n\t{\r\n\t\t$query = $GLOBALS['db']->Query(\"SELECT * FROM \" . PREFIX . \"_modul_shop_kategorie WHERE Elter = '$id' order by Rang ASC\");\r\n\r\n \t\tif (!$query->numrows()) return;\r\n\r\n\t\twhile ($item = $query->fetchrow())\r\n\t\t{\r\n\t\t\t$item->visible_title = $prefix . (($item->Elter!=0 && $admin != 1) ? '' : '') . $item->KatName;\r\n\t\t\t$item->expander = $prefix;\r\n\t\t\t$item->sub = ($item->Elter==0) ? 0 : 1;\r\n\t\t\t$item->dyn_link = \"index.php?module=shop&amp;categ=$item->Id&amp;parent=$item->Elter&amp;navop=\" . (($item->sub==0) ? $item->Id : getParentShopcateg($item->Elter));\r\n\t\t\t$item->dyn_link = $this->shopRewrite($item->dyn_link);\r\n\r\n array_push($entries,$item);\r\n\t\t\tif($admin == 1)\r\n\t\t\t{\r\n\t\t\t\t$this->getCategoriesSimple($item->Id, $prefix . \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\", $entries, $admin, $dropdown);\r\n\t\t\t} else {\r\n\t\t\t\t$this->getCategoriesSimple($item->Id, $prefix . (($dropdown==1) ? '&nbsp;&nbsp;' : $this->_expander), $entries, $dropdown, $item->Id);\r\n\t\t\t}\r\n\t\t}\r\n return $entries;\r\n}", "public function get_category()\n\t{\n\t\tglobal $module_name, $nv_Cache;\n\n\t\t$category = array();\n\n\t\t$sql = \"SELECT * FROM \" . $this->table_prefix . \"_category ORDER BY weight ASC\";\n\t\t$result = $this->db_cache( $sql, 'id', $module_name );\n\n\t\t$category[0] = array(\n\t\t\t'id' => 0,\n\t\t\t'title' => $this->lang('unknow'),\n\t\t\t'keywords' => '',\n\t\t\t'description' => ''\n\t\t);\n\n\t\tif( ! empty( $result ) )\n\t\t{\n\t\t\tforeach( $result as $row )\n\t\t\t{\n\t\t\t\t$category[$row['id']] = array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'title' => $row['title'],\n\t\t\t\t\t'keywords' => $row['keywords'],\n\t\t\t\t\t'description' => $row['description']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $category;\n\t}", "function process_categories() {\n\t\t$this->categories = apply_filters( 'wp_import_categories', $this->categories );\n\n\t\tif ( empty( $this->categories ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->categories as $cat ) {\n\t\t\t// if the category already exists leave it alone\n\t\t\t$term_id = term_exists( $cat['category_nicename'], 'category' );\n\t\t\tif ( $term_id ) {\n\t\t\t\tif ( is_array($term_id) ) $term_id = $term_id['term_id'];\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = (int) $term_id;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$category_parent = empty( $cat['category_parent'] ) ? 0 : category_exists( $cat['category_parent'] );\n\t\t\t$category_description = isset( $cat['category_description'] ) ? $cat['category_description'] : '';\n\t\t\t$catarr = array(\n\t\t\t\t'category_nicename' => $cat['category_nicename'],\n\t\t\t\t'category_parent' => $category_parent,\n\t\t\t\t'cat_name' => $cat['cat_name'],\n\t\t\t\t'category_description' => $category_description\n\t\t\t);\n\n\t\t\t$id = wp_insert_category( $catarr );\n\t\t\tif ( ! is_wp_error( $id ) ) {\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = $id;\n\t\t\t} else {\n\t\t\t\tprintf( 'Failed to import category %s', esc_html($cat['category_nicename']) );\n\t\t\t\tif ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )\n\t\t\t\t\techo ': ' . $id->get_error_message();\n\t\t\t\techo '<br />';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tunset( $this->categories );\n\t}", "function wc_marketplace_category() {\n global $wmp;\n $wmp->output_report_category();\n }", "function customcats_category($id)\n\t{\n\t\tglobal $db, $Categories;\n\n\t\t$class_tpl = new Template('customcats');\n\t\t$sSQL = 'SELECT ccTemplate FROM '.PREFIX.'categories WHERE id='.(int)$id;\n\t\t$result=$db->query($sSQL);\n\t\t$rs=$result->fetch();\n\t\tif($rs['ccTemplate'] <> '')\n\t\t{\n\t\t\treturn FILESYSTEM_PATH .'modules/customcats/templates/cattemplates/'.$rs['ccTemplate'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function run()\n {\n $this->insertCategories('Fast Food', 'Brza Hrana');\n $this->insertCategories('Barbecue', 'Roštilj');\n $this->insertCategories('Dessert', 'Desert');\n $this->insertCategories('Icecream', 'Sladoled');\n $this->insertCategories('Soup', 'Juha');\n }", "function create_cat_list($cat_id = 0)\n{\n global $ce_cache, $db_prefix, $config;\n $list = array();\n\n $output = qcache_get(\"catlist_.$cat_id\", false);\n if (!$output) {\n if ($cat_id) {\n $list = get_cat_child($cat_id);\n } else {\n // if no 'cat_id', get top cats\n $list = array_keys($ce_cache['cat_structure_top']);\n }\n\n // default thumb\n $cat_default_img = \"$config[site_url]/$config[skin]/images/nothumb_small.png\";\n\n // get its children & grand children\n foreach ($list as $child) {\n $row = array();\n $img = sql_qquery(\"SELECT cat_image FROM \".$db_prefix.\"product_cat WHERE idx='$child' LIMIT 1\");\n\n $row['cat_image'] = $img['cat_image'] ? $config['site_url'].'/public/image/'.$img['cat_image'] : $cat_default_img;\n $row['cat_url'] = $ce_cache['cat_url'][$child];\n $row['cat_name'] = '<a href=\"'.$ce_cache['cat_url'][$child].'\">'.$ce_cache['cat_name_def'][$child].'</a>';\n $output[] = $row;\n }\n\n qcache_update(\"catlist_.$cat_id\", serialize($output), false);\n } else {\n $output = unserialize($output);\n }\n if (!is_array($output)) {\n $output = array();\n }\n return $output;\n}", "public function GetCategories()\n {\n \n \n global $PAGE;\n $output = '';\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n } else {\n $type = \" AND `type_customer`=1\";\n }\n \n \n # GET THE CURRENTLY SELECTED CATEGORY\n # ============================================================================\n $default_selected_cid = ($this->Use_Common_Category) ? $this->Common_Category_Id : $this->Default_Category_Id;\n $eq_cat = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $selected_cid = (isset($eq_cat['cid'])) ? $eq_cat['cid'] : $default_selected_cid;\n \n if ($this->Use_Common_Category) {\n $selected_common = (isset($eq_cat['special']) && $eq_cat['special'] == 'common') ? true : false;\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : $selected_common;\n } else {\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : false;\n }\n \n if ($this->Use_Display_All_Category) {\n $selected_all = (isset($eq_cat['special']) && $eq_cat['special'] == 'all') ? true : false;\n $selected_all = ($selected_cid == $this->All_Category_Id) ? true : $selected_all;\n }\n //$selected_all = true;\n \n \n # GET ALL THE CATEGORIES\n # ============================================================================\n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_categories'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type\",\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n \n \n # OUTPUT THE CATEGORIES MENU\n # ============================================================================\n $output .= '<div class=\"orange left_header\">HELP CENTER TOPICS</div><br />';\n $output .= '<div class=\"left_content\">';\n \n # OUTPUT COMMON CATEGORY\n if ($this->Use_Common_Category) {\n $eq = EncryptQuery(\"cat=Most Common;cid=0;special=common\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n $class = ($selected_common) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >Most Common</a></div><br />\";\n }\n \n # OUTPUT ALL DATABASE CATEGORIES\n foreach ($records as $record) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl($record['title']);\n $query_link = '/' . EncryptQuery(\"cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat={$record['title']};cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($record['helpcenter_categories_id'] == $selected_cid) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >{$record['title']}</a></div>\";\n }\n \n # OUTPUT DISPLAY ALL CATEGORY\n if ($this->Use_Display_All_Category) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl('View All');\n $query_link = '/' . EncryptQuery(\"cid={$this->All_Category_Id}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat=View All;cid={$this->All_Category_Id};special=all\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($selected_all) ? 'faq_selected_category' : '';\n $output .= \"<br /><div class='$class'><a href='{$link}' class='link_arrow' >View All</a></div>\";\n }\n \n $output .= '</div>';\n \n \n AddStyle(\"\n .faq_selected_category {\n background-color:#F2935B;\n color:#fff;\n }\n \");\n \n return $output;\n \n\n }", "public static function renderCategories() \n {\n $categories = self::find()->indexBy('category_id')->asArray()->all();\n foreach($categories as $category) {\n ?>\n <li class=\"b-categories__item b-categories__<?= $category[\"name\"]; ?> transition3\">\n <ul class=\"submenu\">\n <li>\n <?= Html::a(\n Html::tag('span', mb_strtoupper($category[\"title\"]),\n ['class' => 'b-categories__link']),\n ['category/view', 'id' => $category['category_id']],\n ['class' => [$category[\"name\"], 'b-categories__alink']]\n ) ?>\n </li>\n </ul>\n </li>\n <?php\n }\n }", "function showCategory()\r\n {\r\n }", "function generate_category_content()\n {\n global $conf, $page;\n\n if ( count($page['chronology_date'])==0 )\n {\n $this->build_nav_bar(CYEAR); // years\n }\n if ( count($page['chronology_date'])==1 )\n {\n $this->build_nav_bar(CWEEK, array()); // week nav bar 1-53\n }\n if ( count($page['chronology_date'])==2 )\n {\n $this->build_nav_bar(CDAY); // days nav bar Mon-Sun\n }\n $this->build_next_prev();\n return false;\n }", "public function get_categories() {\n\t\treturn [ 'happyden' ];\n\t}", "public function run()\n {\t\n \t// kkb\n Sp_category::insert([\n 'category' => 'PUBLIC GOODS'\n ]);\n\n Sp_category::insert([\n 'category' => 'ENVIRONMENTAL PROTECTION AND CONSERVATION'\n ]);\n\n Sp_category::insert([\n 'category' => 'ENTERPRISE'\n ]);\n }", "function app_category($cat_name = NULL, $parent_cat_id) {\n\tif (get_cat_ID($cat_name ) == 0) {\n\t\treturn wp_create_category($cat_name, $parent_cat_id);\n\t}\n\telse {\n\t\treturn get_cat_ID($cat_name);\n\t}\n}", "public function get_categories() {\n return [ 'Alita-elements' ];\n }", "public function get_categories() {\n return [ 'Alita-elements' ];\n }", "public function showTVShowCategories(){\n $querry=$this->con->prepare(\"SELECT * from categories\");\n $querry->execute();\n\n\n $html=\"<div class='previewCategories'>\n <h1>TV Shows</h1>\";\n\n //Keep on Appending the HTML OF EACH CATEGORY\n while($row=$querry->fetch(PDO::FETCH_ASSOC)){ //This loop working needs investigation\n $html.=$this->getCategoyHtml($row,null,true,false);\n }\n\n //Return the whole html to print\n return $html.\"</div>\";\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 }", "private function getCategoryID() {\n return 0;\n }", "public function run()\n {\n $categories = [\n [\n 'name' => 'salad',\n 'slug' => str_slug('salad')\n ],\n [\n 'name' => 'Nut free',\n 'slug' => str_slug('Nut free')\n ],\n [\n 'name' => 'Spicy',\n 'slug' => str_slug('Spicy')\n ],\n [\n 'name' => 'Egg Free',\n 'slug' => str_slug('Egg Free')\n ]\n\n ];\n\n foreach ($categories as $category) {\n App\\Category::create($category);\n }\n\n }", "public function categorylist($c){\n $this->cat_id = $c; \n }", "function &getCategory($index) {\n\t\treturn $this->domit_rss_categories[$index];\n\t}", "function &getCategory($index) {\n\t\treturn $this->domit_rss_categories[$index];\n\t}", "public function index()\n {\n return IngramCategory::all();\n }", "public function get_cat_name() {\n $c = $this->cat;\n $tmp = \"\";\n switch($c) {\n case 1:\n $tmp = \"News\";\n break;\n case 2:\n $tmp = \"Eventi\";\n break;\n case 3:\n $tmp = \"Pubblicazioni\";\n break;\n }\n return $tmp;\n }", "public function run()\n {\n $category = [\n [\n 'text' => 'Спорт',\n 'slug' => 'sport'\n ],\n [\n 'text' => 'Политика',\n 'slug' => 'politics'\n ],\n [\n 'text' => 'Экономика',\n 'slug' => 'economics'\n ],\n [\n 'text' => 'Здоровье',\n 'slug' => 'health'\n ],\n [\n 'text' => 'Технологии',\n 'slug' => 'hitec'\n ],\n [\n 'text' => 'Погода',\n 'slug' => 'weather'\n ],\n ];\n\n DB::table('categories')->insert($category);\n }", "public function filterSpecificCategories($array){\n\n $newArray = [];\n\n foreach($array as $key => $value){\n $cat = trim(strtolower(strstr($value->getArticleID()->getCategory(), ' ')));\n if($cat == \"world news\" || $cat == \"football\"/* ||$cat == \"fashion\" || $cat == \"technology\"*/){\n //test fashion whs technology $numb raus? film und politics guuut 0.8\n $newArray[$key] = $value;\n }\n\n /* if($cat == \"sport\"|| $cat == \"football\" || $cat == \"culture\" || $cat == \"art and design\"){\n $newArray[$key] = $value;\n }*/\n\n /*if( $cat == \"sport\" || $cat == \"uk news\" || $cat == \"opinion\" || $cat == \"society\" || $cat == \"business\" ||\n $cat == \"politics\" || $cat == \"world news\" || $cat == \"life and style\" || $cat == \"environment\" || $cat == \"technology\"\n ||$cat == \"television & radio\" || $cat == \"culture\" || $cat == \"art and design\" || $cat == \"film\" || $cat == \"books\"\n ||$cat == \"us news\" || $cat == \"football\" || $cat == \"fashion\" || $cat == \"travel\" || $cat == \"science\"/*){ //20 categories\n $newArray[$key] = $value;\n }*/\n\n /* if( $cat == \"us news\" || $cat == \"technology\" || $cat == \"science\" || $cat == \"sport\" || $cat == \"opinion\" ||\n $cat == \"world news\" || $cat == \"football\" || $cat == \"politics\" || $cat == \"fashion\" || $cat == \"television & radio\"\n ||$cat == \"culture\" || $cat == \"environment\" || $cat == \"art and design\" || $cat == \"life and style\" || $cat == \"travel\"/*\n || $cat == \"books\" || $cat == \"uk news\" || $cat == \"business\" || $cat == \"film\" || $cat == \"society\"){ //20 categories\n $newArray[$key] = $value;\n }\n */\n\n }\n\n\n return $newArray;\n }", "public function getComboKindCategory()\n {\n $querystr = <<<EOQUERY\n SELECT * FROM askme_kind_category a\n ORDER BY a.`desc` LIMIT 0,10\nEOQUERY;\n\n $results = $this->c->query($querystr);\n if ($results === FALSE)\n return \"\";\n\n $ret = '<select class=\"gradient_combo\" id=\"id_kind_category\" '.\n 'style=\"margin-right: 10px; width: '.$this->width.'px;\">';\n $ret .= \"<option value='0'>\";\n $ret .= $this->first_element;\n $ret .= \"</option>\";\n\n while (($row = $results->fetch_assoc()) !== NULL)\n {\n $ret .= \"<option value='{$row['id_kind_category']}'>\";\n $ret .= $row['desc'];\n $ret .= \"</option>\";\n }\n\n $ret .= \"</select>\";\n\n $results->close();\n\n return $ret;\n\n }", "private function generateSiteMapCategories()\n {\n $max \t\t= $this->model_extension_module_siteMapGenerate->countCategories();\n $step \t\t= 50000;\n $count \t\t= 0;\n $fileNumber = 1;\n\n while ($count <= $max) {\n $output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $output .= '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n $categories\t= $this->model_extension_module_siteMapGenerate->getCategories($step, $count);\n\n foreach ($categories as $category) {\n $outputCategory = $this->generateUrlCategory($category['category_id'], $category['parent_id']);\n $output .= '<url>';\n $output .= '<loc>' . $outputCategory . '</loc>';\n $output .= '<changefreq>weekly</changefreq>';\n $output .= '<priority>1.0</priority>';\n $output .= '</url>';\n }\n\n $output \t.= '</urlset>';\n $this->response->addHeader('Content-Type: application/xml');\n\n $siteMapName = (!file_exists(DIR_MAIN . 'sitemap-categories.xml')) ? 'sitemap-categories' : 'sitemap-categories-' . $fileNumber;\n $siteMapXmlUrl = DIR_MAIN . $siteMapName . '.xml';\n $openedFile = fopen($siteMapXmlUrl, 'w');\n chmod($siteMapXmlUrl, 0775);\n file_put_contents($siteMapXmlUrl, $output);\n fclose($openedFile);\n\n array_push($this->includedFiles, $siteMapXmlUrl);\n\n if (file_exists(DIR_MAIN . 'sitemap-categories-' . $fileNumber . '.xml')) $fileNumber++;\n $count = $count + $step;\n }\n }", "public function run()\n {\n //\n Category::truncate();\n $beer = ['Ale', 'Lager', 'Lambic'];\n $spirit = ['Brandy', 'Whisky', 'Rum', 'Mezcal', 'Gin', 'Vodka'];\n $wine = ['Sauvignon Blanc', 'Riesling', 'Cabernet Sauvignon', 'Merlet', 'Pinot Noir'];\n $drinkwine = ['Glassware', 'Wine Bucket', 'Wine Opener'];\n for ($i = 0; $i < count($beer); $i++) {\n Category::create([\n 'type_id'=> 1,\n 'name' => $beer[$i],\n ]);\n }\n for ($i = 0; $i < count($spirit); $i++) {\n Category::create([\n 'type_id'=> 2,\n 'name' => $spirit[$i],\n ]);\n }\n for ($i = 0; $i < count($wine); $i++) {\n Category::create([\n 'type_id'=> 3,\n 'name' => $wine[$i],\n ]);\n }\n for ($i = 0; $i < count($drinkwine); $i++) {\n Category::create([\n 'type_id'=> 4,\n 'name' => $drinkwine[$i],\n ]);\n }\n\n }", "public function run()\n {\n $categories = ['特色书籍','文学综合馆','教育馆','人文综合馆','经管综合馆','生活馆','计算机馆','励志成功馆','童书馆'];\n\n foreach ($categories as $category){\n Category::create([\n 'name' => $category,\n 'description' => '--'\n ]);\n }\n }", "public static function getCategoryLinks() {\r\n\t\t//get categories from database\r\n\t\t$_db = DBHandler::getInstance ();\r\n\t\t$res = $_db->getAllCategories ();\r\n\t\t\r\n\t\t//loop through categories and create url to category\r\n\t\techo '<ul>';\r\n\t\t$url = $_SERVER ['PHP_SELF'];\r\n\t\techo \"<li><a href=\\\"$url\\\">New Beers</a></li>\";\r\n\t\twhile ( $categories = $res->fetch_object () ) {\r\n\t\t\t$url = $_SERVER ['PHP_SELF'];\r\n\t\t\t$url = $url . \"?categoryid=\" . $categories->category_ID;\r\n\t\t\techo \"<li><a href=\\\"$url\\\">\" . $categories->category_name . \"</a></li>\";\r\n\t\t}\r\n\t\techo '</ul>';\r\n\t}", "public function run()\n {\n $categories = [\"legendize\",\"legendized\",\"legendizes\",\"legendizing\",\"legendries\",\"legendry\",\"legends\",\"leger\",\"legerdemain\",\"legerdemainist\",\"legerdemainists\",\"legerdemains\",\"legering\",\"legerings\",\"legerities\",\"legerity\",\"legers\",\"leges\",\"legge\",\"legged\",\"legger\",\"leggers\",\"legges\",\"leggie\",\"leggier\",\"leggiero\",\"leggies\",\"leggiest\",\"leggin\",\"legginess\",\"legginesses\",\"legging\",\"legginged\",\"leggings\",\"leggins\",\"leggism\",\"leggisms\",\"leggy\",\"leghorn\",\"leghorns\",\"legibilities\",\"legibility\",\"legible\",\"legibleness\",\"legiblenesses\",\"legibly\",\"legion\",\"legionaries\",\"legionary\",\"legioned\",\"legionella\",\"legionellae\",\"legionellas\",\"legionnaire\",\"legionnaires\",\"legions\",\"legislate\",\"legislated\",\"legislates\",\"legislating\",\"legislation\",\"legislations\",\"legislative\",\"legislatively\",\"legislatives\",\"legislator\",\"legislatorial\",\"legislators\",\"legislatorship\",\"legislatorships\",\"legislatress\",\"legislatresses\",\"legislature\",\"legislatures\",\"legist\",\"legists\",\"legit\",\"legitim\",\"legitimacies\",\"legitimacy\",\"legitimate\",\"legitimated\",\"legitimately\",\"legitimateness\",\"legitimates\",\"legitimating\",\"legitimation\",\"legitimations\",\"legitimatise\",\"legitimatised\",\"legitimatises\",\"legitimatising\",\"legitimatize\",\"legitimatized\",\"legitimatizes\",\"legitimatizing\",\"legitimator\",\"legitimators\",\"legitimisation\",\"legitimisations\",\"legitimise\",\"legitimised\",\"legitimiser\",\"legitimisers\",\"legitimises\",\"legitimising\",\"legitimism\",\"legitimisms\",\"legitimist\",\"legitimistic\",\"legitimists\",\"legitimization\",\"legitimizations\",\"legitimize\",\"legitimized\",\"legitimizer\",\"legitimizers\",\"legitimizes\",\"legitimizing\",\"legitims\",\"legits\",\"leglan\",\"leglans\",\"leglen\",\"leglens\",\"legless\",\"leglessness\",\"leglessnesses\",\"leglet\",\"leglets\",\"leglike\",\"leglin\",\"leglins\",\"legman\",\"legmen\",\"legong\",\"legongs\",\"legroom\",\"legrooms\",\"legs\",\"legside\",\"legsides\",\"leguaan\",\"leguaans\",\"leguan\",\"leguans\",\"legume\",\"legumes\",\"legumin\",\"leguminous\",\"legumins\",\"legwarmer\",\"legwarmers\",\"legwear\",\"legwears\",\"legwork\",\"legworks\",\"lehaim\",\"lehaims\",\"lehayim\",\"lehayims\",\"lehr\",\"lehrjahre\",\"lehrs\",\"lehua\",\"lehuas\",\"lei\",\"leidger\",\"leidgers\",\"leiger\",\"leigers\",\"leiomyoma\",\"leiomyomas\",\"leiomyomata\",\"leiotrichies\",\"leiotrichous\",\"leiotrichy\",\"leipoa\",\"leipoas\",\"leir\",\"leired\",\"leiring\",\"leirs\",\"leis\",\"leish\",\"leisher\",\"leishest\",\"leishmania\",\"leishmaniae\",\"leishmanial\",\"leishmanias\",\"leishmaniases\",\"leishmaniasis\",\"leishmanioses\",\"leishmaniosis\",\"leisler\",\"leislers\",\"leister\",\"leistered\",\"leistering\",\"leisters\",\"leisurable\",\"leisurably\",\"leisure\",\"leisured\",\"leisureliness\",\"leisurelinesses\",\"leisurely\",\"leisures\",\"leisuring\",\"leitmotif\",\"leitmotifs\",\"leitmotiv\",\"leitmotivs\",\"lek\",\"leke\",\"lekgotla\",\"lekgotlas\",\"lekked\",\"lekker\",\"lekking\",\"lekkings\",\"leks\",\"leku\",\"lekvar\",\"lekvars\",\"lekythi\",\"lekythoi\",\"lekythos\",\"lekythus\",\"leman\",\"lemans\",\"leme\",\"lemed\"];\n for ($i=0; $i < count($categories); $i++) {\n Category::create([\n 'name' => $categories[$i],\n ]);\n }\n }", "private function getCategory() {\n return '';\n }", "function list_categories() {\n $project_parent_category = get_category_by_slug('project');\n $project_parent_category_id=$project_parent_category->term_id;\n $categories=get_the_category();\n $count = 0;\n foreach($categories as $category){\n if($category->category_parent==$project_parent_category_id){\n if ($count == 0) {\n echo '<div class=\"category-symbology\">';\n\n if(get_post_type(get_the_id()) == 'discussion') { echo '<i class=\"social-foundicon-chat\"> </i> '; }\n }\n echo \"<a class='one-category' href='/project/\". $category->slug . \"'>\" . $category->name . \"</a>\";\n if ($count == 0) {\n echo '</div>';\n } \n $count++;\n }\n }\n\n //emit a chat symbol for discussion\n if($count == 0 && get_post_type(get_the_id()) == 'discussion') {\n generate_discussion_w_no_category();\n }\n}", "public function run()\n {\n $categories = [\n ['nama_kategori' => 'Apple'],\n ['nama_kategori' => 'Samsung'],\n ['nama_kategori' => 'Xiaomi'],\n ['nama_kategori' => 'Vivo'],\n ['nama_kategori' => 'Motorola'],\n ['nama_kategori' => 'Google Pixel'],\n ['nama_kategori' => 'HTC'],\n ['nama_kategori' => 'Huawei'],\n ['nama_kategori' => 'Oppo'],\n ['nama_kategori' => 'LG'],\n ['nama_kategori' => 'Lenovo'],\n ['nama_kategori' => 'Oppo'],\n ['nama_kategori' => 'Polytron'],\n ['nama_kategori' => 'ASUS'],\n ['nama_kategori' => 'Lenovo'],\n ['nama_kategori' => 'Nokia'],\n ['nama_kategori' => 'Smartfren'],\n ['nama_kategori' => 'Sony'],\n ['nama_kategori' => 'Nexian'],\n ['nama_kategori' => 'Panasonic'],\n ['nama_kategori' => 'Evercross'],\n ['nama_kategori' => 'Mito'],\n ['nama_kategori' => 'Advan'],\n ['nama_kategori' => 'Cherry Mobile'],\n ['nama_kategori' => 'Maxtron'],\n ];\n\n foreach ($categories as $category) {\n Category::create($category);\n }\n }", "public function testCategoryMap()\n {\n $this->assertEquals(Record::mapCategory('Labor'), 'labor');\n $this->assertEquals(Record::mapCategory('工具器具備品'), 'tools_equipment');\n $this->assertEquals(Record::mapCategory('広告宣伝費'), 'promotion');\n $this->assertEquals(Record::mapCategory('販売キャンペーン'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO', true), 'seo');\n $this->assertEquals(Record::mapCategory('地代家賃'), 'rent');\n $this->assertEquals(Record::mapCategory('packing & delivery expenses'), 'delivery');\n $this->assertEquals(Record::mapCategory('Revenue'), 'revenue');\n $this->assertEquals(Record::mapCategory('収益'), 'revenue');\n $this->assertEquals(Record::mapCategory('水道光熱費'), 'utility');\n $this->assertEquals(Record::mapCategory('法定福利費'), 'labor');\n $this->assertEquals(Record::mapCategory('法定福利費', true), 'welfare');\n }", "function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn $row_getQuery['cat_name'];\n\t}", "function target_add_cat($cat)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $cat['name']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat (id, name, view_order, cat_opt) \n\t VALUES('. (int)$cat['id'] .','. _esc($cat['name']) .','. (int)$cat['view_order'] .', 3)');\n\t$GLOBALS['cat_map'][ $cat['id'] ] = $cat['id'];\n/*\nfud_use('cat.inc', true);\n$nc = new fud_cat;\n$nc->name = $c->name;\n$nc->description = $c->description;\n$nc->view_order = $c->disporder;\n$nc->cat_opt = 1|2;\t// This should be the default in cat.inc. Fix in next release and del this line.\n$GLOBALS['cat_map'][$c->fid] = $nc->add('LAST');\t// FIRST should also be defaulted.\n*/\n}", "public function categories()\n {\n $group_id = ee()->input->get('group_id') ? ee()->input->get('group_id') : ee()->publisher_category->get_first_group();\n\n $vars = ee()->publisher_helper_cp->get_category_vars($group_id);\n\n $vars = ee()->publisher_helper_cp->prep_category_vars($vars);\n\n // Load the file manager for the category image.\n ee()->publisher_helper_cp->load_file_manager();\n\n // Bail if there are no category groups defined.\n if (empty($vars['category_groups']))\n {\n show_error('No category groups found, please <a href=\"'. BASE.AMP .'D=cp&C=admin_content&M=edit_category_group\">create one</a>.');\n }\n\n return ee()->load->view('category/index', $vars, TRUE);\n }", "function tep_get_subCategory($tagValue){\n\tglobal $languages_id,$customer_group_id;\n\t//禁用的电池分类ID @nathan 2011-11-2\n\t//$disable_batteries = array(1,3,21,23,25,73,111,307,314,499);\n\t$disable_batteries = array(23,25,73,111,307,499);\n\t$disable_batteries_three = array(188,191,192,193,194,195,502,556,112,115,117,126,129,136,139,141,172,175,601,181,306,312,313,500,501,562,197,198,202,204,205,206,208,210,211,212,213,217,218,220,503,504,505,521,557,558,559,560,561,563,507,508,509,510,511,512,513,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,741);\n\t$jsonData = array();\n\tif (isset($tagValue) && !empty($tagValue)){\n\t\t# \n\t\t# URL\n\t\t# Ʒ\n\t\t# |_| |=|\n\t\t$topNavi_categories_sql = sprintf(\"SELECT DISTINCT C.categories_id,C.parent_id, CD.categories_name FROM %s AS CD INNER JOIN %s AS C ON CD.categories_id=C.categories_id WHERE CD.language_id=%u AND C.products_group_access like '%s' AND C.parent_id=%u ORDER BY C.sort_order ASC\",TABLE_CATEGORIES_DESCRIPTION,TABLE_CATEGORIES,(int)$languages_id,\"%\".$customer_group_id.\"%\",(int)$tagValue);\n\t\t$topNavi_categories_query = tep_db_query($topNavi_categories_sql);\n\t\tif (tep_db_num_rows($topNavi_categories_query) > 0){\n\t\t\t$i = 0;\n\t\t\twhile ($topNavi_categories = tep_db_fetch_array($topNavi_categories_query)) {\n\t\t\t\t//禁止显示的电池分类 @nathan 2011-11-2\n\t\t\t\tif($tagValue == 408 && in_array($topNavi_categories['categories_id'], $disable_batteries)) continue;\n\n\t\t\t\t$products_in_category = tep_count_products_in_category($topNavi_categories['categories_id']);\n\t\t\t\tif ($products_in_category > 0){\n\t\t\t\t\t$jsonData[$i]['name'] = $topNavi_categories['categories_name'];\n\t\t\t\t\t$jsonData[$i]['url'] = tep_href_link(FILENAME_DEFAULT,tep_get_abscPath($topNavi_categories['categories_id']),'NONSSL',false);\n\t\t\t\t\t$jsonData[$i]['parent'] = '0';\n\t\t\t\t\t$jsonData[$i]['num'] = tep_count_products_in_category($topNavi_categories['categories_id']);\n\t\t\t\t\t$i++;\n\t\t\t\t\t$sub_categories_sql = sprintf(\"SELECT DISTINCT C.categories_id,C.parent_id, CD.categories_name FROM %s AS CD INNER JOIN %s AS C ON CD.categories_id=C.categories_id WHERE CD.language_id=%u AND C.products_group_access like '%s' AND C.parent_id=%u ORDER BY C.sort_order ASC\",TABLE_CATEGORIES_DESCRIPTION,TABLE_CATEGORIES,(int)$languages_id,\"%\".$customer_group_id.\"%\",(int)$topNavi_categories['categories_id']);\n\t\t\t\t\t$sub_categories_query = tep_db_query($sub_categories_sql);\n\t\t\t\t\tif (tep_db_num_rows($sub_categories_query) > 0){\n\t\t\t\t\t\twhile ($sub_categories = tep_db_fetch_array($sub_categories_query)) {\n\t\t\t\t\t\t\tif(in_array($sub_categories['categories_id'], $disable_batteries_three)) continue;\n\t\t\t\t\t\t\t$products_in_subcategory = tep_count_products_in_category($sub_categories['categories_id']);\n\t\t\t\t\t\t\tif ($products_in_subcategory > 0){\n\t\t\t\t\t\t\t\t$jsonData[$i]['name'] = $sub_categories['categories_name'];\n\t\t\t\t\t\t\t\t$jsonData[$i]['url'] = tep_href_link(FILENAME_DEFAULT,tep_get_abscPath($sub_categories['categories_id']),'NONSSL',false);\n\t\t\t\t\t\t\t\t$jsonData[$i]['parent'] = $sub_categories['categories_id'];\n\t\t\t\t\t\t\t\t$jsonData[$i]['num'] = tep_count_products_in_category($sub_categories['categories_id']);\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}unset($products_in_subcategory);\n\t\t\t\t\t\t}unset($sub_categories);\n\t\t\t\t\t}unset($sub_categories_query,$sub_categories_sql);\n\t\t\t\t}unset($products_in_category);\n\t\t\t}unset($topNavi_categories);\n\t\t}unset($topNavi_categories_query,$topNavi_categories_sql);\n\t\t//echo json_encode($jsonData);\n\t\treturn $jsonData;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function run()\n {\n\t\tDB::table('categories')->insert([\n\t\t\t[\n\t\t\t\t'name' => 'Nikon',\n\t\t\t\t'type' => 'Mirrorless',\n\t\t\t\t'model' => 2018\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Canon',\n\t\t\t\t'type' => 'Full frame',\n\t\t\t\t'model' => 2015\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Nikon',\n\t\t\t\t'type' => 'Full frame',\n\t\t\t\t'model' => 2015\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Canon',\n\t\t\t\t'type' => 'Point and Shoot',\n\t\t\t\t'model' => 2017\n\t\t\t]\n\t\t]);\n }", "function displayCategory()\r\n\t {\r\n\t \t$productId = JRequest::getVar('product_id');\r\n\t \t\r\n\t \t$model = $this->getModel('qrcode');\r\n\t \t$productList = $model->getProductByCategory();//Store product details based on category.\r\n\t \tob_clean();\r\n\t \t\r\n\t \techo \"<b>\".JText::_('COM_QRCODE_VIEW_DEFAULT_PRODUCT_LIST').\"</b>\";\r\n \r\n\t \t\t\t$options = array();\r\n $default = \"\";\r\n if($productId)\r\n {\r\n \t$default = $productId;\r\n }\r\n $options[] = JHTML::_('select.option', \"0\", JText::_('COM_QRCODE_VIEW_DEFAULT_DISPLAY_ALL'));\r\n foreach ($productList as $key=>$val) {\r\n $options[] = JHTML::_('select.option', $val['product_id'], $val['product_name']);\r\n }\r\n echo JHTML::_('select.genericlist', $options, 'qrcode', 'onchange=getProductId(this.value)','value', 'text', $default); \r\n exit();\r\n\t }", "public function run()\n {\n $c = \\App\\Category::find(373);\n foreach ($c->sub as $cat) {\n \tforeach($cat->products as $p){\n \t\t$p->name = str_replace($cat->title.', ', $cat->title.'. ', $p->name);\n \t\t//$p->name = $cat->title.', '.$p->name;\n \t\t$p->title = $p->name;\n \t\t$p->h1 = $p->name;\n \t\t$p->save();\n \t}\n \techo $cat->title;\n }\n }", "function showCategory()\n {\n echo '女装';\n }", "function showCategory()\n\t {\n\t\t\n\t\t $res=mysql_query(\"select * from category\");\n\t\t while($data=mysql_fetch_array($res))\n\t\t {\n\t\t\t\n\t\t\techo '<option value=\"'.$data['cat_id'].'\">'.$data['cat_title'].'</option>';\n\t\t }\n\t\t \n\t }", "public function run()\n {\n $categories = [\n [\n 'title' => '最新资讯'\n ],\n [\n 'title' => '金融新规'\n ],\n [\n 'title' => '理财知识库'\n ]\n ];\n\n foreach ($categories as $item) {\n ArticleCategory::create($item);\n }\n }", "function CATEGORYSET($t_args) {\n // The dictionary of the associated factor.\n $dictionary = get_first_key($t_args, ['dictionary', 'dict', 0]);\n $values = array_values($dictionary);\n\n // The component types used.\n $category = lookupType('category', ['dict' => $dictionary]);\n $bitset = lookupType('bitset', ['values' => $values]);\n\n $size = $bitset->get('size.bytes');\n\n // The name of the object type.\n $className = 'CategorySet' . $size;\n\n $systemHeaders = ['cstdio', 'cstring'];\n $userHeaders = [];\n $libHeaders = [];\n $libraries = [];\n $constructors = [];\n $methods = [];\n $functions = [];\n $binaryOperators = [];\n $unaryOperators = [];\n $globalContent = '';\n $complex = false;\n $properties = [];\n $extra = ['size.bytes' => $size];\n $describeJson = DescribeJson('categoryset',\n DescribeJsonStatic(['levels' => $values]));\n\n $globalContent = '';\n?>\n\nclass <?=$className?> {\n public:\n using Category = <?=$category?>;\n using BitSet = <?=$bitset?>;\n using StorageType = BitSet::StorageType;\n\n private:\n // The binary data corresponding to the encoded string.\n BitSet data;\n\n public:\n<? $constructors[] = [[], true]; ?>\n <?=$className?>();\n<? $constructors[] = [['BASE::NULL'], true]; ?>\n <?=$className?>(const GrokitNull& null);\n<? $constructors[] = [['BASE::STRING_LITERAL'], true]; ?>\n <?=$className?>(const char* str);\n <?=$className?>(const BitSet& data);\n <?=$className?>(const <?=$className?>& other);\n\n<? $methods[] = ['IsEmpty', [], 'BASE::BOOL', true]; ?>\n bool IsEmpty() const;\n\n <?=$className?>& operator =(const <?=$className?>& other) = default;\n<? $binaryOperators[] = '=='; ?>\n bool operator ==(const <?=$className?>& other) const;\n<? $binaryOperators[] = '!='; ?>\n bool operator !=(const <?=$className?>& other) const;\n<? $binaryOperators[] = '<'; ?>\n bool operator <(const <?=$className?>& other) const;\n<? $binaryOperators[] = '>'; ?>\n bool operator >(const <?=$className?>& other) const;\n<? $binaryOperators[] = '<='; ?>\n bool operator <=(const <?=$className?>& other) const;\n<? $binaryOperators[] = '>='; ?>\n bool operator >=(const <?=$className?>& other) const;\n\n void FromString(const char* str);\n int ToString(char* buffer) const;\n\n void FromJson(const Json::Value& src);\n void ToJson(Json::Value& dest) const;\n};\n\ninline <?=$className?>::<?=$className?>()\n : data() {\n}\n\ninline <?=$className?>::<?=$className?>(const GrokitNull& null)\n : data() {\n}\n\ninline <?=$className?>::<?=$className?>(const char* str) {\n this->FromString(str);\n}\n\ninline <?=$className?>::<?=$className?>(const <?=$className?>::BitSet& data)\n : data(data) {\n}\n\ninline <?=$className?>::<?=$className?>(const <?=$className?>& other)\n : data(other.data) {\n}\n\ninline bool <?=$className?>::IsEmpty() const {\n return data == 0;\n}\n\ninline bool <?=$className?>::operator ==(const <?=$className?>& other) const {\n return this->data == other.data;\n}\n\ninline bool <?=$className?>::operator !=(const <?=$className?>& other) const {\n return this->data != other.data;\n}\n\ninline bool <?=$className?>::operator <(const <?=$className?>& other) const {\n return this->data < other.data;\n}\n\ninline bool <?=$className?>::operator >(const <?=$className?>&other) const {\n return this->data > other.data;\n}\n\ninline bool <?=$className?>::operator <=(const <?=$className?>& other) const {\n return this->data <= other.data;\n}\n\ninline bool <?=$className?>::operator >=(const <?=$className?>& other) const {\n return this->data >= other.data;\n}\n\ninline void <?=$className?>::FromString(const char* str) {\n StorageType mask;\n char* storage;\n char* copy = strdup(str);\n char* token = strtok_r(copy, \" \", &storage);\n while (token != NULL) {\n Category level (token);\n WARNINGIF(level.Invalid(), \"Invalid token: %s\", token);\n mask |= 1 << level;\n token = strtok_r(NULL, \" \", &storage);\n }\n data = mask;\n free(copy);\n}\n\ninline int <?=$className?>::ToString(char* buffer) const {\n char* start = buffer;\n<? foreach ($dictionary as $name) { ?>\n if (data.<?=$name?>())\n buffer += sprintf(buffer, \"%s \", \"<?=$name?>\");\n<? }?>\n if (start == buffer) {\n buffer[0] = '\\0';\n return 1;\n } else {\n buffer[-1] = '\\0';\n return buffer - start;\n }\n}\n\ninline void <?=$className?>::FromJson(const Json::Value& src) {\n this->FromString(src.asCString());\n}\n\ninline void <?=$className?>::ToJson(Json::Value& dest) const {\n char* buffer;\n this->ToString(buffer);\n dest = buffer;\n}\n\n<? ob_start(); ?>\n\ninline void FromString(@type& data, const char* buffer) {\n data.FromString(buffer);\n}\n\ninline int ToString(const @type& data, char* buffer) {\n return data.ToString(buffer);\n}\n\ninline void FromJson(const Json::Value& src, @type& dest) {\n dest.FromJson(src);\n}\n\ninline void ToJson(const @type& src, Json::Value& dest) {\n src.ToJson(dest);\n}\n\n<? $globalContent .= ob_get_clean(); ?>\n\n<?\n return [\n 'kind' => 'TYPE',\n 'name' => $className,\n 'complex' => $complex,\n 'system_headers' => $systemHeaders,\n 'user_headers' => $userHeaders,\n 'lib_headers' => $libHeaders,\n 'libraries' => $libraries,\n 'binary_operators' => $binaryOperators,\n 'unary_operators' => $unaryOperators,\n 'global_content' => $globalContent,\n 'constructors' => $constructors,\n 'methods' => $methods,\n 'functions' => $functions,\n 'libraries' => $libraries,\n 'properties' => $properties,\n 'extras' => $extra,\n 'describe_json' => $describeJson,\n ];\n}", "function my_separate_category() {\n return 1;\n }" ]
[ "0.5693002", "0.5598186", "0.5574848", "0.5549675", "0.55261123", "0.55019057", "0.5456339", "0.5451833", "0.5441126", "0.5415014", "0.54074347", "0.54053885", "0.53769916", "0.53746605", "0.53699756", "0.5368163", "0.5364913", "0.53618485", "0.53604215", "0.5350838", "0.53386694", "0.53386694", "0.53386694", "0.53298503", "0.5329816", "0.53031427", "0.53012615", "0.5273691", "0.5257244", "0.5246563", "0.5241412", "0.52267516", "0.5224496", "0.522307", "0.52223337", "0.52060646", "0.52038044", "0.5197098", "0.5187236", "0.5185991", "0.51859087", "0.51825225", "0.51817757", "0.5180948", "0.5168623", "0.5155115", "0.5152874", "0.5140077", "0.51332206", "0.5121281", "0.51130176", "0.51114815", "0.5094946", "0.50930876", "0.50822973", "0.507887", "0.5078687", "0.50770825", "0.5074672", "0.50696594", "0.5064504", "0.5058916", "0.50572246", "0.50444704", "0.5035323", "0.5030612", "0.5030612", "0.50214887", "0.5011992", "0.5007514", "0.5005339", "0.5000547", "0.49958715", "0.49958715", "0.4992328", "0.49881303", "0.49821496", "0.49819243", "0.4981257", "0.4977662", "0.49755394", "0.4966254", "0.49649444", "0.4957699", "0.49554297", "0.49550062", "0.49540797", "0.49492112", "0.49457964", "0.49432945", "0.4942872", "0.49428043", "0.49418718", "0.49407595", "0.49363694", "0.4935504", "0.49254686", "0.4919285", "0.49169093", "0.49164736" ]
0.5201279
37
Un usuario se relaciona a un caso
public function casos() { return $this->hasOne('App\Caso'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function agregarUsuario(){\n \n }", "public function telaCadastroUsuario():void {\n $session =(Session::get('USER_AUTH'));\n if (!isset($session)) {\n $this->view('Home/login_viewer.php');\n }\n elseif ((int) Session::get('USER_ID')!==1) {\n Url::redirect(SELF::PAINEL_USUARIO);\n }\n else {\n $this->cabecalhoSistema();\n $this->view('Administrador/usuario/formulario_cadastro_usuario_viewer.php');\n $this->rodapeSistema();\n }\n }", "function mcomprobarUsuarioSesion() {\n\t\t$conexion = conexionbasedatos();\n\t\tif (isset($_SESSION[\"nickname\"]) ) {\n\t\t\t$nickname = $_SESSION[\"nickname\"];\n\n\t\t\t$consulta = \"select * \n\t\t\t\t\t\t from final_USUARIO\n\t\t\t\t\t\t where nickname = '$nickname';\";\n\n\t\t\tif ($resultado = $conexion->query($consulta)) {\n\t\t\t\tif ($datos = $resultado->fetch_assoc()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn -2;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else {\n\t\t\treturn -2;\n\t\t}\n\t\t\n\t}", "public function login($user, $clave)\n {\n parent::conectar();\n\n \n\n // El metodo salvar sirve para escapar cualquier comillas doble o simple y otros caracteres que pueden vulnerar nuestra consulta SQL\n $user = parent::salvar($user);\n $clave = parent::salvar($clave);\n\n // Si necesitas filtrar las mayusculas y los acentos habilita las lineas 36 y 37 recuerda que en la base de datos debe estar filtrado tambien para una \n \n\t$consulta = 'select id, nombre, cargo from usuarios where email=\"'.$user.'\" and clave= MD5(\"'.$clave.'\")\n\t UNION SELECT codpaci, nombrep, cargo from customers where email =\"'.$user.'\" and clave= MD5(\"'.$clave.'\")';\n\t \n\t \n /*\n Verificamos si el usuario existe, la funcion verificarRegistros\n retorna el número de filas afectadas, en otras palabras si el\n usuario existe retornara 1 de lo contrario retornara 0\n */\n\n $verificar_usuario = parent::verificarRegistros($consulta);\n\n // si la consulta es mayor a 0 el usuario existe\n if($verificar_usuario > 0){\n\n \n\n /*\n Realizamos la misma consulta de la linea 55 pero esta ves transformaremos el resultado en un arreglo,\n ten mucho cuidado con usar el metodo consultaArreglo ya que devuelve un arreglo de la primera fila encontrada\n es decir, como nosotros solo validamos a un usuario no hay problema pero esta funcion no funciona si\n vas a listar a los usuarios, espero que me entiendan xd\n */\n\n $user = parent::consultaArreglo($consulta);\n\n /*\n Bien espero ser un poco claro en esta parte, la variable user\n en la linea 69 pasa a ser un arreglo con los campos consultados en la linea\n 48, entonces para acceder a los datos utilizamos $user[nombre_del_campo] Ok?\n bueno hagamos el ejercicio.\n */\n\n /*\n Inicializamos la sessión | Recuerda con las variables de sesión\n podemos acceder a la informacion desde cualquiera pagina siempre y cuando\n exista una sesión y ademas utilicemos el codigo de la linea 84\n */\n\n session_start();\n\n /*\n Las variables de sesion son muy faciles de usar, es como\n declarar una variable, lo unico diferente es que obligatoria mente\n debes usar $_SESSION[] y .... el nombre de la variable ya no sera asi\n $miVariable sino entre comillas dentro del arreglo de sesion, haber me\n dejo explicar, $_SESSION['miVariable'], recuerda que como declares la variable\n en este archivo asi mismo lo llamaras en los demas.\n */\n\n $_SESSION['id'] = $user['id'];\n $_SESSION['nombre'] = $user['nombre'];\n $_SESSION['cargo'] = $user['cargo'];\n\n /*\n Que porqué almacenamos cargo? es encillo en nuestros proyectos\n pueden existir archivos que solo puede ver un usuario con el cargo de\n administrador y no un usuario estandar, asi que la variable global de\n sesion nos ayudara a verificar el cargo del usuario que ha iniciado sesion\n Ok?\n */\n\n /*\n Recuerda:\n cargo con valor: 1 es: Administrador\n cargo con valor: 2 es: usuario estandar\n puedes agregar cuantos cargos desees, en este ejemplo solo uso 2\n */\n\n // Verificamos que cargo tiene l usuario y asi mismo dar la respuesta a ajax para que redireccione\n if($_SESSION['cargo'] == 1){\n echo 'view/admin/admin.php';\n }else if($_SESSION['cargo'] == 2){\n echo 'view/user/user.php';\n }\n\n\n // u.u finalizamos aqui :v\n\n }else{\n // El usuario y la clave son incorrectos\n echo 'error_3';\n }\n\n\n # Cerramos la conexion\n parent::cerrar();\n }", "public function ctrIngresoUsuario(){\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingUsuario\"]) && \n\t\t\t\tpreg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla=\"usuarios\";\n\t\t\t$item=\"usuario\";\n\t\t\t$valor=$_POST[\"ingUsuario\"];\n\t\t\t$respuesta=ModeloUsuarios::MdlMostrarUsuarios($tabla,$item,$valor);\t\n\t\t\t //var_dump($respuesta[\"usuario\"]);\n\t\t\tif($respuesta[\"usuario\"]==$_POST[\"ingUsuario\"] && $respuesta[\"password\"]==$_POST[\"ingPassword\"]){\n\t\t\t\t$_SESSION[\"iniciarSesion\"]=\"ok\";\n\t\t\t\techo '<script>\n\t\t\t\twindow.location=\"inicio\";\n\t\t\t\t</script>';\n\t\t\t}else{\n\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelva a intentarlo</div>';\n\t\t\t}\n\t\t}\n\t}\n }", "function altaUsuarioProfesor($datos) {\n\n if (BDConexionSistema::getInstancia()->begin_transaction()) {\n // INSERCION PROFESOR\n //Creo objeto sin enviar ID y enviando todos los datos del formulario\n $Profesor = new Profesor(null, $datos);\n $apellido = mysqli_real_escape_string(BDConexionSistema::getInstancia(), $Profesor->getApellido());\n\n if ($this->chequearEmail($Profesor->getEmail())) {\n $this->query = \"INSERT INTO PROFESOR \"\n . \"VALUES ('{$Profesor->getId()}', '0', '{$Profesor->getNombre()}', '{$apellido}',\"\n . \"'{$Profesor->getEmail()}', '{$Profesor->getCategoria()}', '{$Profesor->getPreferencias()}', '{$Profesor->getIdDepartamento()}')\";\n\n $consulta = BDConexionSistema::getInstancia()->query($this->query);\n } else {\n throw new Exception(\"El email: <b>\" . $Profesor->getEmail() . \"</b> ya corresponde a un profesor en la Base de Datos\");\n }\n\n if (!$consulta) {\n BDConexionSistema::getInstancia()->rollback();\n throw new Exception(\"No se puedo dar de alta el profesor (Error en la Base de Datos).\");\n }\n\n // INSERCION USUARIO\n\n $query = \"INSERT INTO \" . Constantes::BD_USERS . \".usuario \"\n . \"VALUES (null,'{$datos[\"nombreUsuario\"]}','{$datos[\"email\"]}')\";\n $consulta = BDConexionSistema::getInstancia()->query($query);\n if (!$consulta) {\n BDConexionSistema::getInstancia()->rollback();\n //arrojar una excepcion\n //die(BDConexion::getInstancia()->errno);\n throw new Exception(\"No se puedo dar de alta el profesor (Error en la Base de Datos).\");\n }\n\n // recuperamos la id del usuario\n $idUsuario = BDConexionSistema::getInstancia()->insert_id;\n\n // INSERCION USUARIO_ROL\n $query = \"INSERT INTO \" . Constantes::BD_USERS . \".usuario_rol \"\n . \"VALUES ({$idUsuario}, 9)\";\n $consulta = BDConexionSistema::getInstancia()->query($query);\n if (!$consulta) {\n BDConexionSistema::getInstancia()->rollback();\n //arrojar una excepcion\n //die(BDConexion::getInstancia()->errno);\n throw new Exception(\"No se puedo dar de alta el profesor (Error en la Base de Datos).\");\n }\n\n BDConexionSistema::getInstancia()->commit();\n BDConexionSistema::getInstancia()->autocommit(true);\n\n // si no se produjeron excepciones OK insercion, retornamos VERDADERO\n return TRUE;\n } else {\n throw new Exception(\"No se puedo dar de alta el profesor (Error en la Base de Datos).\");\n }\n }", "public function getUsuario() {\n }", "public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"user01\"])){\n\n\t\t//\t if(preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingresoEmail\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingresoPassword\"])){\n\n\t\t\t \t//$encriptar = crypt($_POST[\"ingresoPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t\t$encriptar = crypt($_POST[\"passwords01\"], '$2a$07$asxx54ahjppf17sd87a5a4dDDGsystemdevmybebe$');\n\n\t\t\t \t$tabla = \"genusuario\";\n\t\t\t \t$item = \"usunombre\";\n\t\t\t \t$valor = $_POST[\"user01\"];\n\n\t\t\t \t$respuesta = UserModel::mdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t//echo \"<pre>\".print_r($respuesta).\"</pre>\";\n\n\t\t\t \tif($respuesta[\"usunombre\"] == $_POST[\"user01\"] && $respuesta[\"usuclave\"] == $encriptar){\n\n\t\t\t \t\tif($respuesta[\"usuverific\"] == 0){\n\n\t\t\t \t\t\techo'<script>\n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t \ttext: \"¡El correo electrónico aún no ha sido verificado, por favor revise la bandeja de entrada o la carpeta SPAM de su correo electrónico para verificar la cuenta, o contáctese con nuestro soporte a [email protected]!\",\n\t\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t\t\t\treturn;\n\n\t\t\t \t\t}else{\n\n\t\t\t \t\t\t$_SESSION[\"validarSesion\"] = \"ok\";\n\t\t\t \t\t\t$_SESSION[\"id\"] = $respuesta[\"oid\"];\n\n\t\t\t \t\t\t$ruta = RouteController::ctrRoute();\n\n\t\t\t \t\t\techo '<script>\n\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"'.$ruta.'backoffice\";\t\t\t\t\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t \t\t}\n\n\t\t\t \t}else{\n\n\t\t\t \t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t \ttext: \"¡El email o contraseña no coinciden!\",\n\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\t\t\t \t}\n\n\n\t\t/*\t }else{\n\n\t\t\t \techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\ttitle: \"¡CORREGIR!\",\n\t\t\t\t\t\ttext: \"¡No se permiten caracteres especiales en ninguno de los campos!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\thistory.back();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\t\n\n\t\t\t\t</script>';\n\n\t\t\t }*/\n\n\t\t}\n\n\t}", "public function recepcionUsuario($nombre , $password){\n\t\t\t$result_child = $this->_db->query(\"SELECT * FROM usuario WHERE login_usu = '\".$nombre.\"'\");\n\t\t\t$retorna_child = $result_child->fetch_all(MYSQL_ASSOC);\n\n\t\t\t//mensaje por defecto indicando que no se registro\n\t\t\t//genera mensaje para el sistema\n\t\t\t$outp = array('activo'=> \"0\");\n\n\t\t\t//verifica que exista el usuario\n\t\t\tif (!$result_child) {\n \t\t\treturn \"Falló SELECT usuario: (\" . $this->_db->errno . \") \" . $this->_db->error;\n\t\t\t}else{\n\n\t\t\t\tif (count($retorna_child) > 0) {\n\t\t\t\t\t//print_r(count($retorna_child));\n\t\t\t\t\t//busca su grupo de usuario para asignar un rol \n\t\t\t\t\t$result_master = $this->_db->query(\"SELECT * FROM grupousu WHERE idGrupoUsu = '\".$retorna_child[0]['GrupoUsu_idGrupoUsu'].\"'\");\n\t\t\t\t\t$retorna_master = $result_master->fetch_all(MYSQL_ASSOC);\n\n\t\t\t\t\t//verifique que tenga un grupo de usuario\n\t\t\t\t\tif (!$result_child) {\n\t \t\t\t\treturn \"Falló SELECT grupousu: (\" . $this->_db->errno . \") \" . $this->_db->error;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//verifica la contrasena\n\t\t\t\t\t\tif (md5($retorna_child[0]['pass_usu']) == $password) {\n\t\t\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t\t\t$outp[] = array('idUsuario'=> \"\".$retorna_child[0]['idUsuario'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'nombres_usu'=> \"\".$retorna_child[0]['nombres_usu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'apellidos_usu'=> \"\".$retorna_child[0]['apellidos_usu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'GrupoUsu_idGrupoUsu'=> \"\".$retorna_master[0]['idGrupoUsu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'idGrupoUsu'=> \"\".$retorna_master[0]['idGrupoUsu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'activo'=> \"1\",\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn $outp;\n\t\t\t\t\t\t\t$result_child->close();\n\t\t\t\t\t\t\t$result_master->close();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t\t\t$outp[] = array('activo'=> \"0\"\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t$outp[] = array('activo'=> \"0\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $outp;\n\t\t\t\n\t\t}", "public function saveUsuario(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_usuario SET usuario = \"%s\" password = \"%s\" WHERE usuario_id = %d',\n $this->usuario,\n $this->password,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_usuario ( usuario, password) VALUES (\"%s\", \"%s\")',\n $this->usuario,\n $this->password );\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "public function usuarioExiste($usuario)\n {\n $bd = new Bd();\n\n $usser = \"SELECT * FROM usuarios WHERE mail='\" . $this->mail . \"'\" . \" AND clave='\" . $this->clave . \"'\";\n $resultado = $bd->consulta($usser);\n\n\n if ($bd->numeroElementos() == 1) {\n session_start();\n $_SESSION['mail'] = $this->mail;\n $_SESSION['clave'] = $this->clave;\n\n header('location: inici.php');\n } else {\n\n header(\"location: registro.php\");\n }\n }", "function isUsuario() {\n if (\\Illuminate\\Support\\Facades\\Auth::user()->rol_id == 3) {\n return true;\n } else {\n return false;\n }\n }", "private function accesoUsuario()\n {\n if ($this->adminSession) {\n $usuario = $this->session->userdata('admin');\n if ($usuario['id'] > 0) {\n redirect('admin/dashboard');\n } else {\n $this->adminSession = false;\n $this->session->sess_destroy();\n redirect('admin/index'); \n }\n }\n }", "private function usuarios(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"GET\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t}//es una petición GET\n\t\t//se realiza la consulta a la bd\n\t\t$query = $this->_conn->query(\n\t\t\t\"SELECT id, nombre, email \n\t\t\t FROM usuario\");\n\t\t//cantidad de usuarios\n\t\t$filas = $query->fetchAll(PDO::FETCH_ASSOC); \n \t$num = count($filas);\n \t//si devolvio un resultado, se envia al cliente\n \tif ($num > 0) { \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['usuarios'] = $filas; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } //se envia un error \n\t $this->mostrarRespuesta($this->devolverError(2), 204);\n\t}", "public function IniciarSesion(Usuario $usu){\n $conn = new conexion();\n $rol = 0;\n try {\n if($conn->conectar()){\n $str_sql = \"Select usuarios.id_usu, usuarios.nom_usu,usuarios.usuario,usuarios.foto,tp_usuarios.nom_tp as rol,usuarios.idcliente from usuarios \"\n . \"INNER JOIN tp_usuarios WHERE usuarios.id_tp_usu = tp_usuarios.id_tp \"\n . \"and usuarios.usuario = '\".$usu->getUsuario().\"' and usuarios.pass = '\".$usu->getPass().\"' \"\n . \"and estado = 'Activo'\";\n $sql = $conn->getConn()->prepare($str_sql);\n $sql->execute();\n $resultado = $sql->fetchAll();\n foreach ($resultado as $row){\n $rol = 1;\n session_start();\n $_SESSION['id'] = $row['id_usu'];\n //$_SESSION['idcli'] = $row['idcliente'];\n $_SESSION['perfil'] = $row['usuario'];\n $_SESSION['rol'] = $row['rol'];\n $_SESSION['user'] = $row['nom_usu'];\n $_SESSION['img'] = $row['foto'];\n }\n }\n } catch (Exception $exc) {\n $rol = -1;\n echo $exc->getMessage();\n }\n $conn->desconectar();\n return $rol;\n }", "public function existe_usuario($user){ \n \n $query = \"SELECT email, password, idneo4j FROM usuario WHERE email = '\".$user.\"';\";\n $mysql = new Conexion();\n $resultado = $mysql->get_resultados_query($query);\n \n //print_r($resultado);\n \n if(!empty($resultado))\n return $resultado;\n \n return false;\n \n }", "static public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t// $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$usesomesillystringforsalt$');\n\n\t\t\t\t$item = \"usu_descri\";\n\t\t\t\t$valor = $_POST[\"ingUsuario\"];\n\t\t\t\t$pass = $_POST[\"ingPassword\"];\n\n\t\t\t\t$respuesta = ModeloUsuarios::MdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t// var_dump($respuesta);\n\t\t\t\t// die();\n\n\t\t\t\tif($respuesta[\"usu_descri\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"])\n\t\t\t\t{\n\n\t\t\t\t\tif($respuesta['estado'] == 'A')\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$_SESSION[\"iniciarSesion\"] = \"ok\";\n\t\t\t\t\t\t$_SESSION[\"id\"] = $respuesta[\"id\"];\n\t\t\t\t\t\t// $_SESSION[\"nombre\"] = $respuesta[\"nombre\"];\n\t\t\t\t\t\t$_SESSION[\"usuario\"] = $respuesta[\"usu_descri\"];\n\t\t\t\t\t\t// $_SESSION[\"foto\"] = $respuesta[\"foto\"];\n\t\t\t\t\t\t// $_SESSION[\"perfil\"] = $respuesta[\"perfil\"];\n\n\t\t\t\t\t\techo '<script>\n\t\n\t\t\t\t\t\twindow.location = \"inicio\";\n\t\n\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">El usuario no esta activo, porfavor, comuniquese con el administrador</div>';\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelve a intentarlo</div>';\n\n\t\t\t\t}\n\n\t\t\t}\t\n\n\t\t}\n\n\t}", "function cadastrarUser(){\n //$this->session->set_tempdata('erro-acesso', 'login e senha n&atilde;o correspondem!', 5);\n\t \n\t\t/*$verificarUser = $this->login->get_verificar_user('sytesraul', '513482am');\n\t\tif($verificarUser != null) :\n\t\t\techo \"USUARIO JA CADASTRADO \".$verificarUser->name_login;\n\t\tendif;*/\n\t //redirect('login/acessoAceito', 'refresh');\n\t \n\t\t$dados['titulo'] = 'Cadastrar Usuário';\n\t\t$dados['h2'] = 'Tela de Cadastro';\n\t\t$this->load->view('login/cadastrar_user_view', $dados);\n\t\t\n\t\t\n\t}", "public function guardarUsuario()\r\n {\r\n $user = new \\App\\Models\\User;\r\n \r\n $user->Seq_Usuario = $_REQUEST['Seq_Usuario'];\r\n $user->Usuario = $_REQUEST['username'];\r\n $user->Password = $_REQUEST['password'];\r\n $user->sys_rol_id = $_REQUEST['rolID'];\r\n\r\n\r\n $userController = new App\\Controllers\\UserController;\r\n\r\n if($user->Seq_Usuario > 0) {\r\n $result = $userController->updateUser($user);\r\n } else {\r\n $result = $userController->createUser($user);\r\n }\r\n \r\n /**\r\n * Variable de sesión usada para mostrar la notificación del\r\n * resultado de la solicitud.\r\n */\r\n $_SESSION['result'] = $result;\r\n \r\n header('Location: ?c=Registro&a=usuarios');\r\n }", "public function loginUsuario($login = '', $clave = '') {\n $password = md5($clave);\n $this->consulta = \"SELECT * \n FROM usuario \n WHERE login = '$login' \n AND password = '$password' \n AND estado = 'Activo' \n LIMIT 1\";\n\n if ($this->consultarBD() > 0) {\n $_SESSION['LOGIN_USUARIO'] = $this->registros[0]['login'];\n $_SESSION['ID_USUARIO'] = $this->registros[0]['idUsuario'];\n $_SESSION['PRIVILEGIO_USUARIO'] = $this->registros[0]['privilegio'];\n $_SESSION['ACTIVACION_D'] = 0;\n// $_SESSION['ACCESOMODULOS'] = $this->registros[0]['accesoModulos'];\n\n $tipoUsuario = $this->registros[0]['tipoUsuario'];\n\n switch ($tipoUsuario) {\n case 'Empleado':\n $idEmpleado = $this->registros[0]['idEmpleado'];\n $this->consulta = \"SELECT primerNombre, segundoNombre, primerApellido, segundoApellido, cargo, cedula, tipoContrato \n FROM empleado \n WHERE idEmpleado = $idEmpleado \n LIMIT 1\";\n $this->consultarBD();\n// $apellidos = explode(' ', $this->registros[0]['apellidos']);\n $_SESSION['ID_EMPLEADO'] = $idEmpleado;\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['primerNombre'] . ' ' . $this->registros[0]['primerApellido'];\n $_SESSION['CARGO_USUARIO'] = $this->registros[0]['cargo'];\n $_SESSION['TIPO_CONTRATO'] = $this->registros[0]['tipoContrato'];\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['primerNombre'] . ' ' . $this->registros[0]['segundoNombre'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['primerApellido'] . ' ' . $this->registros[0]['segundoApellido'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['cedula'];\n break;\n case 'Cliente Residencial':\n $idResidencial = $this->registros[0]['idResidencial'];\n $this->consulta = \"SELECT nombres, apellidos, cedula \n FROM residencial \n WHERE idResidencial = $idResidencial \n LIMIT 1\";\n $this->consultarBD();\n $apellidos = explode(' ', $this->registros[0]['apellidos']);\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['nombres'] . ' ' . $apellidos[0];\n $_SESSION['CARGO_USUARIO'] = 'Cliente Residencial';\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['nombres'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['apellidos'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['cedula'];\n break;\n case 'Cliente Corporativo':\n $idCorporativo = $this->registros[0]['idCorporativo'];\n $this->consulta = \"SELECT razonSocial, nit \n FROM corporativo \n WHERE idCorporativo = $idCorporativo \n LIMIT 1\";\n\n $this->consultarBD();\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['CARGO_USUARIO'] = 'Cliente Corporativo';\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['nit'];\n break;\n case 'Administrador':\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = 'Administrador';\n $_SESSION['CARGO_USUARIO'] = 'Administrador';\n $_SESSION['TIPO_CONTRATO'] = 'Laboral Administrativo';\n\n $_SESSION['NOMBRES_USUARIO'] = 'Administrador';\n $_SESSION['APELLIDOS_USUARIO'] = 'Administrador';\n $_SESSION['CEDULA_USUARIO'] = '10297849';\n $_SESSION['ID_EMPLEADO'] = '12';\n $_SESSION['ID_CAJA_MAYOR_FNZAS'] = 2;\n $idEmpleado = 12;\n break;\n default:\n break;\n }\n\n //******************************************************************\n // VARIABLES DE SESSION PARA EL ACCESO AL MODULO RECAUDOS Y FACTURACION DE swDobleclick\n\n $_SESSION['user_name'] = $_SESSION['NOMBRES_APELLIDO_USUARIO'];\n $_SESSION['user_charge'] = $_SESSION['CARGO_USUARIO'];\n\n $_SESSION['user_id'] = 0; //$this->getIdUsuarioOLD($idEmpleado);\n $_SESSION['user_privilege'] = 0; //$this->getPrivilegioUsuarioOLD($idEmpleado);\n\n //******************************************************************\n\n $fechaHora = date('Y-m-d H:i:s');\n $idUsuario = $_SESSION['ID_USUARIO'];\n $consultas = array();\n $consultas[] = \"UPDATE usuario \n SET fechaHoraUltIN = '$fechaHora' \n WHERE idUsuario = $idUsuario\";\n $this->ejecutarTransaccion($consultas);\n return true;\n } else {\n return false;\n }\n }", "private function consultar_usuario_por_correo() {\n $sentencia = \"select id,nombrecompleto ,correo,token \"\n . \"from usuario u where u.correo ='{$this->referencia_a_buscar}'; \";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function buscaCvePas(){\n /* Consulta usando ELOQUENT -> Trae al usuario si lo encuentra en la tabla usuarios */\n $usuario = Usuario::where([\n ['cuentaUsuario', $this->cuentaUsuario],\n ['contrasenia', $this->contrasenia]\n ])->first();\n return $usuario;\n }", "public function solicitaUsuario()\n {\n // Lo emitimos por evento\n $this->emit('cambioUsuario', $this->usuario);\n }", "function post_conectar()\n\t{\n\t\t//En este metodo antiguamente se incluia codigo para asegurarse que el esquema de auditoria\n\t\t//guardara el usuario conectado.\n\t}", "public static function verifUserLogueado() {\n if(isset($_SESSION['loggedUser'])) {\n \n if($_SESSION['loggedUser']->getAdmin()==1) {\n $cineDAO = new CineDAO();\n $arrCines = $cineDAO->GetAll($_SESSION['loggedUser']->getId_usuario());\n require_once(VIEWS_PATH.\"navAdmin.php\");\n \n }\n else {\n require_once(VIEWS_PATH.\"nav.php\");\n \n }\n }else {\n require_once(VIEWS_PATH.\"login.php\");\n }\n }", "public function crearUsuario() {\n\n\n if ($this->seguridad->esAdmin()) {\n $id = $this->usuario->getLastId();\n $usuario = $_REQUEST[\"usuario\"];\n $contrasenya = $_REQUEST[\"contrasenya\"];\n $email = $_REQUEST[\"email\"];\n $nombre = $_REQUEST[\"nombre\"];\n $apellido1 = $_REQUEST[\"apellido1\"];\n $apellido2 = $_REQUEST[\"apellido2\"];\n $dni = $_REQUEST[\"dni\"];\n $imagen = $_FILES[\"imagen\"];\n $borrado = 'no';\n if (isset($_REQUEST[\"roles\"])) {\n $roles = $_REQUEST[\"roles\"];\n } else {\n $roles = array(\"2\");\n }\n\n if ($this->usuario->add($id,$usuario,$contrasenya,$email,$nombre,$apellido1,$apellido2,$dni,$imagen,$borrado,$roles) > 1) {\n $this->perfil($id);\n } else {\n echo \"<script>\n i=5;\n setInterval(function() {\n if (i==0) {\n location.href='index.php';\n }\n document.body.innerHTML = 'Ha ocurrido un error. Redireccionando en ' + i;\n i--;\n },1000);\n </script>\";\n } \n } else {\n $this->gestionReservas();\n }\n \n }", "public function createUser($correo)\n {\n $query = $this->connect()->prepare('SELECT * FROM users WHERE Correo = :correo');\n $query->execute(['correo' => $correo]);\n //Guardo el obj PDO en cadenaValida\n $this->cadenaValida = $query->fetch();\n\n //si el resultado retorna true no inserta, de lo contrario inserta\n if ($this->cadenaValida) {\n //El usuario ya existe, hay que retornar mensaje de lo que paso\n\n return $resultado = true;\n }else\n {\n //El correo buscado no existe, hay que insertar en tabla users\n //Obtenemos el ultimo valor de ID de usuario para agregar al nuevo\n $idTemp = $this->connect()->query('SELECT MAX(IDUsuario) FROM users');\n \n $a = $idTemp->fetch(PDO::FETCH_BOTH);\n\n $this->idu = $a[0];\n\n $this->idu = (int) $this->idu + 1;\n $this->nombre = $_POST['name'];\n $this->apellidoP = $_POST['ap'];\n $this->apellidoM = $_POST['am'];\n $this->correo = $_POST['correo'];\n $this->pass = md5($_POST['pass']);\n $this->rol = 1;\n\n $query = $this->connect()->prepare(\n 'INSERT INTO users VALUES(\n :idTemp,\n :nombre,\n :apellidoP,\n :apellidoM,\n :correo,\n :pass,\n :rol)'\n );\n\n $query->execute([\n 'idTemp' => $this->idu,\n 'nombre' => $this->nombre,\n 'apellidoP' => $this->apellidoP,\n 'apellidoM' => $this->apellidoM,\n 'correo' => $this->correo,\n 'pass' => $this->pass,\n 'rol' => $this->rol]);\n\n return $resultado = false;\n }\n }", "public function buscarUsuarios(){\n\t\t}", "static public function ctrIngresoUsuario(){\n\t\t\n\t\tif (isset($_POST['user']) && isset($_POST['pass'])) {\n\t\t\tif (preg_match('/^[a-zA-Z-0-9 ]+$/', $_POST['user'])) {\n\t\t\t\tswitch ($_POST['rol']) {\n\t\t\t\t\tcase 'Encargado':\n\t\t\t\t\t\t$answer = adminph\\Attendant::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Propietario':\n\t\t\t\t\t\t$answer = adminph\\Propietary::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Arrendatario':\n\t\t\t\t\t\t$answer = adminph\\Lessee::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$answer = adminph\\User::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$password = $_POST[\"pass\"];\n\t\t\t\tif (is_object($answer)) {\n\t\t\t\t\tif (password_verify($password,$answer->password) ) {\n\t\t\t\t\t\tif ($answer->state == 1) {\n\t\t\t\t\t\t\tif ($_POST['rol'] == 'Otro') {\n\t\t\t\t\t\t\t\tsession(['rank' => $answer->type]);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tsession(['rank' => $_POST['rol']]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsession(['user' => $answer->username]);\n\t\t\t\t\t\t\tsession(['name' => $answer->name]);\n\t\t\t\t\t\t\tsession(['id' => $answer->id]);\n\t\t\t\t\t\t\tsession(['photo' => $answer->photo]);\n\t\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\t= REGISTRAR LOGIN =\n\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\tdate_default_timezone_set('America/Bogota');\n\t\t\t\t\t\t\tsession(['log' => date(\"Y-m-d h:i:s\")]);\n\t\t\t\t\t\t\t$answer->last_log = session('log');\n\t\t\t\t\t\t\tif ($answer->save()) {\n\t\t\t\t\t\t\t\techo ' <script>\n\t\t\t\t\t\t\twindow.location = \"inicio\"; </script> ';\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\techo '<br><div class=\"alert alert-warning\" style=\"text-align: center;\" >Este usuario se encuentra desactivado, por favor contacte al administrador.</div>';\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo '<head><style type=\"text/css\" media=\"screen\">body{background:#4a6886;color:#fff;}</style></head><body><div class=\"alert alert-warning\" style=\"text-align: center; font-size: 30px;margin-top:15%\" >Las credenciales ingresadas no son correctas.</div><br><br><div style=\"text-align: center; margin-left: 35%;margin-top:5%; width:30%;background:#E75300; padding: 10px;\"><a href=\"/\"> <span style=\" font-size: 18px; color: #fff\"><b>Volver al inicio</b></span> </a></div></body>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function datos_usuario(){\n\t\t$data = json_decode(json_encode($_SESSION['USER']),true);\n\n\t\t$result = $this->_db->query(\"\n\t\tSELECT a.roleid FROM \".DB_PRE.\"role_assignments a, \".DB_PRE.\"context b \n\t\tWHERE a.userid = '$data[id]' AND a.contextid = b.id AND b.instanceid =\".ID_CURSO\n\t\t);\n\n\t\t$rol = 0;\n\t\tif (!$result) {\n\t\t\tprintf(\"Errormessage datos_usuario: %s\\n\", $this->_db->error);\n\t\t}else{\n\t $rol_user = $result->fetch_all(MYSQLI_ASSOC);\n\t if(count($rol_user) > 0){\n\t \t$rol = $rol_user['0']['roleid'];\n\t }\n \t}\n\n\t\t$usuario = array(\n\t\t\t\"id\" => $data['id'],\n\t\t\t\"nombre\" => $data['firstname'],\n\t\t\t\"apellido\" => $data['lastname'],\n\t\t\t\"codigo_estudiante\" => $data['idnumber'],\n\t\t\t\"rol\" => $rol\n\t\t);\n\n\t\t$datos_add = $this->_db->query(\"\n\t\t\tSELECT e.per_aca, b.id_facultad, a.id_programa, e.idnumber as codigo_curso, a.id_genero, a.idnumber\n\t\t\tFROM am_usuario a, am_programa b, \".DB_PRE.\"course e\n\t\t\tWHERE a.id_programa = b.id_programa\n\t\t\tAND e.id = \".ID_CURSO.\"\n\t\t\tAND id_moodle = \".$data['id']\n\t\t\t);\n\n\t\tif (!$datos_add) {\n\t\t\tprintf(\"Errormessage datos_add: %s\\n\", $this->_db->error);\n\t\t}else{\n\t\t\t$row = $datos_add->fetch_all(MYSQLI_ASSOC);\n\t\t\tforeach ($row as $key) {\n\t\t\t\tforeach ($key as $data => $value) {\n\t\t\t\t\t$usuario[$data] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $usuario;\n\t}", "public function vldUsuario(User $usuario) {\n try {\n $sql = \"SELECT\n id,\n name,\n email\n FROM users\n WHERE \";\n \n if ($usuario->getID() > 0) {\n $sql .= \" id <> '\".$usuario->getId().\"' AND \";\n }\n \n if ($usuario->getEmail() != \"\") {\n $sql .= \"( UPPER(email) = '\".strtoupper($usuario->getEmail()).\"' ) \";\n }\n $stmt = $this->cnx->prepare($sql);\n $result = $stmt->execute();\n \n $linhas = $stmt->rowCount();\n\n if($linhas <= 0) {\n return 0;\n }\n \n if ($result) {\n return 1;\n }\n \n \n } catch (Exception $e) {\n throw new Exception(\"Ocorreu um erro no ao validar dados de usuarios do sistema\");\n }\n }", "private function crearUsuario(){\n \t\t#valida que la solicitud sea mediante un post \n\t if ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t \t//envia un error \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405); \n\t }\n\t //valida que los datos a incorporar no sean vacios \n\t if (isset($this->datosPeticion['nombre'], $this->datosPeticion['email'], $this->datosPeticion['pwd'])){\n\t $nombre = $this->datosPeticion['nombre']; \n\t $pwd = $this->datosPeticion['pwd']; \n\t $email = $this->datosPeticion['email'];\n\n\t //valida la existemcia del usuario mediante el email \n\t if (!$this->existeUsuario($email)){ \n\t $query = $this->_conn->prepare(\n\t \t\"INSERT into usuario (nombre,email,password,fRegistro) \n\t \t VALUES (:nombre, :email, :pwd, NOW())\");\n\t //se le asignan los valores a las variables de la consulta \n\t $query->bindValue(\":nombre\", $nombre); \n\t $query->bindValue(\":email\", $email); \n\t $query->bindValue(\":pwd\", sha1($pwd)); \n\t $query->execute(); \n\t if ($query->rowCount() == 1){ // se inserto bien \n\t $id = $this->_conn->lastInsertId(); \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['msg'] = 'usuario creado correctamente'; \n\t $respuesta['usuario']['id'] = $id; \n\t $respuesta['usuario']['nombre'] = $nombre; \n\t $respuesta['usuario']['email'] = $email; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } else //se envia un error de insercion en la bd\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } else //se envia un error del usuario no existe\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(8)), 400); \n\t } else { \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } \n\t}", "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }", "public function insertarUsuario($usuario, $contrasenia, $nombre, $apellido, \n $correo, $imagen, $rol){\n if(empty($usuario) or \n empty($contrasenia) or \n empty($nombre) or \n empty($apellido) or \n empty($correo) or\n empty($imagen) or \n empty($rol)){\n header(\"Location:usuarios.php?accion=add_usuario&i=1\");\n exit();\n }\n \n $sql = \"INSERT INTO usuarios VALUES(null, ?, ?, ?, ?, ?, ?, ?)\";\n\n $resultado = $this->db->prepare($sql);\n\n $resultado->bindValue(1, $usuario);\n $resultado->bindValue(2, $contrasenia);\n $resultado->bindValue(3, $nombre);\n $resultado->bindValue(4, $apellido);\n $resultado->bindValue(5, $correo);\n $resultado->bindValue(6, $imagen);\n $resultado->bindValue(7, $rol);\n \n\n if(!$resultado->execute()){\n header(\"Location:usuarios.php?accion=add_usuario&i=2\");\n }else{\n //Insertamos el registro\n if($resultado->rowCount()>0){\n header(\"Location:usuarios.php?accion=add_usuario&i=3\");\n }else{\n header(\"Location:usuarios.php?accion=add_usuario&i=4\");\n }\n }\n }", "public function getIdUsuario(){\n return $this->idUsuario;\n }", "public function gestionarRolProyecto($usuario){\n \n $em=$this->em;\n\n //detecto si tiene el tipo de rol en otro proyecto y espacio para borrar el de progis symfony\n $dql = \" select x from ProyectoBundle:Miembroproyecto x \n join x.rolproyecto rp \n join x.miembroespacio me\n\n where \n\n x.id!=:idmiembroProyecto and me.usuario= :usuario\";\n\n $query = $em->createQuery($dql);\n $query->setParameter('usuario',$usuario);\n $rolProyecto = $query->getResult();\n \n /*\n //definicion\n $miembroProyecto= $em->getRepository('ProyectoBundle:Miembroproyecto')->find($idMiembroProyecto);\n $rolProgis = $em->getRepository('UsuarioBundle:Rol')->findByRol('ROLE_PROGIS');\n \n $rolProyecto=$miembroProyecto->getRolproyecto();\n $usuario=$miembroProyecto->getMiembroEspacio()->getUsuario();\n //fin definiciones\n \n //detecto si tiene el tipo de rol en otro proyecto\n $dql = \"select x from ProyectoBundle:Miembroproyecto x join x.rolproyecto rp join x.miembroespacio me where me.usuario= :usuario and rp.rol like '%ROLE_%'\";\n $query = $em->createQuery($dql);\n $query->setParameter('usuario',$usuario);\n $rolesAsignados = $query->getResult();\n\n \n //si no tenia asignados y se le esta asignando le tildo el rol por defecto en symfony\n if(!empty($rolesAsignados)):\n $usuario->getUser()->removeRol($rolProgis[0]);\n $usuario->getUser()->addRol($rolProgis[0]);\n elseif(empty($rolesAsignados)):\n $usuario->getUser()->removeRol($rolProgis[0]);\n endif;\n \n $em->flush();*/\n }", "function registrarUsuario(){\n\n\t require(\"Conexion.php\");\t\n\t \n if(isset($_POST['insertar'])){\n\t\n\t $nombre=$_POST[\"nombre\"];\n $apellido=$_POST[\"apellido\"];\n\t $correo=$_POST[\"correo\"];\n\t $direccion=$_POST[\"direccion\"];\n\t $username=$_POST[\"nombre\"];\n\t $password=$_POST[\"password\"];\n\n\t $db=new Conexion();\n\t\n\t\t /* evitar duplicaciones*/\t\t\n $sql = \"select count(*) from datos_usuario where nombre ='$nombre'\";\n\t\t\n if ($resultado = $db->connect()-> query($sql)) {\n\n /* Comprobar el número de filas que coinciden con la sentencia SELECT */\n if ($resultado->fetchColumn() > 0) {\n\n /* Ejecutar la sentencia SELECT para mostrar el nombre duplicado*/\n $sql = \"select nombre from datos_usuario where nombre = '$nombre'\";\n foreach ($db->connect()->query($sql) as $fila) {\n \n\t\t $duplicado=$nombre;\n }\t\n\n\t echo '<script language=\"javascript\">alert(\"Usuario duplicado: '.$duplicado.' ya esta en uso.\");</script>';\n\n echo \"<script>\n setTimeout(function() {\n location.href = '../vista/registro_user.php';\n }, 0001);\n </script>\";\t\t\t \n }\n \n /* No coincide ningua fila inserta */\n else {\t\t\n\t\t\t/*no hay duplicaciones insertamos*/\n\t\n $query=$db->connect()->prepare(\"insert into datos_usuario (nombre, apellido, correo, direccion)\n\t values (:nombre, :apellido, :correo,:direccion)\");\t\t\t \n $query->execute(array(\":nombre\"=>$nombre, \":apellido\"=>$apellido,\":correo\"=>$correo,\"direccion\"=>$direccion));\n\t\n\t/*----------------segunda tabla-----------------------------*/\n\t $db=new Conexion();\n\t \n\t $sql2=\"insert into usuarios(username, password, rol_id) values (:username, :password, :rol_id)\";\n\t $query=$db->connect()->prepare($sql2);\n\t\t\t \n $query->execute(array(\":username\"=>$nombre, \":password\"=>$password, \":rol_id\"=>2));\n\t\n\t\t echo'<script type=\"text/javascript\">\n alert(\"Usuario registrado\");\n </script>';\n\t\n\t \n\t echo \"<script>\n setTimeout(function() {\n location.href = '../vista/login.php';\n }, 0001);\n </script>\";\t\n\t\t } \t\n }\n }\n }", "protected function checkUser() {\n if(!$this->session->userdata(\"usuario_id\")) {\n redirect(\"/login\");\n }\n }", "public function userExists($codigo, $clave, $tipo_usuario)\n\t{\n\t\t$db = Db::getConnect();\n\t\t$md5Clave = md5($clave);\n\t\t$query = $db->prepare('SELECT * FROM usuarios \n\t\t\t\t\t\t\t\t\t\t\t WHERE codigo = :codigo AND clave = :clave\n\t\t\t\t\t\t\t\t\t\t\t\t AND tipo = :tipo');\n\t\t$query->execute([\n\t\t\t'codigo' => $codigo,\n\t\t\t'clave' => $md5Clave,\n\t\t\t'tipo' => $tipo_usuario\n\t\t]);\n\n\t\t// ME TRAE EL NUMERO DE FILAS ENCONTRADAS\n\t\tif ($query->rowCount()) {\n\n\t\t\tforeach ($query as $currentUser) {\n\t\t\t\t$this->id = $currentUser['id'];\n\t\t\t\t$this->tipo = $currentUser['tipo'];\n\t\t\t\t$this->nombre = $currentUser['nombre'];\n\t\t\t\t$this->apellido = $currentUser['apellido'];\n\t\t\t\t$this->cedula = $currentUser['cedula'];\n\t\t\t\t$this->foto = $currentUser['foto'];\n\t\t\t\t$this->direccion = $currentUser['direccion'];\n\t\t\t\t$this->telefono = $currentUser['telefono'];\n\t\t\t\t$this->estudios = $currentUser['estudios'];\n\t\t\t\t$this->anopromo = $currentUser['anopromo'];\n\t\t\t\t$this->codigo = $currentUser['codigo'];\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function consultar_usuario_todos() {\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u;\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function autentificacion($username,$password){\n $userService = new UsuariosServiceImp();\n //objeto de tipo usuario\n $usuario = new Usuarios();\n //llamdo al metodo definido en la capa de servicio\n $usuario = $userService->buscarPorUsernamePassword($username,$password);\n if ( is_object($usuario)){\n /*\n variable de sesion mediante variables locales\n \n $_SESSION['nombre'] = $usuario->getNombre();\n $_SESSION['correo'] = $usuario->getEmail();\n $_SESSION['id'] = $usuario->getId();\n */\n /* variable de sesion mediante un arreglo asociado\n */\n $_SESSION['miSesion'] = array();\n $_SESSION['miSesion']['nombre'] = $usuario->getNombre();\n $_SESSION['miSesion']['correo'] = $usuario->getEmail();\n $_SESSION['miSesion']['id'] = $usuario->getId();\n \n //echo \"<br>El usuario es valido\";\n header(\"location:../view/productos.class.php\");\n }else{\n //echo \"<br>Este usuario no esta registrado en la base de datos\";\n header(\"location:../view/formLogin.html\");\n }\n }", "private function ifoCadUser()\n {\n $infoCadUser = new AdmsRead();\n $infoCadUser->fullRead(\"SELECT env_email_conf, adms_niveis_acesso_id, adms_sits_usuario_id FROM adms_cads_usuarios WHERE id =:id LIMIT :limit\", \"id=1&limit=1\");\n $this->IfoCadUser = $infoCadUser->getResultado();\n\n }", "function crearUsuario($correo,$nombre,$contrasenya){\n require (\"../configuracion/conexion.php\");\n \n //COMPROBAR SI EL CORREO YA ESTA EN USO\n $comprobarCorreo =\"SELECT correo FROM Usuarios WHERE correo='$correo'\";\n $resultCorreo = mysqli_query($conn, $comprobarCorreo);\n \n $filasCorreo=mysqli_num_rows($resultCorreo);\n if($filasCorreo==0){\n \n //COMPROBAR SI YA EXISTE EL NOMBRE DE USUARIO\n \n $comprobarNombre =\"SELECT nombre_usuario FROM Usuarios WHERE nombre_usuario='$nombre'\";\n $resultNombre = mysqli_query($conn, $comprobarNombre);\n \n $filasNombre=mysqli_num_rows($resultNombre);\n if($filasNombre==0){\n \n //AUTOINCREMENTAR ID\n $cons = \"SELECT ID_usuario FROM Usuarios ORDER BY ID_usuario DESC LIMIT 1;\";\n $result = mysqli_query($conn, $cons);\n \n while($fila = mysqli_fetch_array($result)){\n \n $ID = $fila[0] + 1;\n }\n //METER USUARIO\n $addUsuario = \"INSERT INTO Usuarios VALUES('$ID','$nombre','$contrasenya','$correo');\";\n $result = mysqli_query($conn, $addUsuario);\n \n \n //INICIAR SESION DESPUES DE CREARLO\n \n $cons=\"SELECT * FROM Usuarios WHERE correo='$correo' and password='$contrasenya'\";\n $result = mysqli_query($conn, $cons);\n \n if ($fila = mysqli_fetch_array($result)) {\n \n session_start();\n \t $_SESSION[\"correo\"] = $fila['correo'];\n \t $_SESSION[\"usuario\"] = $fila['nombre_usuario'];\n \t $_SESSION[\"id\"] = $fila['ID_usuario'];\n \t $_SESSION[\"idAlbum\"] = \"\";\n\t $_SESSION[\"nombre_album\"] = \"\";\n }\n \n return 0;\n \n }else{\n return 2;\n }\n }else{\n return 1;\n }\n \n mysqli_free_result($result);\n mysqli_close($conn);\n\n //LISTA DE ERRORES Y CORRECTO:\n //0 Funciona todo bien\n //1 Correo en uso\n //2 Nombre en uso\n }", "private function consultar_usuario_por_nombre() {\n $sentencia = \"select id,nombrecompleto ,correo,token \"\n . \"from usuario u where u.nombrecompleto ilike '%{$this->referencia_a_buscar}%'; \";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "private function consultar_usuario_por_id() {\n\n if (is_numeric($this->referencia_a_buscar)) {\n $id_a_buscar = intval($this->referencia_a_buscar);\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u where u.id= {$id_a_buscar};\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n } else {\n $this->respuesta = null;\n }\n }", "public function consultarUsuario($parametros)\n {\n //echo \"<h1>$correo -- $contrasena</h1>\";\n // header('Location: ../vistas/index.php');\n\n #LLAMO LA CONEXION PARA PODER CONSULTAR A LA BASE DE DATOS\n $modelo = new Conexion_PDO();\n $conexion = $modelo->get_Conexion_Mysql();\n #PREPARO LA SQL PARA VERIFICAR SI EL USUARIO EXISTE Y ESTA ACTIVO\n $sql = \"SELECT priape,segape,nom from datosiniciales\";\n $statement = $conexion->prepare($sql);\n $statement->execute();\n $resultados = $statement->fetch();\n // VERIFICA SI EL RESULTADO ES DIFERENTE DE VACIO QUIERE DECIR QUE EL CORREO SI EXISTE Y ESTA ACTIVO\n if ($resultados != '') {\n\n echo \"<br>- \"$resultados['priape'];\n echo \"<br>- \"$resultados['segape'];\n echo \"<br>- \"$resultados['nom'];\n return 1;\n\n // $_SESSION['identificacion'] = $dato['numeroid'];\n // $_SESSION['nombre'] = $dato['nombre1'];\n // $_SESSION['apellido'] = $dato['apellido1'];\n // header('location:acceso.php');\n\n } else {\n return 2;\n // echo \"Error, verifica tu usuario y contraseña\";\n // header('location:../index.php');\n }\n\n }", "public function userCadConfirm($codConfirmacao=''){\n \n\n \n if($codConfirmacao==''){//se em branco retorna NULL (erro)\n \n \n return null;\n \n }else{//caso codigo informado procede com a conferencia e a ativacao\n \n \n \n $sql = new Sql();\n $ativacao = $sql->select('SELECT * FROM usuarios \n WHERE cod_ativacao_usuario = :cod_ativacao_usuario',\n array(':cod_ativacao_usuario'=>$codConfirmacao)); \n \n if(count($ativacao)==0){\n \n \n return null;//caso nada encontrado retorna NULL (deve pode ser um codigo invalido)\n \n }elseif(count($ativacao)>0){//caso codigo de confirmacao for OK entao ativa o cadastro\n \n \n //obtem o id do usuario\n $id_usuario = $ativacao[0]['id_usuario'];\n \n \n //verifica se existe a necessidade de ativacao\n if($ativacao[0]['status_usuario']==1){//cadastro JA ATIVO basta notificar\n \n return true;//retorna true confirmando que o cadastro esta atualizado \n \n }elseif($ativacao[0]['status_usuario']==0){//CASO INATIVO ENTÃO PROCEDE COM A ATIVACAO\n \n //atualiza o cadastro do usuario ativando ele\n $res = $sql->query('UPDATE usuarios SET status_usuario = 1\n WHERE id_usuario = :id_usuario',\n array(':id_usuario'=>$id_usuario));\n \n if($res>0){//se o numero de linhas afetadas for maior que ZERO\n \n return true;//retorna true confirmando que o cadastro esta atualizado\n \n }else{\n return false;//caso nada encontrado retorna FALSE (pode ter ocorrido erro na atualizacao)\n\n }\n }\n } \n }\n }", "function setUsuario($usuario, $contraseña, $nombre, $apellidos, $telefono, $movil){\n\t\t\n\t\t$resultado = conectar()->query( \"SELECT * FROM usuarios WHERE usuario LIKE '$usuario'\");\n\t\tif($resultado->num_rows == 0){\n\t\t\tconectar()->query(\"INSERT INTO usuarios (usuario, contrasenia, nombre, apellidos, telefono, movil) VALUES ('\" . $usuario . \"','\" . $contraseña . \"','\" . $nombre . \"','\" . $apellidos .\"','\" . $telefono . \"','\" . $movil .\"')\");\n\t\t\techo \"<script>alert('Te has registrado correctamente!');document.location.reload();\";\t\n\t\t}else{\n\t\t\techo \"<script>alert('Ya existe ese nombre de usuario!');</script>\";\n\t\t}\n\t}", "public function insertUsuario(){\n $query = \"INSERT INTO usuario (nombre, apellido, sexo, fecha_nac, correo, contrasenia) VALUES ('\".parent::string($this->getNombre()).\"', '\".parent::string($this->getApellido()).\"', '\".parent::string($this->getSexo()).\"', '\".parent::string($this->getFecha_Nac()).\"', '\".parent::string($this->getCorreo()).\"', '\".md5(md5(\"PAO%%%%0001TPIPSADSADasdsad\").parent::string($this->getContrasenia())).\"');\";\n $result = mysqli_query(parent::conexion(), $query);\n if($result){\n $fila = mysqli_fetch_array($result);\n parent::desconectar();\n return $fila;\n } else{\n echo parent::conexion()->error;\n parent::desconectar();\n return false;\n }\n }", "public function verificarLogin($nombre, $password)\n {\n //busca en la tabla usuarios los campos donde el nombre sea igual a admin si no encuentra nada devuelve null\n $usuario = R::findOne('usuarios', 'alias=?', [\n $nombre\n ]);\n $a=\"\";\n $b=\"\";\n echo $usuario->alias;\n echo $usuario->contrasena;\n //comprueba si la variable usuario es distinta al campo alias almacenado en la base de datos si es asi a octiene el valor=\"no\"\n if ($usuario->alias!=$nombre) {\n \n $a=\"no\";\n }\n //comprueba si la variable password es distinta al campo contraseña almacenado en la base de datos si es asi b octiene el valor=\"no\"\n if (! password_verify($password, $usuario->contrasena)) {\n \n $b=\"no\";\n }\n // si a y b de los if anteriores son no redirecciona al controlador a la carpeta usuarios dentro de esta carpeta al controlador usuarios.php linea 192\n \n if($a!=\"no\"&& $b!=\"no\"){\n //rdirege al controlador Usuarios/Bienvenidos_u\n \n redirect(base_url().\"usuario/Usuarios/Bienvenidos_u\");\n \n \n \n }\n else{\n session_destroy();\n // redirecciona al controlador usuario usuarios.php linea 190 dentro de la carpeta usuario\n redirect(base_url().\"usuario/Usuarios/errorsesion\");\n }\n \n }", "private function existeUsuario()\n {\n $con = Conexion::getInstance();\n $sql = \"SELECT user \n FROM usuarios\n WHERE user = '{$this->usuario}' AND estado = 1 AND idUsuario != {$this->Id}\";\n\n $result = mysqli_query($con, $sql);\n\n if($result->num_rows >= 1 && $result != false)\n {\n return false;\n }\n\n return true;\n }", "private function verificarUsuarioAdministrador(){\n $user = User::getUsuario();\n if( $user == 'NULL'|| !$user->admin){\n return redirect('/admin')->with('flash_message_error', 'Error acceso denegado.');\n }\n }", "public function gestionarProgis($usuario){\n \n $em=$this->em;\n \n //busco si posee rol de proyecto\n $dql = \" select x from ProyectoBundle:Miembroproyecto x \n join x.miembroespacio me\n where me.usuario= :usuario\";\n\n $query = $em->createQuery($dql);\n $query->setParameter('usuario',$usuario);\n $rolProyecto = $query->getResult();\n \n \n //busco si posee rol general\n $dql = \"select x from PrincipalBundle:Miembroespacio x where x.poseerolgeneral=true and x.usuario= :usuario\";\n $query = $em->createQuery($dql);\n $query->setParameter('usuario',$usuario);\n $rolGeneral = $query->getResult();\n \n $rolProgis = $em->getRepository('UsuarioBundle:Rol')->findByRol('ROLE_PROGIS');\n if(empty($rolProyecto) and empty($rolGeneral)):\n $usuario->getUser()->removeRol($rolProgis[0]);\n else:\n $usuario->getUser()->removeRol($rolProgis[0]);\n $usuario->getUser()->addRol($rolProgis[0]);\n endif;\n \n $em->flush();\n \n /*\n \n //definicion\n $miembroEspacio = $em->getRepository('PrincipalBundle:Miembroespacio')->find($idMiembroEspacio);\n $rolProgis = $em->getRepository('UsuarioBundle:Rol')->findByRol('ROLE_PROGIS');\n $rolGeneral=$miembroEspacio->getRolgeneral();\n $usuario=$miembroEspacio->getUsuario();\n //fin definiciones\n \n //detecto si tiene el tipo de rol en otro espacio\n $dql = \"select x from PrincipalBundle:Miembroespacio x join x.rolgeneral rg where x.usuario= :usuario and rg.rol like '%ROLE_%'\";\n $query = $em->createQuery($dql);\n $query->setParameter('usuario',$usuario);\n $rolesAsignados = $query->getResult();\n\n \n //si no tenia asignados y se le esta asignando le tildo el rol por defecto en symfony\n if(!empty($rolesAsignados)):\n $usuario->getUser()->removeRol($rolProgis[0]);\n $usuario->getUser()->addRol($rolProgis[0]);\n elseif(empty($rolesAsignados)):\n $usuario->getUser()->removeRol($rolProgis[0]);\n endif;\n \n $em->flush();*/\n }", "public function agregar_usuario_controlador()\n {\n $nombres = strtoupper(mainModel::limpiar_cadena($_POST['usu_nombres_reg']));\n $apellidos = strtoupper(mainModel::limpiar_cadena($_POST['usu_apellidos_reg']));\n $identidad=mainModel::limpiar_cadena($_POST['usu_identidad_reg']);\n $puesto=mainModel::limpiar_cadena($_POST['usu_puesto_reg']);\n $unidad=mainModel::limpiar_cadena($_POST['usu_unidad_reg']);\n $rol = mainModel::limpiar_cadena($_POST['usu_rol_reg']);\n $celular = mainModel::limpiar_cadena($_POST['usu_celular_reg']);\n $usuario = strtolower(mainModel::limpiar_cadena($_POST['usu_usuario_reg']));\n $email=$usuario . '@didadpol.gob.hn' ;\n\n\n /*comprobar campos vacios*/\n if ($nombres == \"\" || $apellidos == \"\" || $usuario == \"\" || $email == \"\" || $rol == \"\" || $identidad == \"\" || $puesto == \"\" || $unidad == \"\") {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"NO HAS COMPLETADO TODOS LOS CAMPOS QUE SON OBLIGATORIOS\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n\n if (mainModel::verificar_datos(\"[A-ZÁÉÍÓÚáéíóúñÑ ]{3,35}\", $nombres)) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL CAMPO NOMBRES SOLO DEBE INCLUIR LETRAS Y DEBE TENER UN MÍNIMO DE 3 LETRAS\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n if (mainModel::verificar_datos(\"[A-ZÁÉÍÓÚáéíóúñÑ ]{3,35}\", $apellidos)) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL CAMPO APELLIDOS SOLO DEBE INCLUIR LETRAS Y DEBE TENER UN MÍNIMO DE 3 LETRAS\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n if ($celular != \"\") {\n if (mainModel::verificar_datos(\"[0-9]{8}\", $celular)) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL NÚMERO DE CELULAR NO COINCIDE CON EL FORMATO SOLICITADO\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n }\n if (mainModel::verificar_datos(\"[0-9]{13}\", $identidad)) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL NÚMERO DE IDENTIDAD NO COINCIDE CON EL FORMATO SOLICITADO\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n /*validar DNI*/\n $check_dni = mainModel::ejecutar_consulta_simple(\"SELECT identidad FROM tbl_usuarios WHERE identidad='$identidad'\");\n if ($check_dni->rowCount() > 0) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL NÚMERO DE IDENTIDAD YA ESTÁ REGISTRADO\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n\n if (mainModel::verificar_datos(\"[a-z]{3,15}\", $usuario)) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL CAMPO NOMBRE DE USUARIO SOLO DEBE INCLUIR LETRAS Y DEBE TENER UN MÍNIMO DE 5 Y UN MAXIMO DE 15 LETRAS\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n\n /*validar usuario*/\n $check_user = mainModel::ejecutar_consulta_simple(\"SELECT nom_usuario FROM tbl_usuarios WHERE nom_usuario='$usuario'\");\n if ($check_user->rowCount() > 0) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL USUARIO YA ESTÁ REGISTRADO\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n /*validar email*/\n\n \n $caracteres = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n $pass = \"\";\n for ($i = 0; $i < 8; $i++) {\n $pass .= substr($caracteres, rand(0, 64), 1);\n }\n $message = \"<html><body><p>Hola, \" . $nombres . \" \" . $apellidos;\n $message .= \" Estas son tus credenciales para ingresar al sistema de DIDADPOL\";\n $message .= \"</p><p>Usuario: \" . $usuario;\n $message .= \"</p><p>Correo: \" . $email;\n $message .= \"</p><p>Contraseña: \" . $pass;\n $message .= \"</p><p>Inicie sesión aquí para cambiar la contraseña por defecto \" . SERVERURL . \"login\";\n $message .= \"<p></body></html>\";\n\n $res = mainModel::enviar_correo($message, $nombres, $apellidos, $email);\n if (!$res) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"NO SE ENVIÓ CORREO ELECTRÓNICO\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n\n $passcifrado = mainModel::encryption($pass);\n\n $datos_usuario_reg = [\n \"rol\" => $rol,\n \"puesto\"=>$puesto,\n \"unidad\"=>$unidad,\n \"usuario\" => $usuario,\n \"nombres\" => $nombres,\n \"apellidos\" => $apellidos,\n \"dni\"=>$identidad,\n \"clave\" => $passcifrado,\n \"estado\" => \"NUEVO\",\n \"email\" => $email,\n \"celular\" => $celular\n ];\n $agregar_usuario = usuarioModelo::agregar_usuario_modelo($datos_usuario_reg);\n if ($agregar_usuario->rowCount() == 1) {\n $alerta = [\n \"Alerta\" => \"limpiar\",\n \"Titulo\" => \"USUARIO REGISTRADO\",\n \"Texto\" => \"LOS DATOS DEL USUARIO SE HAN REGISTRADO CON ÉXITO\",\n \"Tipo\" => \"success\"\n ];\n } else {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"NO SE HA PODIDO REGISTRAR EL USUARIO\",\n \"Tipo\" => \"error\"\n ];\n }\n echo json_encode($alerta);\n }", "private function preAddUser(){\n $LMS = new LMS();\n $api = $LMS->getDataXUserPass($this->_user, $this->_pass, 'https://www.sistemauno.com/source/ws/uno_wsj_login.php');\n $this->_person = \"\";\n if ($this->isObjectAPI($api)) {\n //validar Permisos\n $FilterAPI = new FilterAPI($api);\n $this->_datPerson = $FilterAPI->runFilter($this->_user, $this->_pass);\n if (is_array($this->_datPerson)) {\n //si el usuario cuenta con un perfil apropiado se le pide que valide sus coreo\n $this->validateEmailUser();\n if($this->validUniqueMail()){\n $this->sendMail();\n $this->_response = \"1|\" . $this->_datPerson[email] . \"|\" . $this->_datPerson[personId] . \"|\" . $this->_code . \"|\" . $this->_datPerson['name'];\n }else{\n $this->_response = \"2|\" . $this->_datPerson[email] . \"|\" . $this->_datPerson[personId] . \"|\" . $this->_code . \"|\" . $this->_datPerson['name'];\n }\n } else {\n $this->_response = $this->_datPerson;\n }\n } else {\n $this->_response = $api;\n }\n }", "private function existeusuario2($usuario)\n {\n $stmt = $this->con->prepare(\"SELECT id_conductor FROM `descuento` WHERE id_conductor = ?\");\n $stmt->bind_param(\"s\", $usuario);\n $stmt->execute(); \n $stmt->store_result();\n return $stmt->num_rows > 0;\n }", "public function getUsuario(){\n return $this->usuario;\n }", "static public function ctrIngresoUsuario()\n {\n\n if (isset($_POST['ingEmail'])) {\n if (\n preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingEmail\"]) &&\n preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])\n ) {\n\n\n $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n $tabla = \"usuarios\";\n $item = \"email\";\n $valor = $_POST[\"ingEmail\"];\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuario($tabla, $item, $valor);\n\n /*Validacion junto con la BD*/\n if ($respuesta[\"email\"] == $_POST[\"ingEmail\"] && $respuesta[\"password\"] == $encriptar) {\n //validacion con la BD si ya esta verficado el email\n if ($respuesta['verificacion'] == 1) {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡NO HA VERIFICADO SU CORREO ELECTRONICO!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise la bandeja de entrada o la carpeta de SPAM, para verifcar la direccion de correo electronico ' . $_POST[\"ingEmail\"] . '\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n } else {\n\n /*Variables de sesion*/\n\n @session_start();\n $_SESSION['validarSesion'] = 'ok';\n $_SESSION['id'] = $respuesta['id'];\n $_SESSION['nombre'] = $respuesta['nombre'];\n $_SESSION['foto'] = $respuesta['foto'];\n $_SESSION['email'] = $respuesta['email'];\n $_SESSION['password'] = $respuesta['password'];\n $_SESSION['modo'] = $respuesta['modo'];\n\n //Utilizando del local storgae, alcenamos la ruta, para cuando inicie sesion, sea redireccionado hacia la ruta\n echo '\n <script> \n window.location = localStorage.getItem(\"rutaActual\");\n </script>\n ';\n\n\n }\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR AL INGRESAR!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise el correo electronico, o la contraseña\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t window.location = localStorage.getItem(\"rutaActual\");\n\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n }\n\n\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t text: \"¡Error al ingresar al sistema, no se permiten caracteres especiales\",\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n }\n }\n\n\n }", "function inativaUsuario($id){\n\t\t\ttry{\n\t\t\t\t$conn = Banco::ConectaBanco();\n\t\t\t\t$statm = $conn->prepare(\n\t\t\t\t\"UPDATE Usuario\n\t\t\t\t\tSET usuario_ativo = FALSE\n\t\t\t\t\tWHERE usuario_id = :id AND usuario_ativo = TRUE\n\t\t\t\t\");\n\t\t\t\t$statm->bindValue(\":id\", $id);\n\t\t\t\t$conn = NULL;\n\t\t\t\treturn $statm->execute();\n\t\t\t}catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t}", "function saveUsuario(Usuario $objeto) {\n $campos = $this->_getCampos($objeto);\n \n $id = $campos['id'];\n unset($campos['id']);\n unset($campos['tipo']);\n unset($campos['activa']);\n unset($campos['falta']);\n if($objeto->getPassword() === null || $objeto->getPassword() === ''){\n unset($campos['password']);\n }\n return $this->db->updateParameters(self::TABLA, $campos, array('id' => $id));\n }", "public function select($usuario_has_hojaruta);", "public function usuarioAutorizado($usuario)\r\n\t {\r\n\t \t$lista = self::getListaUsuarioAutorizado();\r\n\t \tif ( count($lista) > 0 ) {\r\n\r\n\t \t\tforeach ( $lista as $key => $value ) {\r\n\t \t\t\tif ( $value == $usuario ) {\r\n\t \t\t\t\treturn true;\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t}\r\n\r\n\t \treturn false;\r\n\t }", "public function getdatosUsuarios(){\n\t\t$bd = new bd();\n\t\t$result = $bd->doSingleSelect($this->u_table,\"id = {$this->id}\");\n\t\tif($result){\n\t\t\t$this->datosUsuario($result[\"direccion\"], $result[\"telefono\"], $result[\"descripcion\"], $result[\"estados_id\"], $result[\"facebook\"], $result[\"twitter\"],$result[\"website\"],$result[\"certificado\"],$result[\"id_sede\"]);\n\t\t\t$this->id = $result[\"id\"];\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function ctrIngresoUsuario(){\n\n\t\t\tif(isset($_POST[\"ingresoUsuario\"])){\n\n\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9 ]+$/', $_POST[\"ingresoUsuario\"]) && \n\t\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingresoPassword\"])){\n\n\t\t\t\t\t$tabla= \"administrador\";\n\t\t\t\t\t$item =\"usuario\";\n\n\t\t\t\t\t$valor = $_POST[\"ingresoUsuario\"];\n\t\t\t\t\t$respuesta = AdministradorModelo::mdlMostrarUsuario($tabla,$item,$valor);\n\n\t\t\t\t\tif($respuesta != null){\n\n\t\t\t\t\t\t if($respuesta[\"usuario\"]==$_POST[\"ingresoUsuario\"] && $respuesta[\"password\"]==$_POST[\"ingresoPassword\"]){\n\n\t\t\t\t\t\t\tif($respuesta[\"estado\"]==1){\n\n\t\t\t\t\t\t\t\t$_SESSION[\"verificarUsuarioB\"]=\"ok\";\n\t\t\t\t\t\t\t\t$_SESSION[\"idUsuarioB\"]=$respuesta[\"id_admin\"];\n\n\t\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\twindow.location = \"'.$_SERVER[\"REQUEST_URI\"].'\";\n\t\t\t\t\t\t\t </script>';\n\n\n\t\t\t\t\t\t\t}else {\n\n\t\t\t\t\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t\t\t\t\t\t\t<span>¡ERROR AL INGRESAR!</span> El usuario está desactivado.\n\t\t\t\t\t\t\t\t </div>';\n\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t} else {\n\n\n\t\t\t\t\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t\t\t\t\t<span>¡ERROR AL INGRESAR!</span> Su contraseña y/o usario no es correcta, Intentelo de nuevo.\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t}\n\t\t\t\t\n\n\n\t\t\t\t}else {\n\n\t\t\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t\t\t<span>¡ERROR!</span> no se permite caracteres especiales.\n\t\t\t\t\t</div>';\n\n\t\t\t\t}\n\n\n\n\n\t\t\t}\n\n\t}", "function registro($_usuario, $_pass, $_nombre, $_apellidos, $_email) {\n\t\t$sql = \"SELECT * from usuario where usuario='\".$_usuario.\"'\";\n\n\t\t$usuario_result = $this->db->query($sql)->result();\n\n\t\tif (count($usuario_result)!='0') {\n\n\t\t\t// SI EXISTE DEVOLVEMOS \"FALSE\"\n\t\t\techo \"false\";\n\t\t} else {\n\n\t\t\t// SI NO EXISTE HACEMOS LA INSERCION Y LO GUARDAMOS EN LA VARIABLE SESSION\n\t\t\t$insert = \"INSERT INTO usuario value (NULL, '\".$_nombre.\"', '\".$_apellidos.\"', '\".$_usuario.\"', md5('\".$_pass.\"'), '\".$_email.\"', 'usuario');\";\n\n\t\t\t$this->db->query($insert);\n\n\t\t\t$sql = \"SELECT * from usuario where usuario='\".$_usuario.\"'\";\n\n\t\t\t$usuario_result = $this->db->query($sql)->result();\n\n\t\t\tforeach ($usuario_result[0] as $key => $value) {\n\t\t\t\t$usuario[0][$key] = $value;\n\t\t\t}\n\t\t\tif (count($usuario_result)=='1') {\n\t\t\t\t$this->session->id_usuario = $usuario[0]['id'];\n\t\t\t\t$this->session->nombre = $usuario[0]['usuario'];\n\t\t\t\t$this->session->email = $usuario[0]['email'];\n\t\t\t\t$this->session->privilegio = $usuario[0]['privilegio'];\n\t\t\t\t$this->session->sesion = TRUE;\n\t\t\t}\n\n\t\t\techo \"true\";\n\t\t}\n\n\t}", "public function addUsuario($principal, $secundario, $nome, $sobrenome, $email, $senha, $permissao, $imgUser)\n {\n $imgUser = $this->salvaImgUser($imgUser, $email);\n // Fim do codigo\n\n $senha = password_hash($senha, PASSWORD_DEFAULT);\n\n $emailVerify = LoginHandler::emailExist($email);\n\n if (empty($emailVerify)) {\n $pdo = Usuario::sqlSelect();\n\n $sql = \"INSERT INTO usuarios (nome, sobrenome, email, senha, permissao, id_usuario_principal, img_user, id_usuario_cadastrou) VALUES (:nome, :sobrenome, :email, :senha, :permissao, $principal, :img_user, $secundario)\";\n $sql = $pdo->prepare($sql);\n $sql->bindValue(\":nome\", $nome);\n $sql->bindValue(\":sobrenome\", $sobrenome);\n $sql->bindValue(\":email\", $email);\n $sql->bindValue(\":senha\", $senha);\n $sql->bindValue(\":permissao\", $permissao);\n $sql->bindValue(\":img_user\", $imgUser);\n\n $sql->execute();\n\n if ($sql->rowCount() > 0) {\n $_SESSION['aviso'] = \"Usuário adicionado com sucesso!\";\n $_SESSION['color'] = \"lightgreen\";\n } else {\n $_SESSION['aviso'] = \"Error: Algo deu errado!\";\n $_SESSION['color'] = \"lightcoral\";\n }\n } else {\n $_SESSION['aviso'] = \"Error: E-mail já cadastrado!\";\n $_SESSION['color'] = \"lightcoral\";\n }\n }", "function Usuario($idUsuario = '')\n\t\t{\n\t\t\t$this->id = \"usuario_id\";\n\t\t\t$this->tabla = \"usuario\";\n\t\t\t\n\t\t\t$this->exitoListar = t(\"User list obtained successfully\");\n\t\t\t$this->errorListar = t(\"Error obtaining user list\");\n\t\t\t$this->exitoInsertar = t(\"User created successfully\");\n\t\t\t$this->exitoActualizar = t(\"User updated successfully\");\n\t\t\t$this->errorInsertar = t(\"Error creating user\");\n\t\t\t$this->errorActualizar = t(\"Error updating user\");\t\n\t\t\t\n\t\t\t$this->campos = array(\n\t\t\t\t'usuario_id' => array('tipo'=>'id','nulo'=>true,'msg'=>t('Invalid user ID'),'valor'=>'','lectura'=>false),\n\t\t\t\t'usuario_nombre' => array('tipo'=>'string','nulo'=>true,'msg'=>t('Invalid user name'),'valor'=>'','lectura'=>false),\n\t\t\t\t'usuario_login' => array('tipo'=>'string','nulo'=>false,'msg'=>t('Invalid user login'),'valor'=>null,'lectura'=>false),\n\t\t\t\t'usuario_password' => array('tipo'=>'string','nulo'=>false,'msg'=>t('Invalid password'),'valor'=>null,'lectura'=>false),\n\t\t\t\t'usuario_rol_id' => array('tipo'=>'int','nulo'=>false,'msg'=>t('Invalid Rol'),'valor'=>null,'lectura'=>false),\n\t\t\t\t'usuario_email' => array('tipo'=>'email','nulo'=>true,'msg'=>t('Invalid email'),'valor'=>'','lectura'=>false),\n\t\t\t\t'usuario_apellido1' => array('tipo'=>'string','nulo'=>true,'msg'=>t('Invalid surname1'),'valor'=>'','lectura'=>false),\n\t\t\t\t'usuario_apellido2' => array('tipo'=>'string','nulo'=>true,'msg'=>t('Invalid surname2'),'valor'=>'','lectura'=>false),\n\t\t\t\t'usuario_detalles' => array('tipo'=>'html','nulo'=>true,'msg'=>t('Invalid details'),'valor'=>'','lectura'=>false)\n\t\t\t);\n\n\t\t\t$this->relaciones = array(\n\t\t\t\n\t\t\t\t'rol' => array (\n\t\t\t\t\t'tabla' => 'rol',\n\t\t\t\t\t'relacion' => '1a1',\n\t\t\t\t\t'soloLectura' => true,\n\t\t\t\t\t'clavePrimaria' => 'usuario_rol_id',\n\t\t\t\t\t'claveAjena1' => 'rol_id',\n\t\t\t\t\t'claveAjena2' => '',\n\t\t\t\t\t'campos' => array(\n\t\t\t\t\t\t'rol_id' => array('tipo'=>'id','nulo'=>true,'msg'=>t('Invalid rol id'),'valor'=>'','lectura'=>true),\t\t\t\t\t\n\t\t\t\t\t\t'rol_nombre' => array('tipo'=>'string','nulo'=>true,'msg'=>t('Invalid rol name'),'valor'=>'','lectura'=>true)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$this->campos['usuario_id']['valor'] = $idUsuario;\n\t\t}", "private function existeusuario($usuario)\n {\n $stmt = $this->con->prepare(\"SELECT id_conductor FROM `carga` WHERE id_conductor = ?\");\n $stmt->bind_param(\"s\", $usuario);\n $stmt->execute(); \n $stmt->store_result();\n\n return $stmt->num_rows > 0;\n }", "public function getUsuario()\n {\n return $this->hasOne(User::className(), ['id' => 'createdBy'])->inverseOf('comentarios');\n }", "function loguear($usuario) {\n $_SESSION[\"idUser\"] = $usuario[\"id\"];\n }", "public function ultimoUsuario() {\n $ultimo = new SqlQuery(); //instancio objeto la case en cuestion\n (string) $tabla = get_class($this); //obtengo el nombre de la clase para realizar la consulta en la BD\n try {\n $this->refControladorPersistencia->get_conexion()->beginTransaction();\n $usuarioConsulta = $this->refControladorPersistencia->ejecutarSentencia($ultimo->buscarUltimo($tabla)); //en esta consulta busco cual es el ultimo usuario \n $arrayUsuario = $usuarioConsulta->fetchAll(PDO::FETCH_ASSOC); //utilizo el FETCH_ASSOC para que no repita los campos\n $this->refControladorPersistencia->get_conexion()->commit(); //realizo el commit de los datos a la base de datos\n $idUsuario = \"\"; //creo una variable para poder enviar los datos al metodo correpondiente\n foreach ($arrayUsuario as $id) {//recorro el array que contiene los datos que necesito para buscarl el ultimo usuario\n foreach ($id as $clave => $value) {//recorro los datos dentro del array y obtengo el valor que necesito\n $idUsuario = $value; //asigno el valor correspondiente a la variable creada anteriormente para tal caso\n }\n }\n //envio los datos al metodo que se va a encargar de ralizar la consulta a la base de \n //datos para obtener el último usiario registrado y devolver los datos para mostrarlos por pantalla\n $usuarioId = $this->buscarUsuarioXId($idUsuario); //lamo al metodo para obtener todos los datos del usuario que \n //estoy buscando en este caso el último que se creo\n return $usuarioId; //regreso los datos de ese usuario a la llamada para enviarlos desde el ruteador a la vista\n } catch (PDOException $excepcionPDO) { //atrapo la excepcion por si algo salio mal que se realice el rollback \n echo \"<br>Error PDO: \" . $excepcionPDO->getTraceAsString() . '<br>';\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si hay algún error hace rollback\n }\n }", "function compruebaLoginUsuario($bd){\n //Hago un filtrado previo por si hay valores indeseables en el array\n $arrayFiltrado=array();\n foreach ($_POST as $k => $v)\n $arrayFiltrado[$k] = filtrado($v);\n\n //Utilizo los objetos DAO para añadir el usuario a la BD\n $daoUsuario = new Usuarios($bd);\n $usuario = new Usuario();\n $usuario->setPassword($arrayFiltrado[\"password\"]);\n $usuario->setUsuario($arrayFiltrado[\"usuario\"]);\n $resultado = $daoUsuario->compruebaCredenciales($usuario);\n //Compruebo si tengo usuario\n if($resultado!=false) {\n $usuario->setPassword(null);\n $usuario->setId($resultado[\"id\"]);\n $usuario->setImagen($resultado[\"imagen\"]);\n return $usuario;\n }\n else\n return false;\n}", "function agregar($nombre,$correo,$usuario,$rol,$zonah,$estado,$psw)\n {\n $Valores = \"'\".$usuario.\"','\".$psw.\"','\".$nombre.\"','\".$correo.\"',\".$estado.\",\".$zonah.\",\".$rol;\n $this->Insertar(\"usuarios\",\"usuario,password,nombre,correo,activo,zonashorarias_id,roles_id\",$Valores);\n }", "function recuperarUsuario()\n {\n $_codigo=$this->codigo ; \n $this->dataBaseAccess(); \n $mySelect = 'select Codigo_empresa,Nome,Senha where Codigo = ' . $this->Codigo ;\n $ret = mysqli_query($this->myCon , $mySelect) ;\n $numRows= mysqli_num_rows($ret); \n if($numRows>0)\n {\n $reg = mysqli_fetch_array($ret) ;\n $this->Codigo_empresa=$reg['Codigo_empresa'] ;\n $this->Nome=$reg['Nome'] ;\n $this->Senha=$reg['Senha'] ;\n mysqli_close( $this->myCon );\n $this->records_found=$numRows ;\n return true ; // ja cadastrado \n }else{\n mysqli_close( $this->myCon );\n return false ; \n }\n }", "public function buscarUsuario($id) {\n\t\t// hace consulta y setea valores\n\t\t$this->id = $id;\n\t\tif(!$this->getdatosUsuarios()){\t\t\t\n\t\t\tif(!$this->getdatosNatural()){\t\t\t\t\n\t\t\t\t$this->getdatosJuridico();\n\t\t\t}\n\t\t\t$this->getdatosAcceso();\n\t\t\t$this->getdatosStatus();\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function existe_usuario()\n\t{\n\t\t$data = $this->request->getRawInput();\n\t\t$ruc = $data['nick']; \n\t\t$usu = new Admin_model();\n\t\t$usuarioObject = $usu->where(\"nick\", $ruc) \n\t\t->first();\n\t\treturn !is_null($usuarioObject);\n\t\t \n\t}", "public function login($usuario, $senha) {\n global $conexao;\n\n // Verifica se o email e senha são iguais aos que serão recebidos\n $sql = \"Select * FROM suafesta.cadastros WHERE usuario = :usuario AND senha = :senha\";\n\n // $sql é nada mais nada menos que a tabela usuario\n\n $sql = $conexao->prepare($sql);\n\n // Passa o valor recebido do parametro na variavel\n $sql->bindValue(\"usuario\", $usuario);\n $sql->bindValue(\"senha\", $senha);\n\n $sql->execute();\n\n // Se quantidade de registros > 0\n if($sql->rowCount() > 0) {\n // Fetch - cria um array e retorna apenas uma linha dele\n $dado = $sql->fetch();\n\n echo $sql->rowCount();\n\n // Mostre a linha que está na posição do codigo que bate o email e a senha\n //echo $dado['codigo'];\n\n // Salvar o codigo do usuario no navegador\n $_SESSION[\"codUser\"] = $dado['codigo'];\n \n return true;\n } else {\n return false;\n }\n\n }", "function registrar_usuario($identificacion,$nombre,$apellidos,$correo,$password)\n\t{\n\t\t$respuesta= array();\n\t\t$usuario = new Usuario();\n\t\t$existe_usuario = $usuario->consultar_usuario($correo);\n\t\tif (empty($existe_usuario)) {\n\t\t\t$usuario_nuevo = $usuario->registrar_usuario($identificacion,$nombre,$apellidos,$correo,$password);\n\t\t\t$respuesta[\"usuario_nuevo\"]=$usuario_nuevo;\n\t\t\tif ($usuario_nuevo) {\n\t\t\t\t$respuesta[\"valor\"]=1; \n\t\t\t} else{\n\t\t\t\t$respuesta[\"valor\"]=0; \n\t\t\t}\n\t\t} else{\n\t\t\t$respuesta[\"valor\"]=2; \n\t\t}\n\t\techo json_encode($respuesta);\n\n\t}", "static public function ctrIngresoUsuario()\n{ \n if(isset($_POST[\"ingUsuario\"]))\n {\n\n if(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])) {\n\n\n //$encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t//print_r($_POST);\n $tabla = \"usuarios\";\n $item= \"codusuario\";\n $valor= $_POST[\"ingUsuario\"];\t\t\t\t\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuarios($tabla, $item, $valor );\n\n if($respuesta[\"codusuario\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"] ){\n\n if($respuesta[\"bloqueado\"] == 0 ) {\n $_SESSION[\"iniciarSesion\"] = \"ok\";\n $_SESSION[\"id\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"nombre\"] = $respuesta[\"nomusuario\"];\n $_SESSION[\"usuario\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"perfil\"] = $respuesta[\"codperfil\"];\n $_SESSION[\"foto\"] = \"\";\n $_SESSION[\"id_local\"] = 1;\n\n date_default_timezone_set('America/Bogota');\n $fecha = date('Y-m-d');\n $hora = date('H:i:s');\n $fechaActual = $fecha.' '.$hora;\n\n $tabla = 'usuarios';\n $item1 = 'fecingreso';\n $valor1 = $fechaActual ;\n $item2 = 'codusuario';\n $valor2= $respuesta[\"codusuario\"] ;\n $respuestaUltimoLogin = ModeloUsuarios::mdlActualizarUsuario($tabla,$item1, $valor1, $item2, $valor2 );\n\n if($respuestaUltimoLogin == \"ok\")\n {\n echo '<script> window.location = \"inicio\"</script>';\n\n }\n\n } \n else \n echo '<br><div class=\"alert alert-danger\">El usuario no se encuentra activado.</div>';\n\n }else {\n\n echo '<br><div class=\"alert alert-danger\">Error al ingresar vuelve a intentarlo.</div>';\n }\t\t\t\t\n\n }//\n\n }\n\n}", "public function getUsuario() {\n return $this->iUsuario;\n }", "function agregarUsuarioBD($objeto) {\n\n $user = strtoupper(htmlentities($objeto->getUsuario(), ENT_QUOTES));\n \n $pass = $objeto->getContrasena();\n\n $conexion = $this->conectar(\"ADMIN\",\"1234\");\n\n $agrego = oci_parse($conexion,'CREATE USER '.$user.' IDENTIFIED BY '.$pass);\n oci_execute($agrego);\n\n $agrego = oci_parse($conexion,'GRANT ALL PRIVILEGES TO '.$user);\n oci_execute($agrego);\n\n $string = \"INSERT INTO UsuarioCtx_TAB VALUES ('\".$user.\"')\";\n $result = oci_parse($conexion, $string);\n oci_execute($result);\n\n $result = oci_parse($conexion, \"INSERT INTO MEDICO VALUES (\".$objeto->getCI().\", '\".$objeto->getNombres().\"', '\".$objeto->getApellidos().\"', '\".$user.\"', '\".$pass.\"', \".$objeto->isFisio().\")\");\n oci_execute($result);\n\n $this->desconectar($conexion);\n return $result;\n }", "public function atualizarUsuarios($idusuario, $nome, $email, $senha, $senha_confirma, $telefone, $dtnascimento, $habilitado, $idpermissao){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT count(*) as total from tbusuarios WHERE email = '$email' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n \n if($senha != $senha_confirma){\n return 2;\n }elseif ($senha == '' || $senha == null && $senha_confirma == '' || $senha_confirma == null ) {\n $sql = \"UPDATE tbusuarios SET nome = '$nome', email='$email', dt_nascimento='$dtnascimento', telefone='$telefone', data_modificado = NOW(), habilitado='$habilitado', idpermissao='$idpermissao' WHERE idusuario = '$idusuario' \";\n echo $this->conexao->query($sql);\n }else{\n $sql = \"UPDATE tbusuarios SET nome = '$nome', email='$email', senha='$senha', senha_confirma='$senha_confirma' dt_nascimento='$dtnascimento', telefone='$telefone', data_modificado = NOW(), habilitado='$habilitado', idpermissao='$idpermissao' WHERE idusuario = '$idusuario' \";\n\n echo $this->conexao->query($sql);\n }\n }", "public function getIdUsuario()\n {\n return $this->id_usuario;\n }", "public function getIdUsuario()\n {\n return $this->id_usuario;\n }", "public function updatedUsuario()\n {\n // Notificamos al otro componente el cambio\n $this->emit('cambioUsuario', $this->usuario);\n }", "public function issetConsejo($login, $clave) {\n if ($login == \"\" || $clave == \"\")\n return false;\n $activo = Objectbase::STATUS_AC;\n $sql = \"select * , c.id as consejo_id from \" . $this->getTableName() . \" as c , \" . $this->getTableName('usuario') . \" as u where c.login = '$login' and c.clave = '$clave' and c.usuario_id = u.id and u.estado = '$activo' and c.estado = '$activo' \";\n //echo $sql; \n $resultado = mysql_query($sql);\n if (!$resultado)\n return false;\n $user = mysql_fetch_object($resultado);\n return $user;\n }", "function ins_permisos($DBcon, $idusuario, $tipousuario)\n {\n\n $query = $this->set_profile($tipousuario,$idusuario);\n\n $stmt = $DBcon->prepare($query);\n\n // check for successfull registration\n if ( $stmt->execute() ) {\n $response['status'] = 'success';\n $response['message'] = '&nbsp; Registro exitoso, Gracias!';\n\n } else {\n $response['status'] = 'error'; // could not register\n $response['message'] = '&nbsp; No se pudo registrar, intente nuevamente más tarde';\n }\n\n return $response;\n }", "public function InicioSesionUser()\n {\n /// obtiene la fecha actual del servidor\n $mytime = Carbon::now();\n $fechaHoy = Carbon::parse($mytime)->format('Y-m-d');\n\n /// buscar ordes\n $ordenesNuevas = OrdenTrabajo::whereDate('created_at', $fechaHoy)->where('status', 1)->where('estado_or', 0)->get();\n $ordenesFinalizadas = OrdenTrabajo::whereDate('updated_at', $fechaHoy)\n ->where('status', 1)\n ->where('etapa_servicio_or', 3)\n ->where('estado_or', 1)->get();\n\n $ordenesAsignadas = OrdenTrabajo::where('status', 1)\n ->where('etapa_servicio_or', 2)\n ->where('estado_or', 1)->get();\n\n $tecnicos = DB::table('users')\n ->join('tecnicos', 'users.id', '=', 'tecnicos.id')\n ->select(\n 'users.*',\n 'tecnicos.id as id_tec',\n 'tecnicos.especialidad_t',\n 'tecnicos.profesion_t',\n 'tecnicos.tipo_t'\n )\n ->where('tipo_p', '1')\n ->where('estado_p', 1)\n ->get();\n return view('admin/dashboard/inicio/inicio', compact(\n 'ordenesNuevas', 'fechaHoy', 'ordenesFinalizadas', 'ordenesAsignadas','tecnicos'\n ));\n }", "public function autenticar(Autenticar $autenticar){\n\n $sql = \"select * from tbl_funcionario where matricula = '\".$autenticar->getLogin().\"' and senha = '\".$autenticar->getSenha().\"'\";\n\n echo $sql;\n \n $pdoConn = $this->conn->startConnection();\n\n $select = $pdoConn->query($sql);\n\n if($rsContatos=$select->fetch(PDO::FETCH_ASSOC)){\n // echo \"AQQUI\";\n // var_dump($rsContatos);\n \n // require_once('model/usuarioCmsClass.php');\n $user = new UsuarioCms();\n\n $user->setId($rsContatos['id']);\n $user->setNome($rsContatos['nome']);\n $user->setLogin($rsContatos['matricula']);\n $user->setSenha($rsContatos['senha']);\n $user->setIdPermissao($rsContatos['id_permissao']);\n\n return $user;\n }else{\n return \"FALHA\";\n }\n\n $this->conn->closeConnection();\n\n }", "public function AgregarUsuario(Usuario $usu){\n $conn = new conexion();\n $user = -1;\n try {\n if($conn->conectar()){\n $str_sql = \"Insert into usuarios(nom_usu,usuario,cedula,telefono,email,pass,foto,estado,\"\n . \"id_tp_usu,tipo,idcliente) values(\"\n .\"'\".$usu->getNom_usu().\"',\"\n .\"'\".$usu->getUsuario().\"',\"\n .\"'\".$usu->getCedula().\"',\"\n .\"'\".$usu->getTelefono().\"',\"\n .\"'\".$usu->getEmail().\"',\"\n .\"'\".$usu->getPass().\"',\"\n .\"'\".$usu->getFoto().\"',\"\n .\"'\".$usu->getEstado().\"',\"\n .\"\".$usu->getId_tp_usu().\",\"\n .\"'\".$usu->getTipo().\"',\"\n .\"\".$usu->getIdcliente().\");\";\n $sql = $conn->getConn()->prepare($str_sql);\n $user = $sql->execute();\n \n }\n } catch (Exception $exc) {\n echo $exc->getMessage();\n }\n $conn->desconectar();\n return $user;\n }", "function PesquisaUsuarioPorId($id){\n\t\t\t\n\t\t\ttry{\n\t\t\t\t$conn = Banco::ConectaBanco();\n\t\t\t\t$statm = $conn->prepare(\"SELECT * FROM Usuario WHERE usuario_id = :id AND usuario_ativo = TRUE\");\n\t\t\t\t$statm->bindValue(\":id\", $id);\n\t\t\t\t$statm->execute();\n\t\t\t\t$conn = NULL;\n\t\t\t\treturn $row = $statm->fetch(PDO::FETCH_ASSOC);\n\t\t\t}catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t}", "public function saveUserContratante()\n {\n\n $data_insert = [\n 'id_user' => $this->_id_user,\n 'id_contratante' => $this->_id_contratante,\n ];\n return parent::save($data_insert);\n }", "public function getUsuario()\r\n {\r\n return $this->usuario;\r\n }", "public function ingresar() {\n require 'modelos/usuariosModelo.php';\n\n //Creamos una instancia de nuestro \"modelo\"\n $usuarios = new usuarioModelo();\n\n //Le pedimos al modelo todos los items\n $datosUsuario = $usuarios->encontrarUsuario($_POST['usuario'], $_POST['contrasena']);\n $n = 0;\n while ($item = $datosUsuario->fetch()) {\n $_SESSION['username'] = $item['usu_usuario'];\n $_SESSION['userid'] = $item['usu_id'];\n $_SESSION['tipo'] = $item['usu_tipo'];\n $_SESSION['acceso'] = true;\n \n $n++;\n }\n echo $n;\n }", "public function loginTraitement(){\n\n $identifiant = $this->verifierSaisie(\"identifiant\");\n $password = $this->verifierSaisie(\"password\");\n\n //securite\n if (($identifiant != \"\") && ($password != \"\")){\n\n //on crée un objet de la classe \\W\\Security\\AuthentificationModel\n //ce qui nous permet d'utiliser la methode isValidLoginInfo\n $objetAuthentificationModel = new \\W\\Security\\AuthentificationModel;\n\n $idUser = $objetAuthentificationModel->isValidLoginInfo($identifiant, $password);\n\n if($idUser > 0){\n\n // recuperer les infos de l'utilisateur\n //requete base de donnée pour les recuperer\n //je crée un objet de la classe \\W\\Model\\UsersModel\n $objetUsersModel = new \\W\\Model\\UsersModel;\n // je retrouve les infos de la ligne grace à la colonne ID\n // La classe UsersModel herite de la classe Model je peu donc faire un find pour recupeerr les infos\n $tabUser = $objetUsersModel->find($idUser);\n\n // Je vais ajouter des infos dans la session\n $objetAuthentificationModel->logUserIn($tabUser);\n\n // recuperer l'username\n $username = $tabUser[\"username\"];\n\n\n $GLOBALS[\"loginRetour\"] = \"Bienvenue $username\";\n\n $this->redirectToRoute(\"admin_accueil\");\n }\n else{\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }else{\n\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }", "function getCodUsuario() {\n return $this->codUsuario;\n }", "static public function ctrCrearUsuario(){\n \t\tif(isset($_POST[\"nuevoUsuario\"])){\n \t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoNombre\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"nuevoUsuario\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"nuevoPassword\"])){\n\n\n\t\t\t\t//Inicializamos la ruta de la foto por si no hay foto.\n\t\t\t\t$ruta =\"\";\n\n\n \t\t\t\t$tabla = \"usuarios\";\n\n \t\t\t\t//$encriptar = crypt($_POST[\"nuevoPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n \t\t\t\t$encriptar = $_POST[\"nuevoPassword\"];\n\n\n \t\t\t\t$datos = array (\"nombre\" => $_POST[\"nuevoNombre\"],\n \t\t\t\t\t\t\t\t\"usuario\" => $_POST[\"nuevoUsuario\"],\n \t\t\t\t\t\t\t\"password\" => $encriptar ,\n \t\t\t\t\t\t\"perfil\" => $_POST[\"nuevoPerfil\"]);\n\t\t\t\t\t\t \n\t\t\t\t$nombreValido = ModeloUsuarios::mdlValidadUsuario($tabla, $_POST[\"nuevoUsuario\"]);\n\t\t\t\t$respuesta = \"\";\n\t\t\t\tif($nombreValido)\n\t\t\t\t \t$respuesta = ModeloUsuarios::mdlIngresarUsuario($tabla, $datos);\n\n \t\t\t\tif($respuesta == \"ok\" AND $nombreValido ){\n\n \t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\ttitle: \"¡El usuario ha sido guardado correctamente!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t\n\n\t\t\t\t</script>';\n\n \t\t\t\t}else \t\t\n \t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡El usuario no se ha logrado ingresar!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t});\n\t\t\t\t\n\n\t\t\t\t</script>';\n\n \t\t\t\t\n\n \t\t\t}else {\n \n \t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡El usuario no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t\n\n\t\t\t\t</script>';\n\n\n \t\t\t}\n \n \n\n\n \t\t}\n\n\t}", "private function valUserExisting(){\n if($this->_personDB->getActive()){\n if($this->logIn()){\n $this->addUserHttpSession();\n $this->_response = 'ok';\n }\n }else{\n $this->_response = '104';\n }\n }", "public function toggleLikeSeguirUsuario ($user_seguido_id) {\n\n $id_user = Session::get('user')->id;\n\n $userActual = User::find($id_user);\n\n $actuales = UsersSeguidos::where('user_seguido_id', $user_seguido_id)\n ->where('user_id', $id_user)\n ->get()\n ;\n $siguiendo = false;\n\n if(count($actuales) > 0) {\n $userActual->deleteSeguirUser($user_seguido_id);\n } else {\n $userActual->addSeguirUser($user_seguido_id);\n $siguiendo = true;\n }\n\n return response()->json([\n 'siguiendo' => $siguiendo\n ]);\n }", "public function getUsuario()\n {\n return $this->usuario;\n }", "public static function insertar_usuario($conexion, $usuario) {\n\n $usuario_insertado = false;\n\n if (isset($conexion)) {\n try {\n $sql = \"INSERT INTO usuarios(nombre,correo,password,fecha_registro,activo,perfil,tienda) VALUES(:nombre, :correo, :password,NOW(),0,:perfil,:tienda)\";\n $sentencia = $conexion->prepare($sql);\n $sentencia->bindParam(':nombre', $usuario->obtenerNombre(), PDO::PARAM_STR);\n $sentencia->bindParam(':correo', $usuario->obtenerCorreo(), PDO::PARAM_STR);\n $sentencia->bindParam(':password', $usuario->obtenerPassword(), PDO::PARAM_STR);\n $sentencia->bindParam(':perfil', $usuario->obtenerPerfil(), PDO::PARAM_STR);\n $sentencia->bindParam(':tienda', $usuario->obtenerTienda(), PDO::PARAM_STR);\n $usuario_insertado = $sentencia->execute();\n } catch (PDOException $ex) {\n print 'ERROR' . $ex->getMessage();\n }\n }\n return $usuario_insertado;\n }" ]
[ "0.7242818", "0.69337624", "0.6872422", "0.68023205", "0.6747905", "0.66934353", "0.66796505", "0.6676691", "0.6661754", "0.66554147", "0.6635119", "0.66178393", "0.6601649", "0.6573955", "0.6573873", "0.65582687", "0.6535543", "0.6527967", "0.6509618", "0.64968747", "0.64900106", "0.64784247", "0.64746165", "0.64674836", "0.64463335", "0.6442966", "0.64351094", "0.6434282", "0.642875", "0.6427034", "0.6426976", "0.641886", "0.64125055", "0.6397064", "0.6396854", "0.63963217", "0.6390601", "0.63840145", "0.63821435", "0.63783383", "0.637614", "0.6375868", "0.63732547", "0.6370732", "0.6365235", "0.63648325", "0.63622844", "0.6353119", "0.6338486", "0.6329402", "0.63276595", "0.6311326", "0.63110703", "0.6311065", "0.62982154", "0.62883085", "0.6286167", "0.62810487", "0.62677604", "0.6258605", "0.624851", "0.6247691", "0.6240206", "0.6235478", "0.62336373", "0.6232628", "0.622718", "0.6222545", "0.6222506", "0.62185365", "0.62144303", "0.6214316", "0.6214177", "0.6207349", "0.6205405", "0.6204731", "0.61985964", "0.61978424", "0.6195256", "0.6194435", "0.6194267", "0.6188134", "0.61794806", "0.61794806", "0.6177693", "0.61690015", "0.61651313", "0.6161529", "0.61585456", "0.6156782", "0.61546683", "0.61537653", "0.6148365", "0.61460847", "0.6141732", "0.6141403", "0.6140652", "0.6139522", "0.61394846", "0.61389387", "0.61363703" ]
0.0
-1
Un usuario puede tener varias actualizaciones en casos
public function actualizaciones() { return $this->hasMany('App\Actualizacioncaso'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actualizar(){\n }", "public function presupuestoModificado(){\n $this->iPresupuestoModificado = $this->iPresupuestoInicial;\n $this->save();\n }", "public function actualizar(){\n }", "public function actualizar(){\n }", "public function actualizar() {\n $ord = $this->orden;\n $this->cargarPersonas($ord);\n }", "public function actualizaEstado(){\n $this->estado = 'Completo';\n // $this->cotiza = $this->generarCustomID();\n $this->save();\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->rh157_sequencial = ($this->rh157_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh157_sequencial\"]:$this->rh157_sequencial);\n $this->rh157_usuario = ($this->rh157_usuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh157_usuario\"]:$this->rh157_usuario);\n $this->rh157_lotacao = ($this->rh157_lotacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh157_lotacao\"]:$this->rh157_lotacao);\n }else{\n $this->rh157_sequencial = ($this->rh157_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh157_sequencial\"]:$this->rh157_sequencial);\n }\n }", "public function Actualizar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\t\t\t$sql = \"UPDATE denuncia SET ES_LA_VICTIMA='$this->esLaVictima', DESCRIPCION_EVENTO='$this->descripcionEvento', ASESORADO='$this->yaAsesorado', \n\t\t\tASISTENCIA_PROFESIONAL='$this->asistenciaProfesional', DENUNCIA_POLICIAL='$this->denunciaPolicial', PERPETRADOR_CONOCIDO='$this->perpetradorConocido', PROCEDIMIENTO_PERPETRADOR='$this->procedimientoPerpetrador' WHERE ID_DENUNCIA = '$this->idDenuncia'\";\n\t\t\tif ($enlace->query($sql) === TRUE) {\n \t\t\techo \"Denuncia actualizada\";\n\t\t\t} else {\n \t\t\techo \"Error al actualizar la denuncia\";\n\t\t\t}\n\t\t}", "public function actualizarArticulos()\n\t{\n\t\t\n\t\t$permiso = $this->Autorizaciones_model->validarPermiso($this->session->userdata(\"id\"), \"1060\");\n\t\tif($permiso){\n\t\t\t$this->Hana_model->actualizarArticulos();\n\t\t} else {\n\t\t\t$mensaje[0][\"mensaje\"] = \"no tiene permiso\";\n\t\t $mensaje[0][\"tipo\"] = \"error\";\n\t\t //$this->db->trans_commit();\n\t\t echo json_encode($mensaje);\n\t\t return;\n\t\t}\n\t}", "public function actualizar(){\r\n\t\t\t$user_table = Config::get()->db_user_table;\r\n\t\t\t$consulta = \"UPDATE $user_table\r\n\t\t\t\t\t\t\t SET password='$this->password', \r\n\t\t\t\t\t\t\t \t\tnombre='$this->nombre', \r\n\t\t\t\t\t\t\t \t\temail='$this->email', \r\n\t\t\t\t\t\t\t \t\timagen='$this->imagen',\r\n apellido1='$this->apellido1',\r\n apellido2='$this->apellido2', \r\n fecha_nacimiento='$this->fecha_nacimiento',\r\n direccion='$this->direccion',\r\n cp='$this->cp',\r\n poblacion='$this->poblacion',\r\n telf_movil='$this->telf_movil',\r\n telf_fijo='$this->telf_fijo',\r\n nivel_estudios='$this->nivel_estudios',\r\n nombre_titulacion='$this->nombre_titulacion',\r\n otros='$this->otros',\r\n observaciones='$this->observaciones',\r\n en_activo=$this->en_activo,\r\n razon_social='$this->razon_social',\r\n puesto_trabajo='$this->puesto_trabajo',\r\n regimen=$this->regimen,\r\n activo=$this->activo\r\n\t\t\t\t\t\t\t WHERE dni='$this->dni';\";\r\n\t\t\treturn Database::get()->query($consulta);\r\n\t\t}", "public function actualizar(){\r\n\t\t\t$user_table = Config::get()->db_user_table;\r\n\t\t\t$consulta = \"UPDATE $user_table\r\n\t\t\t\t\t\t\t SET \tid='$this->id',\r\n\t\t\t\t\t\t\t \t\tdni='$this->dni',\r\n\t\t\t\t\t\t\t \t\tnom='$this->nom', \r\n\t\t\t\t\t\t\t \t\tcognom1='$this->cognom1', \r\n\t\t\t\t\t\t\t \t\tcognom2='$this->cognom2', \r\n\t\t\t\t\t\t\t \t\tdata_naixement='$this->data_naixement',\r\n\t\t\t\t\t\t\t \t\testudis='$this->estudis',\r\n\t\t\t\t\t\t\t \t\tsituacio_laboral='$this->situacio_laboral',\r\n\t\t\t\t\t\t\t \t\tprestacio='$this->prestacio',\r\n\t\t\t\t\t\t\t \t\ttelefon_mobil='$this->telefon_mobil',\r\n\t\t\t\t\t\t\t \t\ttelefon_fix='$this->telefon_fix',\r\n\t\t\t\t\t\t\t \t\temail='$this->email',\r\n\t\t\t\t\t\t\t \t\tadmin='$this->admin',\r\n\t\t\t\t\t\t\t \t\timatge='$this->imatge'\t\t\t\t \t\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t WHERE id='$this->id';\";\r\n\t\t\t\r\n\t\t\treturn Database::get()->query($consulta);\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->r07_anousu = ($this->r07_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r07_anousu\"]:$this->r07_anousu);\n $this->r07_mesusu = ($this->r07_mesusu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r07_mesusu\"]:$this->r07_mesusu);\n $this->r07_codigo = ($this->r07_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r07_codigo\"]:$this->r07_codigo);\n $this->r07_descr = ($this->r07_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r07_descr\"]:$this->r07_descr);\n $this->r07_valor = ($this->r07_valor == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r07_valor\"]:$this->r07_valor);\n $this->r07_instit = ($this->r07_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r07_instit\"]:$this->r07_instit);\n }else{\n $this->r07_anousu = ($this->r07_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r07_anousu\"]:$this->r07_anousu);\n $this->r07_mesusu = ($this->r07_mesusu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r07_mesusu\"]:$this->r07_mesusu);\n $this->r07_codigo = ($this->r07_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r07_codigo\"]:$this->r07_codigo);\n $this->r07_instit = ($this->r07_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r07_instit\"]:$this->r07_instit);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->fa35_i_codigo = ($this->fa35_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"fa35_i_codigo\"]:$this->fa35_i_codigo);\n $this->fa35_i_listacontrolado = ($this->fa35_i_listacontrolado == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"fa35_i_listacontrolado\"]:$this->fa35_i_listacontrolado);\n $this->fa35_i_medanvisa = ($this->fa35_i_medanvisa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"fa35_i_medanvisa\"]:$this->fa35_i_medanvisa);\n }else{\n $this->fa35_i_codigo = ($this->fa35_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"fa35_i_codigo\"]:$this->fa35_i_codigo);\n }\n }", "public function actualizar_estado() {\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed222_i_codigo = ($this->ed222_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed222_i_codigo\"]:$this->ed222_i_codigo);\n $this->ed222_i_itinerario = ($this->ed222_i_itinerario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed222_i_itinerario\"]:$this->ed222_i_itinerario);\n $this->ed222_i_escolaproc = ($this->ed222_i_escolaproc == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed222_i_escolaproc\"]:$this->ed222_i_escolaproc);\n }else{\n $this->ed222_i_codigo = ($this->ed222_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed222_i_codigo\"]:$this->ed222_i_codigo);\n }\n }", "public function actualizar_empresa_controlador(){\n\t\t\n\t\t$cuenta= mainModel::decryption($_POST['codigo']);\n\t\t$nit= mainModel::limpiar_cadena($_POST['nit-update']);\n\t\t$nombre= mainModel::limpiar_cadena($_POST['nombre-update']);\n\t\t$telefono= mainModel::limpiar_cadena($_POST['telefono-update']);\n\t\t$email= mainModel::limpiar_cadena($_POST['email-update']);\n\t\t$direccion= mainModel::limpiar_cadena($_POST['direccion-update']);\n\t\t$director= mainModel::limpiar_cadena($_POST['director-update']);\n\t\t$telefono2= mainModel::limpiar_cadena($_POST['telefono2-update']);\n\t\t$year= mainModel::limpiar_cadena($_POST['year-update']);\n\t\t\n\n\t\t$consulta1=mainModel::ejecutar_consulta_simple(\"SELECT * FROM empresa WHERE id='$cuenta'\");\n\t\t$datosEmpresa=$consulta1->fetch();\n\n\t\t\tif($nit!=$datosEmpresa['EmpresaCodigo']){\n\t\t\t\t$const1=mainModel::ejecutar_consulta_simple(\"SELECT EmpresaCodigo FROM empresa WHERE EmpresaCodigo='$nit'\");\n\t\t\t\tif($const1->rowCount()>=1){\n\t\t\t\t\t$alerta=[\n\t\t\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\t\"Texto\"=>\"La Empresa que acaba de actualizar ya se encuenta registrada.\",\n\t\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t\t\t];\n\t\t\t\t\t\treturn mainModel::sweet_alert($alerta);\n\t\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t$datosEmpresaAct=[\n\t\t\t\t\t\"Nit\"=>$nit,\n\t\t\t\t\t\"Nombre\"=>$nombre,\n\t\t\t\t\t\"Telefono\"=>$telefono,\n\t\t\t\t\t\"Email\"=>$email,\n\t\t\t\t\t\"Direccion\"=>$direccion,\n\t\t\t\t\t\"Director\"=>$director,\n\t\t\t\t\t\"Telefono2\"=>$telefono2,\n\t\t\t\t\t\"Year\"=>$year,\n\t\t\t\t\t\"Id\"=>$cuenta\n\t\t\t\t];\n\n\t\t\t\tif(empresaModelo::actualizar_empresa_modelo($datosEmpresaAct)){\n\t\t\t\t\t$alerta=[\n\t\t\t\t\t\t\t\"Alertas\"=>\"recargar\",\n\t\t\t\t\t\t\t\"Titulo\"=>\"Datos actualizados\",\n\t\t\t\t\t\t\t\"Texto\"=>\"Los datos fueron actualizados de manera satisfactoria.\",\n\t\t\t\t\t\t\t\"Tipo\"=>\"success\"\n\t\t\t\t\t\t\t];\n\t\t\t\t}else{\n\t\t\t\t\t$alerta=[\n\t\t\t\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\t\t\"Texto\"=>\"Los datos no han podido ser actualizar los datos, por favor intente nuevamente.\",\n\t\t\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\treturn mainModel::sweet_alert($alerta);\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->rh33_sequencial = ($this->rh33_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh33_sequencial\"]:$this->rh33_sequencial);\n $this->rh33_solicita = ($this->rh33_solicita == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh33_solicita\"]:$this->rh33_solicita);\n $this->rh33_anousu = ($this->rh33_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh33_anousu\"]:$this->rh33_anousu);\n $this->rh33_mesusu = ($this->rh33_mesusu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh33_mesusu\"]:$this->rh33_mesusu);\n $this->rh33_siglaarq = ($this->rh33_siglaarq == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh33_siglaarq\"]:$this->rh33_siglaarq);\n $this->rh33_seqfolha = ($this->rh33_seqfolha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh33_seqfolha\"]:$this->rh33_seqfolha);\n $this->rh33_instit = ($this->rh33_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh33_instit\"]:$this->rh33_instit);\n }else{\n $this->rh33_sequencial = ($this->rh33_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh33_sequencial\"]:$this->rh33_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->r60_anousu = ($this->r60_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_anousu\"]:$this->r60_anousu);\n $this->r60_mesusu = ($this->r60_mesusu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_mesusu\"]:$this->r60_mesusu);\n $this->r60_numcgm = ($this->r60_numcgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_numcgm\"]:$this->r60_numcgm);\n $this->r60_tbprev = ($this->r60_tbprev == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_tbprev\"]:$this->r60_tbprev);\n $this->r60_rubric = ($this->r60_rubric == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_rubric\"]:$this->r60_rubric);\n $this->r60_regist = ($this->r60_regist == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_regist\"]:$this->r60_regist);\n $this->r60_folha = ($this->r60_folha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_folha\"]:$this->r60_folha);\n $this->r60_base = ($this->r60_base == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_base\"]:$this->r60_base);\n $this->r60_dprev = ($this->r60_dprev == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_dprev\"]:$this->r60_dprev);\n $this->r60_pdesc = ($this->r60_pdesc == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_pdesc\"]:$this->r60_pdesc);\n $this->r60_novod = ($this->r60_novod == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_novod\"]:$this->r60_novod);\n $this->r60_novop = ($this->r60_novop == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_novop\"]:$this->r60_novop);\n $this->r60_altera = ($this->r60_altera == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_altera\"]:$this->r60_altera);\n $this->r60_ajuste = ($this->r60_ajuste == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_ajuste\"]:$this->r60_ajuste);\n $this->r60_basef = ($this->r60_basef == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_basef\"]:$this->r60_basef);\n }else{\n $this->r60_anousu = ($this->r60_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_anousu\"]:$this->r60_anousu);\n $this->r60_mesusu = ($this->r60_mesusu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_mesusu\"]:$this->r60_mesusu);\n $this->r60_numcgm = ($this->r60_numcgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_numcgm\"]:$this->r60_numcgm);\n $this->r60_tbprev = ($this->r60_tbprev == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_tbprev\"]:$this->r60_tbprev);\n $this->r60_rubric = ($this->r60_rubric == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_rubric\"]:$this->r60_rubric);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ov01_sequencial = ($this->ov01_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_sequencial\"]:$this->ov01_sequencial);\n $this->ov01_situacaoouvidoriaatendimento = ($this->ov01_situacaoouvidoriaatendimento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_situacaoouvidoriaatendimento\"]:$this->ov01_situacaoouvidoriaatendimento);\n $this->ov01_tipoprocesso = ($this->ov01_tipoprocesso == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_tipoprocesso\"]:$this->ov01_tipoprocesso);\n $this->ov01_formareclamacao = ($this->ov01_formareclamacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_formareclamacao\"]:$this->ov01_formareclamacao);\n $this->ov01_tipoidentificacao = ($this->ov01_tipoidentificacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_tipoidentificacao\"]:$this->ov01_tipoidentificacao);\n $this->ov01_usuario = ($this->ov01_usuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_usuario\"]:$this->ov01_usuario);\n $this->ov01_depart = ($this->ov01_depart == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_depart\"]:$this->ov01_depart);\n $this->ov01_instit = ($this->ov01_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_instit\"]:$this->ov01_instit);\n $this->ov01_numero = ($this->ov01_numero == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_numero\"]:$this->ov01_numero);\n $this->ov01_anousu = ($this->ov01_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_anousu\"]:$this->ov01_anousu);\n if($this->ov01_dataatend == \"\"){\n $this->ov01_dataatend_dia = ($this->ov01_dataatend_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_dataatend_dia\"]:$this->ov01_dataatend_dia);\n $this->ov01_dataatend_mes = ($this->ov01_dataatend_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_dataatend_mes\"]:$this->ov01_dataatend_mes);\n $this->ov01_dataatend_ano = ($this->ov01_dataatend_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_dataatend_ano\"]:$this->ov01_dataatend_ano);\n if($this->ov01_dataatend_dia != \"\"){\n $this->ov01_dataatend = $this->ov01_dataatend_ano.\"-\".$this->ov01_dataatend_mes.\"-\".$this->ov01_dataatend_dia;\n }\n }\n $this->ov01_horaatend = ($this->ov01_horaatend == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_horaatend\"]:$this->ov01_horaatend);\n $this->ov01_requerente = ($this->ov01_requerente == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_requerente\"]:$this->ov01_requerente);\n $this->ov01_solicitacao = ($this->ov01_solicitacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_solicitacao\"]:$this->ov01_solicitacao);\n $this->ov01_executado = ($this->ov01_executado == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_executado\"]:$this->ov01_executado);\n }else{\n $this->ov01_sequencial = ($this->ov01_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_sequencial\"]:$this->ov01_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed77_i_codigo = ($this->ed77_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_codigo\"]:$this->ed77_i_codigo);\n $this->ed77_i_base = ($this->ed77_i_base == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_base\"]:$this->ed77_i_base);\n $this->ed77_i_escola = ($this->ed77_i_escola == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_escola\"]:$this->ed77_i_escola);\n $this->ed77_i_basecont = ($this->ed77_i_basecont == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_basecont\"]:$this->ed77_i_basecont);\n }else{\n $this->ed77_i_codigo = ($this->ed77_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_codigo\"]:$this->ed77_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed03_i_codigo = ($this->ed03_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_codigo\"]:$this->ed03_i_codigo);\n $this->ed03_i_rechumanoativ = ($this->ed03_i_rechumanoativ == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_rechumanoativ\"]:$this->ed03_i_rechumanoativ);\n $this->ed03_i_relacaotrabalho = ($this->ed03_i_relacaotrabalho == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_relacaotrabalho\"]:$this->ed03_i_relacaotrabalho);\n }else{\n $this->ed03_i_codigo = ($this->ed03_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_codigo\"]:$this->ed03_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->rh54_seq = ($this->rh54_seq == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh54_seq\"]:$this->rh54_seq);\n $this->rh54_regist = ($this->rh54_regist == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh54_regist\"]:$this->rh54_regist);\n $this->rh54_base = ($this->rh54_base == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh54_base\"]:$this->rh54_base);\n $this->rh54_rubric = ($this->rh54_rubric == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh54_rubric\"]:$this->rh54_rubric);\n }else{\n $this->rh54_seq = ($this->rh54_seq == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh54_seq\"]:$this->rh54_seq);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->v59_inicial = ($this->v59_inicial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v59_inicial\"]:$this->v59_inicial);\n $this->v59_numpre = ($this->v59_numpre == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v59_numpre\"]:$this->v59_numpre);\n }else{\n $this->v59_inicial = ($this->v59_inicial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v59_inicial\"]:$this->v59_inicial);\n $this->v59_numpre = ($this->v59_numpre == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v59_numpre\"]:$this->v59_numpre);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed20_i_codigo = ($this->ed20_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_codigo\"]:$this->ed20_i_codigo);\n $this->ed20_c_outroscursos = ($this->ed20_c_outroscursos == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_outroscursos\"]:$this->ed20_c_outroscursos);\n $this->ed20_c_posgraduacao = ($this->ed20_c_posgraduacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_posgraduacao\"]:$this->ed20_c_posgraduacao);\n $this->ed20_i_escolaridade = ($this->ed20_i_escolaridade == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_escolaridade\"]:$this->ed20_i_escolaridade);\n $this->ed20_i_censomunicender = ($this->ed20_i_censomunicender == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censomunicender\"]:$this->ed20_i_censomunicender);\n $this->ed20_i_censoufender = ($this->ed20_i_censoufender == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censoufender\"]:$this->ed20_i_censoufender);\n $this->ed20_c_passaporte = ($this->ed20_c_passaporte == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_passaporte\"]:$this->ed20_c_passaporte);\n $this->ed20_i_censoufcert = ($this->ed20_i_censoufcert == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censoufcert\"]:$this->ed20_i_censoufcert);\n $this->ed20_c_certidaocart = ($this->ed20_c_certidaocart == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaocart\"]:$this->ed20_c_certidaocart);\n if($this->ed20_c_certidaodata == \"\"){\n $this->ed20_c_certidaodata_dia = ($this->ed20_c_certidaodata_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaodata_dia\"]:$this->ed20_c_certidaodata_dia);\n $this->ed20_c_certidaodata_mes = ($this->ed20_c_certidaodata_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaodata_mes\"]:$this->ed20_c_certidaodata_mes);\n $this->ed20_c_certidaodata_ano = ($this->ed20_c_certidaodata_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaodata_ano\"]:$this->ed20_c_certidaodata_ano);\n if($this->ed20_c_certidaodata_dia != \"\"){\n $this->ed20_c_certidaodata = $this->ed20_c_certidaodata_ano.\"-\".$this->ed20_c_certidaodata_mes.\"-\".$this->ed20_c_certidaodata_dia;\n }\n }\n $this->ed20_c_certidaolivro = ($this->ed20_c_certidaolivro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaolivro\"]:$this->ed20_c_certidaolivro);\n $this->ed20_c_certidaofolha = ($this->ed20_c_certidaofolha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaofolha\"]:$this->ed20_c_certidaofolha);\n $this->ed20_c_certidaonum = ($this->ed20_c_certidaonum == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaonum\"]:$this->ed20_c_certidaonum);\n $this->ed20_i_certidaotipo = ($this->ed20_i_certidaotipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_certidaotipo\"]:$this->ed20_i_certidaotipo);\n if($this->ed20_d_dataident == \"\"){\n $this->ed20_d_dataident_dia = ($this->ed20_d_dataident_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_d_dataident_dia\"]:$this->ed20_d_dataident_dia);\n $this->ed20_d_dataident_mes = ($this->ed20_d_dataident_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_d_dataident_mes\"]:$this->ed20_d_dataident_mes);\n $this->ed20_d_dataident_ano = ($this->ed20_d_dataident_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_d_dataident_ano\"]:$this->ed20_d_dataident_ano);\n if($this->ed20_d_dataident_dia != \"\"){\n $this->ed20_d_dataident = $this->ed20_d_dataident_ano.\"-\".$this->ed20_d_dataident_mes.\"-\".$this->ed20_d_dataident_dia;\n }\n }\n $this->ed20_i_censoufident = ($this->ed20_i_censoufident == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censoufident\"]:$this->ed20_i_censoufident);\n $this->ed20_i_censoorgemiss = ($this->ed20_i_censoorgemiss == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censoorgemiss\"]:$this->ed20_i_censoorgemiss);\n $this->ed20_c_identcompl = ($this->ed20_c_identcompl == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_identcompl\"]:$this->ed20_c_identcompl);\n $this->ed20_i_censomunicnat = ($this->ed20_i_censomunicnat == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censomunicnat\"]:$this->ed20_i_censomunicnat);\n $this->ed20_i_censoufnat = ($this->ed20_i_censoufnat == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censoufnat\"]:$this->ed20_i_censoufnat);\n $this->ed20_i_nacionalidade = ($this->ed20_i_nacionalidade == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_nacionalidade\"]:$this->ed20_i_nacionalidade);\n $this->ed20_i_raca = ($this->ed20_i_raca == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_raca\"]:$this->ed20_i_raca);\n $this->ed20_c_nis = ($this->ed20_c_nis == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_nis\"]:$this->ed20_c_nis);\n $this->ed20_i_codigoinep = ($this->ed20_i_codigoinep == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_codigoinep\"]:$this->ed20_i_codigoinep);\n $this->ed20_i_pais = ($this->ed20_i_pais == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_pais\"]:$this->ed20_i_pais);\n $this->ed20_i_tiposervidor = ($this->ed20_i_tiposervidor == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_tiposervidor\"]:$this->ed20_i_tiposervidor);\n $this->ed20_i_rhregime = ($this->ed20_i_rhregime == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_rhregime\"]:$this->ed20_i_rhregime);\n $this->ed20_c_efetividade = ($this->ed20_c_efetividade == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_efetividade\"]:$this->ed20_c_efetividade);\n $this->ed20_i_censocartorio = ($this->ed20_i_censocartorio == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censocartorio\"]:$this->ed20_i_censocartorio);\n $this->ed20_i_zonaresidencia = ($this->ed20_i_zonaresidencia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_zonaresidencia\"]:$this->ed20_i_zonaresidencia);\n }else{\n $this->ed20_i_codigo = ($this->ed20_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_codigo\"]:$this->ed20_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->tf33_i_codigo = ($this->tf33_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_i_codigo\"]:$this->tf33_i_codigo);\n $this->tf33_i_login = ($this->tf33_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_i_login\"]:$this->tf33_i_login);\n $this->tf33_i_fechamento = ($this->tf33_i_fechamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_i_fechamento\"]:$this->tf33_i_fechamento);\n $this->tf33_c_nomearquivo = ($this->tf33_c_nomearquivo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_c_nomearquivo\"]:$this->tf33_c_nomearquivo);\n if($this->tf33_d_datasistema == \"\"){\n $this->tf33_d_datasistema_dia = ($this->tf33_d_datasistema_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_d_datasistema_dia\"]:$this->tf33_d_datasistema_dia);\n $this->tf33_d_datasistema_mes = ($this->tf33_d_datasistema_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_d_datasistema_mes\"]:$this->tf33_d_datasistema_mes);\n $this->tf33_d_datasistema_ano = ($this->tf33_d_datasistema_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_d_datasistema_ano\"]:$this->tf33_d_datasistema_ano);\n if($this->tf33_d_datasistema_dia != \"\"){\n $this->tf33_d_datasistema = $this->tf33_d_datasistema_ano.\"-\".$this->tf33_d_datasistema_mes.\"-\".$this->tf33_d_datasistema_dia;\n }\n }\n $this->tf33_c_horasistema = ($this->tf33_c_horasistema == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_c_horasistema\"]:$this->tf33_c_horasistema);\n $this->tf33_o_arquivo = ($this->tf33_o_arquivo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_o_arquivo\"]:$this->tf33_o_arquivo);\n }else{\n $this->tf33_i_codigo = ($this->tf33_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_i_codigo\"]:$this->tf33_i_codigo);\n }\n }", "public function actualizar_Datos_Usuario2(){\n\t\t$sql = \"UPDATE usuarios SET Documento=\".$this->usuario->get_Nid().\",\n\t\t\t\t\t\t\t\t\tNombres='\".$this->usuario->get_Nombres().\"',\n\t\t\t\t\t\t\t\t\tApellidos = '\".$this->usuario->get_Apellidos().\"',\n\t\t\t\t\t\t\t\t\tUsuario = '\".$this->usuario->get_Usuario().\"',\n\t\t\t\t\t\t\t\t\tPregunta = '\".$this->usuario->get_Pregunta().\"',\n\t\t\t\t\t\t\t\t\tRespuesta = '\".$this->usuario->get_Respuesta().\"',\n\t\t\t\t\t\t\t\t\tTipo_Documento = '\".$this->usuario->get_TipoId().\"',\n\t\t\t\t\t\t\t\t\tCiudad = '\".$this->usuario->get_Ciudad().\"',\n\t\t\t\t\t\t\t\t\tDireccion = '\".$this->usuario->get_Direccion().\"',\n\t\t\t\t\t\t\t\t\tEdad = '\".$this->usuario->get_Edad().\"',\n\t\t\t\t\t\t\t\t\tFoto = '\".$this->usuario->get_Foto().\"',\n\t\t\t\t\t\t\t\t\tTelefono = '\".$this->usuario->get_Celular().\"',\n\t\t\t\t\t\t\t\t\tCorreo_Electronico = '\".$this->usuario->get_Email().\"',\n\t\t\t\t\t\t\t\t\tGenero = '\".$this->usuario->get_Genero().\"',\n\t\t\t\t\t\t\t\t\tperfiles_Nombre = '\".$this->usuario->get_Perfil().\"'\n\t\t\t WHERE Documento=\".$this->usuario->get_Nid().\"\";\n\n\n\n\t\t//echo $sql;\n\t\t$salida = 0;\n\t\t$valida = new Validacion_Datos(); // <- Para validar los tipos de datos\n\t\t// Validacion de los minimos\n\t\tif(!(strlen($this->usuario->get_Nid()) > 7))\t\t\t$salida = 2;\n\t\telseif(!(strlen($this->usuario->get_Nombres()) > 1))\t$salida = 3;\n\t\telseif(!(strlen($this->usuario->get_Apellidos()) > 1))\t$salida = 4;\n\t\telseif(!(strlen($this->usuario->get_Usuario()) > 4))\t$salida = 5;\n\t\telseif(!(strlen($this->usuario->get_Pregunta()) > 9))\t$salida = 7;\n\t\telseif(!(strlen($this->usuario->get_Respuesta()) > 1))\t$salida = 8;\n\t\telseif(!(strlen($this->usuario->get_Ciudad()) > 1))\t\t$salida = 10;\n\t\telseif(!(strlen($this->usuario->get_Direccion()) > 2))\t$salida = 11;\n\t\telseif(!(strlen($this->usuario->get_Edad()) > 0))\t\t$salida = 12;\n\t\telseif(!(strlen($this->usuario->get_Foto()) > 2))\t\t$salida = 13;\n\t\telseif(!(strlen($this->usuario->get_Celular()) > 7))\t$salida = 14;\n\t\telseif(!(strlen($this->usuario->get_Email()) > 6))\t\t$salida = 15;\n\t\t// Validacion de los tipos de datos (Numérico,Alfabético,Alfanumérico)\n\t\telseif(!($valida->is_Number($this->usuario->get_Nid())))\t\t\t\t$salida = 18;\n\t\telseif(!($valida->is_Alphanumeric($this->usuario->get_Usuario())))\t\t$salida = 19;\n\t\telseif(!($valida->is_Alphabetic($this->usuario->get_Nombres())))\t\t$salida = 20;\n\t\telseif(!($valida->is_Alphabetic($this->usuario->get_Apellidos())))\t\t$salida = 21;\n\t\telseif(!($valida->is_Alphanumeric($this->usuario->get_Respuesta())))\t$salida = 24;\n\t\telseif(!($valida->is_Alphabetic($this->usuario->get_Ciudad())))\t\t\t$salida = 25;\n\t\telseif(!($valida->is_Number($this->usuario->get_Edad())))\t\t\t\t$salida = 26;\n\t\telseif(!($valida->is_Number($this->usuario->get_Celular())))\t\t\t$salida = 28;\n\n\n\t\t///////////////////////////////////////////////////////////////////////////\n\n\t\t\n\t\telseif($this->bd->insertar($sql))\n\t\t\t$salida = true;\n\t\telse $salida = 31;\n\t\t\n\n\t\treturn $salida;\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed07_i_codigo = ($this->ed07_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_i_codigo\"]:$this->ed07_i_codigo);\n $this->ed07_c_senha = ($this->ed07_c_senha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_senha\"]:$this->ed07_c_senha);\n $this->ed07_c_necessidades = ($this->ed07_c_necessidades == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_necessidades\"]:$this->ed07_c_necessidades);\n $this->ed07_c_foto = ($this->ed07_c_foto == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_foto\"]:$this->ed07_c_foto);\n $this->ed07_t_descr = ($this->ed07_t_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_t_descr\"]:$this->ed07_t_descr);\n $this->ed07_i_responsavel = ($this->ed07_i_responsavel == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_i_responsavel\"]:$this->ed07_i_responsavel);\n $this->ed07_c_certidao = ($this->ed07_c_certidao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_certidao\"]:$this->ed07_c_certidao);\n $this->ed07_c_cartorio = ($this->ed07_c_cartorio == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_cartorio\"]:$this->ed07_c_cartorio);\n $this->ed07_c_livro = ($this->ed07_c_livro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_livro\"]:$this->ed07_c_livro);\n $this->ed07_c_folha = ($this->ed07_c_folha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_folha\"]:$this->ed07_c_folha);\n if($this->ed07_d_datacert == \"\"){\n $this->ed07_d_datacert_dia = ($this->ed07_d_datacert_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_d_datacert_dia\"]:$this->ed07_d_datacert_dia);\n $this->ed07_d_datacert_mes = ($this->ed07_d_datacert_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_d_datacert_mes\"]:$this->ed07_d_datacert_mes);\n $this->ed07_d_datacert_ano = ($this->ed07_d_datacert_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_d_datacert_ano\"]:$this->ed07_d_datacert_ano);\n if($this->ed07_d_datacert_dia != \"\"){\n $this->ed07_d_datacert = $this->ed07_d_datacert_ano.\"-\".$this->ed07_d_datacert_mes.\"-\".$this->ed07_d_datacert_dia;\n }\n }\n $this->ed07_t_pendentes = ($this->ed07_t_pendentes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_t_pendentes\"]:$this->ed07_t_pendentes);\n }else{\n $this->ed07_i_codigo = ($this->ed07_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_i_codigo\"]:$this->ed07_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->rh55_instit = ($this->rh55_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh55_instit\"]:$this->rh55_instit);\n $this->rh55_codigo = ($this->rh55_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh55_codigo\"]:$this->rh55_codigo);\n $this->rh55_estrut = ($this->rh55_estrut == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh55_estrut\"]:$this->rh55_estrut);\n $this->rh55_descr = ($this->rh55_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh55_descr\"]:$this->rh55_descr);\n }else{\n $this->rh55_instit = ($this->rh55_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh55_instit\"]:$this->rh55_instit);\n $this->rh55_codigo = ($this->rh55_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh55_codigo\"]:$this->rh55_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed339_sequencial = ($this->ed339_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed339_sequencial\"]:$this->ed339_sequencial);\n $this->ed339_criterioavaliacao = ($this->ed339_criterioavaliacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed339_criterioavaliacao\"]:$this->ed339_criterioavaliacao);\n $this->ed339_disciplina = ($this->ed339_disciplina == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed339_disciplina\"]:$this->ed339_disciplina);\n }else{\n $this->ed339_sequencial = ($this->ed339_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed339_sequencial\"]:$this->ed339_sequencial);\n }\n }", "function actualizar_usuario($id_colaborador,$nombre,$primer_apellido,$segundo_apellido,$usuario,$password,$email,$t_ruso,$t_arabe,$t_rumano,$t_chino,$t_polaco,$t_bulgaro,$t_ingles,$t_frances,$t_catalan,$gestion_usuarios,$gestion_palabras,$definicion_palabras,$borrar_palabras,$add_imagenes,$borrar_imagenes,$add_simbolos,$borrar_simbolos,$simbolos_especiales) {\n\n\t\t$UpdateRecords = \"UPDATE colaboradores \n\t\tSET nombre='$nombre', primer_apellido='$primer_apellido', segundo_apellido='$segundo_apellido', login='$usuario', password='$password',\n\t\testado='1', email='$email'\n\t\tWHERE id_colaborador='$id_colaborador'\";\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($UpdateRecords); \t\n\t\tmysql_close($connection);\n\t\t\n\t\t$UpdateRecords2 = \"UPDATE colaboradores_permisos\n\t\tSET traduccion_ruso='$t_ruso', traduccion_arabe='$t_arabe', traduccion_rumano='$t_rumano',\n\t\ttraduccion_chino='$t_chino',traduccion_polaco='$t_polaco',traduccion_bulgaro='$t_bulgaro',\n\t\ttraduccion_ingles='$t_ingles',traduccion_frances='$t_frances',traduccion_catalan='$t_catalan',\n\t\tgestion_usuarios='$gestion_usuarios', gestion_palabras='$gestion_palabras', definicion_palabras='$definicion_palabras', \n\t\tborrar_palabras='$borrar_palabras', add_imagenes='$add_imagenes', borrar_imagenes='$borrar_imagenes', add_simbolos='$add_simbolos',\n\t\tborrar_simbolos='$borrar_simbolos', simbolos_especiales='$simbolos_especiales'\n\t\t WHERE id_colaborador='$id_colaborador'\";\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($UpdateRecords2); \n\t\tmysql_close($connection);\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed95_i_codigo = ($this->ed95_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed95_i_codigo\"]:$this->ed95_i_codigo);\n $this->ed95_i_escola = ($this->ed95_i_escola == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed95_i_escola\"]:$this->ed95_i_escola);\n $this->ed95_i_calendario = ($this->ed95_i_calendario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed95_i_calendario\"]:$this->ed95_i_calendario);\n $this->ed95_i_aluno = ($this->ed95_i_aluno == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed95_i_aluno\"]:$this->ed95_i_aluno);\n $this->ed95_i_serie = ($this->ed95_i_serie == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed95_i_serie\"]:$this->ed95_i_serie);\n $this->ed95_i_regencia = ($this->ed95_i_regencia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed95_i_regencia\"]:$this->ed95_i_regencia);\n $this->ed95_c_encerrado = ($this->ed95_c_encerrado == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed95_c_encerrado\"]:$this->ed95_c_encerrado);\n }else{\n $this->ed95_i_codigo = ($this->ed95_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed95_i_codigo\"]:$this->ed95_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->c27_sequencial = ($this->c27_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c27_sequencial\"]:$this->c27_sequencial);\n $this->c27_contacorrente = ($this->c27_contacorrente == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c27_contacorrente\"]:$this->c27_contacorrente);\n $this->c27_estrutural = ($this->c27_estrutural == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c27_estrutural\"]:$this->c27_estrutural);\n }else{\n $this->c27_sequencial = ($this->c27_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c27_sequencial\"]:$this->c27_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed276_i_codigo = ($this->ed276_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_i_codigo\"]:$this->ed276_i_codigo);\n $this->ed276_i_alunoalt = ($this->ed276_i_alunoalt == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_i_alunoalt\"]:$this->ed276_i_alunoalt);\n $this->ed276_c_campo = ($this->ed276_c_campo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_c_campo\"]:$this->ed276_c_campo);\n $this->ed276_c_contant = ($this->ed276_c_contant == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_c_contant\"]:$this->ed276_c_contant);\n $this->ed276_c_contatual = ($this->ed276_c_contatual == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_c_contatual\"]:$this->ed276_c_contatual);\n }else{\n $this->ed276_i_codigo = ($this->ed276_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_i_codigo\"]:$this->ed276_i_codigo);\n }\n }", "function Actualizar() {\n /**\n * Crear instancia de EstacionHidrometrica\n */\n $EstacionHidrometrica = new EstacionHidrometrica();\n /**\n * Colocar los datos del POST por medio de los metodos SET\n */\n $EstacionHidrometrica->setIdEstacion(filter_input(INPUT_GET, 'clave'));\n $EstacionHidrometrica->setNombre(filter_input(INPUT_GET, 'nombre'));\n $EstacionHidrometrica->setCuenca_id(filter_input(INPUT_GET, 'cuenca_id'));\n $EstacionHidrometrica->setCorriente(filter_input(INPUT_GET, 'corriente'));\n $EstacionHidrometrica->setRegion_id(filter_input(INPUT_GET, 'region_id'));\n $EstacionHidrometrica->setEstado_id(filter_input(INPUT_GET, 'estado_id'));\n $EstacionHidrometrica->setLatitud(filter_input(INPUT_GET, 'latitud'));\n $EstacionHidrometrica->setLongitud(filter_input(INPUT_GET, 'longitud'));\n if ($EstacionHidrometrica->Update() != null) {\n echo 'OK';\n } else {\n echo 'Algo salío mal :(';\n }\n}", "public function PrePersist(){\n $this->login = strtolower($this->login);\n $this->activo = false;\n $this->creadoEl = new \\DateTime();\n }", "public function actualizar()\n\t{\n\n $datos = Input::all();\n\n foreach($datos['cuota'] as $dato ){\n $repo = $this->prestamosCuotasRepo->find($dato['id']);\n $manager = new PrestamosCuotasManager($repo,$dato);\n $manager->save();\n }\n\n return Redirect::back()->with('mensaje_exito','Prestamo Editado Correctamente!');\n\n\n\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->c72_sequencial = ($this->c72_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c72_sequencial\"]:$this->c72_sequencial);\n $this->c72_conplano = ($this->c72_conplano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c72_conplano\"]:$this->c72_conplano);\n $this->c72_conplanoorcamento = ($this->c72_conplanoorcamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c72_conplanoorcamento\"]:$this->c72_conplanoorcamento);\n $this->c72_anousu = ($this->c72_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c72_anousu\"]:$this->c72_anousu);\n }else{\n $this->c72_sequencial = ($this->c72_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c72_sequencial\"]:$this->c72_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->sd77_i_codigo = ($this->sd77_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"sd77_i_codigo\"]:$this->sd77_i_codigo);\n $this->sd77_i_procedimento = ($this->sd77_i_procedimento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"sd77_i_procedimento\"]:$this->sd77_i_procedimento);\n $this->sd77_i_habilitacao = ($this->sd77_i_habilitacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"sd77_i_habilitacao\"]:$this->sd77_i_habilitacao);\n $this->sd77_i_grupohabilitacao = ($this->sd77_i_grupohabilitacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"sd77_i_grupohabilitacao\"]:$this->sd77_i_grupohabilitacao);\n $this->sd77_i_anocomp = ($this->sd77_i_anocomp == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"sd77_i_anocomp\"]:$this->sd77_i_anocomp);\n $this->sd77_i_mescomp = ($this->sd77_i_mescomp == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"sd77_i_mescomp\"]:$this->sd77_i_mescomp);\n }else{\n $this->sd77_i_codigo = ($this->sd77_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"sd77_i_codigo\"]:$this->sd77_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->s158_i_codigo = ($this->s158_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_i_codigo\"]:$this->s158_i_codigo);\n $this->s158_i_profissional = ($this->s158_i_profissional == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_i_profissional\"]:$this->s158_i_profissional);\n $this->s158_i_tiporeceita = ($this->s158_i_tiporeceita == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_i_tiporeceita\"]:$this->s158_i_tiporeceita);\n $this->s158_t_prescricao = ($this->s158_t_prescricao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_t_prescricao\"]:$this->s158_t_prescricao);\n $this->s158_i_situacao = ($this->s158_i_situacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_i_situacao\"]:$this->s158_i_situacao);\n if($this->s158_d_validade == \"\"){\n $this->s158_d_validade_dia = ($this->s158_d_validade_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_d_validade_dia\"]:$this->s158_d_validade_dia);\n $this->s158_d_validade_mes = ($this->s158_d_validade_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_d_validade_mes\"]:$this->s158_d_validade_mes);\n $this->s158_d_validade_ano = ($this->s158_d_validade_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_d_validade_ano\"]:$this->s158_d_validade_ano);\n if($this->s158_d_validade_dia != \"\"){\n $this->s158_d_validade = $this->s158_d_validade_ano.\"-\".$this->s158_d_validade_mes.\"-\".$this->s158_d_validade_dia;\n }\n }\n $this->s158_i_login = ($this->s158_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_i_login\"]:$this->s158_i_login);\n if($this->s158_d_data == \"\"){\n $this->s158_d_data_dia = ($this->s158_d_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_d_data_dia\"]:$this->s158_d_data_dia);\n $this->s158_d_data_mes = ($this->s158_d_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_d_data_mes\"]:$this->s158_d_data_mes);\n $this->s158_d_data_ano = ($this->s158_d_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_d_data_ano\"]:$this->s158_d_data_ano);\n if($this->s158_d_data_dia != \"\"){\n $this->s158_d_data = $this->s158_d_data_ano.\"-\".$this->s158_d_data_mes.\"-\".$this->s158_d_data_dia;\n }\n }\n $this->s158_c_hora = ($this->s158_c_hora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_c_hora\"]:$this->s158_c_hora);\n }else{\n $this->s158_i_codigo = ($this->s158_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s158_i_codigo\"]:$this->s158_i_codigo);\n }\n }", "public function actualizar($objeto){\r\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->am10_sequencial = ($this->am10_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am10_sequencial\"]:$this->am10_sequencial);\n $this->am10_descricao = ($this->am10_descricao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am10_descricao\"]:$this->am10_descricao);\n $this->am10_padrao = ($this->am10_padrao == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am10_padrao\"]:$this->am10_padrao);\n $this->am10_vinculatodasatividades = ($this->am10_vinculatodasatividades == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am10_vinculatodasatividades\"]:$this->am10_vinculatodasatividades);\n }else{\n $this->am10_sequencial = ($this->am10_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am10_sequencial\"]:$this->am10_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->k142_sequencial = ($this->k142_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_sequencial\"]:$this->k142_sequencial);\n $this->k142_idret = ($this->k142_idret == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_idret\"]:$this->k142_idret);\n $this->k142_processo = ($this->k142_processo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_processo\"]:$this->k142_processo);\n if($this->k142_dataprocesso == \"\"){\n $this->k142_dataprocesso_dia = ($this->k142_dataprocesso_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_dia\"]:$this->k142_dataprocesso_dia);\n $this->k142_dataprocesso_mes = ($this->k142_dataprocesso_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_mes\"]:$this->k142_dataprocesso_mes);\n $this->k142_dataprocesso_ano = ($this->k142_dataprocesso_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_ano\"]:$this->k142_dataprocesso_ano);\n if($this->k142_dataprocesso_dia != \"\"){\n $this->k142_dataprocesso = $this->k142_dataprocesso_ano.\"-\".$this->k142_dataprocesso_mes.\"-\".$this->k142_dataprocesso_dia;\n }\n }\n $this->k142_titular = ($this->k142_titular == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_titular\"]:$this->k142_titular);\n $this->k142_observacao = ($this->k142_observacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_observacao\"]:$this->k142_observacao);\n }else{\n $this->k142_sequencial = ($this->k142_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_sequencial\"]:$this->k142_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed315_sequencial = ($this->ed315_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed315_sequencial\"]:$this->ed315_sequencial);\n $this->ed315_escola = ($this->ed315_escola == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed315_escola\"]:$this->ed315_escola);\n $this->ed315_db_estrutura = ($this->ed315_db_estrutura == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed315_db_estrutura\"]:$this->ed315_db_estrutura);\n $this->ed315_ativo = ($this->ed315_ativo == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed315_ativo\"]:$this->ed315_ativo);\n $this->ed315_arredondamedia = ($this->ed315_arredondamedia == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed315_arredondamedia\"]:$this->ed315_arredondamedia);\n $this->ed315_observacao = ($this->ed315_observacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed315_observacao\"]:$this->ed315_observacao);\n $this->ed315_ano = ($this->ed315_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed315_ano\"]:$this->ed315_ano);\n }else{\n $this->ed315_sequencial = ($this->ed315_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed315_sequencial\"]:$this->ed315_sequencial);\n }\n }", "public function actualizar()\n {\n // Comprobar si esta logeado como admin\n if( isset($_SESSION['admin']) ){\n\n // Capturar el id enviado por GET\n $id = $_POST['idTipoReporte'];\n\n // Encontra el usuario por el id capturado y guardarlo en una variable\n $tipoReporte = TipoReporte::encontrarPorID($id);\n\n\n // Pasarle los datos a la instancia\n $tipoReporte->reporte = $_POST['tipoReporte'];\n\n\n // Guardar el Reporte\n $res = $tipoReporte->guardar();\n\n\n // Comprobar si se actualizo correctamente el tipo de reporte en la db\n if ($res == 1) {\n $msg = \"El tipo de reporte se actualizo exitosamente\";\n } else {\n $msg = \"Error al actualizar el reporte\";\n }\n\n // Guardar mensaje con el resultado de la operacion de actualizar al usuario en una cookie\n setcookie('mensaje', $msg, time() + 5, '/');\n\n // Redirigir a la tabla con todos los tipos de reporte\n header('Location: ../reportes/tipos_reporte');\n\n\n } else {\n // Redirigir al perfil\n header('Location: ../perfil');\n }\n\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->rh153_sequencial = ($this->rh153_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh153_sequencial\"]:$this->rh153_sequencial);\n $this->rh153_consignadomovimentoservidor = ($this->rh153_consignadomovimentoservidor == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh153_consignadomovimentoservidor\"]:$this->rh153_consignadomovimentoservidor);\n $this->rh153_instit = ($this->rh153_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh153_instit\"]:$this->rh153_instit);\n $this->rh153_rubrica = ($this->rh153_rubrica == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh153_rubrica\"]:$this->rh153_rubrica);\n $this->rh153_valordescontar = ($this->rh153_valordescontar == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh153_valordescontar\"]:$this->rh153_valordescontar);\n $this->rh153_valordescontado = ($this->rh153_valordescontado == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh153_valordescontado\"]:$this->rh153_valordescontado);\n $this->rh153_parcela = ($this->rh153_parcela == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh153_parcela\"]:$this->rh153_parcela);\n $this->rh153_totalparcelas = ($this->rh153_totalparcelas == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh153_totalparcelas\"]:$this->rh153_totalparcelas);\n }else{\n $this->rh153_sequencial = ($this->rh153_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh153_sequencial\"]:$this->rh153_sequencial);\n }\n }", "function evt__form_pase__modificacion($datos)\r\n\t{\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n $datos['id_cargo']=$car['id_cargo'];\r\n \r\n \r\n //print_r($pase_nuevo);exit;\r\n if($this->dep('datos')->tabla('pase')->esta_cargada()){//es modificacion\r\n $pas=$this->dep('datos')->tabla('pase')->get();\r\n if($pas['tipo']<>$datos['tipo']){\r\n toba::notificacion()->agregar('no puede cambiar el tipo del pase', 'info'); \r\n }else{\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n }\r\n }else{//es alta de un pase nuevo\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n $pase_nuevo=$this->dep('datos')->tabla('pase')->get();\r\n $p['id_pase']=$pase_nuevo['id_pase'];\r\n $this->dep('datos')->tabla('pase')->cargar($p);//lo cargo para que se sigan viendo los datos en el formulario\r\n if($datos['tipo']=='T'){//si el pase es temporal\r\n //ingreso un cargo en la unidad destino\r\n //la ingresa con fecha de alta = desde\r\n $nuevo_cargo['id_persona']=$car['id_persona'];\r\n $nuevo_cargo['codc_carac']=$car['codc_carac'];\r\n $nuevo_cargo['codc_categ']=$car['codc_categ'];\r\n $nuevo_cargo['codc_agrup']=$car['codc_agrup'];\r\n $nuevo_cargo['chkstopliq']=$car['chkstopliq'];\r\n $nuevo_cargo['fec_alta']=$datos['desde'];\r\n $nuevo_cargo['pertenece_a']=$datos['destino'];\r\n $nuevo_cargo['generado_x_pase']=$pase_nuevo['id_pase']; \r\n $res=$this->controlador()->dep('datos')->tabla('cargo')->agregar_cargo($nuevo_cargo);\r\n if($res==1){\r\n toba::notificacion()->agregar('Se ha creado un nuevo cargo en el destino del pase', 'info');\r\n }\r\n \r\n }else{//pase definitivo entonces tengo que modificar la fecha del cargo en la unidad destino con la fecha de alta del definitivo\r\n $nuevafecha = strtotime ( '-1 day' , strtotime ( $datos['desde'] ) ) ;\r\n $nuevafecha = date ( 'Y-m-d' , $nuevafecha );\r\n //print_r($nuevafecha);exit;\r\n $salida=$this->controlador()->dep('datos')->tabla('cargo')->modificar_alta($datos['id_cargo'],$datos['destino'],$datos['desde']);\r\n //le coloca fecha de baja al cargo de la unidad origen\r\n $this->controlador()->dep('datos')->tabla('cargo')->finaliza_cargo($datos['id_cargo'],$nuevafecha);\r\n if($salida==1){\r\n toba::notificacion()->agregar('Se ha modificado la fecha del cargo generado a partir del pase temporal', 'info');\r\n }\r\n \r\n } \r\n }\r\n \r\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->t74_sequencial = ($this->t74_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"t74_sequencial\"]:$this->t74_sequencial);\n $this->t74_usuario = ($this->t74_usuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"t74_usuario\"]:$this->t74_usuario);\n if($this->t74_data == \"\"){\n $this->t74_data_dia = ($this->t74_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"t74_data_dia\"]:$this->t74_data_dia);\n $this->t74_data_mes = ($this->t74_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"t74_data_mes\"]:$this->t74_data_mes);\n $this->t74_data_ano = ($this->t74_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"t74_data_ano\"]:$this->t74_data_ano);\n if($this->t74_data_dia != \"\"){\n $this->t74_data = $this->t74_data_ano.\"-\".$this->t74_data_mes.\"-\".$this->t74_data_dia;\n }\n }\n $this->t74_hora = ($this->t74_hora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"t74_hora\"]:$this->t74_hora);\n }else{\n $this->t74_sequencial = ($this->t74_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"t74_sequencial\"]:$this->t74_sequencial);\n }\n }", "public function actualizarEstablecimiento() {\n $establecimientoMapper = new Establecimientomapper();\n // Se recupera el establecimiento\n $idEstablecimiento = $_SESSION['id'];\n $establecimiento = $establecimientoMapper->recuperarEstablecimiento($idEstablecimiento);\n // Se recuperan los datos del formulario\n $nombre = $_POST['inputNombreNuevoEstablecimiento'];\n $direccion = $_POST['inputDireccionNuevoEstablecimiento'];\n $localizacion = $_POST['inputLocalizacionNuevoEstablecimiento'];\n $descripcion = $_POST['inputDescripcionNuevoEstablecimiento'];\n // Se actualiza el objeto establecimiento\n $establecimiento->set_nombre($nombre);\n $establecimiento->set_direccion($direccion);\n $establecimiento->set_localizacion($localizacion);\n $establecimiento->set_descripcion($descripcion);\n // Se intenta actualizar en la base de datos\n $operacionCorrecta = $establecimientoMapper->modificarEstablecimiento($establecimiento);\n if($operacionCorrecta){\n $mensajes[] = \"Se ha <strong>actualizado</strong> el establecimiento!\";\n $_SESSION['mensajes'] = $mensajes;\n header(\"Location: ?controller=establecimiento&action=index\");\n }\n else{\n $mensajes[] = \"<strong>Error!</strong> No se han podido actualizar el establecimiento\";\n $_SESSION['mensajes'] = $mensajes;\n header(\"Location: ?controller=establecimiento&action=index\");\n }\n }", "function modificarCuentaServSoc()\n {\n // TODO: Implement modificarCuentaServSoc() method.\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->at36_sequencia = ($this->at36_sequencia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"at36_sequencia\"]:$this->at36_sequencia);\n $this->at36_tarefa = ($this->at36_tarefa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"at36_tarefa\"]:$this->at36_tarefa);\n $this->at36_usuario = ($this->at36_usuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"at36_usuario\"]:$this->at36_usuario);\n if($this->at36_data == \"\"){\n $this->at36_data_dia = ($this->at36_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"at36_data_dia\"]:$this->at36_data_dia);\n $this->at36_data_mes = ($this->at36_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"at36_data_mes\"]:$this->at36_data_mes);\n $this->at36_data_ano = ($this->at36_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"at36_data_ano\"]:$this->at36_data_ano);\n if($this->at36_data_dia != \"\"){\n $this->at36_data = $this->at36_data_ano.\"-\".$this->at36_data_mes.\"-\".$this->at36_data_dia;\n }\n }\n $this->at36_hora = ($this->at36_hora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"at36_hora\"]:$this->at36_hora);\n $this->at36_ip = ($this->at36_ip == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"at36_ip\"]:$this->at36_ip);\n $this->at36_tipo = ($this->at36_tipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"at36_tipo\"]:$this->at36_tipo);\n }else{\n $this->at36_sequencia = ($this->at36_sequencia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"at36_sequencia\"]:$this->at36_sequencia);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->cm16_i_cemiterio = ($this->cm16_i_cemiterio == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_i_cemiterio\"]:$this->cm16_i_cemiterio);\n $this->cm16_c_nome = ($this->cm16_c_nome == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_nome\"]:$this->cm16_c_nome);\n $this->cm16_c_endereco = ($this->cm16_c_endereco == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_endereco\"]:$this->cm16_c_endereco);\n $this->cm16_c_cidade = ($this->cm16_c_cidade == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_cidade\"]:$this->cm16_c_cidade);\n $this->cm16_c_bairro = ($this->cm16_c_bairro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_bairro\"]:$this->cm16_c_bairro);\n $this->cm16_c_cep = ($this->cm16_c_cep == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_cep\"]:$this->cm16_c_cep);\n $this->cm16_c_telefone = ($this->cm16_c_telefone == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_telefone\"]:$this->cm16_c_telefone);\n }else{\n $this->cm16_i_cemiterio = ($this->cm16_i_cemiterio == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_i_cemiterio\"]:$this->cm16_i_cemiterio);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed10_i_codigo = ($this->ed10_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_i_codigo\"]:$this->ed10_i_codigo);\n $this->ed10_i_tipoensino = ($this->ed10_i_tipoensino == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_i_tipoensino\"]:$this->ed10_i_tipoensino);\n $this->ed10_i_grauensino = ($this->ed10_i_grauensino == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_i_grauensino\"]:$this->ed10_i_grauensino);\n $this->ed10_c_descr = ($this->ed10_c_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_c_descr\"]:$this->ed10_c_descr);\n $this->ed10_c_abrev = ($this->ed10_c_abrev == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_c_abrev\"]:$this->ed10_c_abrev);\n $this->ed10_mediacaodidaticopedagogica = ($this->ed10_mediacaodidaticopedagogica == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_mediacaodidaticopedagogica\"]:$this->ed10_mediacaodidaticopedagogica);\n $this->ed10_ordem = ($this->ed10_ordem == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_ordem\"]:$this->ed10_ordem);\n $this->ed10_censocursoprofiss = ($this->ed10_censocursoprofiss == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_censocursoprofiss\"]:$this->ed10_censocursoprofiss);\n }else{\n $this->ed10_i_codigo = ($this->ed10_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_i_codigo\"]:$this->ed10_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->v30_sequencial = ($this->v30_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_sequencial\"]:$this->v30_sequencial);\n $this->v30_receita = ($this->v30_receita == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_receita\"]:$this->v30_receita);\n if($this->v30_datageracao == \"\"){\n $this->v30_datageracao_dia = ($this->v30_datageracao_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_datageracao_dia\"]:$this->v30_datageracao_dia);\n $this->v30_datageracao_mes = ($this->v30_datageracao_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_datageracao_mes\"]:$this->v30_datageracao_mes);\n $this->v30_datageracao_ano = ($this->v30_datageracao_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_datageracao_ano\"]:$this->v30_datageracao_ano);\n if($this->v30_datageracao_dia != \"\"){\n $this->v30_datageracao = $this->v30_datageracao_ano.\"-\".$this->v30_datageracao_mes.\"-\".$this->v30_datageracao_dia;\n }\n }\n $this->v30_valorhistorico = ($this->v30_valorhistorico == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorhistorico\"]:$this->v30_valorhistorico);\n $this->v30_valorcorrecao = ($this->v30_valorcorrecao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorcorrecao\"]:$this->v30_valorcorrecao);\n $this->v30_valorpagoparcialhistorico = ($this->v30_valorpagoparcialhistorico == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorpagoparcialhistorico\"]:$this->v30_valorpagoparcialhistorico);\n $this->v30_valorpagoparcial = ($this->v30_valorpagoparcial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorpagoparcial\"]:$this->v30_valorpagoparcial);\n $this->v30_valorpago = ($this->v30_valorpago == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorpago\"]:$this->v30_valorpago);\n $this->v30_valorcancelado = ($this->v30_valorcancelado == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorcancelado\"]:$this->v30_valorcancelado);\n $this->v30_valordesconto = ($this->v30_valordesconto == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valordesconto\"]:$this->v30_valordesconto);\n $this->v30_valorpagohistorico = ($this->v30_valorpagohistorico == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorpagohistorico\"]:$this->v30_valorpagohistorico);\n $this->v30_valorcanceladohistorico = ($this->v30_valorcanceladohistorico == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorcanceladohistorico\"]:$this->v30_valorcanceladohistorico);\n $this->v30_instituicao = ($this->v30_instituicao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_instituicao\"]:$this->v30_instituicao);\n }else{\n $this->v30_sequencial = ($this->v30_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_sequencial\"]:$this->v30_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->am05_sequencial = ($this->am05_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_sequencial\"]:$this->am05_sequencial);\n $this->am05_nome = ($this->am05_nome == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_nome\"]:$this->am05_nome);\n $this->am05_nomefanta = ($this->am05_nomefanta == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_nomefanta\"]:$this->am05_nomefanta);\n $this->am05_numero = ($this->am05_numero == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_numero\"]:$this->am05_numero);\n $this->am05_complemento = ($this->am05_complemento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_complemento\"]:$this->am05_complemento);\n $this->am05_cep = ($this->am05_cep == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_cep\"]:$this->am05_cep);\n $this->am05_bairro = ($this->am05_bairro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_bairro\"]:$this->am05_bairro);\n $this->am05_ruas = ($this->am05_ruas == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_ruas\"]:$this->am05_ruas);\n $this->am05_cnpj = ($this->am05_cnpj == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_cnpj\"]:$this->am05_cnpj);\n $this->am05_cgm = ($this->am05_cgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_cgm\"]:$this->am05_cgm);\n $this->am05_areatotal = ($this->am05_areatotal == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_areatotal\"]:$this->am05_areatotal);\n $this->am05_protprocesso = ($this->am05_protprocesso == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_protprocesso\"]:$this->am05_protprocesso);\n }else{\n $this->am05_sequencial = ($this->am05_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"am05_sequencial\"]:$this->am05_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->x49_sequencial = ($this->x49_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x49_sequencial\"]:$this->x49_sequencial);\n $this->x49_aguacoletor = ($this->x49_aguacoletor == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x49_aguacoletor\"]:$this->x49_aguacoletor);\n $this->x49_instit = ($this->x49_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x49_instit\"]:$this->x49_instit);\n $this->x49_anousu = ($this->x49_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x49_anousu\"]:$this->x49_anousu);\n $this->x49_mesusu = ($this->x49_mesusu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x49_mesusu\"]:$this->x49_mesusu);\n $this->x49_situacao = ($this->x49_situacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x49_situacao\"]:$this->x49_situacao);\n $this->x49_db_layouttxt = ($this->x49_db_layouttxt == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x49_db_layouttxt\"]:$this->x49_db_layouttxt);\n }else{\n $this->x49_sequencial = ($this->x49_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x49_sequencial\"]:$this->x49_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->tf28_i_codigo = ($this->tf28_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_codigo\"]:$this->tf28_i_codigo);\n $this->tf28_i_situacao = ($this->tf28_i_situacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_situacao\"]:$this->tf28_i_situacao);\n $this->tf28_i_pedidotfd = ($this->tf28_i_pedidotfd == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_pedidotfd\"]:$this->tf28_i_pedidotfd);\n if($this->tf28_d_datasistema == \"\"){\n $this->tf28_d_datasistema_dia = ($this->tf28_d_datasistema_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_d_datasistema_dia\"]:$this->tf28_d_datasistema_dia);\n $this->tf28_d_datasistema_mes = ($this->tf28_d_datasistema_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_d_datasistema_mes\"]:$this->tf28_d_datasistema_mes);\n $this->tf28_d_datasistema_ano = ($this->tf28_d_datasistema_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_d_datasistema_ano\"]:$this->tf28_d_datasistema_ano);\n if($this->tf28_d_datasistema_dia != \"\"){\n $this->tf28_d_datasistema = $this->tf28_d_datasistema_ano.\"-\".$this->tf28_d_datasistema_mes.\"-\".$this->tf28_d_datasistema_dia;\n }\n }\n $this->tf28_c_horasistema = ($this->tf28_c_horasistema == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_c_horasistema\"]:$this->tf28_c_horasistema);\n $this->tf28_c_obs = ($this->tf28_c_obs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_c_obs\"]:$this->tf28_c_obs);\n $this->tf28_i_login = ($this->tf28_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_login\"]:$this->tf28_i_login);\n }else{\n $this->tf28_i_codigo = ($this->tf28_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_codigo\"]:$this->tf28_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->c64_codpla = ($this->c64_codpla == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c64_codpla\"]:$this->c64_codpla);\n $this->c64_estrut = ($this->c64_estrut == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c64_estrut\"]:$this->c64_estrut);\n $this->c64_descr = ($this->c64_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c64_descr\"]:$this->c64_descr);\n }else{\n $this->c64_codpla = ($this->c64_codpla == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c64_codpla\"]:$this->c64_codpla);\n }\n }", "function evt__form_cargo__modificacion($datos)\r\n\t{\r\n $res=0;\r\n if($this->controlador()->dep('datos')->tabla('cargo')->esta_cargada()){//es una modificacion\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n \r\n if(isset($datos['id_puesto'])){\r\n $res=$this->controlador()->dep('datos')->tabla('puesto')->hay_superposicion_con($car['id_cargo'],$datos['id_puesto'],$datos['fec_alta'],$datos['fec_baja']);\r\n }\r\n if($res==1){//hay otro puesto \r\n toba::notificacion()->agregar('Hay superposicion. El puesto id:'.$datos['id_puesto']. ' esta ocupado por otro cargo en ese periodo. Ver en Informes->Puestos', 'error'); \r\n }else{\r\n $this->controlador()->dep('datos')->tabla('cargo')->set($datos);\r\n $this->controlador()->dep('datos')->tabla('cargo')->sincronizar(); \r\n }\r\n }else{//es un alta\r\n if(isset($datos['id_puesto'])){\r\n $res=$this->controlador()->dep('datos')->tabla('puesto')->hay_superposicion_con(0,$datos['id_puesto'],$datos['fec_alta'],$datos['fec_baja']); \r\n }\r\n if($res==1){//hay otro puesto \r\n throw new toba_error('Hay superposicion. El puesto id:'.$datos['id_puesto']. ' esta ocupado por otro cargo en ese periodo. Ver en Informes->Puestos');\r\n // toba::notificacion()->agregar('Hay superposicion. El puesto id:'.$datos['id_puesto']. ' esta ocupado por otro cargo en ese periodo. Ver en Informes->Puestos', 'error'); \r\n }else{\r\n $pers=$this->controlador()->dep('datos')->tabla('persona')->get(); \r\n $datos['generado_x_pase']=0;\r\n $datos['id_persona']=$pers['id_persona'];\r\n $this->controlador()->dep('datos')->tabla('cargo')->set($datos);\r\n $this->controlador()->dep('datos')->tabla('cargo')->sincronizar();\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n $cargo['id_cargo']=$car['id_cargo'];\r\n $this->controlador()->dep('datos')->tabla('cargo')->cargar($cargo);\r\n } \r\n }\r\n\t}", "abstract function ActualizarDatos();", "public function update(){\n \n // esta operación solamente la puede hacer el administrador\n // o bien el usuario propietario de los datos que se muestran\n if(!Login::isAdmin() || !Login::get() || Login::get()->id != $id)\n throw new Exception('No tienes los permisos necesarios');\n \n // comprueba que llegue el formulario con los datos\n if(empty($_POST['actualizar']))\n throw new Exception('No se recibieron datos');\n \n $id = intval($_POST['id']); // recuperar el id vía POST\n \n // recuperar el usuario\n if(!$mascota = Mascotas::GetMascota($id))\n throw new Exception(\"No existe la mascota $id.\");\n \n $mascota->nombre = DB::escape($_POST['nombre']);\n $mascota->sexo = DB::escape($_POST['sexo']);\n $mascota->biografia = DB::escape($_POST['biografia']);\n $mascota->fechanacimiento = DB::escape($_POST['fechanacimiento']);\n $mascota->fechafallecimiento = DB::escape($_POST['fechafallecimiento']);\n \n //la clave solamente cambia si se indica una nueva\n if(!empty($_POST['clave']))\n $mascota->clave = md5($_POST['clave']);\n \n // intenta realizar la actualización de datos\n if($mascota->actualizar()===false)\n throw new Exception(\"No se pudo actualizar $mascota->nombre\");\n \n // prepara un mensaje\n $GLOBALS['mensaje'] = \"Actualización de la mascota $mascota->nombre correcta.\";\n \n // repite la operación edit, así mantiene la vista de edición.\n $this->edit($mascota->id);\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->x40_codcorte = ($this->x40_codcorte == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_codcorte\"]:$this->x40_codcorte);\n if($this->x40_dtinc == \"\"){\n $this->x40_dtinc_dia = ($this->x40_dtinc_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_dtinc_dia\"]:$this->x40_dtinc_dia);\n $this->x40_dtinc_mes = ($this->x40_dtinc_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_dtinc_mes\"]:$this->x40_dtinc_mes);\n $this->x40_dtinc_ano = ($this->x40_dtinc_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_dtinc_ano\"]:$this->x40_dtinc_ano);\n if($this->x40_dtinc_dia != \"\"){\n $this->x40_dtinc = $this->x40_dtinc_ano.\"-\".$this->x40_dtinc_mes.\"-\".$this->x40_dtinc_dia;\n }\n }\n $this->x40_usuario = ($this->x40_usuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_usuario\"]:$this->x40_usuario);\n $this->x40_anoini = ($this->x40_anoini == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_anoini\"]:$this->x40_anoini);\n $this->x40_anofim = ($this->x40_anofim == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_anofim\"]:$this->x40_anofim);\n $this->x40_entrega = ($this->x40_entrega == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_entrega\"]:$this->x40_entrega);\n $this->x40_rua = ($this->x40_rua == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_rua\"]:$this->x40_rua);\n $this->x40_vlrminimo = ($this->x40_vlrminimo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_vlrminimo\"]:$this->x40_vlrminimo);\n $this->x40_sql = ($this->x40_sql == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_sql\"]:$this->x40_sql);\n $this->x40_codsituacao = ($this->x40_codsituacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_codsituacao\"]:$this->x40_codsituacao);\n $this->x40_zona = ($this->x40_zona == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_zona\"]:$this->x40_zona);\n $this->x40_tipomatricula = ($this->x40_tipomatricula == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_tipomatricula\"]:$this->x40_tipomatricula);\n }else{\n $this->x40_codcorte = ($this->x40_codcorte == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_codcorte\"]:$this->x40_codcorte);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed112_sequencial = ($this->ed112_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed112_sequencial\"]:$this->ed112_sequencial);\n $this->ed112_formacontrole = ($this->ed112_formacontrole == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed112_formacontrole\"]:$this->ed112_formacontrole);\n $this->ed112_quantidadedisciplinas = ($this->ed112_quantidadedisciplinas == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed112_quantidadedisciplinas\"]:$this->ed112_quantidadedisciplinas);\n $this->ed112_habilitado = ($this->ed112_habilitado == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed112_habilitado\"]:$this->ed112_habilitado);\n $this->ed112_escola = ($this->ed112_escola == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed112_escola\"]:$this->ed112_escola);\n $this->ed112_controlefrequencia = ($this->ed112_controlefrequencia == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed112_controlefrequencia\"]:$this->ed112_controlefrequencia);\n $this->ed112_disciplinaeliminadependencia = ($this->ed112_disciplinaeliminadependencia == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed112_disciplinaeliminadependencia\"]:$this->ed112_disciplinaeliminadependencia);\n $this->ed112_justificativa = ($this->ed112_justificativa == \"\" ? \"\" : $this->ed112_justificativa);\n }else{\n $this->ed112_sequencial = ($this->ed112_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed112_sequencial\"]:$this->ed112_sequencial);\n }\n }", "public function actualizarInfoUsuario(){\n \n if(isset($_PUT[\"editFname\"])){\n \n $datos = array(\n \"id\" => $_PUT[\"\"],\n \"Fname\" => $_PUT[\"\"],\n \"Lname\" => $_PUT[\"\"],\n \"Pass\" => $_PUT[\"\"],\n \"Area\" => $_PUT[\"\"],\n );\n\n $actualizar = UsersModel::actualizarInfoUsuario($datos, \"usuario\");\n\n if($actualizar){\n header(\"location: \".URL_PAGE.\"viewUser/\".$_PUT[\"\"]);\n }; \n \n\n }\n\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->rh73_sequencial = ($this->rh73_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh73_sequencial\"]:$this->rh73_sequencial);\n $this->rh73_rubric = ($this->rh73_rubric == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh73_rubric\"]:$this->rh73_rubric);\n $this->rh73_seqpes = ($this->rh73_seqpes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh73_seqpes\"]:$this->rh73_seqpes);\n $this->rh73_instit = ($this->rh73_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh73_instit\"]:$this->rh73_instit);\n $this->rh73_valor = ($this->rh73_valor == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh73_valor\"]:$this->rh73_valor);\n $this->rh73_pd = ($this->rh73_pd == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh73_pd\"]:$this->rh73_pd);\n $this->rh73_tiporubrica = ($this->rh73_tiporubrica == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh73_tiporubrica\"]:$this->rh73_tiporubrica);\n }else{\n $this->rh73_sequencial = ($this->rh73_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh73_sequencial\"]:$this->rh73_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->s152_i_codigo = ($this->s152_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_codigo\"]:$this->s152_i_codigo);\n $this->s152_i_cbosprofissional = ($this->s152_i_cbosprofissional == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_cbosprofissional\"]:$this->s152_i_cbosprofissional);\n $this->s152_i_cgsund = ($this->s152_i_cgsund == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_cgsund\"]:$this->s152_i_cgsund);\n $this->s152_i_login = ($this->s152_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_login\"]:$this->s152_i_login);\n $this->s152_i_pressaosistolica = ($this->s152_i_pressaosistolica == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_pressaosistolica\"]:$this->s152_i_pressaosistolica);\n $this->s152_i_pressaodiastolica = ($this->s152_i_pressaodiastolica == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_pressaodiastolica\"]:$this->s152_i_pressaodiastolica);\n $this->s152_i_cintura = ($this->s152_i_cintura == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_cintura\"]:$this->s152_i_cintura);\n $this->s152_n_peso = ($this->s152_n_peso == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_n_peso\"]:$this->s152_n_peso);\n $this->s152_i_altura = ($this->s152_i_altura == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_altura\"]:$this->s152_i_altura);\n $this->s152_i_glicemia = ($this->s152_i_glicemia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_glicemia\"]:$this->s152_i_glicemia);\n $this->s152_i_alimentacaoexameglicemia = ($this->s152_i_alimentacaoexameglicemia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_alimentacaoexameglicemia\"]:$this->s152_i_alimentacaoexameglicemia);\n if($this->s152_d_dataconsulta == \"\"){\n $this->s152_d_dataconsulta_dia = ($this->s152_d_dataconsulta_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_dataconsulta_dia\"]:$this->s152_d_dataconsulta_dia);\n $this->s152_d_dataconsulta_mes = ($this->s152_d_dataconsulta_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_dataconsulta_mes\"]:$this->s152_d_dataconsulta_mes);\n $this->s152_d_dataconsulta_ano = ($this->s152_d_dataconsulta_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_dataconsulta_ano\"]:$this->s152_d_dataconsulta_ano);\n if($this->s152_d_dataconsulta_dia != \"\"){\n $this->s152_d_dataconsulta = $this->s152_d_dataconsulta_ano.\"-\".$this->s152_d_dataconsulta_mes.\"-\".$this->s152_d_dataconsulta_dia;\n }\n }\n if($this->s152_d_datasistema == \"\"){\n $this->s152_d_datasistema_dia = ($this->s152_d_datasistema_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_datasistema_dia\"]:$this->s152_d_datasistema_dia);\n $this->s152_d_datasistema_mes = ($this->s152_d_datasistema_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_datasistema_mes\"]:$this->s152_d_datasistema_mes);\n $this->s152_d_datasistema_ano = ($this->s152_d_datasistema_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_datasistema_ano\"]:$this->s152_d_datasistema_ano);\n if($this->s152_d_datasistema_dia != \"\"){\n $this->s152_d_datasistema = $this->s152_d_datasistema_ano.\"-\".$this->s152_d_datasistema_mes.\"-\".$this->s152_d_datasistema_dia;\n }\n }\n $this->s152_c_horasistema = ($this->s152_c_horasistema == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_c_horasistema\"]:$this->s152_c_horasistema);\n $this->s152_n_temperatura = ($this->s152_n_temperatura == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_n_temperatura\"]:$this->s152_n_temperatura);\n $this->s152_evolucao = ($this->s152_evolucao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_evolucao\"]:$this->s152_evolucao);\n $this->s152_perimetrocefalico = ($this->s152_perimetrocefalico == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_perimetrocefalico\"]:$this->s152_perimetrocefalico);\n $this->s152_frequenciarespiratoria = ($this->s152_frequenciarespiratoria == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_frequenciarespiratoria\"]:$this->s152_frequenciarespiratoria);\n $this->s152_frequenciacardiaca = ($this->s152_frequenciacardiaca == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_frequenciacardiaca\"]:$this->s152_frequenciacardiaca);\n if($this->s152_dum == \"\"){\n $this->s152_dum_dia = ($this->s152_dum_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_dum_dia\"]:$this->s152_dum_dia);\n $this->s152_dum_mes = ($this->s152_dum_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_dum_mes\"]:$this->s152_dum_mes);\n $this->s152_dum_ano = ($this->s152_dum_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_dum_ano\"]:$this->s152_dum_ano);\n if($this->s152_dum_dia != \"\"){\n $this->s152_dum = $this->s152_dum_ano.\"-\".$this->s152_dum_mes.\"-\".$this->s152_dum_dia;\n }\n }\n $this->s152_saturacao = ($this->s152_saturacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_saturacao\"]:$this->s152_saturacao);\n $this->s152_subjetivo = ($this->s152_subjetivo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_subjetivo\"]:$this->s152_subjetivo);\n }else{\n $this->s152_i_codigo = ($this->s152_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_codigo\"]:$this->s152_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->rh95_sequencial = ($this->rh95_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh95_sequencial\"]:$this->rh95_sequencial);\n $this->rh95_id_usuario = ($this->rh95_id_usuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh95_id_usuario\"]:$this->rh95_id_usuario);\n $this->rh95_ano = ($this->rh95_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh95_ano\"]:$this->rh95_ano);\n if($this->rh95_datageracao == \"\"){\n $this->rh95_datageracao_dia = ($this->rh95_datageracao_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh95_datageracao_dia\"]:$this->rh95_datageracao_dia);\n $this->rh95_datageracao_mes = ($this->rh95_datageracao_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh95_datageracao_mes\"]:$this->rh95_datageracao_mes);\n $this->rh95_datageracao_ano = ($this->rh95_datageracao_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh95_datageracao_ano\"]:$this->rh95_datageracao_ano);\n if($this->rh95_datageracao_dia != \"\"){\n $this->rh95_datageracao = $this->rh95_datageracao_ano.\"-\".$this->rh95_datageracao_mes.\"-\".$this->rh95_datageracao_dia;\n }\n }\n $this->rh95_fontepagadora = ($this->rh95_fontepagadora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh95_fontepagadora\"]:$this->rh95_fontepagadora);\n }else{\n $this->rh95_sequencial = ($this->rh95_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh95_sequencial\"]:$this->rh95_sequencial);\n }\n }", "function modificarServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_ime';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\t\t\t\t\r\n\t\t\r\n\t\t$parametros = $this->aParam->getArregloParametros('asignacion');\r\n\t\t//si esdel tipo matriz verifica en la primera posicion el tipo de vista\r\n\t\tif($this->esMatriz){\r\n\t\t $tipo_operacion =$parametros[0]['tipo_operacion'];\t\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t$tipo_operacion =$parametros['tipo_operacion'];\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif($tipo_operacion=='asignacion'){\r\n\t\t $this->transaccion='tgv_SERVIC_MOD';\r\n } \r\n elseif($tipo_operacion=='cambiar_estado'){ \r\n\t\t $this->transaccion='tgv_SERCAMEST_MOD';\r\n\t\t $this->setParametro('operacion','operacion','varchar');// cuando finaliza los requerimientos, su valor es fin_requerimiento\r\n\t\t //$this->setParametro('id_abogado','id_abogado','int4');\r\n\t\t}\r\n\t\telseif ($tipo_operacion=='def_fechas'){ \r\n\t\t $this->transaccion='tgv_DEFFECHA_MOD';\r\n\t\t // $this->setParametro('operacion','operacion','varchar');// cuando finaliza los requerimientos, su valor es fin_requerimiento\r\n\t\t //$this->setParametro('id_abogado','id_abogado','int4');\r\n\t\t}\r\n\t\t\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('id_servicio','id_servicio','int4');\r\n\t\t$this->setParametro('estado','estado','varchar');\r\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\r\n\t\t$this->setParametro('id_lugar_destino','id_lugar_destino','int4');\r\n\t\t$this->setParametro('id_ep','id_ep','int4');\r\n\t\t$this->setParametro('fecha_asig_fin','fecha_asig_fin','date');\r\n\t\t$this->setParametro('fecha_sol_ini','fecha_sol_ini','date');\r\n\t\t$this->setParametro('descripcion','descripcion','varchar');\r\n\t\t$this->setParametro('id_lugar_origen','id_lugar_origen','int4');\r\n\t\t$this->setParametro('cant_personas','cant_personas','int4');\r\n\t\t$this->setParametro('fecha_sol_fin','fecha_sol_fin','date');\r\n\t\t$this->setParametro('id_funcionario','id_funcionario','int4');\r\n\t\t$this->setParametro('fecha_asig_ini','fecha_asig_ini','date');\r\n\t\t$this->setParametro('id_funcionario_autoriz','id_funcionario_autoriz','int4');\r\n\t\t$this->setParametro('observaciones','observaciones','varchar');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "public function atualizar()\n {\n //Executa o processo de validação\n $validacao = self::validar('update');\n\n //Verifica o status da validação do formulário\n //Se não houveram erros, insere no banco de dados\n //Caso contrário, informa ao usuário os erros de validação\n if($validacao)\n {\n //Obtem os dados do formulário preenchido\n $empresa = $this->input->post();\n\n //Obtem o id da empresa a ser atualizada\n $id = $empresa['id_empresa'];\n\n //Atualiza os dados da empresa a partir do seu id e retorna o status da operação\n $status = $this->EmpresasModel->atualizar($id, $empresa);\n\n //Checa o status da operação\n //Se bem sucedida, carrega a tela de visualizar a empresa \n //Caso contrário, informa ao usuário\n if(!$status){\n\t\t\t\t$this->session->set_flashdata('error', 'Não foi possível alterar as informações.');\n\t\t\t}else{\n //Consulta os dados da empresa que foi atualizada\n $resultado = $this->EmpresasModel->getById($id);\n $dados = array(\"empresaid\" => $resultado, \"success\" => 'Informações alteradas com sucesso.'); \n //Carrega a tela com os dados atualizados\n $this->load->view(\"Empresas/empresa\", $dados);\n\t\t\t}\n }\n else\n {\n\t\t\t$this->session->set_flashdata('error', validation_errors('<p>','</p>'));\n }\n //Carrega a página de alterar os dados da empresa com as informações atuais\n $dados['empresaid'] = $this->EmpresasModel->getById($id);\n $this->load->view(\"Empresas/altera\", $dados); \n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n\n $this->rh141_sequencial = ($this->rh141_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh141_sequencial\"]:$this->rh141_sequencial);\n $this->rh141_codigo = ($this->rh141_codigo === \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh141_codigo\"]:$this->rh141_codigo);\n $this->rh141_anoref = ($this->rh141_anoref == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh141_anoref\"]:$this->rh141_anoref);\n $this->rh141_mesref = ($this->rh141_mesref == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh141_mesref\"]:$this->rh141_mesref);\n $this->rh141_anousu = ($this->rh141_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh141_anousu\"]:$this->rh141_anousu);\n $this->rh141_mesusu = ($this->rh141_mesusu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh141_mesusu\"]:$this->rh141_mesusu);\n $this->rh141_instit = ($this->rh141_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh141_instit\"]:$this->rh141_instit);\n $this->rh141_tipofolha = ($this->rh141_tipofolha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh141_tipofolha\"]:$this->rh141_tipofolha);\n $this->rh141_aberto = ($this->rh141_aberto == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh141_aberto\"]:$this->rh141_aberto);\n $this->rh141_descricao = ($this->rh141_descricao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh141_descricao\"]:$this->rh141_descricao);\n }else{\n $this->rh141_sequencial = ($this->rh141_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh141_sequencial\"]:$this->rh141_sequencial);\n }\n }", "public function actualizarCampos(){\n //---- eliminamos todos los registros\n $sql = \"DELETE FROM \". TABLE_EMPRESA .\"_campo WHERE uid_empresa = \". $this->getUID();\n if( !$this->db->query($sql) ){ return $this->db->lastErrorString(); }\n\n //---- asignamos los que se han indicado en el formulario\n $inserts = array();\n $asignados = isset($_REQUEST[\"elementos-asignados\"]) ? $_REQUEST[\"elementos-asignados\"] : [];\n foreach ($asignados as $idCampoAsignado) {\n $inserts[] = \"(\". $this->getUID() .\", \". $idCampoAsignado .\")\";\n }\n\n if (!count($inserts)) return true;\n\n $sql = \"INSERT INTO \". TABLE_EMPRESA .\"_campo ( uid_empresa, uid_campo ) VALUES \". implode(\",\", $inserts);\n if( !$this->db->query($sql) ){ return $this->db->lastErrorString(); }\n\n //----- si todo va bien\n return true;\n }", "public function modificarEstado(){\n\t\t$firephp = FirePHP::getInstance(True);\n\t\t$this->load->database();\n\t\t$this->load->model('Estado');\n\t\t//TODO Deshardcodear el idUsuario cuando se da cambia el estado (cuando este listo el manejo de sesions de usuarios).\n\t\t$idUsuario=1;\n\t\t$idBache=$_POST[\"idBache\"];\n\t\t$estado=$_POST[\"estadoBache\"];\n\t\t$firephp->log(\"idBache=\".$idBache.\";idUsuario=\".$idUsuario.\";estado=\".$estado);\n\t\t$this->Estado->cambiarEstado($idBache,$idUsuario,$estado);\n\t\t$firephp->log(\"Se cambio el estado del bache!\");\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->as19_sequencial = ($this->as19_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_sequencial\"]:$this->as19_sequencial);\n $this->as19_nome = ($this->as19_nome == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_nome\"]:$this->as19_nome);\n $this->as19_detalhamento = ($this->as19_detalhamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_detalhamento\"]:$this->as19_detalhamento);\n $this->as19_tabcurritipo = ($this->as19_tabcurritipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_tabcurritipo\"]:$this->as19_tabcurritipo);\n if($this->as19_inicio == \"\"){\n $this->as19_inicio_dia = ($this->as19_inicio_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_inicio_dia\"]:$this->as19_inicio_dia);\n $this->as19_inicio_mes = ($this->as19_inicio_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_inicio_mes\"]:$this->as19_inicio_mes);\n $this->as19_inicio_ano = ($this->as19_inicio_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_inicio_ano\"]:$this->as19_inicio_ano);\n if($this->as19_inicio_dia != \"\"){\n $this->as19_inicio = $this->as19_inicio_ano.\"-\".$this->as19_inicio_mes.\"-\".$this->as19_inicio_dia;\n }\n }\n if($this->as19_fim == \"\"){\n $this->as19_fim_dia = ($this->as19_fim_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_fim_dia\"]:$this->as19_fim_dia);\n $this->as19_fim_mes = ($this->as19_fim_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_fim_mes\"]:$this->as19_fim_mes);\n $this->as19_fim_ano = ($this->as19_fim_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_fim_ano\"]:$this->as19_fim_ano);\n if($this->as19_fim_dia != \"\"){\n $this->as19_fim = $this->as19_fim_ano.\"-\".$this->as19_fim_mes.\"-\".$this->as19_fim_dia;\n }\n }\n $this->as19_horaaulasdia = ($this->as19_horaaulasdia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_horaaulasdia\"]:$this->as19_horaaulasdia);\n $this->as19_ministrante = ($this->as19_ministrante == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_ministrante\"]:$this->as19_ministrante);\n $this->as19_responsavel = ($this->as19_responsavel == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_responsavel\"]:$this->as19_responsavel);\n }else{\n $this->as19_sequencial = ($this->as19_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"as19_sequencial\"]:$this->as19_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->c112_sequencial = ($this->c112_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c112_sequencial\"]:$this->c112_sequencial);\n $this->c112_reconhecimentocontabiltipo = ($this->c112_reconhecimentocontabiltipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c112_reconhecimentocontabiltipo\"]:$this->c112_reconhecimentocontabiltipo);\n $this->c112_numcgm = ($this->c112_numcgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c112_numcgm\"]:$this->c112_numcgm);\n $this->c112_processoadm = ($this->c112_processoadm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c112_processoadm\"]:$this->c112_processoadm);\n $this->c112_valor = ($this->c112_valor == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c112_valor\"]:$this->c112_valor);\n $this->c112_estornado = ($this->c112_estornado == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c112_estornado\"]:$this->c112_estornado);\n }else{\n $this->c112_sequencial = ($this->c112_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c112_sequencial\"]:$this->c112_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->rh85_sequencial = ($this->rh85_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_sequencial\"]:$this->rh85_sequencial);\n $this->rh85_regist = ($this->rh85_regist == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_regist\"]:$this->rh85_regist);\n $this->rh85_anousu = ($this->rh85_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_anousu\"]:$this->rh85_anousu);\n $this->rh85_mesusu = ($this->rh85_mesusu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_mesusu\"]:$this->rh85_mesusu);\n if($this->rh85_dataemissao == \"\"){\n $this->rh85_dataemissao_dia = ($this->rh85_dataemissao_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_dataemissao_dia\"]:$this->rh85_dataemissao_dia);\n $this->rh85_dataemissao_mes = ($this->rh85_dataemissao_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_dataemissao_mes\"]:$this->rh85_dataemissao_mes);\n $this->rh85_dataemissao_ano = ($this->rh85_dataemissao_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_dataemissao_ano\"]:$this->rh85_dataemissao_ano);\n if($this->rh85_dataemissao_dia != \"\"){\n $this->rh85_dataemissao = $this->rh85_dataemissao_ano.\"-\".$this->rh85_dataemissao_mes.\"-\".$this->rh85_dataemissao_dia;\n }\n }\n $this->rh85_horaemissao = ($this->rh85_horaemissao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_horaemissao\"]:$this->rh85_horaemissao);\n $this->rh85_sigla = ($this->rh85_sigla == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_sigla\"]:$this->rh85_sigla);\n $this->rh85_codautent = ($this->rh85_codautent == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_codautent\"]:$this->rh85_codautent);\n $this->rh85_ip = ($this->rh85_ip == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_ip\"]:$this->rh85_ip);\n $this->rh85_externo = ($this->rh85_externo == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_externo\"]:$this->rh85_externo);\n }else{\n $this->rh85_sequencial = ($this->rh85_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh85_sequencial\"]:$this->rh85_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->k107_sequencial = ($this->k107_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k107_sequencial\"]:$this->k107_sequencial);\n $this->k107_empagemov = ($this->k107_empagemov == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k107_empagemov\"]:$this->k107_empagemov);\n if($this->k107_data == \"\"){\n $this->k107_data_dia = ($this->k107_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k107_data_dia\"]:$this->k107_data_dia);\n $this->k107_data_mes = ($this->k107_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k107_data_mes\"]:$this->k107_data_mes);\n $this->k107_data_ano = ($this->k107_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k107_data_ano\"]:$this->k107_data_ano);\n if($this->k107_data_dia != \"\"){\n $this->k107_data = $this->k107_data_ano.\"-\".$this->k107_data_mes.\"-\".$this->k107_data_dia;\n }\n }\n $this->k107_valor = ($this->k107_valor == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k107_valor\"]:$this->k107_valor);\n $this->k107_ctacredito = ($this->k107_ctacredito == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k107_ctacredito\"]:$this->k107_ctacredito);\n $this->k107_ctadebito = ($this->k107_ctadebito == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k107_ctadebito\"]:$this->k107_ctadebito);\n }else{\n $this->k107_sequencial = ($this->k107_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k107_sequencial\"]:$this->k107_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->pc31_orcamforne = ($this->pc31_orcamforne == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_orcamforne\"]:$this->pc31_orcamforne);\n $this->pc31_nomeretira = ($this->pc31_nomeretira == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_nomeretira\"]:$this->pc31_nomeretira);\n if($this->pc31_dtretira == \"\"){\n $this->pc31_dtretira_dia = ($this->pc31_dtretira_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_dtretira_dia\"]:$this->pc31_dtretira_dia);\n $this->pc31_dtretira_mes = ($this->pc31_dtretira_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_dtretira_mes\"]:$this->pc31_dtretira_mes);\n $this->pc31_dtretira_ano = ($this->pc31_dtretira_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_dtretira_ano\"]:$this->pc31_dtretira_ano);\n if($this->pc31_dtretira_dia != \"\"){\n $this->pc31_dtretira = $this->pc31_dtretira_ano.\"-\".$this->pc31_dtretira_mes.\"-\".$this->pc31_dtretira_dia;\n }\n }\n $this->pc31_horaretira = ($this->pc31_horaretira == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_horaretira\"]:$this->pc31_horaretira);\n $this->pc31_liclicitatipoempresa = ($this->pc31_liclicitatipoempresa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_liclicitatipoempresa\"]:$this->pc31_liclicitatipoempresa);\n $this->pc31_tipocondicao = ($this->pc31_tipocondicao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_tipocondicao\"]:$this->pc31_tipocondicao);\n }else{\n $this->pc31_orcamforne = ($this->pc31_orcamforne == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_orcamforne\"]:$this->pc31_orcamforne);\n }\n }", "public function actualizarCita(){\n $sql =\"update cita set id_paciente=$this->id_paciente, id_medico = $this->id_medico,fecha_cita = '$this->fecha_cita', hora_cita='$this->hora_cita', tipo_servicio='$this->tipo_servicio', motivo ='$this->motivo', estado = '$this->estado' where id =$this->id\";\n if($this->conn->executeQuery($sql)){\n $this->conn->close();\n return true;\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed100_i_codigo = ($this->ed100_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_codigo\"]:$this->ed100_i_codigo);\n $this->ed100_i_historicompsfora = ($this->ed100_i_historicompsfora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_historicompsfora\"]:$this->ed100_i_historicompsfora);\n $this->ed100_i_disciplina = ($this->ed100_i_disciplina == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_disciplina\"]:$this->ed100_i_disciplina);\n $this->ed100_i_justificativa = ($this->ed100_i_justificativa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_justificativa\"]:$this->ed100_i_justificativa);\n $this->ed100_i_qtdch = ($this->ed100_i_qtdch == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_qtdch\"]:$this->ed100_i_qtdch);\n $this->ed100_c_resultadofinal = ($this->ed100_c_resultadofinal == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_c_resultadofinal\"]:$this->ed100_c_resultadofinal);\n $this->ed100_t_resultobtido = ($this->ed100_t_resultobtido == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_t_resultobtido\"]:$this->ed100_t_resultobtido);\n $this->ed100_c_situacao = ($this->ed100_c_situacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_c_situacao\"]:$this->ed100_c_situacao);\n $this->ed100_c_tiporesultado = ($this->ed100_c_tiporesultado == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_c_tiporesultado\"]:$this->ed100_c_tiporesultado);\n $this->ed100_i_ordenacao = ($this->ed100_i_ordenacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_ordenacao\"]:$this->ed100_i_ordenacao);\n $this->ed100_c_termofinal = ($this->ed100_c_termofinal == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_c_termofinal\"]:$this->ed100_c_termofinal);\n $this->ed100_opcional = ($this->ed100_opcional == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_opcional\"]:$this->ed100_opcional);\n $this->ed100_basecomum = ($this->ed100_basecomum == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_basecomum\"]:$this->ed100_basecomum);\n }else{\n $this->ed100_i_codigo = ($this->ed100_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_codigo\"]:$this->ed100_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ht13_sequencial = ($this->ht13_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ht13_sequencial\"]:$this->ht13_sequencial);\n $this->ht13_habitprograma = ($this->ht13_habitprograma == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ht13_habitprograma\"]:$this->ht13_habitprograma);\n $this->ht13_habitcandidatointeresse = ($this->ht13_habitcandidatointeresse == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ht13_habitcandidatointeresse\"]:$this->ht13_habitcandidatointeresse);\n $this->ht13_codproc = ($this->ht13_codproc == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ht13_codproc\"]:$this->ht13_codproc);\n }else{\n $this->ht13_sequencial = ($this->ht13_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ht13_sequencial\"]:$this->ht13_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->c60_codcon = ($this->c60_codcon == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_codcon\"]:$this->c60_codcon);\n $this->c60_anousu = ($this->c60_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_anousu\"]:$this->c60_anousu);\n $this->c60_estrut = ($this->c60_estrut == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_estrut\"]:$this->c60_estrut);\n $this->c60_descr = ($this->c60_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_descr\"]:$this->c60_descr);\n $this->c60_finali = ($this->c60_finali == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_finali\"]:$this->c60_finali);\n $this->c60_codsis = ($this->c60_codsis == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_codsis\"]:$this->c60_codsis);\n $this->c60_codcla = ($this->c60_codcla == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_codcla\"]:$this->c60_codcla);\n $this->c60_consistemaconta = ($this->c60_consistemaconta == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_consistemaconta\"]:$this->c60_consistemaconta);\n $this->c60_identificadorfinanceiro = ($this->c60_identificadorfinanceiro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_identificadorfinanceiro\"]:$this->c60_identificadorfinanceiro);\n $this->c60_naturezasaldo = ($this->c60_naturezasaldo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_naturezasaldo\"]:$this->c60_naturezasaldo);\n $this->c60_funcao = ($this->c60_funcao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_funcao\"]:$this->c60_funcao);\n }else{\n $this->c60_codcon = ($this->c60_codcon == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_codcon\"]:$this->c60_codcon);\n $this->c60_anousu = ($this->c60_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c60_anousu\"]:$this->c60_anousu);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->l30_codigo = ($this->l30_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_codigo\"]:$this->l30_codigo);\n if($this->l30_data == \"\"){\n $this->l30_data_dia = ($this->l30_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_data_dia\"]:$this->l30_data_dia);\n $this->l30_data_mes = ($this->l30_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_data_mes\"]:$this->l30_data_mes);\n $this->l30_data_ano = ($this->l30_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_data_ano\"]:$this->l30_data_ano);\n if($this->l30_data_dia != \"\"){\n $this->l30_data = $this->l30_data_ano.\"-\".$this->l30_data_mes.\"-\".$this->l30_data_dia;\n }\n }\n $this->l30_portaria = ($this->l30_portaria == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_portaria\"]:$this->l30_portaria);\n if($this->l30_datavalid == \"\"){\n $this->l30_datavalid_dia = ($this->l30_datavalid_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_datavalid_dia\"]:$this->l30_datavalid_dia);\n $this->l30_datavalid_mes = ($this->l30_datavalid_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_datavalid_mes\"]:$this->l30_datavalid_mes);\n $this->l30_datavalid_ano = ($this->l30_datavalid_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_datavalid_ano\"]:$this->l30_datavalid_ano);\n if($this->l30_datavalid_dia != \"\"){\n $this->l30_datavalid = $this->l30_datavalid_ano.\"-\".$this->l30_datavalid_mes.\"-\".$this->l30_datavalid_dia;\n }\n }\n $this->l30_tipo = ($this->l30_tipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_tipo\"]:$this->l30_tipo);\n $this->l30_nomearquivo = ($this->l30_nomearquivo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_nomearquivo\"]:$this->l30_nomearquivo);\n }else{\n $this->l30_codigo = ($this->l30_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_codigo\"]:$this->l30_codigo);\n }\n }", "public function actualizar($registro) {\n \n }", "public function actualizar($registro) {\n \n }", "public function actualizarUsuario()\n {\n //quitamos el id del array y lo guardamos a parte\n $datos = $_POST;\n $ciu = isset($datos['CIU']) ? $datos['CIU'] : $this->session->userdata(\"ciu\");\n unset($datos['CIU']);\n\n //miramos si ha enviado imagen de perfil. de ser asi se procesa en otro metodo aparte y se quita del array\n if (isset($datos['img'])) {\n self::actualizarImagenPerfil($datos['img']);\n unset($datos['img']);\n }\n\n echo $this->Usuarios_model->actualizarUsuario($ciu, $datos);\n }", "public function actualizar()\n\t{\n\t\tif (isset($_POST[\"id\"])) {\n\n\t\t\t$id = $this->input->post(\"id\");\n\t\t\t$no_caja = $this->input->post(\"no_caja\");\n\t\t\t$nombre = $this->input->post(\"nombre\");\n\t\t\t$remision = $this->input->post(\"remision\");\n\t\t\t$this->form_validation->set_rules('no_caja', 'NÚmero de caja', 'required');\n\t\t\t$this->form_validation->set_rules('nombre', 'Nombre', 'required');\n\t\t\t$this->form_validation->set_rules('remision', 'Remision', 'required|numeric');\n\t\t\t$this->form_validation->set_message('required', 'El campo {field} es obligatorio.');\n\t\t\t$this->form_validation->set_message('numeric', 'El campo {field} deber ser numérico.');\n\n\t\t\t/*if($id_usuario != $id_usuario_org) {\n\t\t\t\t$is_unique = '|is_unique[cajas.id_usuario]';\n\t\t\t } else {\n\t\t\t\t$is_unique = '';\n\t\t\t }*/\n\n\t\t\tif ($this->form_validation->run() == TRUE) {\n\t\t\t\t$resultado = $this->cajasModel->guardarCambios($id, $no_caja, $nombre, $remision);\n\n\t\t\t\tif ($resultado) {\n\t\t\t\t\t$this->index(1, \"La caja se actualizo con exito\", \"success\");\n\t\t\t\t} else {\n\t\t\t\t\t$this->editar($id, 1, \"Error al actualizo datos\", \"error\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->editar($id, 2, \"Error al actualizo datos\", \"error\");\n\t\t\t}\n\t\t} else {\n\t\t\tredirect(\"/cajas\");\n\t\t}\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->h50_sequencial = ($this->h50_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"h50_sequencial\"]:$this->h50_sequencial);\n $this->h50_lei = ($this->h50_lei == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"h50_lei\"]:$this->h50_lei);\n $this->h50_descr = ($this->h50_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"h50_descr\"]:$this->h50_descr);\n $this->h50_obs = ($this->h50_obs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"h50_obs\"]:$this->h50_obs);\n $this->h50_confobs = ($this->h50_confobs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"h50_confobs\"]:$this->h50_confobs);\n $this->h50_minimopontos = ($this->h50_minimopontos == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"h50_minimopontos\"]:$this->h50_minimopontos);\n $this->h50_assentaaprova = ($this->h50_assentaaprova == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"h50_assentaaprova\"]:$this->h50_assentaaprova);\n $this->h50_assentareprova = ($this->h50_assentareprova == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"h50_assentareprova\"]:$this->h50_assentareprova);\n $this->h50_duracaoestagio = ($this->h50_duracaoestagio == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"h50_duracaoestagio\"]:$this->h50_duracaoestagio);\n $this->h50_instit = ($this->h50_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"h50_instit\"]:$this->h50_instit);\n }else{\n $this->h50_sequencial = ($this->h50_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"h50_sequencial\"]:$this->h50_sequencial);\n }\n }", "function evt__procesar(){\n $m = $this->dep('datos')->tabla('mesa')->get();\n $p = array_search('junta_electoral', $this->s__perfil);\n if($p !== false){//Ingreso con perfil junta_electoral\n $m['estado'] = 3;//Cambia el estado de la mesa a Confirmado\n }\n else{\n $p = array_search('secretaria', $this->s__perfil);\n if($p !== false){//Ingreso con perfil secretaria\n $m['estado'] = 4;//Cambia el estado de la mesa a Definitivo\n }\n else{\n $p = array_search('autoridad_mesa', $this->s__perfil); \n if($p !== false){//Ingreso con perfil autoridad de mesa\n $m['estado'] = 1;//Cambia el estado de la mesa a Cargado\n }\n }\n }\n $this->dep('datos')->tabla('mesa')->set($m);\n// print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n $this->dep('datos')->tabla('mesa')->resetear();\n \n \n if(isset($this->s__retorno)){//debe retornar a confirmar\n if($this->s__retorno_estado=='')\n $dato = true;\n else\n $dato['f'] = $this->s__retorno_estado;\n toba::vinculador()->navegar_a(\"\",$this->s__retorno,$dato); \n $this->s__retorno = null; \n $this->s__id_mesa = null;\n $this->s__retorno_estado = null;\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->tr20_id = ($this->tr20_id == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_id\"]:$this->tr20_id);\n if($this->tr20_dtalvara == \"\"){\n $this->tr20_dtalvara_dia = ($this->tr20_dtalvara_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_dia\"]:$this->tr20_dtalvara_dia);\n $this->tr20_dtalvara_mes = ($this->tr20_dtalvara_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_mes\"]:$this->tr20_dtalvara_mes);\n $this->tr20_dtalvara_ano = ($this->tr20_dtalvara_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_ano\"]:$this->tr20_dtalvara_ano);\n if($this->tr20_dtalvara_dia != \"\"){\n $this->tr20_dtalvara = $this->tr20_dtalvara_ano.\"-\".$this->tr20_dtalvara_mes.\"-\".$this->tr20_dtalvara_dia;\n }\n }\n $this->tr20_numcgm = ($this->tr20_numcgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_numcgm\"]:$this->tr20_numcgm);\n $this->tr20_ruaid = ($this->tr20_ruaid == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_ruaid\"]:$this->tr20_ruaid);\n $this->tr20_nro = ($this->tr20_nro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_nro\"]:$this->tr20_nro);\n $this->tr20_bairroid = ($this->tr20_bairroid == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_bairroid\"]:$this->tr20_bairroid);\n $this->tr20_complem = ($this->tr20_complem == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_complem\"]:$this->tr20_complem);\n $this->tr20_fone = ($this->tr20_fone == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_fone\"]:$this->tr20_fone);\n $this->tr20_prefixo = ($this->tr20_prefixo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_prefixo\"]:$this->tr20_prefixo);\n }else{\n $this->tr20_id = ($this->tr20_id == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_id\"]:$this->tr20_id);\n }\n }", "public function actualizar(){\n\textract($_REQUEST);\n\t$db=new clasedb();\n\t$conex=$db->conectar();//conectando con la base de datos\n\n\t$sql=\"SELECT * FROM usuarios WHERE correo='\".$correo.\"' AND id!=\".$_SESSION['id_usuario'];;\n\t$res=mysqli_query($conex,$sql);\n\t$cuantos=mysqli_num_rows($res);\n\t//echo $cuantos;\n\tif ($cuantos>0) {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\talert(\"Ya existe un usuario con este correo\");\n\t\t\twindow.location=\"ControladorPerfil.php?operacion=verperfil\";\n\t\t</script>\n\t\t\t<?php\n\n\t\t}else{\n\t\t\n\t\t\t$sql=\"UPDATE usuarios SET nombre='\".$nombre.\"', correo='\".$correo.\"', pregunta='\".$pregunta.\"',respuesta='\".$respuesta.\"' WHERE usuarios.id=\".$_SESSION['id_usuario'];;\n\n\n\t\t\t$res=mysqli_query($conex,$sql);\n\t\t\tif ($res) {\n\t\t\t\t$sql=\"INSERT INTO auditoria VALUES (NULL, '\".$_SESSION['id_usuario'].\"', 'modificó perfil', 'usuarios', CURRENT_TIMESTAMP, '\".$_SESSION['tipo_usuario'].\"')\";\n\n\t\t $resultado=mysqli_query($conex,$sql);\n ?>\n\t\t\t\t\t\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\talert(\"Registro modificado\");\n\t\t\t\t\t\twindow.location=\"ControladorPerfil.php?operacion=verperfil\";\n\t\t\t\t\t</script>\n\t\t\t\t\t<?php\n\t\t\t} else {\n\t\t\t\t\t?>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\talert(\"Error al modificar el registro\");\n\t\t\t\t\t\twindow.location=\"ControladorPerfil.php?operacion=verperfil\";\n\t\t\t\t\t</script>\n\t\t\t\t\t<?php\n\t\t\t\t\t}\t\t\t\n\t\t\t\n\t\n\t}\n}", "function actualizarEmpresa($data_empresa,$data_contacto,$data_usuario){\n\t\t\t$where = \"usuario.usuario_id=\". $data_usuario[\"usuario_id\"];\n\t\t\t$query = $this->db->update_string(\"usuario\",$data_usuario,$where);\n\t\t\t$this->db->query($query);\n\n\t\t\t#actualizar tabla de contacto\n\t\t\t$where = \"contacto.contacto_id=\". $data_contacto[\"contacto_id\"];\n\t\t\t$query = $this->db->update_string(\"contacto\",$data_contacto,$where);\n\t\t\t\n\t\t\t$this->db->query($query);\n\n\t\t\t#actualizar tabla de empresa\n\t\t\t$where = \"empresa_id=\". $data_empresa[\"empresa_id\"];\n\t\t\t$query = $this->db->update_string(\"empresa\",$data_empresa,$where);\n\t\t\t#echo $query;\n\t\t\t$this->db->query($query);\n\n\t\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->y78_codtipo = ($this->y78_codtipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_codtipo\"]:$this->y78_codtipo);\n $this->y78_receit = ($this->y78_receit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_receit\"]:$this->y78_receit);\n $this->y78_valor = ($this->y78_valor == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_valor\"]:$this->y78_valor);\n $this->y78_descr = ($this->y78_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_descr\"]:$this->y78_descr);\n }else{\n $this->y78_codtipo = ($this->y78_codtipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_codtipo\"]:$this->y78_codtipo);\n $this->y78_receit = ($this->y78_receit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_receit\"]:$this->y78_receit);\n }\n }", "function actualizar(){\n\t\t$rut = $this->input->post('rut');\n\t\t\n\t\t$data = array(\n\t\t\t'nombre' => $this->input->post('nombre'),\n\t\t\t'apellido' => $this->input->post('apellido'),\n\t\t\t'contrasena' => $this->input->post('password'),\n\t\t\t'estado' => 1,\n\t\t\t'modificado' => $this->session->userdata['username'],\n\t\t\t'fechaModificado' => date('Y-m-d H:i:s', time())\n\t\t);\n\t\t\n\t\t# se agrega el cliente en la BD\n\t\t$this->usuarios_model->actualizar($rut,$data);\n\n\t\t#echo json_encode($data);\n\t\t\n\t\t# redirigimos a la siguiente pagina\n\t\tredirect('admin_listar_usuarios');\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->e80_codage = ($this->e80_codage == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_codage\"]:$this->e80_codage);\n if($this->e80_data == \"\"){\n $this->e80_data_dia = ($this->e80_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_data_dia\"]:$this->e80_data_dia);\n $this->e80_data_mes = ($this->e80_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_data_mes\"]:$this->e80_data_mes);\n $this->e80_data_ano = ($this->e80_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_data_ano\"]:$this->e80_data_ano);\n if($this->e80_data_dia != \"\"){\n $this->e80_data = $this->e80_data_ano.\"-\".$this->e80_data_mes.\"-\".$this->e80_data_dia;\n }\n }\n if($this->e80_cancelado == \"\"){\n $this->e80_cancelado_dia = ($this->e80_cancelado_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_cancelado_dia\"]:$this->e80_cancelado_dia);\n $this->e80_cancelado_mes = ($this->e80_cancelado_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_cancelado_mes\"]:$this->e80_cancelado_mes);\n $this->e80_cancelado_ano = ($this->e80_cancelado_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_cancelado_ano\"]:$this->e80_cancelado_ano);\n if($this->e80_cancelado_dia != \"\"){\n $this->e80_cancelado = $this->e80_cancelado_ano.\"-\".$this->e80_cancelado_mes.\"-\".$this->e80_cancelado_dia;\n }\n }\n $this->e80_instit = ($this->e80_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_instit\"]:$this->e80_instit);\n }else{\n $this->e80_codage = ($this->e80_codage == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_codage\"]:$this->e80_codage);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->s113_i_codigo = ($this->s113_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_codigo\"]:$this->s113_i_codigo);\n $this->s113_i_prestadorhorarios = ($this->s113_i_prestadorhorarios == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_prestadorhorarios\"]:$this->s113_i_prestadorhorarios);\n $this->s113_i_numcgs = ($this->s113_i_numcgs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_numcgs\"]:$this->s113_i_numcgs);\n if($this->s113_d_agendamento == \"\"){\n $this->s113_d_agendamento_dia = ($this->s113_d_agendamento_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_dia\"]:$this->s113_d_agendamento_dia);\n $this->s113_d_agendamento_mes = ($this->s113_d_agendamento_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_mes\"]:$this->s113_d_agendamento_mes);\n $this->s113_d_agendamento_ano = ($this->s113_d_agendamento_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_ano\"]:$this->s113_d_agendamento_ano);\n if($this->s113_d_agendamento_dia != \"\"){\n $this->s113_d_agendamento = $this->s113_d_agendamento_ano.\"-\".$this->s113_d_agendamento_mes.\"-\".$this->s113_d_agendamento_dia;\n }\n }\n if($this->s113_d_exame == \"\"){\n $this->s113_d_exame_dia = ($this->s113_d_exame_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_dia\"]:$this->s113_d_exame_dia);\n $this->s113_d_exame_mes = ($this->s113_d_exame_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_mes\"]:$this->s113_d_exame_mes);\n $this->s113_d_exame_ano = ($this->s113_d_exame_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_ano\"]:$this->s113_d_exame_ano);\n if($this->s113_d_exame_dia != \"\"){\n $this->s113_d_exame = $this->s113_d_exame_ano.\"-\".$this->s113_d_exame_mes.\"-\".$this->s113_d_exame_dia;\n }\n }\n $this->s113_i_ficha = ($this->s113_i_ficha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_ficha\"]:$this->s113_i_ficha);\n $this->s113_c_hora = ($this->s113_c_hora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_hora\"]:$this->s113_c_hora);\n $this->s113_i_situacao = ($this->s113_i_situacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_situacao\"]:$this->s113_i_situacao);\n if($this->s113_d_cadastro == \"\"){\n $this->s113_d_cadastro_dia = ($this->s113_d_cadastro_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_dia\"]:$this->s113_d_cadastro_dia);\n $this->s113_d_cadastro_mes = ($this->s113_d_cadastro_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_mes\"]:$this->s113_d_cadastro_mes);\n $this->s113_d_cadastro_ano = ($this->s113_d_cadastro_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_ano\"]:$this->s113_d_cadastro_ano);\n if($this->s113_d_cadastro_dia != \"\"){\n $this->s113_d_cadastro = $this->s113_d_cadastro_ano.\"-\".$this->s113_d_cadastro_mes.\"-\".$this->s113_d_cadastro_dia;\n }\n }\n $this->s113_c_cadastro = ($this->s113_c_cadastro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_cadastro\"]:$this->s113_c_cadastro);\n $this->s113_i_login = ($this->s113_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_login\"]:$this->s113_i_login);\n $this->s113_c_encaminhamento = ($this->s113_c_encaminhamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_encaminhamento\"]:$this->s113_c_encaminhamento);\n }else{\n $this->s113_i_codigo = ($this->s113_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_codigo\"]:$this->s113_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->s113_i_codigo = ($this->s113_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_codigo\"]:$this->s113_i_codigo);\n $this->s113_i_prestadorhorarios = ($this->s113_i_prestadorhorarios == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_prestadorhorarios\"]:$this->s113_i_prestadorhorarios);\n $this->s113_i_numcgs = ($this->s113_i_numcgs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_numcgs\"]:$this->s113_i_numcgs);\n if($this->s113_d_agendamento == \"\"){\n $this->s113_d_agendamento_dia = ($this->s113_d_agendamento_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_dia\"]:$this->s113_d_agendamento_dia);\n $this->s113_d_agendamento_mes = ($this->s113_d_agendamento_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_mes\"]:$this->s113_d_agendamento_mes);\n $this->s113_d_agendamento_ano = ($this->s113_d_agendamento_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_ano\"]:$this->s113_d_agendamento_ano);\n if($this->s113_d_agendamento_dia != \"\"){\n $this->s113_d_agendamento = $this->s113_d_agendamento_ano.\"-\".$this->s113_d_agendamento_mes.\"-\".$this->s113_d_agendamento_dia;\n }\n }\n if($this->s113_d_exame == \"\"){\n $this->s113_d_exame_dia = ($this->s113_d_exame_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_dia\"]:$this->s113_d_exame_dia);\n $this->s113_d_exame_mes = ($this->s113_d_exame_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_mes\"]:$this->s113_d_exame_mes);\n $this->s113_d_exame_ano = ($this->s113_d_exame_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_ano\"]:$this->s113_d_exame_ano);\n if($this->s113_d_exame_dia != \"\"){\n $this->s113_d_exame = $this->s113_d_exame_ano.\"-\".$this->s113_d_exame_mes.\"-\".$this->s113_d_exame_dia;\n }\n }\n $this->s113_i_ficha = ($this->s113_i_ficha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_ficha\"]:$this->s113_i_ficha);\n $this->s113_c_hora = ($this->s113_c_hora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_hora\"]:$this->s113_c_hora);\n $this->s113_i_situacao = ($this->s113_i_situacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_situacao\"]:$this->s113_i_situacao);\n if($this->s113_d_cadastro == \"\"){\n $this->s113_d_cadastro_dia = ($this->s113_d_cadastro_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_dia\"]:$this->s113_d_cadastro_dia);\n $this->s113_d_cadastro_mes = ($this->s113_d_cadastro_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_mes\"]:$this->s113_d_cadastro_mes);\n $this->s113_d_cadastro_ano = ($this->s113_d_cadastro_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_ano\"]:$this->s113_d_cadastro_ano);\n if($this->s113_d_cadastro_dia != \"\"){\n $this->s113_d_cadastro = $this->s113_d_cadastro_ano.\"-\".$this->s113_d_cadastro_mes.\"-\".$this->s113_d_cadastro_dia;\n }\n }\n $this->s113_c_cadastro = ($this->s113_c_cadastro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_cadastro\"]:$this->s113_c_cadastro);\n $this->s113_i_login = ($this->s113_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_login\"]:$this->s113_i_login);\n $this->s113_c_encaminhamento = ($this->s113_c_encaminhamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_encaminhamento\"]:$this->s113_c_encaminhamento);\n }else{\n $this->s113_i_codigo = ($this->s113_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_codigo\"]:$this->s113_i_codigo);\n }\n }", "function evt__form_integrante_i__modificacion($datos)\r\n {\r\n $perfil = toba::usuario()->get_perfil_datos();\r\n if ($perfil == null) {//es usuario de SCyT\r\n if($this->chequeo_formato_norma($datos['rescd_bm'])){ \r\n $datos2['rescd_bm']=$datos['rescd_bm'];\r\n $datos2['resaval']=$datos['resaval'];\r\n $datos2['cat_investigador']=$datos['cat_investigador'];\r\n $this->dep('datos')->tabla('integrante_interno_pi')->set($datos2);\r\n $this->dep('datos')->tabla('integrante_interno_pi')->sincronizar();\r\n toba::notificacion()->agregar('Guardado. Solo modifica ResCD baja/modif, Res Aval, Cat Investigador', 'info');\r\n }\r\n }else{//es usuario de la UA\r\n $pi=$this->controlador()->controlador()->dep('datos')->tabla('pinvestigacion')->get();\r\n $int=$this->dep('datos')->tabla('integrante_interno_pi')->get(); \r\n if($datos['desde']<$pi['fec_desde'] or $datos['hasta']>$pi['fec_hasta']){//no puede ir fuera del periodo del proyecto\r\n //toba::notificacion()->agregar('Revise las fechas. Fuera del periodo del proyecto!', 'error'); \r\n throw new toba_error(\"Revise las fechas. Fuera del periodo del proyecto!\");\r\n }else{ \r\n //Pendiente verificar que la modificacion no haga que se superpongan las fechas\r\n $haysuperposicion=false;//no es igual al del alta porque no tengo que considerar el registro vigente$this->controlador()->controlador()->dep('datos')->tabla('pinvestigacion')->superposicion_modif($pi['id_pinv'],$datos['id_docente'],$datos['desde'],$datos['hasta'],$registro['id_designacion'],$registro['desde']);\r\n if(!$haysuperposicion){\r\n $band=false;\r\n if($pi['estado']=='A'){\r\n $band=$this->dep('datos')->tabla('logs_integrante_interno_pi')->fue_chequeado($int['id_designacion'],$int['pinvest'],$int['desde']);\r\n } \r\n $regenorma = '/^[0-9]{4}\\/[0-9]{4}$/';\r\n if ( !preg_match($regenorma, $datos['rescd'], $matchFecha) ) {\r\n throw new toba_error('Nro Resolucion CD invalida. Debe ingresar en formato XXXX/YYYY');\r\n }else{\r\n if (isset($datos['rescd_bm']) && !preg_match($regenorma, $datos['rescd_bm'], $matchFecha) ) {\r\n throw new toba_error('Nro Resolucion CD Baja/Modif invalida. Debe ingresar en formato XXXX/YYYY');\r\n }else{\r\n if($band){//si alguna vez fue chequeado por SCyT entonces solo puede modificar fecha_hasta y nada mas (se supone que lo demas ya es correcto) \r\n //fecha_hasta porque puede ocurrir que haya una baja del participante o la modificacion de funcion o carga horaria\r\n unset($datos['funcion_p']);\r\n unset($datos['cat_investigador']);\r\n unset($datos['identificador_personal']);\r\n unset($datos['carga_horaria']);\r\n unset($datos['desde']);\r\n unset($datos['rescd']);\r\n unset($datos['cat_invest_conicet']);\r\n unset($datos['resaval']);\r\n unset($datos['hs_finan_otrafuente']);\r\n //Solo si cambia hasta y resol bm pierde el check\r\n if( $int['hasta']<>$datos['hasta'] or $int['rescd_bm']<>$datos['rescd_bm'] ){\r\n $datos['check_inv']=0;//pierde el check si es que lo tuviera. Solo cuando cambia algo\r\n }\r\n $mensaje='Ha sido chequeado por SCyT, solo puede modificar fecha hasta y resCD baja/modif';\r\n }else{//band false significa que puede modificar cualquier cosa\r\n //esto lo hago porque el set de toba no modifica la fecha desde por ser parte de la clave \r\n $this->dep('datos')->tabla('integrante_interno_pi')->modificar_fecha_desde($int['id_designacion'],$int['pinvest'],$int['desde'],$datos['desde']);\r\n $mensaje=\"Los datos se han guardado correctamente\";\r\n }\r\n $this->dep('datos')->tabla('integrante_interno_pi')->set($datos);\r\n $this->dep('datos')->tabla('integrante_interno_pi')->sincronizar();\r\n toba::notificacion()->agregar($mensaje, 'info'); \r\n }\r\n }\r\n }else{\r\n //toba::notificacion()->agregar('Hay superposicion de fechas', 'error'); \r\n throw new toba_error(\"Hay superposicion de fechas\");\r\n }\r\n }\r\n }\r\n //nuevo Lo coloco para que el formulario se oculte al finalizar\r\n $this->dep('datos')->tabla('integrante_interno_pi')->resetear();\r\n $this->s__mostrar_i=0;\r\n }", "public function actualizaSoloUsuario($dataArray){\n //deleted, created_at y updated_at son comunes, pero estos jamas se actualizaran por acá\n if (array_key_exists('password',$dataArray))\n $dataArray['password'] = bcrypt($dataArray['password']);\n \n $this->model->update($dataArray); //set data only in its PersonaNatural model\n }", "public function updatedUsuario()\n {\n // Notificamos al otro componente el cambio\n $this->emit('cambioUsuario', $this->usuario);\n }", "private function modificarCita(){\n $query = \"UPDATE \" . $this->table . \" SET PacienteId ='\" . $this->idpaciente . \"',Fecha = '\" . $this->fecha . \"', HoraInicio = '\" . $this->horarioIn . \"', HoraFin = '\" .\n $this->horarioFn . \"', Motivo = '\" . $this->motivo . \"' WHERE CitaId = '\" . $this->idcita . \"'\"; \n $resp = parent::nonQuery($query);\n if($resp >= 1){\n return $resp;\n }else{\n return 0;\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->cm06_i_codigo = ($this->cm06_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_i_codigo\"]:$this->cm06_i_codigo);\n $this->cm06_i_sepultamento = ($this->cm06_i_sepultamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_i_sepultamento\"]:$this->cm06_i_sepultamento);\n $this->cm06_i_ossoario = ($this->cm06_i_ossoario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_i_ossoario\"]:$this->cm06_i_ossoario);\n if($this->cm06_d_entrada == \"\"){\n $this->cm06_d_entrada_dia = ($this->cm06_d_entrada_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_d_entrada_dia\"]:$this->cm06_d_entrada_dia);\n $this->cm06_d_entrada_mes = ($this->cm06_d_entrada_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_d_entrada_mes\"]:$this->cm06_d_entrada_mes);\n $this->cm06_d_entrada_ano = ($this->cm06_d_entrada_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_d_entrada_ano\"]:$this->cm06_d_entrada_ano);\n if($this->cm06_d_entrada_dia != \"\"){\n $this->cm06_d_entrada = $this->cm06_d_entrada_ano.\"-\".$this->cm06_d_entrada_mes.\"-\".$this->cm06_d_entrada_dia;\n }\n }\n $this->cm06_t_obs = ($this->cm06_t_obs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_t_obs\"]:$this->cm06_t_obs);\n }else{\n $this->cm06_i_codigo = ($this->cm06_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_i_codigo\"]:$this->cm06_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->k04_sequencial = ($this->k04_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k04_sequencial\"]:$this->k04_sequencial);\n $this->k04_receit = ($this->k04_receit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k04_receit\"]:$this->k04_receit);\n $this->k04_codjm = ($this->k04_codjm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k04_codjm\"]:$this->k04_codjm);\n if($this->k04_dtini == \"\"){\n $this->k04_dtini_dia = ($this->k04_dtini_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k04_dtini_dia\"]:$this->k04_dtini_dia);\n $this->k04_dtini_mes = ($this->k04_dtini_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k04_dtini_mes\"]:$this->k04_dtini_mes);\n $this->k04_dtini_ano = ($this->k04_dtini_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k04_dtini_ano\"]:$this->k04_dtini_ano);\n if($this->k04_dtini_dia != \"\"){\n $this->k04_dtini = $this->k04_dtini_ano.\"-\".$this->k04_dtini_mes.\"-\".$this->k04_dtini_dia;\n }\n }\n if($this->k04_dtfim == \"\"){\n $this->k04_dtfim_dia = ($this->k04_dtfim_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k04_dtfim_dia\"]:$this->k04_dtfim_dia);\n $this->k04_dtfim_mes = ($this->k04_dtfim_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k04_dtfim_mes\"]:$this->k04_dtfim_mes);\n $this->k04_dtfim_ano = ($this->k04_dtfim_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k04_dtfim_ano\"]:$this->k04_dtfim_ano);\n if($this->k04_dtfim_dia != \"\"){\n $this->k04_dtfim = $this->k04_dtfim_ano.\"-\".$this->k04_dtfim_mes.\"-\".$this->k04_dtfim_dia;\n }\n }\n }else{\n $this->k04_sequencial = ($this->k04_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k04_sequencial\"]:$this->k04_sequencial);\n }\n }" ]
[ "0.68042487", "0.67675763", "0.6733117", "0.6733117", "0.65137994", "0.6472444", "0.64704186", "0.6391399", "0.63866514", "0.62865937", "0.6277645", "0.6272031", "0.6270816", "0.62503624", "0.6245995", "0.6238028", "0.6212144", "0.6203599", "0.6170402", "0.6169222", "0.61688924", "0.6160208", "0.6156453", "0.6145056", "0.6144602", "0.612848", "0.6126856", "0.6125554", "0.61202246", "0.611449", "0.610431", "0.61008966", "0.6091323", "0.6079888", "0.6073712", "0.60707885", "0.6068029", "0.6066668", "0.6063028", "0.60617775", "0.6058618", "0.60518897", "0.6051277", "0.6050937", "0.6049718", "0.60487396", "0.60378414", "0.6037699", "0.6019527", "0.6009579", "0.6005569", "0.60051817", "0.60049886", "0.6000604", "0.5997334", "0.59971577", "0.59970814", "0.59952295", "0.59927857", "0.5986914", "0.59817123", "0.59783936", "0.59756124", "0.59733325", "0.5961713", "0.5955221", "0.5952095", "0.5948009", "0.5947226", "0.59449494", "0.59436214", "0.5943078", "0.5941028", "0.59407496", "0.59279966", "0.5917154", "0.59164745", "0.59140146", "0.5907292", "0.5901694", "0.58983064", "0.5883945", "0.5883945", "0.588384", "0.58747363", "0.58738196", "0.5868844", "0.5859982", "0.5857715", "0.58529556", "0.5848938", "0.58468145", "0.58455646", "0.5829766", "0.5829766", "0.582537", "0.58191645", "0.5818699", "0.5816784", "0.58151525", "0.58087105" ]
0.0
-1
add messages to session at end of page
public function __destruct() { $_SESSION['mod_messages'] = $this->messages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setMessage()\r\n\t{\r\n\t\t$model = $this->getModel();\r\n\t\tif (!$model->isMultiPage()) {\r\n\t\t\t$this->assign('message', '');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$message = '';\r\n\t\tif ($model->sessionModel) {\r\n\t\t\t$this->message = $model->sessionModel->status;\r\n\t\t\t//see http://fabrikar.com/forums/showpost.php?p=73833&postcount=14\r\n\t\t\t//if ($model->sessionModel->statusid == _FABRIKFORMSESSION_LOADED_FROM_COOKIE) {\r\n\t\t\tif ($model->sessionModel->last_page > 0) {\r\n\t\t\t\t$message .= ' <a href=\"#\" class=\"clearSession\">'.JText::_('COM_FABRIK_CLEAR').'</a>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->assign('message', $message);\r\n\t}", "protected function _setSessionMessages($messages) {}", "function printMessages()\n {\n //check if messages buffer contain any values\n if(isset($_SESSION['msg']))\n {\n echo \"{$_SESSION['msg']}\";\n unset($_SESSION['msg']);\n }\n }", "protected function messagesToSession() {\n\t\t$_SESSION['messages'] = $this->messages;\n\t\t$_SESSION['fieldMessages'] = $this->fieldMessages;\n\t}", "function add_message($msg, $msg_type = MSG_TYPE_SUCCESS) {\n if (!isset($_SESSION['message']))\n $_SESSION['message'] = [];\n $_SESSION['message'][] = ['type' => $msg_type, 'message' => htmlentities($msg, ENT_QUOTES)];\n}", "function display_message(){\r\n if(isset($_SESSION['message'])){\r\n echo $_SESSION['message'];\r\n unset($_SESSION['message']);\r\n }\r\n}", "function on_session_end() {\n}", "function flashMessage() {\n if (isset($_SESSION['add'])){\n echo('<p style=\"color: red;\">'.htmlentities($_SESSION['add']).\"</p>\");\n unset($_SESSION['add']);\n }\n if (isset($_SESSION['success'])) {\n echo('<p style=\"color: green;\">'.htmlentities($_SESSION['success']).\"</p>\\n\");\n unset($_SESSION['success']);\n }\n if (isset($_SESSION['error'])) {\n echo('<p style=\"color:red;\">'.htmlentities($_SESSION['error']).\"</p>\\n\");\n unset($_SESSION['error']);\n }\n}", "function endSession()\n {\n $this->documentBuffer .= \"</div>\\n\";\n }", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\r\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\r\n\t}", "function ClearMessage() {\r\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\r\n\t}", "function ClearMessage() {\r\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\r\n\t}", "function ClearMessage() {\r\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\r\n\t}", "function setMessage($message=''){\n $_SESSION['message'] = $message;\n }", "private function check_message(){\t\t\tif(isset($_SESSION['message'])){\r\n\t\t\t\t// Add it as an attribute and erase the stored version\r\n\t\t\t\t\r\n\t\t\t\t$this->message = $_SESSION['message'];\r\n\t\t\t\tunset($_SESSION['message']);\r\n\t\t\t}else{\r\n\t\t\t\t$this->message=\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "protected function flash()\n\t{\n\t\t$this->session->flash($this->sessionKey, $this->bag->toJson());\n\t}", "public function clearMsg() {\n\t\t$_SESSION['msg'] = null;\n\t}", "function set_message($section,$messages) {\n //script_message is an array of lists. Each element of array is indexed by\n // section name and contains a list of messages.\n $this->store_in_session('script_messages',$section,$messages);\n \n }", "public function clear_message() {\n unset($_SESSION['message']);\n }", "private function check_message ()\n\t{\t\tif (isset($_SESSION['message']))\n\t\t{\n\t\t\t// Add it as an attribute and erase the stored version\n\t\t\t$this->message = $_SESSION['message'];\n\t\t\tunset($_SESSION['message']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->message = \"\";\n\t\t}\n\t}", "public function sessions_end()\n\t{\n\t\t// nothing to see here\n\t}", "function set_message($msg, $url='')\n\t{\n\t\t$_SESSION['message'] = $msg;\n\t\tif ($url)\n\t\t\tredirect($url);\n\t}", "protected function addFlashMessages() {}", "function printFlashMessage() {\n if (!isset($_SESSION['flashMessage'])) {\n return;\n }\n\n echo '<div class=\"alert alert-success mb-4\" id=\"FlashMessage\">'.$_SESSION['flashMessage']\n .'<button type=\"button\" class=\"close\" onclick=\"location.reload(true); return false;\">'\n .'<span aria-hidden=\"true\">&times;</span>'\n .'</button>'\n .'</div>';\n $_SESSION['flashMessage'] = null;\n}", "function flash_message($type, $message) {\n $_SESSION['message'] = array('type' => $type, 'message' => $message);\n if (isset($_SESSION['message'])) {\n\t\tprint_r( $_SESSION['message']);\n\t}\n}", "function checkMessage() {\n if (isset($_SESSION['message'])) {\n echo \"\n <br>\n <div class='container'>\n <div class='alert alert-dismissible alert-{$_SESSION['message']['type']}' role='alert'>\n <strong>{$_SESSION['message']['name']}</strong> {$_SESSION['message']['desc']}\n <button type='button' class='close' data-dismiss='alert' aria-label='Close'>\n <span aria-hidden='true'>&times;</span>\n </button>\n </div>\n </div>\";\n unset($_SESSION['message']);\n }\n }", "static private function showMessages() {\n if (isset($_SESSION['messages'])) {\n\n $messages = new View(\"global.messages\", array(\"messages\" => $_SESSION['messages']));\n echo $messages->getHtml();\n // du coup on peut supprimer les messages\n unset($_SESSION['messages']);\n }\n }", "public function action_endsession()\n\t{\n\t\t// This is so easy!\n\t\tunset($_SESSION['admin_time']);\n\n\t\t// Clean any admin tokens as well.\n\t\tcleanTokens(false, '-admin');\n\n\t\tif (isset($this->_req->query->redir, $this->_req->server->HTTP_REFERER))\n\t\t{\n\t\t\tredirectexit($_SERVER['HTTP_REFERER']);\n\t\t}\n\n\t\tredirectexit();\n\t}", "static private function _setMsgs( Array $data )\n\t{\n\t\tFactory::getInstance( 'Session' )->set( self::$var_name, $data );\n\t}", "function checkForMessage() {\n if (isset($_SESSION['message'])) {\n echo $_SESSION['message'] . '<br>';\n unset($_SESSION['message']);\n }\n}", "function printSessionSuccessMessage(){\n\t\tif (!empty($_SESSION[\"successMessage\"])) {\n\t\t\techo(\"<div class=\\\"alert alert-success alert-dismissible fade show text-center\\\" role=\\\"alert\\\">\" \n\t\t\t\t. $_SESSION[\"successMessage\"] \n\t\t\t\t. \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\">&times;</span></button></div>\");\n\t\t}\n\t}", "protected function emptyMessagesFromSession()\n {\n $this->session->set('messages', null);\n }", "function ShowMsg(){\n\tif(GetVal($_SESSION,\"Msg\")!=\"\"){\n\t\techo '<span class=\"Message\">'.$_SESSION['Msg'].'</span><br/>';\n\t\t$_SESSION['Msg']=\"\";\n\t}\n}", "function set_message($msg)\n{\n if (!empty($msg)) {\n $_SESSION['message'] = $msg;\n } else {\n $msg = \"\";\n }\n}", "public function doLogout() {\n $_SESSION = array();\n session_destroy();\n $this->messages[] = \"Acabas de cerrar Sesión.\";\n \n\n }", "public function is_there_any_msg()\n\t{\n\t\tif(isset($_SESSION[\"message\"]))\n\t\t{\n\t\t\t$this->_message = $_SESSION[\"message\"];\n\t\t\tunset($_SESSION[\"message\"]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_message=\"\";\n\t\t}\n\t}", "public function resetMessage(){\n\t\t\tif (isset($_SESSION['message']) && $_SESSION['message']!='') {\n\t\t\t\t$_SESSION['message']='';\n\t\t\t}\n\t\t}", "public function postDispatch()\n {\n $this->view->flashMessenger = array_merge(\n $this->_flashMessenger->getMessages(), $this->_flashMessenger->getCurrentMessages()\n );\n $this->_flashMessenger->clearCurrentMessages();\n }", "function osc_add_flash_ok_message($msg, $section = 'pubMessages') {\n Session::newInstance()->_setMessage($section, $msg, 'ok');\n }", "function set_message($message){\r\n if(!empty($message)){\r\n $_SESSION['message'] = $message;\r\n }else{\r\n $message = \"\";\r\n }\r\n}", "function render_messages() {\n if (isset($_SESSION['message']) && not_null($_SESSION['message'])) {\n for ($i = 0; $i < sizeof($_SESSION['message']); $i++) {\n switch ($_SESSION['message'][$i]['type']) {\n case MSG_TYPE_SUCCESS:\n echo '<p class=\"alert alert-success\" role=\"alert\">' . $_SESSION['message'][$i]['message'] . '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button></p>';\n break;\n case MSG_TYPE_ERROR:\n echo '<p class=\"alert alert-danger\" role=\"alert\">' . $_SESSION['message'][$i]['message'] . '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button></p>';\n break;\n }\n }\n unset($_SESSION['message']);\n }\n}", "function flash_msg(){ ?>\r\n <?php if(isset($_SESSION['success'])): ?>\r\n <p style=\"color: green\"><?= htmlentities($_SESSION['success']) ?></p>\r\n <?php unset($_SESSION['success']); ?>\r\n <?php elseif(isset($_SESSION['failure'])): ?>\r\n <p style=\"color: red\"><?= htmlentities($_SESSION['failure']) ?></p>\r\n <?php unset($_SESSION['failure']); ?>\r\n <?php endif; ?>\r\n<?php }", "private function setResponse($msg){\n $_SESSION[self::RESPONSE_SESSION] = $msg;\n }", "function delete_updating_success_message(){\n\t$_SESSION[\"update-completed\"] = null;\n}", "function manageMessages(&$response)\n\t{\n\t\tif(array_key_exists(\"_ERRORES\",$_SESSION))\n\t\t{\n\t\t\tif (count($_SESSION[\"_ERRORES\"])>0)\n\t\t\t{\n\t\t\t\t$response->setErrors($_SESSION[\"_ERRORES\"]);\n\t\t\t\tunset($_SESSION[\"_ERRORES\"]);\n\t\t\t}\n\t\t}\n\n\t\tif(array_key_exists(\"_MENSAJES\",$_SESSION))\n\t\t{\n\t\t\tif (count($_SESSION[\"_MENSAJES\"])>0)\n\t\t\t{\n\t\t\t\t$response->setMessages($_SESSION[\"_MENSAJES\"]);\n\t\t\t\tunset($_SESSION[\"_MENSAJES\"]);\n\t\t\t}\n\t\t}\n\t}", "private function readMessagesFromSession() {\n\t\tif (!empty($_SESSION['messages'])) {\n\t\t\t$this->messages = array_merge($this->messages, $_SESSION['messages']);\n\n\t\t\t//Messages should stay in session only for 1 request, so remove it from the session\n\t\t\tunset($_SESSION['messages']);\n\t\t}\n\t\tif (!empty($_SESSION['fieldMessages'])) {\n\t\t\t$this->fieldMessages = array_merge($this->fieldMessages, $_SESSION['fieldMessages']);\n\n\t\t\t//Messages should stay in session only for 1 request, so remove it from the session\n\t\t\tunset($_SESSION['fieldMessages']);\n\t\t}\n\t}", "public function delete_messages()\n {\n $this->message=array();\n Session::instance()->delete(\"hana_message\");\n }", "function end() {\n $this->messages[] = array('', $this->page->getLocale('install.end'));\n }", "function mostraAvviso(){\nif(isset($_SESSION['messaggio'])){\necho $_SESSION['messaggio'];\nunset ($_SESSION['messaggio']);\n}\n}", "private function add($params)\n {\n $flash_messages = isset($_SESSION['flash_messages']) ? $_SESSION['flash_messages'] : array();\n $_SESSION['flash_messages'][] = $params;\n }", "function flashmessage(){\n if ( isset($_SESSION['error'])){\n echo \"<p style='color:red'>\".$_SESSION['error'].\"</p>\";\n unset($_SESSION['error']);\n }\n if (isset($_SESSION['success'])){\n echo \"<p style='color:green'>\".$_SESSION['success'].\"</p>\";\n unset($_SESSION['success']);\n }\n}", "private function _write_messages( $messages ) {\n\t\t$this->messages = $messages;\n\t\t$y = $this->encode_cookie( $messages );\n\t\tsetcookie( $this->cookie_handle, $y, 0, '/' );\n\t}", "function extra_siteinfo_currently_loggedin_users_page_end_session_submit($form_id, &$form_state) {\n $user = user_load($form_state['user_id']);\n db_delete('sessions')\n ->condition('uid', $user->uid)\n ->execute();\n drupal_set_message(t('@username ( @userid ) user session has been ended.',\n array(\n '@username' => $user->name,\n '@userid' => $user->uid,\n )\n ));\n drupal_goto('admin/reports/extra-siteinfo/currently-loggedin-users');\n}", "public function addMessage($message, $type) {\n\t\t$messages = $_SESSION[$this->sessionKey];\n\t\t\n\t\t$messages[] = [\n\t\t\t'message' => $message,\n\t\t\t'type' => $type,\n\t\t];\n\t\t\n\t\t$_SESSION[$this->sessionKey] = $messages;\n\t}", "private function success() : void\n {\n session_destroy();\n session_unset();\n (new Repository())->disconnect();\n (new Session())->set('user','success', 'Votre compte a bien été supprimé');\n header('Location:' . self::REDIRECT_SIGNUP);\n die();\n\n }", "function alertCache($message)\n\t{\n\t\t$_SESSION['ALERT'] = $message;\n\t}", "public function putInSession()\n {\n if (!$this->flashNotifications) {\n return;\n }\n if ($this->plural) {\n $this->session->flash(\n \"notifications.$this->plural\", $this->flashNotifications\n );\n } else {\n if (count($this->flashNotifications) === 1) {\n $this->session->flash(\n \"notifications.$this->name\", $this->flashNotifications[0]\n );\n } else {\n throw new Exception(\n \"Could not flash multiple notifications without '\n .'a plural version of the name of the bag.\"\n );\n }\n }\n }", "function printErro(){\n\tif ( $_SESSION['msg'] ) {\n\t\tprint $_SESSION['msg'];\n\t\t$_SESSION['msg'] = '';\n\t}\n}", "function show_flash_msg() {\n $f = get_session(\"MsgFlash\");\n if (!empty($f)) {\n echo $f;\n clear_session(\"MsgFlash\");\n }\n}", "public function showFlashMessage()\n {\n \tif (isset($_SESSION['flashMessage'])) {\n \t\techo '<div class=\"alert alert-' . $_SESSION['flashMessage']['type'] . '\" role=\"alert\">';\n \t\techo '<strong>'. $_SESSION['flashMessage']['message'] . '</strong>';\n \t\techo '</div>';\n\n \t\tunset($_SESSION['flashMessage']);\n \t}\n }", "function flash( $name = '', $message = '', $class = 'success fadeout-message', $url = '' )\n{\n if( !empty( $name ) )\n {\n //No message, create it\n if( !empty( $message ) && empty( $_SESSION[$name] ) )\n {\n if( !empty( $_SESSION[$name] ) )\n {\n unset( $_SESSION[$name] );\n }\n if( !empty( $_SESSION[$name.'_class'] ) )\n {\n unset( $_SESSION[$name.'_class'] );\n }\n \n $_SESSION[$name] = $message;\n $_SESSION[$name.'_class'] = $class;\n }\n //Message exists, display it\n elseif( !empty( $_SESSION[$name] ) && empty( $message ) )\n {\n $class = !empty( $_SESSION[$name.'_class'] ) ? $_SESSION[$name.'_class'] : 'success';\n echo '<div class=\"'.$class.'\" id=\"msg-flash\">'.$_SESSION[$name].'</div>';\n unset($_SESSION[$name]);\n unset($_SESSION[$name.'_class']);\n }\n }\n\tif( !empty( $url ) || $url != '' )\n {\n\t\theader('Location: '.$url);\n\t\texit();\n\t}\n}", "public static function flash()\n {\n session_unset();\n $_SESSION = array();\n }", "function setMessage($message, $status) {\n\t$_SESSION['message']['content'] = $message;\n\t$_SESSION['message']['status'] = $status;\n}", "protected function getFlashMessagesFromSession() {}", "protected function showFlashMessages()\n{\n //set the flash messages to all types of laravel session\n session()->flash('error', $this->errorMessages);\n session()->flash('info', $this->infoMessages);\n session()->flash('success', $this->successMessages);\n session()->flash('warning', $this->warningMessages);\n}", "function set_message($msg, $alert_type) {\n\n if(!empty($msg)) {\n $_SESSION['message'] = $msg;\n $_SESSION['alert'] = $alert_type;\n }\n else {\n $msg = \"\";\n $alert_type = \"\";\n }\n\n}", "function setSessionMessage($tag_id, $message) {\n\t$_SESSION['message'] = array('id' => $tag_id, 'message' => $message);\n}", "function setFlash($type, $message)\n{\n $_SESSION['message'] = [$type, $message];\n}", "function flash( $name = '', $message = '', $class = 'success fadeout-message' )\n{\n if( !empty( $name ) )\n {\n //No message, create it\n if( !empty( $message ) && empty( $_SESSION[$name] ) )\n {\n if( !empty( $_SESSION[$name] ) )\n {\n unset( $_SESSION[$name] );\n }\n if( !empty( $_SESSION[$name.'_class'] ) )\n {\n unset( $_SESSION[$name.'_class'] );\n }\n \n $_SESSION[$name] = $message;\n $_SESSION[$name.'_class'] = $class;\n }\n //Message exists, display it\n elseif( !empty( $_SESSION[$name] ) && empty( $message ) )\n {\n $class = !empty( $_SESSION[$name.'_class'] ) ? $_SESSION[$name.'_class'] : 'success';\n echo '<div class=\"'.$class.'\" id=\"msg-flash\">'.$_SESSION[$name].'</div>';\n unset($_SESSION[$name]);\n unset($_SESSION[$name.'_class']);\n }\n }\n}", "function set_return($message)\n{\n\t$_SESSION['notification'] = $message;\n\theader('Location: contact.php');\n\texit;\n}", "protected function setFlashMessage()\n {\n if ($message = $this->session()->getFlash('flash-message')) {\n if ($this->session()->getFlash('flash-error')) {\n $this->pageView()->setError($message);\n } else {\n $this->pageView()->setMessage($message);\n }\n }\n }", "public static function setActionMessage($message, $close = false){\n if (!isset($_SESSION['system_message'])) {\n $_SESSION['system_message'] = array ();\n } \n \n $_SESSION['system_message'][] = $message;\n \n if ($close) {\n session_write_close();\n }\n }", "private function end() {\n if ($this->isSessionStarted()) {\n session_commit();\n $this->clear();\n }\n }", "function osc_add_flash_info_message($msg, $section = 'pubMessages') {\n Session::newInstance()->_setMessage($section, $msg, 'info');\n }", "function printSessionErrorMessage(){\n\t\tif (!empty($_SESSION[\"errorMessage\"])) {\n\t\t\techo(\"<div class=\\\"alert alert-warning text-center\\\" role=\\\"alert\\\">\" . $_SESSION[\"errorMessage\"] . \"</div>\");\n\t\t}\n\t}", "function mensaje_entregables(){\n\t$_SESSION['estado']='9';\n\techo \" <script>window.location='admin_registro.php'; </script>\";\n}" ]
[ "0.7014005", "0.6678771", "0.66640884", "0.6629124", "0.65650845", "0.65595144", "0.6553599", "0.6515858", "0.6491309", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6491241", "0.6490894", "0.6490894", "0.6490894", "0.6490894", "0.6480474", "0.6451353", "0.64207125", "0.640153", "0.63894945", "0.63759166", "0.6353671", "0.63370264", "0.63322186", "0.63285005", "0.6316027", "0.6312979", "0.62993884", "0.62895006", "0.62484604", "0.6240419", "0.62332934", "0.62284905", "0.62263393", "0.62215227", "0.6204699", "0.6204067", "0.6193925", "0.6183598", "0.6165439", "0.6154937", "0.6154219", "0.6152946", "0.6132587", "0.6117365", "0.61149323", "0.61067075", "0.6104022", "0.6101481", "0.6087259", "0.60855615", "0.6082638", "0.6065751", "0.6025831", "0.6005185", "0.5997325", "0.59946936", "0.59474146", "0.59471995", "0.59453815", "0.5927919", "0.59079903", "0.59068334", "0.5904963", "0.59004426", "0.5883024", "0.5880181", "0.58795387", "0.587745", "0.5865333", "0.5861566", "0.58512473", "0.5839605", "0.5838635", "0.5838037", "0.5836711", "0.58303136", "0.5824583" ]
0.6667904
2
Column name from database.
public function getName();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function column_name(): mixed\n\t{\n\t\treturn self::$query->column_name;\n\t}", "abstract public static function get_column_name(): string;", "public function getColumnName();", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "private function getColumn(): string\n {\n return $this->getUsernameColumnName();\n }", "public function getNameColumn()\n {\n return $this->nameColumn;\n }", "public function getName()\n {\n return $this['column_name'];\n }", "public function getColumn(): string\n {\n return $this->column;\n }", "public function getColumn(): string\n {\n return $this->_column;\n }", "public function getColumnName()\n {\n return $this->columnName;\n }", "public function getColumnName(){\n $sql = 'SELECT * FROM wp_operatore_museale';\n $result = $this->conn->query($sql);\n $column = array();\n $i = 0;\n while($nameColumn = $result->fetch_field()){\n $column[$i] = $nameColumn->name;\n $i++;\n }\n return $column;\n }", "public function getColumnName() {\n return $this->columnName;\n }", "public function getName()\n {\n return name_to_id($this->columnName);\n }", "public function getConstantColumnName()\n { if ($this->getPeerName()) {\n return strtoupper($this->getPeerName());\n }\n\n return strtoupper($this->getName());\n }", "protected function get_column() {\n\n\t\t$column = $this->foreign_column ?: $this->foreign_table->get_primary_key();\n\t\t$columns = $this->foreign_table->get_columns();\n\n\t\treturn $columns[ $column ];\n\t}", "protected function getColumn()\n {\n return DB::select(\n 'SELECT\n\t\t\t\t\t\t\t c.COLUMN_NAME\n\t\t\t\t\t\t\t,c.COLUMN_DEFAULT\n\t\t\t\t\t\t\t,c.IS_NULLABLE\n\t\t\t\t\t\t\t,c.DATA_TYPE\n\t\t\t\t\t\t\t,c.CHARACTER_MAXIMUM_LENGTH\n\t\t\t\t\t\t\t,pk.CONSTRAINT_TYPE AS EXTRA\n\t\t\t\t\t\t\tFROM INFORMATION_SCHEMA.COLUMNS AS c\n\t\t\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\t\t SELECT ku.TABLE_CATALOG,ku.TABLE_SCHEMA,ku.TABLE_NAME,ku.COLUMN_NAME, tc.CONSTRAINT_TYPE\n\t\t\t\t\t\t\t FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc\n\t\t\t\t\t\t\t INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS ku ON tc.CONSTRAINT_NAME = ku.CONSTRAINT_NAME\n\t\t\t\t\t\t\t) AS pk ON c.TABLE_CATALOG = pk.TABLE_CATALOG\n\t\t\t\t\t\t\t AND c.TABLE_SCHEMA = pk.TABLE_SCHEMA\n\t\t\t\t\t\t\t AND c.TABLE_NAME = pk.TABLE_NAME\n\t\t\t\t\t\t\t AND c.COLUMN_NAME = pk.COLUMN_NAME\n\t\t\t\t\t\t\tWHERE c.TABLE_NAME = ? AND c.TABLE_CATALOG = ? ',\n [$this->tableName, $this->databaseName]\n );\n }", "protected function getWhereColumn()\n {\n $table = $this->getDoctrineTable();\n \n if ($this->getOption('column'))\n {\n return $table->getColumnName($this->getOption('column'));\n }\n\n $identifier = (array) $table->getIdentifier();\n $columnName = current($identifier);\n\n return $table->getColumnName($columnName);\n }", "public function getColumnName($result_set, $index)\n\t{\n\t\treturn $result_set->fetch_field_direct($index)->name;\n\t}", "public function column_name($item)\n {\n }", "public function getColumn()\n {\n return $this->get('Column');\n }", "protected function get_primary_column_name()\n {\n }", "protected function get_primary_column_name()\n {\n }", "protected function get_primary_column_name()\n {\n }", "function sql_field_name($res, $offset = 0)\n {\n $column = $res->getColumnMeta($offset);\n if ($column) {\n return $column['name'];\n }\n return false;\n }", "public function getColumn(): string;", "public function getDbFieldName($field_name);", "public function extractColumnName($column);", "function field_name($sth,$index){\n try{\n switch(dbconection::$conntype){\n case \"pdo\" : return $sth->getColumnMeta($index)[\"name\"]; break;\n case \"mysql\" : return mysqli_fetch_field_direct($sth,$index)->name; break;\n case \"postgresql\" : return pg_field_name($sth,$index); break;\n default : throw new Exception(\"Nenhum tipo de conexão definida.\");\n }\n }catch(Exception $e){\n printr(\"NAME FIELDS ERROR : \".$e->getMessage());\n }\n }", "public function getVariableColumnName()\r\n\t{\r\n\t\treturn $this->variable_column_name;\r\n\t}", "public function getColumnId(): string\n {\n return $this->getColumn('id', 'id');\n }", "public abstract function getColumnName($result_set, $index);", "public function get_column_names()\r\n {\r\n if (array_get(static::$tables, $this->from)) {\r\n return static::$tables[$this->from]['columns'];\r\n }\r\n\r\n $database = $this->db->get_connection()->get_database();\r\n\r\n $table = $this->from;\r\n\r\n $query = new Query();\r\n return $query->from('INFORMATION_SCHEMA.COLUMNS')\r\n ->where(array(\r\n 'table_schema' => $database,\r\n 'table_name' => $table\r\n ))\r\n ->pluck('column_name');\r\n }", "public function getColumn()\n {\n return $this->column;\n }", "public function getColumn()\n {\n return $this->column;\n }", "public function column_name($user)\n {\n }", "public function getSqlCol()\n {\n return $this->sqlCol;\n }", "abstract public function getColNames();", "public function getColumn() { return $this->column; }", "public function getColumnDetails( $tablename, $columnname );", "private function getColumnname($identifier)\n {\n return $this->options['columns'][$identifier];\n }", "abstract function getProfileColumnName($field_name);", "public function fetchCol($columnName);", "public function getUsernameColumnName(): string\n {\n return $this->usernameColumn ?? $this->getModelGeneratorConfig()->getConfig('column', 'username');\n }", "public function getSqlColString()\n {\n return $this->sqlColString;\n }", "protected function getUuidColumnName() {\n\n $uuidColumn = null;\n\n if ( ! $this->uuidFieldName ) {\n\n $this->initializeHasUuid();\n }\n\n return $this->uuidFieldName;\n }", "public function get_column_id()\n\t{\n\t\treturn $this->table.'.id';\n\t}", "public function getColumn($name)\n {\n return $this->columns[$name];\n }", "function getRecordCol($index) {\n return $this->records[$index]->getCol();\n }", "public function getCol()\n {\n return $this->col;\n }", "public function getColumnString()\n\t{\n\t\t$columns = '';\n\n\t\tfor($i = 0, $len = count($this->column); $i < $len; $i++)\n\t\t{\n\t\t\t$columns .= $this->column[$i]->getName();\n\n\t\t\tif($i != $len-1)\n\t\t\t{\n\t\t\t\t$columns .= \", \";\n\t\t\t}\n\t\t}\n\n\t\treturn $columns;\n\t}", "final public function col($key):?string\n {\n return $this->get(['col',$key]);\n }", "public function getDataColumn()\n {\n return $this->dataColumn;\n }", "public function column() : int\n {\n return $this->column;\n }", "public function getRecordTypeColumnName() {}", "protected function getPositionColumn()\n {\n return $this->positionColumn ?? 'position';\n }", "private function columnName($column)\n {\n // Select all\n if ($column == '*') {\n return \"`{$this->query['table']}`.*\";\n }\n\n if (strpos($column, '.') === false) {\n $column = $this->query['table'] . \".{$column}\";\n }\n\n // Regular column name\n if (strpos($column, '(') === false) {\n return str_replace(array('.'), array('`.`'), \"`{$column}`\");\n } else {\n return trim(str_replace(array('(', ')', '.'), array('(`', '`)', '`.`'), $column), '`');\n }\n }", "abstract public static function get_column_key(): string;", "private function getPropertyName(): string\n {\n $name = $this->foreignKey->getLocalTableName();\n if ($this->hasLocalUniqueIndex()) {\n $name = TDBMDaoGenerator::toSingular($name);\n }\n return TDBMDaoGenerator::toCamelCase($name);\n }", "protected function determineOrderColumnName()\n {\n if (! isset($this->sortable['order_column_name']) || $this->sortable['order_column_name'] == '')\n {\n $orderColumnName = 'order_column';\n }\n else\n {\n $orderColumnName = $this->sortable['order_column_name'];\n }\n\n return $orderColumnName;\n }", "public function get_column_detail()\n\t{\n\t\t$ret_fields\t=\t'';\n\t\t$fields\t\t=\t$this->get_fields_info();\n\t\tif ( $fields )\n\t\t{\n\t\t\tforeach( $fields as $field )\n\t\t\t{\n\t\t\t\t$ret_fields\t=\t$ret_fields.', '.$this->table.'.'.$field->name;\n\t\t\t}\n\t\t}\n\n\t\treturn $ret_fields;\n\t}", "public function get_column_key() {\n\t\treturn $this->column_key;\n\t}", "public function getColumnNames()\r\n\t\t{\r\n\t\t\t$nameColumns = $this->getColumnsArray();\r\n\t\t\treturn implode(\",\", $nameColumns);//Retornando uma lista de colunas separadas por vígula\r\n\t\t}", "function column_post_name( $item ) {\r\n\t\treturn $this->_handle_primary_column( $item, 'post_name', esc_attr( $item->post_name ) );\r\n\t}", "public function getCreatorColumnName() {}", "function wrapper_field_name($columnnum) {\n\t\treturn $this->functions['field_name']($this->query_id, $columnnum);\n\t}", "public function getColumn( $sQuery ){\n $oQuery = $this->query( $sQuery );\n $this->checkQuery( $oQuery );\n return $oQuery->fetchColumn( );\n }", "private function realColumnAttribute($column_name)\r\n\t{\r\n\t\tif($this->pdo->options[LikePDO::ATTR_CASE] == LikePDO::CASE_LOWER)\r\n\t\t\treturn strtolower($column_name);\r\n\t\telseif($this->pdo->options[LikePDO::ATTR_CASE] == LikePDO::CASE_UPPER)\r\n\t\t\treturn strtoupper($column_name);\r\n\t\telse\r\n\t\t\treturn $column_name;\r\n\t}", "public function get_col_dbnames($result){\r\n\t\t$col_dbnames = array();\r\n\t\t$num_fields = $result->FieldCount();\r\n\t\tfor($i = 0; $i < $num_fields; $i++) {\r\n\t\t\t$col_dbname = $this->field_name($result, $i); \r\n\t\t\t$col_dbnames[] = $col_dbname; \r\n\t\t} \r\n\t\t\r\n\t\treturn $col_dbnames;\r\n\t}", "public function column($column, $db = null)\n {\n return $this->executeScript($db, 'Column', $column);\n }", "public function columns($table_name, $dbname = null)\n {\n $dbname = empty($dbname) ? $this->database :$dbname;\n return $this->query(\"SELECT column_name FROM INFORMATION_SCHEMA.columns WHERE table_schema = ? and table_name = ?\", array($dbname, $table_name))->fetchAll(PDO::FETCH_COLUMN);\n }", "public static function getPkColumnName()\n {\n $modelClass = self::getClass();\n\n return implode('__', $modelClass::getScheme()->getPkColumnNames());\n }", "private function getColumnName( $col ) {\n\t\t$pos = strpos( $col, '.' );\n\n\t\tif ( !$pos ) {\n\t\t\treturn $col;\n\t\t}\n\t\treturn substr( $col, $pos + 1 );\n\t}", "public function get($key) {\n if (!array_key_exists($key, $this->mapping))\n return null;\n\n return $this->mapping[$key]['column_name'];\n }", "function db_field_name($qid, $fieldno) {\n\n\treturn mysqli_fetch_field_direct($qid, $fieldno);\n}", "public function getColumna() {\n return $this->columna;\n }", "private function table_columns(){\n $column = array();\n $query = $this->db->select('column_name')\n ->from('information_schema.columns')\n ->where('table_name', $this::$table_name)\n ->get($this::$table_name)->result_array();\n //return individual table column\n foreach($query as $column_array){\n foreach($column_array as $column_name){\n $column[] = $column_name;\n }\n }\n return $column;\n }", "public function column_name($link)\n {\n }", "public function col($column)\n {\n $lang = config('app.locale');\n $column = \"$column\".\"_\".\"$lang\";\n return $this->$column;\n }", "public static function get_metaname( $column ) {\n\t\t\t\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\t$result = $wpdb->get_results($wpdb->prepare( \"SELECT re_title FROM \".$wpdb->prefix.self::$table_name .\" WHERE re_int = %d\", $column ));\n\t\t\t\n\t\t\t$name=\"\";\n\t\t\t\n\t\t\tif(!empty($result)){\n\t\t\t\t\n\t\t\t\tforeach($result as $key => $val){\n\t\t\t\t\t\n\t\t\t\t\t$name = $val->re_title;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $name;\n\n\t\t}", "public function getColumn($name)\r\n {\r\n }", "public function getPrimaryKeyColumn() : string\n {\n return $this->primaryKey;\n }", "private function getColumnPropertyName( Column $column ) : string\n {\n\n return lcfirst(str_replace( '_', '', ucwords( $column->getName(), '_' )));\n\n }", "public function modelColumn();", "private function getColumnPhpname($identifier)\n {\n return $this->query->getTableMap()->getColumn($this->getColumnname($identifier))->getPhpName();\n }", "protected function createColumn()\n\t{\n\n\t\t$columnString = sprintf('`%s` %s',\n\t\t\t $this->getColumnName(),\n\t\t\t $this->getColumnType()\n\t\t );\n\n\t\treturn $columnString;\n\n\t}", "private function __findPrimaryKeyColumnName($tableName){\n $this->debugBacktrace();\n $tableName= str_replace(\"`\",\"\",$tableName);\n $sql = \"SELECT COLUMN_NAME \n FROM information_schema.KEY_COLUMN_USAGE \n WHERE TABLE_NAME = '\". $tableName .\"' \n AND CONSTRAINT_NAME = 'PRIMARY'\";\n\n $result = $this->_perform_mysql_query($sql);\n $primaryKeyColumn = mysqli_fetch_object($result);\n return $primaryKeyColumn->COLUMN_NAME;\n }", "public function getTranslationOriginColumnName() {}", "protected function getColumnName($alias)\n {\n return $this->aliases[$alias] ?? $alias;\n }", "public function getQualifiedLocalizableColumn()\n {\n return $this->getTable() . '.' . $this->getLocalizableColumn();\n }", "public function getPageIdColumnName() {}", "private static function getAnnotatedColumn(string $comment): string\n {\n $columnName = \"\";\n \n $matches = array();\n if (preg_match(\"/@column (\\w+)/\", $comment, $matches)) {\n $columnName = $matches[1];\n }\n return $columnName;\n }", "public function getColumnNames();", "public function getSearchColumnName()\n {\n return $this->searchColumnName;\n }", "public function getIdColumn()\n {\n return $this->idColumn;\n }", "private function _getDbname($idx)\n {\n if (isset($this->columns[$idx] )) return $idx;\n elseif (isset($this->aliases[$idx])) return $this->aliases[$idx];\n elseif (is_int($idx))\n {\n if ($idx <0 || $idx >= count($this->columns)-1) return null;\n \n $j=0;\n foreach ($this->columns as $dbname => &$value)\n {\n if ($j===$idx) return $dbname;\n $j++;\n }\n }\n else return null;\n }", "protected function get_column_info()\n {\n }", "protected function get_column_info()\n {\n }", "function field_name($number, $resultQuery=''){\n\t\tif(!$this->id_connection){\n\t\t\treturn false;\n\t\t}\n\t\tif(!$resultQuery){\n\t\t\t$resultQuery = $this->last_result_query;\n\t\t\tif(!$resultQuery){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(($fieldName = pg_field_name($resultQuery, $number))!==false){\n\t\t\treturn $fieldName;\n\t\t} else {\n\t\t\tthrow new DbException($this->error(), $this->no_error());\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.805437", "0.8029624", "0.7761343", "0.7680524", "0.7680524", "0.7680524", "0.7680524", "0.76248", "0.7595736", "0.75872886", "0.7463314", "0.7445667", "0.74060565", "0.73756254", "0.73563874", "0.71960247", "0.716659", "0.70925176", "0.706511", "0.7016575", "0.6994096", "0.6964951", "0.6963295", "0.69218534", "0.6920066", "0.6920066", "0.69098574", "0.68823653", "0.6855294", "0.68481374", "0.68394405", "0.67955416", "0.6773538", "0.67728233", "0.67717355", "0.676303", "0.676303", "0.6758527", "0.6757832", "0.6735594", "0.6728254", "0.6722368", "0.6710128", "0.6663121", "0.66593426", "0.66500205", "0.66486734", "0.6644043", "0.66369593", "0.6621525", "0.6618252", "0.6602159", "0.6535938", "0.6535509", "0.6529647", "0.6520903", "0.6518015", "0.6517879", "0.65118116", "0.650643", "0.6505561", "0.6504471", "0.6480655", "0.6480273", "0.6470842", "0.6464268", "0.64636934", "0.6455481", "0.6452202", "0.64477825", "0.64461976", "0.644117", "0.6440508", "0.6426926", "0.64154553", "0.6410357", "0.64009416", "0.63940716", "0.6387276", "0.63821584", "0.63627815", "0.6357838", "0.63531023", "0.63528", "0.63480085", "0.63410205", "0.6339254", "0.6329603", "0.6313756", "0.6310858", "0.63093007", "0.63085735", "0.630197", "0.63003075", "0.6299638", "0.62854", "0.62778765", "0.6273248", "0.62729204", "0.62717396", "0.6270607" ]
0.0
-1
Column type from database.
public function getType();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDbFieldType()\n {\n }", "public function getTypeColumn(): string\n {\n if (! isset($this->typeColumn)) {\n return 'type';\n }\n\n return $this->typeColumn;\n }", "public function getDataType(): string\n {\n return $this->col->getAttribute('data-type');\n }", "protected function columnType()\n {\n $table = $this->ask('Enter the name of desired table');\n $this->checkInput($table);\n $column = $this->ask('Enter the desired column');\n $this->checkInput($column);\n $this->service->columnType($table, $column);\n }", "public function getColumnType($name);", "public function getColumnType($name);", "private static function get_column_type($table, $column)\n\t{\n\t\t$EE =& get_instance();\n\n\t\t$table = $EE->db->dbprefix($table);\n\n\t\t$column = $EE->db->escape($column);\n\n\t\t$query = $EE->db->query(\"SHOW COLUMNS FROM `$table` WHERE Field = $column\");\n\n\t\t$column_type = $query->row('Type') ? $query->row('Type') : 'TEXT';\n\n\t\tif ($query->row('Null') === 'NO')\n\t\t{\n\t\t\t$column_type .= ' NOT NULL';\n\t\t}\n\n\t\tif ($query->row('Default') !== NULL && $query->row('Default') !== 'NULL')\n\t\t{\n\t\t\t$column_type .= ' DEFAULT '.$EE->db->escape($query->row('Default'));\n\t\t}\n\n\t\tif ($query->row('Extra') === 'auto_increment')\n\t\t{\n\t\t\t$column_type .= ' AUTO_INCREMENT';\n\t\t}\n\n\t\t$query->free_result();\n\n\t\treturn $column_type;\n\t}", "public static function columnTypes()\n {\n return [\n 'bigInteger' => 'Bigint',\n 'bigPrimaryKey' => 'BigPK',\n 'binary' => 'Binary',\n 'boolean' => 'Boolean',\n 'date' => 'Date',\n 'dateTime' => 'Datetime',\n 'decimal' => 'Decimal',\n 'double' => 'Double',\n 'float' => 'Float',\n 'integer' => 'Integer',\n 'money' => 'Money',\n 'primaryKey' => 'PK',\n 'smallInteger' => 'Smallint',\n 'string' => 'String',\n 'text' => 'Text',\n 'time' => 'Time',\n 'timestamp' => 'Timestamp',\n ];\n }", "public static function getColumnTypes()\n {\n return array(\n 'bookId' => 'int',\n 'languageId' => 'int'\n );\n }", "public static function getDBColumnType($userField)\n\t{\n\t\tglobal $DB;\n\t\tswitch($DB->type)\n\t\t{\n\t\t\tcase \"MYSQL\":\n\t\t\t\treturn \"int(11)\";\n\t\t\tcase \"ORACLE\":\n\t\t\t\treturn \"number(18)\";\n\t\t\tcase \"MSSQL\":\n\t\t\t\treturn \"int\";\n\t\t}\n\t}", "public function getTableDatatype()\r\n\t{\r\n\t\treturn $this->Table_Column->Table_Datatype;\r\n\t}", "public function getColumnTypes();", "public static function getColumnTypes() {\n\t\tstatic $types = array(\n\t\t\t'char' => 'CHAR',\n\t\t\t'string' => 'VARCHAR',\n\t\t\t'text' => 'TEXT',\n\t\t\t'mediumText' => 'MEDIUMTEXT',\n\t\t\t'longText' => 'LONGTEXT',\n\t\t\t'enum' => 'ENUM',\n\t\t\t'tinyBlob' => 'TINYBLOB',\n\t\t\t'blob' => 'BLOB',\n\t\t\t'mediumBlob' => 'MEDIUMBLOB',\n\t\t\t'longBlob' => 'LONGBLOB',\n\t\t\t'binary' => 'BINARY',\n\t\t\t'varbinary' => 'VARBINARY',\n\t\t\t'json' => 'JSON',\n\t\t\t'integer' => 'INT',\n\t\t\t'tinyInteger' => 'TINYINT',\n\t\t\t'smallInteger' => 'SMALLINT',\n\t\t\t'mediumInteger' => 'MEDIUMINT',\n\t\t\t'bigInteger' => 'BIGINT',\n\t\t\t'float' => 'FLOAT',\n\t\t\t'double' => 'DOUBLE',\n\t\t\t'decimal' => 'DECIMAL',\n\t\t\t'boolean' => 'BOOLEAN',\n\t\t\t'date' => 'DATE',\n\t\t\t'dateTime' => 'DATETIME',\n\t\t\t'time' => 'TIME',\n\t\t\t'timestamp' => 'TIMESTAMP',\n\t\t\t'year' => 'YEAR'\n\t\t);\n\n\t\treturn $types;\n\t}", "public function dbFieldType()\n {\n return 'string';\n }", "public static function getColumnTypes()\n {\n return array(\n 'bookId' => 'int',\n 'title' => 'istring',\n 'bindingId' => 'int',\n 'minYear' => 'int',\n 'maxYear' => 'int',\n 'preciseDate' => 'date',\n 'placePublished' => 'istring',\n 'publisher' => 'istring',\n 'printVersion' => 'istring',\n 'firstPage' => 'int',\n 'lastPage' => 'int'\n );\n }", "public static function getColumnTypes()\n {\n return array(\n 'bindingId' => 'int',\n 'libraryId' => 'int',\n 'signature' => 'istring',\n 'summary' => 'istring',\n 'status' => 'int',\n );\n }", "function get_column_type ($table_name, $column_name) { \n\n\t$column_row_arr = NULL;\n\t\n\t// Get the array of meta data for the table\n\tlist($errArr, $columns_arr) = show_columns($table_name);\n if ( count($columns_arr) > 0) {\n \t// Loop through metadata\n \tforeach ($columns_arr as $columns_row)\n \t{\n \t\tif ($columns_row[DFT_FIELD] == $column_name) {\n \t\t\t$column_row_arr = $columns_row;\n \t\t\tbreak; // column name is found in meta data \n \t\t}\n \t}\n }\n\treturn $column_row_arr;\n}", "public function getDatabaseType();", "public function getDatabaseType();", "public function loadColumnType($name);", "public function columnTypes(): array\n {\n return [\n 'id' => '{{ name }} INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE',\n 'varchar' => '{{ name }} TEXT {{ null }} {{ default }} {{ unique }}',\n 'text' => '{{ name }} TEXT {{ null }} {{ default }} {{ unique }}',\n 'int' => '{{ name }} INTEGER {{ null }} {{ default }} {{ unique }}',\n 'timestamp' => '{{ name }} INTEGER {{ null }} {{ default }} {{ unique }}'\n ];\n }", "public function getDatatype() {}", "protected function _getColumnDataType($columnIndex)\n {\n $meta = $this->_statement->getColumnMeta($columnIndex);\n\n switch($meta['native_type'])\n {\n case 'json':\n return PDO::PARAM_JSON;\n\n case 'timestamp':\n return PDO::PARAM_DATETIME;\n\n case 'date':\n return PDO::PARAM_DATE;\n\n case '_text':\n return PDO::PARAM_ARRAY;\n\n case '_int4':\n return PDO::PARAM_ARRAY;\n }\n\n return null;\n }", "public function get_datatype() {\n return $this->datatype;\n }", "public function columnType($name, $type) {\n\n $sqlType = 'TEXT';\n\n switch ($type) {\n\n case 'primaryKey':\n $sqlType = 'SERIAL PRIMARY KEY';\n break;\n\n case 'boolean':\n $sqlType = 'BOOLEAN';\n break;\n\n case 'integer':\n $sqlType = 'INTEGER';\n break;\n\n case 'decimal':\n case 'numeric':\n $sqlType = 'DECIMAL(10,2)';\n break;\n\n case 'float':\n $sqlType = 'REAL';\n break;\n\n case 'binary':\n $sqlType = 'BYTEA';\n break;\n\n case 'string':\n $sqlType = 'VARCHAR(255)';\n break;\n\n case 'date':\n $sqlType = 'DATE';\n break;\n\n case 'datetime':\n $sqlType = 'TIMESTAMP';\n break;\n\n case 'time':\n $sqlType = 'TIME';\n break;\n }\n\n return sprintf('%s %s',\n $this->escapeIdentifier($name),\n $sqlType\n );\n }", "function oci_field_type($statement, $field)\n{\n}", "public function delegateGetDbalColumnType(&$dbal_type, array $drupal_field_specs);", "protected function getColumnPhpType($type)\r\n {\r\n static $typeMap = [\r\n // abstract type => php type\r\n 'text' => 'string',\r\n 'number' => 'integer',\r\n 'container' => 'resource',\r\n 'date' => 'date',\r\n 'time' => 'time',\r\n 'timestamp' => 'timestamp',\r\n ];\r\n if (isset($typeMap[$type])) {\r\n return $typeMap[$type];\r\n } else {\r\n return 'string';\r\n }\r\n }", "protected function getFieldType()\n {\n if (strstr($this->sColumn, 'textarea')) {\n $sType = 'Textarea';\n } elseif (strstr($this->sColumn, 'editor')) {\n $sType = 'CKEditor';\n } elseif (strstr($this->sColumn, 'email')) {\n $sType = 'Email';\n } elseif (strstr($this->sColumn, 'password')) {\n $sType = 'Password';\n } elseif (strstr($this->sColumn, 'url')) {\n $sType = 'Url';\n } elseif (strstr($this->sColumn, 'phone')) {\n $sType = 'Phone';\n } elseif (strstr($this->sColumn, 'date')) {\n $sType = 'Date';\n } elseif (strstr($this->sColumn, 'color')) {\n $sType = 'Color';\n } elseif (strstr($this->sColumn, 'number')) {\n $sType = 'Number';\n } elseif (strstr($this->sColumn, 'range')) {\n $sType = 'Range';\n } elseif (stripos($this->sColumn, 'height') !== false) {\n $sType = 'Height';\n } elseif (stripos($this->sColumn, 'weight') !== false) {\n $sType = 'Weight';\n } else {\n $sType = 'Textbox';\n }\n\n return $sType;\n }", "protected function _getDataTypes(){\n\t\treturn ActiveRecordMetaData::getDataTypes($this->_source, $this->_schema);\n\t}", "public function getDataType() {}", "private function _columnTypeTranslation($type) {\n $map = array(\n 'datetime' => 'timestamp',\n );\n if(!empty($map[$type])) {\n return $map[$type];\n }\n return $type;\n }", "public function getMDB2DataType()\n\t{\n\t\tif($this->mdb2DataType != '')\n\t\t{\n\t\t\treturn $this->mdb2DataType;\n\t\t}\n\t}", "public function field_metatype($result, $index){\r\n $obj_field = new ADOFieldObject();\r\n $obj_field = $result->FetchField($index);\r\n //print_r($obj_field);\r\n $type = $result->MetaType($obj_field->type, $obj_field->max_length); // Since ADOdb 3.0, MetaType accepts $fieldobj as the first parameter, instead of $nativeDBType.\r\n \r\n return $type; \r\n }", "protected static function oci_getType($col)\n {\n throw new RuntimeException(\"no yet implemented\");\n /** @var array $exclusion type of columns that don't use size */\n $exclusion = ['int', 'long', 'tinyint', 'year', 'bigint', 'bit', 'smallint', 'float', 'money'];\n if (in_array($col['DATA_TYPE'], $exclusion) !== false) {\n return $col['DATA_TYPE'];\n }\n if ($col['NUMERIC_SCALE']) {\n $result = \"{$col['DATA_TYPE']}({$col['NUMERIC_PRECISION']},{$col['NUMERIC_SCALE']})\";\n } elseif ($col['NUMERIC_PRECISION'] || $col['CHARACTER_MAXIMUM_LENGTH']) {\n $result = \"{$col['DATA_TYPE']}(\" . ($col['CHARACTER_MAXIMUM_LENGTH'] + $col['NUMERIC_PRECISION']) . ')';\n } else {\n $result = $col['DATA_TYPE'];\n }\n\n return $result;\n }", "public function getColumnDataType($column)\n {\n return Schema::getColumnType(\n $this->getTable(),\n $column\n );\n }", "public function registerColumnTypes();", "protected function _getColumnDataType(CodeGeneratorColumn $column, $mixed=false){\n\t\t$type = false;\n\t\tswitch ($column->getType()){\n\t\t\tcase CodeGeneratorColumn::TYPE_BOOLEAN:\n\t\t\t\t$type = 'bool';\n\t\t\t\tbreak;\n\t\t\tcase CodeGeneratorColumn::TYPE_FLOAT:\n\t\t\t\t$type = 'float';\n\t\t\t\tbreak;\n\t\t\tcase CodeGeneratorColumn::TYPE_INTEGER:\n\t\t\t\t$type = 'integer';\n\t\t\t\tbreak;\n\t\t\tcase CodeGeneratorColumn::TYPE_STRING:\n\t\t\t\t$type = 'string';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif($mixed){\n\t\t\t\t\t$type = 'mixed';\n\t\t\t\t}\n\t\t}\n\t\treturn $type;\n\t}", "function _getTypes()\n {\n $types = array(\n 0 => \"null\",\n 1 => \"bool\",\n 2 => \"int\",\n 3 => \"float\",\n 4 => \"varchar\",\n 5 => \"text\",\n 6 => \"blob\"\n );\n $tLeast = $this->table->count() < 2 ? 4 : 0;\n if ($this->GET('override')) {\n $types[1] = \"int\";\n $types[4] = \"text\";\n $types[6] = \"text\";\n }\n foreach ($this->table->fields as $field) {\n $t[$field] = strcasecmp($field, \"id\") ? $tLeast : 2;\n }\n while ($row = $this->table->each()) {\n foreach ($row as $field => $value) {\n if (preg_match('/[\\x00-\\x06\\x08\\x0B-\\x0C\\x0E-\\x13\\x16-\\x1F]/', $value))\n $t[$field] = 6;\n elseif (strlen($value) > 255 || strpos($value, \"\\n\"))\n $t[$field] = max($t[$field], 5);\n elseif (! empty($value) && ! is_numeric($value))\n $t[$field] = max($t[$field], 4);\n elseif (! preg_match('/^[+-]?\\d{0,10}$/s', $value))\n $t[$field] = max($t[$field], 3);\n elseif (! preg_match('/^[01]?$/s', $value))\n $t[$field] = max($t[$field], 2);\n elseif (strlen($value))\n $t[$field] = max($t[$field], 1);\n }\n }\n foreach ($this->table->fields as $field) {\n $this->types[$field] = $types[$t[$field]];\n }\n $this->table->reset();\n }", "public function sql_field_type($res, $pointer)\n {\n // mysql_field_type compatibility map\n // taken from: http://www.php.net/manual/en/mysqli-result.fetch-field-direct.php#89117\n // Constant numbers see http://php.net/manual/en/mysqli.constants.php\n $mysql_data_type_hash = [\n 1 => 'tinyint',\n 2 => 'smallint',\n 3 => 'int',\n 4 => 'float',\n 5 => 'double',\n 7 => 'timestamp',\n 8 => 'bigint',\n 9 => 'mediumint',\n 10 => 'date',\n 11 => 'time',\n 12 => 'datetime',\n 13 => 'year',\n 16 => 'bit',\n // 252 is currently mapped to all text and blob types (MySQL 5.0.51a)\n 253 => 'varchar',\n 254 => 'char',\n 246 => 'decimal'\n ];\n if ($this->debug_check_recordset($res)) {\n $metaInfo = $res->fetch_field_direct($pointer);\n if ($metaInfo === false) {\n return false;\n }\n return $mysql_data_type_hash[$metaInfo->type];\n } else {\n return false;\n }\n }", "public function getExtendedColumnTypes();", "function column($real) {\n\t\tif (is_array($real)) {\n\t\t\t$col = $real['name'];\n\t\t\tif (isset($real['limit'])) {\n\t\t\t\t$col .= '('.$real['limit'].')';\n\t\t\t}\n\t\t\treturn $col;\n\t\t}\n\n\t\t$col = str_replace(')', '', $real);\n\t\t$limit = $this->length($real);\n\t\tif (strpos($col, '(') !== false) {\n\t\t\tlist($col, $vals) = explode('(', $col);\n\t\t}\n\n\t\tif (in_array($col, array('date', 'time', 'datetime', 'timestamp'))) {\n\t\t\treturn $col;\n\t\t}\n\t\tif (($col == 'tinyint' && $limit == 1) || $col == 'boolean') {\n\t\t\treturn 'boolean';\n\t\t}\n\t\tif (strpos($col, 'int') !== false) {\n\t\t\treturn 'integer';\n\t\t}\n\t\tif (strpos($col, 'char') !== false || $col == 'tinytext') {\n\t\t\treturn 'string';\n\t\t}\n\t\tif (strpos($col, 'text') !== false) {\n\t\t\treturn 'text';\n\t\t}\n\t\tif (strpos($col, 'blob') !== false || $col == 'binary') {\n\t\t\treturn 'binary';\n\t\t}\n\t\tif (strpos($col, 'float') !== false || strpos($col, 'double') !== false || strpos($col, 'decimal') !== false) {\n\t\t\treturn 'float';\n\t\t}\n\t\tif (strpos($col, 'enum') !== false) {\n\t\t\treturn \"enum($vals)\";\n\t\t}\n\t\treturn 'text';\n\t}", "public function GetColumnDataType( $column, $table = '' )\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\tif( empty( $table ) )\r\n\t\t{\r\n\t\t\tif( $this->RowCount() > 0 )\r\n\t\t\t{\r\n\t\t\t\tif( is_numeric( $column ) )\r\n\t\t\t\t{\r\n\t\t\t\t\treturn mysql_field_type( $this->last_result, $column );\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn mysql_field_type( $this->last_result, $this->GetColumnID( $column ) );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif( is_numeric( $column ) ) $column = $this->GetColumnName( $column, $table );\r\n\t\t\t$result = mysql_query( 'SELECT ' . $column . ' FROM ' . $table . ' LIMIT 1');\r\n\t\t\tif( mysql_num_fields( $result ) > 0 )\r\n\t\t\t{\r\n\t\t\t\treturn mysql_field_type( $result, 0 );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->SetError( 'The specified column or table does not exist, or no data was returned', -1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function data_type($type) {\n\t\tstatic $types = array(\n\t\t\t'BIT' => array('type' => 'Binary', 'max_length' => 1, 'nullable' => FALSE),\n\t\t\t'DATETIME' => array('type' => 'Integer'),\n\t\t\t'IMAGE' => array('type' => 'Blob', 'max_length' => 2147483647),\n\t\t\t'MONEY' => array('type' => 'Decimal', 'precision' => 18, 'scale' => 4),\n\t\t\t'NTEXT' => array('type' => 'Text', 'max_length' => '1073741823'),\n\t\t\t'SMALLDATETIME' => array('type' => 'Integer'),\n\t\t\t'SMALLMONEY' => array('type' => 'Decimal', 'precision' => 10, 'scale' => 4),\n\t\t\t'SQL_VARIANT' => array('type' => 'Blob', 'varying' => TRUE),\n\t\t\t//'TABLE' => array('type' => 'Table'),\n\t\t\t'TINYINT' => array('type' => 'Integer', 'range' => array(0, 255)),\n\t\t\t'UNIQUEIDENTIFIER' => array('type' => 'String', 'max_length' => 38),\n\t\t);\n\n\t\t$type = strtoupper($type);\n\n\t\tif (isset($types[$type])) {\n\t\t\treturn $types[$type];\n\t\t}\n\n\t\treturn parent::data_type($type);\n\t}", "public function getDataType()\n {\n return $this->_fields['DataType']['FieldValue'];\n }", "public function getDataType()\n {\n return $this->data_type;\n }", "public final function getFieldtype($fld)\n {\n return isset($this->columns->{$fld}) ? $this->db->convertType($this->columns->{$fld}->type) : false;\n }", "public function getColumnType($column)\n {\n return $this->columns[$column]['type'];\n }", "function getOrigamiColumnType(&$Model, $column) {\n $attribute = $this->getAttribute($Model, $column);\n if (isset($attribute['Datatype']['format']))\n return $attribute['Datatype']['format'];\n return null;\n }", "public function getRecordTypeColumnName() {}", "protected function getColumns(){\n\t\ttry {\n\t\t\t$_db = init::getInstance()->dbh();\n\n\t\t\t$res = $_db->prepare(\"SHOW FIELDS FROM \".$this->_table);\n\n\t\t\t$res->execute();\n\n\t\t\twhile( $r = $res->fetch() ){\n\n\t\t\t\tself::$_fields[$this->_table][] = $r['Field'];\n\n\t\t\t\t//get the type\n\t\t\t\tif( strpos($r['Type'], '(') !== false ){\n\t\t\t\t\t$type = substr($r['Type'], 0, strpos($r['Type'],'('));\n\t\t\t\t} else {\n\t\t\t\t\t$type = $r['Type'];\n\t\t\t\t}\n\n\t\t\t\t//inizialize the default value\n\t\t\t\tif( !empty($r['Default']) ){\n\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = $r['Default'];\n\n\t\t\t\t} elseif( $r['Null'] == 'YES' ){\n\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = null;\n\n\t\t\t\t} else {\n\t\t\t\t\tswitch( strtoupper($type) ){\n\t\t\t\t\t\t//numeric\n\t\t\t\t\t\tcase \"BIT\":\n\t\t\t\t\t\tcase \"TINYINT\":\n\t\t\t\t\t\tcase \"BOOL\":\n\t\t\t\t\t\tcase \"BOOLEAN\":\n\t\t\t\t\t\tcase \"SMALLINT\":\n\t\t\t\t\t\tcase \"MEDIUMINT\":\n\t\t\t\t\t\tcase \"INT\":\n\t\t\t\t\t\tcase \"INTEGER\":\n\t\t\t\t\t\tcase \"BIGINT\":\n\t\t\t\t\t\tcase \"FLOAT\":\n\t\t\t\t\t\tcase \"DOUBLE\":\n\t\t\t\t\t\tcase \"DECIMAL\":\n\t\t\t\t\t\tcase \"DEC\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t//string\n\t\t\t\t\t\tcase \"CHAR\":\n\t\t\t\t\t\tcase \"VARCHAR\":\n\t\t\t\t\t\tcase \"BINARY\":\n\t\t\t\t\t\tcase \"VARBINARY\":\n\t\t\t\t\t\tcase \"TINYBLOB\":\n\t\t\t\t\t\tcase \"TINYTEXT\":\n\t\t\t\t\t\tcase \"BLOB\":\n\t\t\t\t\t\tcase \"TEXT\":\n\t\t\t\t\t\tcase \"MEDIUMBLOB\":\n\t\t\t\t\t\tcase \"MEDIUMTEXT\":\n\t\t\t\t\t\tcase \"LONGBLOB\":\n\t\t\t\t\t\tcase \"LONGTEXT\":\n\t\t\t\t\t\tcase \"ENUM\":\n\t\t\t\t\t\tcase \"SET\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t//date\n\t\t\t\t\t\tcase \"DATE\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '0000-00-00';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DATETIME\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '0000-00-00 00:00:00';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"TIMESTAMP\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '0000-00-00 00:00:00';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"TIME\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '00:00:00';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"YEAR\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '0000';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthrow new Exception('unknow column type');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch ( PDOException $e ){\n\t\t\terreur_pdo( $e, get_class( $this ), __FUNCTION__ );\n\t\t}\n\t}", "public function getColumnType(string $tableName, string $columnName): string\n {\n $tableName = \\HtmlAnalyzer::sanitizeAndRemoveTags($tableName);\n $columnName = \\HtmlAnalyzer::sanitizeAndRemoveTags($columnName);\n\n $query = 'SELECT COLUMN_TYPE\n FROM INFORMATION_SCHEMA.COLUMNS\n WHERE TABLE_SCHEMA = :dbName\n AND TABLE_NAME = :tableName\n AND COLUMN_NAME = :columnName';\n\n $stmt = $this->prepare($query);\n\n try {\n $stmt->bindValue(':dbName', $this->dsn['database'], \\PDO::PARAM_STR);\n $stmt->bindValue(':tableName', $tableName, \\PDO::PARAM_STR);\n $stmt->bindValue(':columnName', $columnName, \\PDO::PARAM_STR);\n $stmt->execute();\n $result = $stmt->fetch(\\PDO::FETCH_ASSOC);\n if (! empty($result)) {\n return $result['COLUMN_TYPE'];\n }\n throw new \\PDOException(\"Unable to get column type\");\n } catch (\\PDOException $e) {\n $this->logSqlError($query, $e->getMessage());\n }\n }", "public function FIELD_TYPE($SQL_Resource, $SColumn)\n {\n if (extension_loaded(\"sqlsrv\") == false)\n {\n return false;\n }\n $Prefix_Field_Type = array(\n -155 => \"datetimeoffset\",\n -154 => \"time\",\n -152 => \"xml\",\n -151 => \"udt\",\n -11 => \"uniqueidentifier\",\n -10 => \"ntext\",\n -9 => \"nvarchar\",\n -8 => \"nchar\",\n -7 => \"bit\",\n -6 => \"tinyint\",\n -5 => \"bigint\",\n -4 => \"image\",\n -3 => \"varbinary\",\n -2 => \"binary\",\n -2 => \"timestamp\",\n -1 => \"text\",\n 1 => \"char\",\n 2 => \"numeric\",\n 3 => \"decimal\",\n 3 => \"money\",\n 3 => \"Smallmoney\",\n 4 => \"int\",\n 5 => \"smallint\",\n 6 => \"float\",\n 7 => \"real\",\n 12 => \"varchar\",\n 91 => \"date\",\n 93 => \"datetime\",\n 93 => \"datetime2\",\n 93 => \"smalldatetime\");\n $DB_Field = sqlsrv_field_metadata($SQL_Resource);\n return $Prefix_Field_Type[$DB_Field[$SColumn]['Type']];\n }", "public function fieldType($result = false, $field_offset = 0){\n $this->resCalc($result); \n return mysql_field_type($result, $field_offset); \n }", "public static function getSchemaType($column)\n {\n // primary key\n if ($column->isPrimaryKey && $column->autoIncrement) {\n if ('bigint' === $column->type) {\n return 'bigInteger()';\n } elseif('smallint' === $column->type) {\n return 'smallInteger()';\n }\n return 'integer()';\n }\n\n // boolean\n if ('tinyint(1)' === $column->dbType) {\n return 'boolean()';\n }\n\n // smallint\n if ('smallint' === $column->type) {\n if (null === $column->size) {\n return 'smallInteger()';\n }\n return 'smallInteger';\n }\n\n // bigint\n if ('bigint' === $column->type) {\n if (null === $column->size) {\n return 'bigInteger()';\n }\n return 'bigInteger';\n }\n\n // enum\n if (null !== $column->enumValues) {\n // https://github.com/yiisoft/yii2/issues/9797\n $enumValues = array_map('addslashes', $column->enumValues);\n return \"enum(['\".implode('\\', \\'', $enumValues).\"'])\";\n }\n\n // others\n if (null === $column->size && 0 >= $column->scale) {\n return $column->type.'()';\n }\n\n return $column->type;\n }", "function db_type_map() {\n // Put :normal last so it gets preserved by array_flip. This makes\n // it much easier for modules (such as schema.module) to map\n // database types back into schema types.\n $map = array(\n 'varchar:normal' => 'VARCHAR',\n 'char:normal' => 'CHAR',\n\n 'text:tiny' => 'TINYTEXT',\n 'text:small' => 'TINYTEXT',\n 'text:medium' => 'MEDIUMTEXT',\n 'text:big' => 'LONGTEXT',\n 'text:normal' => 'TEXT',\n\n 'serial:tiny' => 'TINYINT',\n 'serial:small' => 'SMALLINT',\n 'serial:medium' => 'MEDIUMINT',\n 'serial:big' => 'BIGINT',\n 'serial:normal' => 'INT',\n\n 'int:tiny' => 'TINYINT',\n 'int:small' => 'SMALLINT',\n 'int:medium' => 'MEDIUMINT',\n 'int:big' => 'BIGINT',\n 'int:normal' => 'INT',\n\n 'float:tiny' => 'FLOAT',\n 'float:small' => 'FLOAT',\n 'float:medium' => 'FLOAT',\n 'float:big' => 'DOUBLE',\n 'float:normal' => 'FLOAT',\n\n 'numeric:normal' => 'DECIMAL',\n\n 'blob:big' => 'LONGBLOB',\n 'blob:normal' => 'BLOB',\n\n 'datetime:normal' => 'DATETIME',\n );\n return $map;\n}", "public function getFieldDataType() {\n\t\t$fieldDataType = '';\n\t\t$uitype = $this->get('uitype');\n\t\tif ($uitype == '9') {\n\t\t\t$fieldDataType = 'percent';\n\t\t}\n\n\t\tif (!$fieldDataType) {\n\t\t\t$webserviceField = $this->getWebserviceFieldObject();\n\t\t\t$fieldDataType = $webserviceField->getFieldDataType();\n\t\t\tswitch($fieldDataType) {\n\t\t\t\tcase 'text' : $fieldDataType = 'textArea'; break;\n\t\t\t\tcase 'boolean' : $fieldDataType = 'checkBox'; break;\n\t\t\t case 'multipicklist' : $fieldDataType = 'multiSelectCombo'; break;\n\t\t\t}\n\t\t}\n\t\treturn $fieldDataType;\n\t}", "public function getDataType($type)\n\t{\n\t\tstatic $types = array\n\t\t(\n\t\t\t// SQL-92\n\t\t\t'bit' => array('type' => 'string', 'exact' => true),\n\t\t\t'bit varying' => array('type' => 'string'),\n\t\t\t'char' => array('type' => 'string', 'exact' => true),\n\t\t\t'char varying' => array('type' => 'string'),\n\t\t\t'character' => array('type' => 'string', 'exact' => true),\n\t\t\t'character varying' => array('type' => 'string'),\n\t\t\t'date' => array('type' => 'string'),\n\t\t\t'dec' => array('type' => 'float', 'exact' => true),\n\t\t\t'decimal' => array('type' => 'float', 'exact' => true),\n\t\t\t'double precision' => array('type' => 'float'),\n\t\t\t'float' => array('type' => 'float'),\n\t\t\t'int' => array('type' => 'int', 'min' => '-2147483648', 'max' => '2147483647'),\n\t\t\t'integer' => array('type' => 'int', 'min' => '-2147483648', 'max' => '2147483647'),\n\t\t\t'interval' => array('type' => 'string'),\n\t\t\t'national char' => array('type' => 'string', 'exact' => true),\n\t\t\t'national char varying' => array('type' => 'string'),\n\t\t\t'national character' => array('type' => 'string', 'exact' => true),\n\t\t\t'national character varying' => array('type' => 'string'),\n\t\t\t'nchar' => array('type' => 'string', 'exact' => true),\n\t\t\t'nchar varying' => array('type' => 'string'),\n\t\t\t'numeric' => array('type' => 'float', 'exact' => true),\n\t\t\t'real' => array('type' => 'float'),\n\t\t\t'smallint' => array('type' => 'int', 'min' => '-32768', 'max' => '32767'),\n\t\t\t'time' => array('type' => 'string'),\n\t\t\t'time with time zone' => array('type' => 'string'),\n\t\t\t'timestamp' => array('type' => 'string'),\n\t\t\t'timestamp with time zone' => array('type' => 'string'),\n\t\t\t'varchar' => array('type' => 'string'),\n\t\t\t// SQL:1999\n\t\t\t'binary large object' => array('type' => 'string', 'binary' => true),\n\t\t\t'blob' => array('type' => 'string', 'binary' => true),\n\t\t\t'boolean' => array('type' => 'bool'),\n\t\t\t'char large object' => array('type' => 'string'),\n\t\t\t'character large object' => array('type' => 'string'),\n\t\t\t'clob' => array('type' => 'string'),\n\t\t\t'national character large object' => array('type' => 'string'),\n\t\t\t'nchar large object' => array('type' => 'string'),\n\t\t\t'nclob' => array('type' => 'string'),\n\t\t\t'time without time zone' => array('type' => 'string'),\n\t\t\t'timestamp without time zone' => array('type' => 'string'),\n\t\t\t// SQL:2003\n\t\t\t'bigint' => array('type' => 'int', 'min' => '-9223372036854775808', 'max' => '9223372036854775807'),\n\t\t\t// SQL:2008\n\t\t\t'binary' => array('type' => 'string', 'binary' => true, 'exact' => true),\n\t\t\t'binary varying' => array('type' => 'string', 'binary' => true),\n\t\t\t'varbinary' => array('type' => 'string', 'binary' => true)\n\t\t);\n\n\t\tif (isset($types[$type]))\n\t\t\treturn $types[$type];\n\n\t\treturn array();\n\t}", "private static function normalizeColumnType($col)\n {\n if (preg_match('/\\((.+)\\)/', $col['type'], $matches)) {\n $col['precision'] = $matches[1];\n $col['type'] = preg_replace('/\\(.*/', '', $col['type']);\n }\n $col['type'] = strtolower($col['type']);\n switch ($col['type']) {\n case 'bool':\n case 'tinyint':\n $col['type'] = 'boolean';\n break;\n case 'int':\n $col['type'] = 'integer';\n break;\n case 'nvarchar':\n $col['type'] = 'varchar';\n break;\n case 'float':\n case 'double':\n case 'decimal':\n $col['type'] = 'numeric';\n break;\n case 'timestamp':\n $col['type'] = 'datetime';\n break;\n case 'enum':\n $col['precision'] = array_map(function($e) { return trim($e, \"'\"); }, explode(',', $col['precision']));\n }\n return $col;\n }", "public function MySQLiFieldType($aFieldname) { \n $retval = '';\n if ($aFieldname=='DeterminationID') { $retval = self::C_DeterminationIDMYSQLI_TYPE; }\n if ($aFieldname=='TimestampCreated') { $retval = self::C_TimestampCreatedMYSQLI_TYPE; }\n if ($aFieldname=='TimestampModified') { $retval = self::C_TimestampModifiedMYSQLI_TYPE; }\n if ($aFieldname=='Version') { $retval = self::C_VersionMYSQLI_TYPE; }\n if ($aFieldname=='CollectionMemberID') { $retval = self::C_CollectionMemberIDMYSQLI_TYPE; }\n if ($aFieldname=='Addendum') { $retval = self::C_AddendumMYSQLI_TYPE; }\n if ($aFieldname=='AlternateName') { $retval = self::C_AlternateNameMYSQLI_TYPE; }\n if ($aFieldname=='Confidence') { $retval = self::C_ConfidenceMYSQLI_TYPE; }\n if ($aFieldname=='DeterminedDate') { $retval = self::C_DeterminedDateMYSQLI_TYPE; }\n if ($aFieldname=='DeterminedDatePrecision') { $retval = self::C_DeterminedDatePrecisionMYSQLI_TYPE; }\n if ($aFieldname=='FeatureOrBasis') { $retval = self::C_FeatureOrBasisMYSQLI_TYPE; }\n if ($aFieldname=='IsCurrent') { $retval = self::C_IsCurrentMYSQLI_TYPE; }\n if ($aFieldname=='Method') { $retval = self::C_MethodMYSQLI_TYPE; }\n if ($aFieldname=='NameUsage') { $retval = self::C_NameUsageMYSQLI_TYPE; }\n if ($aFieldname=='Number1') { $retval = self::C_Number1MYSQLI_TYPE; }\n if ($aFieldname=='Number2') { $retval = self::C_Number2MYSQLI_TYPE; }\n if ($aFieldname=='Qualifier') { $retval = self::C_QualifierMYSQLI_TYPE; }\n if ($aFieldname=='Remarks') { $retval = self::C_RemarksMYSQLI_TYPE; }\n if ($aFieldname=='Text1') { $retval = self::C_Text1MYSQLI_TYPE; }\n if ($aFieldname=='Text2') { $retval = self::C_Text2MYSQLI_TYPE; }\n if ($aFieldname=='TypeStatusName') { $retval = self::C_TypeStatusNameMYSQLI_TYPE; }\n if ($aFieldname=='YesNo1') { $retval = self::C_YesNo1MYSQLI_TYPE; }\n if ($aFieldname=='YesNo2') { $retval = self::C_YesNo2MYSQLI_TYPE; }\n if ($aFieldname=='YesNo3') { $retval = self::C_YesNo3MYSQLI_TYPE; }\n if ($aFieldname=='FragmentID') { $retval = self::C_FragmentIDMYSQLI_TYPE; }\n if ($aFieldname=='TaxonID') { $retval = self::C_TaxonIDMYSQLI_TYPE; }\n if ($aFieldname=='ModifiedByAgentID') { $retval = self::C_ModifiedByAgentIDMYSQLI_TYPE; }\n if ($aFieldname=='PreferredTaxonID') { $retval = self::C_PreferredTaxonIDMYSQLI_TYPE; }\n if ($aFieldname=='DeterminerID') { $retval = self::C_DeterminerIDMYSQLI_TYPE; }\n if ($aFieldname=='CreatedByAgentID') { $retval = self::C_CreatedByAgentIDMYSQLI_TYPE; }\n return $retval;\n }", "function getDataType($connection, $idDataType){\n\t$query = \"SELECT * FROM tDataType WHERE idDataType =\".$idDataType;\n\treturn fetchRowFromDBOnID($connection, $query, $idDataType, \"DataType\");\n}", "public function columnTypes()\n {\n return \\array_merge(\\array_filter(parent::columnTypes(), function($elem) {\n if ($elem[0] === Schema::TYPE_JSON) {\n return false;\n }\n return true;\n }), [\n [\n Schema::TYPE_JSON,\n $this->json(),\n \"json\",\n \"json CHECK ([[{name}]] is null or json_valid([[{name}]]))\"\n ]\n ]);\n }", "function mscaffolding_get_type($type)\n\t{\n\t\tswitch($type)\n\t\t{\n\t\t\tcase \"string\":\n\t\t\t\treturn \" VARCHAR (255) CHARACTER SET utf8 COLLATE utf8_slovenian_ci NOT NULL,\";\n\t\t\tcase \"text\":\n\t\t\t\treturn \" TEXT CHARACTER SET utf8 COLLATE utf8_slovenian_ci NOT NULL,\";\n\t\t\tcase \"boolean\":\n\t\t\t\treturn \" TINYINT NOT NULL,\";\n\t\t\tcase \"integer\":\n\t\t\t\treturn \" INT NOT NULL,\";\n\t\t\tdefault:\n\t\t\t\treturn \" INT NOT NULL,\";\n\t\t}\n\t}", "public function getDataType(): string;", "public function getDataType(): string;", "public static function data_type() {\n\n\t\treturn 'string';\n\t}", "public function getContentColumnType(): string {\n return Schema::TYPE_TEXT;\n }", "private function get_db_type() {\n global $CFG;\n return $CFG->dbtype;\n }", "public function getDataType()\n {\n return $this->dataType;\n }", "public function getDataType()\n {\n return $this->dataType;\n }", "public function getDataType()\n {\n return $this->dataType;\n }", "public function getDataType()\n {\n return $this->dataType;\n }", "abstract public function getColumnTypeByField(Entity\\ScalarField $field);", "function pg_field_type($result, $field_number)\n{\n}", "public function getDataType() {\n return $this->dataType;\n }", "public function grid_settings_modify_column($data)\n {\n return $this->get_column_type($data, true);\n }", "public function getType()\n {\n $result = \"\";\n if (preg_match('/int/',$this->type))\n $result = \"int\";\n\n if (preg_match('/year/',$this->type))\n $result = \"int\";\n\n if (preg_match('/integer/',$this->type))\n $result = \"int\";\n\n if (preg_match('/tynyint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/smallint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/mediumint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/bigint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/varchar/',$this->type))\n $result = \"string\";\n\n if (preg_match('/char/',$this->type))\n $result = \"string\";\n\n if (preg_match('/text/',$this->type))\n $result = \"string\";\n\n if (preg_match('/tyntext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/mediumtext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/longtext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/char/',$this->type))\n $result = \"string\";\n\n if (preg_match('/enum/',$this->type))\n $result = \"enum\";\n\n if (preg_match('/set/',$this->type))\n $result = \"string\";\n\n if (preg_match('/date/',$this->type))\n $result = \"date\";\n\n if (preg_match('/time/',$this->type))\n $result = \"time\";\n\n if (preg_match('/datetime/',$this->type))\n $result = \"datetime\";\n\n if (preg_match('/decimal/',$this->type))\n $result = \"float\";\n\n if (preg_match('/float/',$this->type))\n $result = \"float\";\n\n if (preg_match('/double/',$this->type))\n $result = \"double\";\n\n if (preg_match('/real/',$this->type))\n $result = \"real\";\n\n if (preg_match('/fixed/',$this->type))\n $result = \"float\";\n\n if (preg_match('/numeric/',$this->type))\n $result = \"float\";\n\n if (empty($result)){\n // $result = $this->type;\n $result = \"string\";\n }\n\n // TODO EVALUATES BIT, TIMESTAMP, VARBINARY, BLOB MySQL data types\n return $result;\n }", "public function getDataType() {\n\t\treturn $this -> dataType;\n\t}", "protected function createColumn($column)\n {\n $c = new ColumnSchema;\n\n $c->name = strtolower(rtrim($column['fname']));\n// $c->rawName = $this->quoteColumnName($c->name);\n $c->allowNull = $column['fnull'] !== '1';\n $c->isPrimaryKey = $column['fprimary'];\n// $c->isForeignKey = false;\n $c->size = (int) $column['flength'];\n $c->scale = (int) $column['fscale'];\n $c->precision = (int) $column['fprecision'];\n $c->autoIncrement = $column['fautoinc'] === '1';\n $defaultValue = null;\n if (!empty($column['fdefault'])) {\n\n // remove whitespace, 'DEFAULT ' prefix and surrounding single quotes; all optional\n if (preg_match(\"/\\s*(DEFAULT\\s+){0,1}('(.*)'|(.*))\\s*/i\", $column['fdefault'], $parts)) {\n $defaultValue = array_pop($parts);\n }\n\n // handle escaped single quotes like in \"funny''quoted''string\"\n $defaultValue = str_replace('\\'\\'', '\\'', $defaultValue);\n }\n if ($defaultValue === null) {\n $defaultValue = $column['fdefault_value'];\n }\n\n $type = \"\";\n\n $baseTypes = array(\n 7 => 'SMALLINT',\n 8 => 'INTEGER',\n 16 => 'INT64',\n 9 => 'QUAD',\n 10 => 'FLOAT',\n 11 => 'D_FLOAT',\n 17 => 'BOOLEAN',\n 27 => 'DOUBLE',\n 12 => 'DATE',\n 13 => 'TIME',\n 35 => 'TIMESTAMP',\n 261 => 'BLOB',\n 37 => 'VARCHAR',\n 14 => 'CHAR',\n 40 => 'CSTRING',\n 45 => 'BLOB_ID',\n );\n\n if (array_key_exists((int) $column['fcodtype'], $baseTypes)) {\n $type = $baseTypes[(int) $column['fcodtype']];\n }\n\n switch ((int) $column['fcodtype']) {\n case 7:\n case 8:\n switch ((int) $column['fcodsubtype']) {\n case 1:\n $type = 'NUMERIC';\n break;\n case 2:\n $type = 'DECIMAL';\n break;\n }\n break;\n case 12:\n case 13:\n case 35:\n $c->size=19;\n break;\n case 16:\n switch ((int) $column['fcodsubtype']) {\n case 1:\n $type = 'NUMERIC';\n break;\n case 2:\n $type = 'DECIMAL';\n break;\n default :\n $type = 'BIGINT';\n break;\n }\n break;\n case 261:\n switch ((int) $column['fcodsubtype']) {\n case 1:\n $type = 'TEXT';\n break;\n }\n break;\n }\n\n $c->init(rtrim($type), $defaultValue);\n\n return $c;\n }", "public function getDataTypeAttribute(): string\n {\n return $this->config['data_type'];\n }", "public static function getColumnType($type) {\n\t\tforeach (static::getColumnTypes() as $blueprintType => $sqlType) {\n\t\t\tif ($blueprintType === $type) {\n\t\t\t\treturn $sqlType;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "private function getColumnsType($result){\n\n $data=$result['result'];\n $types=$result['columns'];\n $fields=$result['fields'];\n $list=[];\n if($fields!==null && $data!==false){\n foreach ($fields as $key=>$value) {\n foreach($data as $dkey=>$dvalue){\n if(array_key_exists($key,$types['type'])){\n if(preg_match('@int@is',$types['type'][$key])){\n $list[$dkey][$key]=(int)$dvalue->$key;\n }\n elseif(preg_match('@float@is',$types['type'][$key])){\n $list[$dkey][$key]=(float)$dvalue->$key;\n }\n elseif(preg_match('@bool@is',$types['type'][$key])){\n $list[$dkey][$key]=(bool)$dvalue->$key;\n }\n else{\n $list[$dkey][$key]=$dvalue->$key;\n }\n }\n else{\n if(preg_match('@groupBy.*Total@is',$key)){\n $list[$dkey][$key]=(int)$dvalue->$key;\n }\n }\n\n }\n }\n }\n\n return $this->resultRelationObjectGrouping($result,$list);\n\n\n }", "static public function getColumnType($table, $column)\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "protected static function getPhpType($sqlDataType)\n {\n if (strpos($sqlDataType, \"char\") !== false)\n return \"string\";\n \n if (strpos($sqlDataType, \"decimal\") !== false)\n return \"float\";\n \n if (strpos($sqlDataType, \"date\") !== false ||\n strpos($sqlDataType, \"time\") !== false)\n return \"DateTime\";\n \n if (strpos($sqlDataType, \"tinyint\") !== false ||\n strpos($sqlDataType, \"bool\") !== false)\n return \"bool\";\n \n if (strpos($sqlDataType, \"int\") !== false)\n return \"int\";\n \n return \"string\";\n }", "public function getColumnFromRow($row, Table $table)\n {\n $name = $row['Field'];\n $is_nullable = ($row['Null'] == 'YES');\n $autoincrement = (strpos($row['Extra'], 'auto_increment') !== false);\n $size = null;\n $precision = null;\n $scale = null;\n $sqlType = false;\n $desc = $row['Comment'];\n\n $regexp = '/^\n (\\w+) # column type [1]\n [\\(] # (\n ?([\\d,]*) # size or size, precision [2]\n [\\)] # )\n ?\\s* # whitespace\n (\\w*) # extra description (UNSIGNED, CHARACTER SET, ...) [3]\n $/x';\n if (preg_match($regexp, $row['Type'], $matches)) {\n $nativeType = $matches[1];\n if ($matches[2]) {\n if (($cpos = strpos($matches[2], ',')) !== false) {\n $size = (int) substr($matches[2], 0, $cpos);\n $precision = $size;\n $scale = (int) substr($matches[2], $cpos + 1);\n } else {\n $size = (int) $matches[2];\n }\n }\n if ($matches[3]) {\n $sqlType = $row['Type'];\n }\n foreach (self::$defaultTypeSizes as $type => $defaultSize) {\n if ($nativeType == $type && $size == $defaultSize && $scale === null) {\n $size = null;\n continue;\n }\n }\n } elseif (preg_match('/^(\\w+)\\(/', $row['Type'], $matches)) {\n $nativeType = $matches[1];\n if ($nativeType == 'enum') {\n $sqlType = $row['Type'];\n }\n } else {\n $nativeType = $row['Type'];\n }\n\n //BLOBs can't have any default values in MySQL\n $default = preg_match('~blob|text~', $nativeType) ? null : $row['Default'];\n\n $propelType = $this->getMappedPropelType($nativeType);\n if (!$propelType) {\n $propelType = Column::DEFAULT_TYPE;\n $sqlType = $row['Type'];\n $this->warn(\"Column [\" . $table->getName() . \".\" . $name . \"] has a column type (\" . $nativeType . \") that Propel does not support.\");\n }\n\n // Special case for TINYINT(1) which is a BOOLEAN\n if (PropelTypes::TINYINT === $propelType && 1 === $size) {\n $propelType = PropelTypes::BOOLEAN;\n }\n\n $column = new Column($name);\n $column->setTable($table);\n $column->setDomainForType($propelType);\n if ($sqlType) {\n $column->getDomain()->replaceSqlType($sqlType);\n }\n $column->getDomain()->replaceSize($size);\n $column->getDomain()->replaceScale($scale);\n if ($default !== null) {\n if ($propelType == PropelTypes::BOOLEAN) {\n if ($default == '1') {\n $default = 'true';\n }\n if ($default == '0') {\n $default = 'false';\n }\n }\n if (in_array($default, array('CURRENT_TIMESTAMP'))) {\n $type = ColumnDefaultValue::TYPE_EXPR;\n } else {\n $type = ColumnDefaultValue::TYPE_VALUE;\n }\n $column->getDomain()->setDefaultValue(new ColumnDefaultValue($default, $type));\n }\n $column->setAutoIncrement($autoincrement);\n $column->setNotNull(!$is_nullable);\n\n if ($this->addVendorInfo) {\n $vi = $this->getNewVendorInfoObject($row);\n $column->addVendorInfo($vi);\n }\n\n if ($desc){\n if(!$this->isUtf8($desc))\n $desc = utf8_encode($desc);\n $column->setDescription($desc);\n }\n\n return $column;\n }", "function dmlChangeColumnType () {\r\n\t\t// Create connection\r\n\t\t$conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n\t\t// Check connection\r\n\t\tif ($conn->connect_error) {\r\n\t\t\tdie(\"Connection failed: \" . $conn->connect_error);\r\n\t\t} \r\n\r\n\t\t$sql = \"ALTER TABLE tbldmlmapcontent MODIFY CntField7 MEDIUMTEXT\";\r\n\r\n\t\tif ($conn->query($sql) === TRUE) {\r\n\t\t\techo 1;\r\n\t\t} else {\r\n\t\t\techo 0;\r\n\t\t}\r\n\t\t\r\n\t\t$conn->close();\r\n\t}", "public function meta_type();", "protected function get_column_type($data, $grid = false)\n {\n $column = ($grid) ? 'col' : 'field';\n\n $settings = ($grid) ? $data : $data[$column . '_settings'];\n $field_content_type = isset($settings['db_column_type']) ? $settings['db_column_type'] : 'text';\n\n $fields = [\n $column . '_id_' . $data[$column . '_id'] => [\n 'type' => $field_content_type,\n 'null' => true\n ]\n ];\n\n return $fields;\n }", "public function getDataWithTypeDb() {}", "protected function getDataType($value)\n {\n if (is_bool($value))\n {\n return PDO::PARAM_BOOL;\n }\n if (is_null($value))\n {\n return PDO::PARAM_NULL;\n }\n if (is_integer($value))\n {\n return PDO::PARAM_INT;\n }\n return PDO::PARAM_STR;\n }", "protected function column_data_types( $table_columns ) {\n\t\t\t$column_data_types = [];\n\n\t\t\tforeach ( $table_columns as $column_value ) {\n\t\t\t\t$column_data_types[ $column_value['column_name'] ] = $column_value['data_type'];\n\t\t\t}\n\n\t\t\treturn $column_data_types;\n\t\t}", "public function withDataType(DataTypeInterface $type): ColumnInterface;", "public function getFieldType(){\n \treturn $this->field_type;\n }", "public function modelColumn();", "abstract public function getFieldByColumnType($name, $type, array $parameters = null);", "protected function getTypeMapping()\n {\n return self::$mysqlTypeMap;\n }", "public function hasColumnType($name);", "public function hasColumnType($name);", "protected function type_integer(Magic $column)\n {\n return 'INT';\n }", "public function get_type();", "public function getTypeList__600(){\n $query = new Query ( \"SELECT\" );\n\n $type = TypeBean::select ( $query );\n if (! $type) {\n return false;\n }\n return $type;\n }" ]
[ "0.7324146", "0.7318848", "0.7301678", "0.7298576", "0.7258094", "0.7258094", "0.7211228", "0.7187728", "0.70891476", "0.7085432", "0.70708907", "0.7070291", "0.7060033", "0.702823", "0.7022763", "0.69862676", "0.68949693", "0.6869052", "0.6869052", "0.6843515", "0.6810803", "0.67940307", "0.6761577", "0.67526037", "0.6722555", "0.67058367", "0.6699042", "0.66962844", "0.6651025", "0.662387", "0.6616834", "0.65740067", "0.65696615", "0.6565314", "0.65611947", "0.6539104", "0.65141654", "0.649411", "0.6493157", "0.64928216", "0.64636517", "0.645672", "0.64565414", "0.6417359", "0.64008707", "0.6400714", "0.6387961", "0.63398093", "0.63300645", "0.6304831", "0.63040614", "0.6275105", "0.6267431", "0.62620336", "0.6252959", "0.62472486", "0.62199503", "0.62174964", "0.62064874", "0.619729", "0.6195791", "0.6194999", "0.6186836", "0.6177301", "0.6177301", "0.6157377", "0.6141991", "0.61358404", "0.61182886", "0.61182886", "0.61182886", "0.61182886", "0.6114919", "0.6107513", "0.60829115", "0.60786414", "0.60772675", "0.6072454", "0.60599864", "0.60560477", "0.6052862", "0.60520655", "0.6049195", "0.6045475", "0.6044351", "0.6039867", "0.60396266", "0.60325587", "0.60322785", "0.6025044", "0.6014431", "0.60108364", "0.60000634", "0.5987093", "0.5979802", "0.597863", "0.59767276", "0.59767276", "0.59750074", "0.59747666", "0.59738487" ]
0.0
-1
Comment from database and comment from related eloquent model.
public function getComment();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function comment()\n {\n return $this->hasMany(Comment::class);\n }", "public function comment()\n {\n return $this->hasMany('App\\Models\\Comment');\n }", "public function comment()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comment(){\n return $this->hasMany(Comment::class);\n }", "public function comment(){\n return $this->hasMany('App\\Comment');\n }", "public function comment()\n {\n \treturn $this->hasMany('App\\Model\\Comment');\n }", "public function comment()\n {\n return $this->hasMany('Modules\\Comment\\Model\\Comment','user_id');\n }", "public function comment(){\n return $this->hasOne(AdminComment::class);\n }", "public function comments(){\n return $this->hasMany('Corp\\Models\\Comment');\n }", "public function comments()\n {\n return $this->hasMany(CitationComment::class);\n }", "public function comments()\n {\n return $this->hasMany(ExampleComment::class, 'from_user');\n }", "public function comments() {\n\t\t// hasMany(RelatedModel, foreignKeyOnRelatedModel = image_id, localKey = id)\n\t\treturn $this->hasMany('App\\Comment')->with('user')->orderBy('id', 'desc');\n\t}", "public function comments(){\n return $this->hasMany('App\\TextPostComment', 'post_id');\n }", "public function comments(){\n // Note that Comment::class == string 'App\\Comment'\n\n #? When this is called as a property, not a method, Laravel will know to 'eager-load' the relationship\n return $this->hasMany(Comment::class);\n\n }", "public function comments(){\n return $this->hasMany(Comment::class);\n }", "public function comments() {\n return $this->hasMany(Comment::class);\n }", "public function comments()\n {\n return $this->hasMany('App\\Models\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Models\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Models\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Models\\Comment');\n }", "public function comment(){\n return $this->hasMany(User::class);\n }", "public function comments() {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function commentLog()\n {\n return $this->belongsTo('App\\Models\\CommentLog', 'reference', 'comment');\n }", "public function comments() {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function getComments() {\n return $this->hasMany(Comment::class, ['post_id' => 'id']);\n }", "public function comments() {\n return $this->hasMany(Comment::class); // this (User) has many instances of the Comment\n }", "public function comments() {\n return $this->hasMany('App\\Models\\Comment', 'post_id');\n }", "public function comments()\n {\n return $this->hasMany(Comment::class);\n }", "public function comments()\n {\n return $this->hasMany(Comment::class);\n }", "public function comments()\n {\n return $this->hasMany(Comment::class);\n }", "public function comments()\n {\n return $this->hasMany(Comment::class);\n }", "public function comments()\n {\n return $this->hasMany(Comment::class);\n }", "public function comments()\n {\n return $this->hasMany(Comment::class);\n }", "public function comments()\n {\n return $this->hasMany(Comment::class);\n }", "public function comments()\n {\n return $this->hasMany(Comment::class);\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment', 'id_comment', 'id');\n }", "public function comment()\n {\n \treturn $this->hasMany('App\\Comment','idTinTuc','id');\n }", "public function comments()\n {\n return $this->hasMany('App\\NoteComment');\n }", "public function comments2(){\n\t\treturn $this->hasManyThrough('Comment', 'BlogPost', 'posted_by_id', 'blog_post_id');\n\t}", "public function comment()\n {\n return $this->belongsTo('App\\SchoolComment');\n }", "public function comments()\n {\n \treturn $this->hasMany(Comment::class);\n }", "public function comments(){\n \treturn $this->hasMany('App\\Comment');\n }", "public function comment()\n {\n return $this->belongsTo(Comment::class, 'parent_id');\n }", "public function comments() \n {\n \treturn $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany(Comment::class)->dernier();\n }", "public function comments(){\n\t\t// Comment, 'foreign_key', 'local_key'\n\t\treturn $this->hasMany(Comment::class, 'post_id', 'id');\n\t}", "public function comments(){\n return $this->hasMany(Comment::class, \"authenticatedUser_id\");\n }", "public function Comments() {\n return $this->hasMany(Comment::class);\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment', 'author_id', 'id');\n }", "public function comments()\n {\n return $this->hasMany('Model\\PostComment');\n }", "public function comments() {\n return $this->hasMany('\\Veer\\Models\\Comment', 'users_id');\n }", "public function comments()\n {\n return $this->hasMany(Comment::class, 'post_id');\n }", "public function comments()\n {\n return $this->hasMany('VideoBlog\\Comment');\n }", "public function comments()\n\t{\n\t\treturn $this->hasMany('Comment');\n\t}", "public function comments()\n\t{\n\t\treturn $this->hasMany('Comment');\n\t}", "public function comments()\n\t{\n\t\treturn $this->hasMany('Comment');\n\t}", "public function comments(): Relation\n {\n return $this->hasMany(Comment::class, 'user_id');\n }", "public function comments()\n {\n return $this->hasMany(PhotoComment::class);\n }", "public function comments()\n {\n $sort = Sorter::getCommentSortId();\n $orderField = $sort == 1 ? 'rate' : 'id';\n $orderDir = $sort == 1 ? 'desc' : 'asc';\n return $this->morphMany(Comment::class, 'commentable')->orderBy($orderField, $orderDir);\n }", "public function comments() {\n\n\t\treturn $this->hasMany(Comment::class);\n\t}", "public function comments(){\n return $this->hasMany('App\\Models\\Comments', 'article_id');\n }", "public function comments()\n {\n return $this->hasMany('App\\Forum_Models\\Comment');\n }", "public function getComments()\n {\n return $this->hasMany(Comment::class, ['created_by' => 'id']);\n }", "public function comments(){\n return $this->morphMany(Comment::class, 'commentable');\n }", "public function getComments() \n {\n return $this->hasMany(Comment::className(), [\n 'post_id' => 'id',\n ]);\n }", "public function commentDesc(){\n \n return $this->hasMany('Comment','id_phone')->orderBy('created_at','DESC');\n \n }", "public function comments()\n {\n return $this->morphedByMany('App\\Comment', 'likeable');\n }", "public function comments()\n {\n return $this->morphMany('App\\Comment', 'commentable')->orderBy('created_at', 'DESC');\n }", "function comments()\n {\n return $this->morphMany('App\\Comments', 'commentable');\n }", "public function post()\n\t{\n\t\treturn $this->belongsTo('App\\Models\\Post', 'post_id', 'comment_id');\n\t}", "public function comments() {\n return $this->morphMany(Comment::class,'commentable', 'parent_type', 'parent_id')->orderBy('created_at', 'ASC');\n }", "public function comments()\n {\n // check if user is already loaded, if not, we fetch it from database\n if ($this->_comments) {\n return $this->_comments;\n } else {\n $comments = new Application_Model_DbTable_Comments();\n\n foreach ($comments->findAllBy('post_id', $this->_id) as $comment) {\n $this->_comments[] = $comment ;\n }\n return $this->_comments;\n }\n }", "public function comments()\n {\n return $this->morphMany('App\\Comment', 'commentable');\n }", "public function comments()\n {\n return $this->morphMany('App\\Comment', 'commentable');\n }", "public function comments()\n {\n return $this->morphMany('App\\Comment', 'commentable');\n }", "public function getComment() {}", "public function getComment()\n{\n return $this->hasMany(Comment::className(), ['article_id' => 'id']);\n}", "public function comments()\n {\n return $this->hasMany(Comment::class, 'subject_id', 'id')->where('comments.subject_type', Wiki::class)->with(['user', 'likes']);\n }", "public function comments()\n {\n \treturn $this->hasMany(Comment::class, 'article_id');\n }", "public function comments()\n {\n return $this->morphMany(Comments::getCommentsRepository()->getModel(), 'entity');\n }", "public function allComments() {\n\t\treturn $this->hasMany('NGiraud\\News\\Models\\Comment');\n\t}", "public function getComment(){\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id = ?\";\n // prepare query statement\n $stmt = $this->connection->prepare($query);\n $stmt->bindParam(1, $this->id);\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->username = $row['username'];\n $this->message = $row['message'];\n\n }", "public function comments()\n {\n return $this->hasMany(Comment::class)->latest();\n }" ]
[ "0.66370976", "0.6586649", "0.6543918", "0.6534941", "0.6491073", "0.6471365", "0.64028823", "0.636469", "0.62568307", "0.62504464", "0.6229184", "0.62193114", "0.61528355", "0.61310613", "0.6127786", "0.61272615", "0.6124493", "0.6124493", "0.6124493", "0.6124493", "0.6123493", "0.6119133", "0.61180764", "0.61138684", "0.611375", "0.6106686", "0.6106686", "0.6106686", "0.6106686", "0.6106686", "0.6106686", "0.6106686", "0.6106686", "0.6106686", "0.6106686", "0.6106686", "0.6097393", "0.60902363", "0.60776275", "0.60680497", "0.60680497", "0.60680497", "0.60680497", "0.60680497", "0.60680497", "0.60680497", "0.60680497", "0.6066648", "0.6064315", "0.606332", "0.60613334", "0.604795", "0.6028717", "0.60171366", "0.6007676", "0.60051334", "0.6003032", "0.5991562", "0.5990114", "0.5982706", "0.596307", "0.5960866", "0.59496266", "0.59391505", "0.5931801", "0.59304804", "0.59304804", "0.59304804", "0.5928377", "0.5927176", "0.59040636", "0.58935434", "0.5892437", "0.58871007", "0.58764595", "0.5871365", "0.5851836", "0.5825144", "0.582219", "0.5820111", "0.5810426", "0.57969624", "0.5789785", "0.5779352", "0.5777558", "0.5777558", "0.5777558", "0.57582814", "0.5756298", "0.5752634", "0.5742091", "0.5737136", "0.57345235", "0.5732908", "0.57309926" ]
0.5817353
82
Column options from database such as autoincrement, primary_key, unique and etc.
public function getOptions();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function columnTypes(): array\n {\n return [\n 'id' => '{{ name }} INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE',\n 'varchar' => '{{ name }} TEXT {{ null }} {{ default }} {{ unique }}',\n 'text' => '{{ name }} TEXT {{ null }} {{ default }} {{ unique }}',\n 'int' => '{{ name }} INTEGER {{ null }} {{ default }} {{ unique }}',\n 'timestamp' => '{{ name }} INTEGER {{ null }} {{ default }} {{ unique }}'\n ];\n }", "function sql_create_table($options) {\n\t$options = array_merge(array(\n\t\t'hasID' => true,\n\t\t'comment' => null,\n\t\t'columns' => array(),\n\t\t'primaryKeys' => array(),\n\t\t'uniqueKeys' => array(),\n\t\t'foreignKeys' => array(),\n\t\t'collation' => 'utf8_bin',\n\t\t'engine' => 'InnoDB',\n\t), $options);\n\n\tif( $options['hasID'] ){\n\t\tarray_unshift($options['columns'], 'id INT(11) NOT NULL AUTO_INCREMENT');\n\t\tarray_unshift($options['primaryKeys'], 'id');\n\t}\n\n\t$attributes = $options['columns'];\n\n\tif( sizeof($options['primaryKeys']) ){\n\t\t$attributes[] = 'PRIMARY KEY (' . implode(', ', $options['primaryKeys']) . ')';\n\t}\n\n\tif( sizeof($options['uniqueKeys']) ){\n\t\t// array('id', 'test')\n\t\tif( is_simple_array($options['uniqueKeys']) ){\n\t\t\t$options['uniqueKeys'] = array(array('name' => 'uniqueKeys', 'columns' => $options['uniqueKeys']));\n\t\t}elseif( is_assoc_array($options['uniqueKeys']) ){\n\t\t\t$options['uniqueKeys'] = array($options['uniqueKeys']);\n\t\t}\n\t\tforeach ($options['uniqueKeys'] as $uk) {\n\t\t\t$attributes[] = 'CONSTRAINT ' . sql_quote($uk['name'], true) . ' UNIQUE (' . implode(', ', $uk['columns']) . ')';\n\t\t}\n\t}\n\n\tif( sizeof($options['foreignKeys']) ){\n\t\t$options['engine'] = 'InnoDB';\n\t\tforeach ($options['foreignKeys'] as $key => $ref) {\n\t\t\tif( is_string($ref) ){\n\t\t\t\t$attributes[] = 'FOREIGN KEY (' . $key . ') REFERENCES ' . $ref;\n\t\t\t}elseif( is_array($ref) ){\n\t\t\t\tif( !isset($ref['name']) ){\n\t\t\t\t\t$attributes[] = 'FOREIGN KEY (' . $key . ') REFERENCES ' . $ref;\n\t\t\t\t}else{\n\t\t\t\t\t$attributes[] = 'CONSTRAINT ' . $ref['name'] . ' FOREIGN KEY (' . $key . ') REFERENCES ' . $ref['ref'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$comment = '';\n\tif( $options['comment'] ){\n\t\t$comment = ' COMMENT=' . sql_quote($options['comment']);\n\t}\n\n\t$collation = '';\n\tif( $options['collation'] ){\n\t\t$comment = ' COLLATE ' . sql_quote($options['collation']);\n\t}\n\n\t$engine = '';\n\tif( $options['engine'] ){\n\t\t$engine = ' ENGINE=' . sql_quote($options['engine']);\n\t}\n\n\t$prefix = sql_prefix();\n\n\t$query = 'CREATE TABLE IF NOT EXISTS ' . sql_quote($prefix . $options['name'], true) . ' (' . implode(', ', $attributes) . ' ) ' . $comment . $collation . $engine . ';';\n\treturn sql_query($query, null, null);\n}", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'users_id' => 'users_id',\n 'secret_key' => 'secret_key',\n 'hmac' => 'hmac',\n 'created' => 'created'\n );\n }", "public function getAutoIncrementColumn() {\n\n return $this->autoIncrement;\n\n }", "static function setUpColumns($columns)\n {\n $columns->id = Column::AUTO_ID;\n $columns->name = Column::create(Column::STRING + Column::NOT_NULL)->setUnique();\n $columns->address = Column::STRING;\n $columns->createdAt = Column::TIMESTAMP;\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'username' => 'username',\n 'hash' => 'hash',\n 'email' => 'email',\n 'created' => 'created'\n );\n }", "public static function columnTypes()\n {\n return [\n 'bigInteger' => 'Bigint',\n 'bigPrimaryKey' => 'BigPK',\n 'binary' => 'Binary',\n 'boolean' => 'Boolean',\n 'date' => 'Date',\n 'dateTime' => 'Datetime',\n 'decimal' => 'Decimal',\n 'double' => 'Double',\n 'float' => 'Float',\n 'integer' => 'Integer',\n 'money' => 'Money',\n 'primaryKey' => 'PK',\n 'smallInteger' => 'Smallint',\n 'string' => 'String',\n 'text' => 'Text',\n 'time' => 'Time',\n 'timestamp' => 'Timestamp',\n ];\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'user_id' => 'user_id',\n 'create_time' => 'create_time',\n 'money' => 'money',\n 'bank_name' => 'bank_name',\n 'account_bank' => 'account_bank',\n 'account_name' => 'account_name',\n 'remark' => 'remark',\n 'status' => 'status'\n ];\n }", "public function setColumnsWithOptions(string $name, string $type, ?int $option = null, bool $isNull = false, bool $unsigned = false, bool $autoIncrement = false, $defaultValue = null, $primaryKey = false);", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'id_user' => 'id_user',\n 'ip' => 'ip',\n 'user_agent' => 'user_agent'\n ];\n }", "static function setUpColumns($columns)\n {\n $columns->id = Column::AUTO_ID;\n $columns->oneId = OneABBR::columns()->id;\n $columns->createdAt = Column::TIMESTAMP;\n $columns->updatedAt = Column::TIMESTAMP;\n $columns->info = Column::create(Column::STRING)->setIndexed();\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'nickname' => 'nickname',\n 'realname' => 'realname',\n 'username' => 'username',\n 'openid' => 'openid',\n 'phone' => 'phone',\n 'passwd' => 'passwd',\n 'avatar' => 'avatar',\n 'sex' => 'sex',\n 'province' => 'province',\n 'city' => 'city',\n 'area' => 'area',\n 'address' => 'address',\n 'cardsn' => 'cardsn',\n 'recommend' => 'recommend',\n 'level' => 'level',\n 'groupid' => 'groupid',\n 'vip' => 'vip',\n 'add_at' => 'add_at',\n 'active' => 'active',\n 'integral' => 'integral',\n 'money' => 'money',\n 'update_at' => 'update_at'\n ];\n }", "private function getColumns() {\n\t\t$cols = $this->connection->fetchAll(\"DESCRIBE `\".$this->connection->database.\"`.`$this->table`\");\n\t\tif (!$cols) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tself::$primaryKey[$this->table]=FALSE;\n\t\tforeach ($cols as $col) {\n\t\t\tself::$tables[$this->table][ $col['Field']] = $col['Type'];\n\t\t\tif ($col['Key']=='PRI') {\n\t\t\t\tself::$primaryKey[$this->table] = $col['Field'];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function setAsPrimaryColumn(): self;", "public function getSQLDefinition()\n {\n // Index columns are always of the same type\n if ($this->columnName == IESDataColumnType::INDEX_COLUMN_NAME) {\n return \"{$this->columnName} INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY\";\n }\n\n $type = \"\";\n $nullSuffix = $this->nullable ? \"NULL\" : \"NOT NULL\";\n\n if ($this->dataType == IESDataColumnType::STRING) {\n $type = \"VARCHAR({$this->getColumnLength()})\";\n } else if ($this->dataType == IESDataColumnType::BOOLEAN) {\n $type = \"BIT\";\n } else if ($this->dataType == IESDataColumnType::FLOAT) {\n $type = \"DECIMAL(13,4)\";\n } else if ($this->dataType == IESDataColumnType::INTEGER) {\n $subType = $this->getIntegerSubType();\n\n if ($subType == IESDataColumnIntegerTypes::SIGNED_BYTE)\n $type = \"TINYINT SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::SIGNED_SHORT)\n $type = \"SMALLINT SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::SIGNED_INTEGER)\n $type = \"INTEGER SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::SIGNED_LONG)\n $type = \"BIGINT SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_BYTE)\n $type = \"TINYINT UNSIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_SHORT)\n $type = \"SMALLINT UNSIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_INTEGER)\n $type = \"INTEGER UNSIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_LONG)\n $type = \"BIGINT UNSIGNED\";\n }\n\n return \"`{$this->columnName}` {$type} {$nullSuffix}\";\n }", "public function columnMap()\n {\n // the values their names in the application\n return array(\n 'id' => 'id',\n 'enabled' => 'enabled',\n 'suspended' => 'suspended',\n 'gender' => 'gender',\n 'info' => 'info',\n 'password' => 'password',\n 'roles' => 'roles',\n 'first_name' => 'firstName',\n 'last_name' => 'lastName',\n 'email' => 'email',\n 'created_at' => 'created_at',\n 'expires_at' => 'expires_at',\n );\n }", "public function columnMap(){\n\t\treturn array(\n\t\t\t'id'=> 'id',\n\t\t\t'name'=> 'name',\n\t\t\t'content'=> 'content' \n\t\t);\n\t}", "private function alterPrimaryKey()\n {\n if(is_array($this->primaryKeyValue)){\n // check for auto increment\n $autoIncrement = $this->primaryKeyValue['auto_increment'];\n if($autoIncrement){\n $increment = \" AUTO_INCREMENT, AUTO_INCREMENT=1\";\n }\n\n $this->addCollectionQuery(\n \"\n --\n -- AUTO_INCREMENT for table `{$this->tableName}`\n --\n ALTER TABLE `{$this->tableName}`\n MODIFY {$this->createColumnDefinition($this->primaryKeyValue)}{$increment};\n \"\n );\n }\n }", "public function getColumnConfig();", "private function pk_column(){\n\t\tif( in_array(static::$table_name, Model_Kiwi::$composite_key_tables) ){\n\t\t\treturn \"composite_key\";\n\t\t}\n\t\t//if the primary key of the table has been defined in config - return that else use convention\n\t\tif( in_array( static::$table_name, array_keys(Model_Kiwi::$kiwi_pk_hash))){\n\t\t\treturn Model_Kiwi::$kiwi_pk_hash[ static::$table_name ];\n\t\t}\n\t\treturn Model_Kiwi::singularize(static::$table_name) . '_id';\n\t}", "function mappingColumns()\n {\n $mapped_columns = array(\n \"id\" => 0,\n \"url\" => 2,\n \"iframe\" => false,\n \"preview\" => false,\n \"thumbs\" => 1,\n \"title\" => 3,\n \"tags\" => 5,\n \"categories\" => 4,\n \"pornstars\" => 6,\n \"duration\" => 7,\n \"views\" => false,\n \"likes\" => false,\n \"unlikes\" => false,\n );\n\n return $mapped_columns;\n }", "function extraDBFields() {\r\n\t\treturn array(\r\n\t\t\t'db' => array('IdentityURL' => 'Varchar(255)'),\r\n\t\t\t'has_one' => array(),\r\n\t\t\t'defaults' => array('IdentityURL' => null),\r\n\t\t\t'indexes' => array('IdentityURL' => 'unique (IdentityURL)')\r\n\t\t);\r\n\t}", "public function columnMap()\n {\n //the values their names in the application\n return array(\n 'id' => 'ID',\n 'item_id' => 'Item_ID',\n 'des' => 'Des',\n 'depts_id' => 'Depts_ID',\n 'application_id' => 'Application_ID',\n 'module_id' => 'Module_ID',\n );\n\n\n }", "public static function add_column_options($sql, $options = array(), $alter = false) {\n $sql.= isset($options['default']) ? ' DEFAULT ' . $options['default'] : '';\n $sql.= (isset($options['null']) && !$options['null']) ? ' NOT NULL' : '';\n $sql.= ($alter && isset($options['null']) && $options['null']) ? ' NULL' : '';\n return $sql;\n }", "public function getPrimaryKeyColumn() : string\n {\n return $this->primaryKey;\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'pole_id' => 'pole_id',\n 'worker_id' => 'worker_id',\n 'notice' => 'notice'\n ];\n }", "public function columnMap()\n {\n //the values their names in the application\n return array(\n 'id' => 'code' ,\n 'the_name' => 'theName' ,\n 'the_type' => 'theType' ,\n 'the_year' => 'theYear'\n );\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id', \n 'name' => 'name', \n 'class_name' => 'class_name', \n 'description' => 'description', \n 'logo' => 'logo',\n 'delsign' => 'delsign'\n );\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'user_id' => 'user_id',\n 'session_id' => 'session_id',\n 'goods_id' => 'goods_id',\n 'goods_sn' => 'goods_sn',\n 'goods_name' => 'goods_name',\n 'market_price' => 'market_price',\n 'goods_price' => 'goods_price',\n 'member_goods_price' => 'member_goods_price',\n 'goods_num' => 'goods_num',\n 'spec_key' => 'spec_key',\n 'spec_key_name' => 'spec_key_name',\n 'bar_code' => 'bar_code',\n 'selected' => 'selected',\n 'add_time' => 'add_time',\n 'prom_type' => 'prom_type',\n 'prom_id' => 'prom_id',\n 'sku' => 'sku'\n ];\n }", "protected function get_select_id_col_name() {\n return \"accession\";\n }", "public function columnMap()\n {\n return [\n 'id_comentario' => 'id_comentario',\n 'comentario' => 'comentario',\n 'fecha_comentario' => 'fecha_comentario',\n 'id_reporte' => 'id_reporte',\n 'id_usuario' => 'id_usuario'\n ];\n }", "private function setAddColumnSql() {\n\n if (!empty($this->add_columns)) {\n\n foreach ($this->add_columns as $key => $value) {\n\n foreach ($value as $keys) {\n\n $column_data = $this->one_db_table_columns[$key][$keys];\n\n\n\n $add_colum_params = \"\";\n $default_is_string = false;\n $null_string = \"\";\n $default_string = \"\";\n\n\n\n\n //Sütun tipi\n $add_colum_params .= \" \" . $column_data['Type'] . \" \";\n\n\n if ($column_data['Null'] == \"NO\") {\n\n $null_string = \"NOT NULL\";\n } else if ($column_data['Null'] == \"YES\") {\n\n $null_string = \"NULL\";\n }\n\n\n\n $field_type_detect = substr($column_data['Type'], 0, 4);\n\n if (\n $field_type_detect == \"varc\" ||\n $field_type_detect == \"text\" ||\n $field_type_detect == \"date\") {\n\n $default_is_string = true;\n }\n\n\n\n if ($column_data['Default'] != \"\" || !empty($column_data['Default']) || $column_data['Default'] != NULL) {\n\n\n $default_string = \" DEFAULT \";\n\n\n if ($default_is_string) {\n\n\n $default_string .= \" '\" . $column_data['Default'] . \"' \";\n } else {\n\n $default_string .= \" \" . $column_data['Default'] . \" \";\n }\n }\n\n\n\n $add_colum_params .= $null_string . $default_string;\n\n $writesql = <<< EOT\nALTER TABLE {$key} ADD COLUMN {$column_data['Field']} {$add_colum_params};\nEOT;\n\n $this->execute_sql[\"add_columns\"][] = $writesql;\n }\n }\n }\n }", "private function getApplicationIdColumn()\n\t{\n\t\treturn 'application_id';\n\t}", "public function info()\n\t{\n\n\t\t$query = \"SELECT\nc.column_name AS 'name',\nc.data_type AS 'type',\nc.column_type AS 'size',\n(SELECT st.constraint_type FROM information_schema.table_constraints st INNER JOIN information_schema.key_column_usage sk ON (st.constraint_name=sk.constraint_name AND st.table_name=sk.table_name AND st.table_schema=sk.table_schema) WHERE st.constraint_type='PRIMARY KEY' AND sk.column_name=c.column_name AND st.table_name=c.table_name AND st.table_schema=c.table_schema) AS 'primary',\n(SELECT st.constraint_type FROM information_schema.table_constraints st INNER JOIN information_schema.key_column_usage sk ON (st.constraint_name=sk.constraint_name AND st.table_name=sk.table_name AND st.table_schema=sk.table_schema) WHERE st.constraint_type='UNIQUE' AND sk.column_name=c.column_name AND st.table_name=c.table_name AND st.table_schema=c.table_schema) AS 'unique',\nk.referenced_table_name AS 'foreign',\nc.is_nullable AS 'notnull',\nsc.extra AS 'sequence',\nc.column_default AS 'default'\nFROM information_schema.columns c\nLEFT JOIN information_schema.columns sc ON (sc.extra='auto_increment' AND sc.column_name=c.column_name AND sc.table_name=c.table_name AND sc.table_schema=c.table_schema)\nLEFT JOIN information_schema.key_column_usage k ON (k.table_schema=c.table_schema AND k.table_name=c.table_name AND k.column_name=c.column_name AND k.referenced_table_name IS NOT NULL)\nWHERE c.table_schema='\" . $this->_adapter->getConfig('schema') . \"' AND c.table_name='\" . $this->_name . \"'\nORDER BY c.ordinal_position;\";\n\n\t\t$result = $this->_adapter->fetch($query);\n\n\t\tif ( ! empty($result) )\n\t\t{\n\t\t\t\n\t\t\t$schema = array();\n\t\t\t\n\t\t\tforeach ($result as $v )\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif( ! empty($v['primary']) ) // se se eh chave primaria, tenta encontrar os lugares para onde ela propaga\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$query = \"SELECT DISTINCT table_name AS 'tablename' FROM information_schema.key_column_usage WHERE referenced_table_name='\" . $this->getName() . \"' AND referenced_column_name='{$v['name']}'\";\n\t\t\t\t\t\n\t\t\t\t\t$primary_refs = $this->_adapter->fetch($query);\n\t\t\t\t\t\n\t\t\t\t\tif( ! empty($primary_refs) )\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$temparray = array();\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($primary_refs as $k => $ref)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temparray[] = $ref['tablename'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$v['primary'] = $temparray;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$v['primary'] = TRUE;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tunset($v['primary']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $v['notnull']=='NO' )\n\t\t\t\t{\n\t\t\t\t\t$v['notnull'] = TRUE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tunset($v['notnull']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $v['unique']=='UNIQUE' )\n\t\t\t\t{\n\t\t\t\t\t$v['unique'] = TRUE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tunset($v['unique']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $v['sequence']=='auto_increment' )\n\t\t\t\t{\n\t\t\t\t\t$v['sequence'] = 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tunset($v['sequence']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $v['foreign']=='' )\n\t\t\t\t{\n\t\t\t\t\tunset($v['foreign']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $v['default']=='' )\n\t\t\t\t{\n\t\t\t\t\tunset($v['default']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( preg_match(\"~\\(([0-9]+)\\)~\", $v['size'], $match) )\n\t\t\t\t{\n\t\t\t\t\t$v['size'] = $match[1];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$name = $v['name'];\n\t\t\t\t\n\t\t\t\tunset($v['name']);\n\t\t\t\t\n\t\t\t\t$schema[ $name ] = $v;\n\t\t\t\t\n\t\t\t}\n\n\t\t\treturn $schema;\n\t\t\n\t\t}\n\t\t\n\t}", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'producer_id' => 'producer_id',\n 'description_id' => 'description_id',\n 'product_detail_id' => 'product_detail_id',\n 'quantity' => 'quantity',\n 'import_price' => 'import_price',\n 'sale_price' => 'sale_price',\n 'discount' => 'discount',\n 'view' => 'view',\n 'hot' => 'hot',\n 'created_at' => 'created_at'\n ];\n }", "function setup_db_columns() {\n\n static $ret;\n if ($ret)\n return $ret;\n\n $ret = array(\n \"compute_cluster\" =>\n array(\n \"platform_name\",\n \"platform_hardware\",\n \"platform_type\",\n \"os_name\",\n \"os_version\",\n ),\n \"submit\" =>\n array(\n \"mtt_client_version\",\n \"hostname\",\n \"local_username\",\n \"http_username\",\n ),\n \"mpi_get\" => \n array(\n \"mpi_name\",\n \"mpi_version\",\n ),\n \"compiler\" => \n array(\n \"compiler_name\",\n \"compiler_version\",\n ),\n \"mpi_install\" => \n array(\n \"configure_arguments\",\n \"vpath_mode\",\n \"bitness\",\n \"endian\",\n ),\n \"test_build\" => \n array(\n \"suite_name\",\n ),\n \"test_run\" => \n array(\n #\"variant\",\n \"test_name\",\n \"command\",\n \"np\",\n ),\n \"results\" => \n array(\n #\"phase\",\n #\"duration\",\n \"environment\",\n \"merge_stdout_stderr\",\n \"result_stdout\",\n \"result_stderr\",\n \"result_message\",\n \"exit_value\",\n \"exit_signal\",\n \"test_result\",\n ),\n );\n\n return $ret;\n}", "protected function setDbColumns()\n {\n $connection = $this->model()->eloquent()->getConnectionName();\n\n $this->dbColumns = collect(Schema::connection($connection)->getColumnListing($this->model()->getTable()));\n }", "static function setUpColumns($columns)\n {\n $columns->id = Column::AUTO_ID;\n $columns->type = Column::STRING;\n $columns->text = Column::STRING + Column::NOT_NULL;\n }", "public function columnMap()\n {\n return array(\n 'mandatary_id' => 'mandatary_id',\n 'phone' => 'phone',\n 'real_name' => 'real_name',\n 'id_card' => 'id_card',\n 'id_card_image' => 'id_card_image',\n 'business_id' => 'business_id',\n 'status' => 'status',\n 'user_id' => 'user_id',\n 'update_time' => 'update_time'\n );\n }", "public static function getColumns()\n {\n return array('libraryId', 'signature', 'summary', 'status', 'userId');\n }", "public static function getDefaultColumns()\n {\n return [\n config('translatable.db.columns.langcode'),\n config('translatable.db.columns.translation_uuid'),\n ];\n }", "public function setDefaultColumns()\n {\n foreach ($this->Model->columnsInformation as $column) {\n // Set indexes\n if ($column['Key'] == \"PRI\") {\n $this->indexes[] = $this->table . \".\" . $column['Field'];\n }\n // Set columns\n $this->columns[] = $this->table . \".\" . $column['Field'];\n }\n // Set default columns\n $this->defaultColumns = $this->columns;\n // Add actions column\n $this->addCustomColumn($this->builtInCustomColumns['actions']);\n // Add no column\n $this->addCustomColumnAsFirstColumn($this->builtInCustomColumns['no']);\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'notice_id' => 'notice_id',\n 'worker_id' => 'worker_id'\n ];\n }", "public function columnOptions() {\n\t\treturn $this->columnNames;\n\t}", "protected function get_primary_column_name()\n {\n }", "protected function get_primary_column_name()\n {\n }", "protected function get_primary_column_name()\n {\n }", "protected function AdminRows_settings_columns() {\n\treturn array(\n\t 'ID' => 'ID',\n\t 'ID_Parent' \t=> 'Parent',\n\t 'NameSng'\t=> 'Singular',\n\t 'NamePlr'\t=> 'Plural',\n\t 'Descr'\t=> 'Description',\n\t 'Sort'\t=> 'Sort',\n\t 'isType'\t=> 'Type?'\n\t );\n }", "public function columnMap()\n {\n return array(\n 'bonus_id' => 'bonus_id',\n 'bonus_type_id' => 'bonus_type_id',\n 'bonus_sn' => 'bonus_sn',\n 'user_id' => 'user_id',\n 'used_time' => 'used_time',\n 'order_id' => 'order_id',\n 'emailed' => 'emailed'\n );\n }", "public function getAutoIncrement()\n\t{\n\t\treturn 'id';\n\t}", "function metaCourse()\n{\n return array(\n // Every column in the mapped table\n array(\n 'Id', 'Name', 'CourseId'\n ),\n\n // Every column part of the primary key\n array(\n 'Id'\n ),\n\n // Every column and their data types\n array(\n 'Id' => \"Auto_Increment\",\n 'Name' => \"Varchar\",\n 'CourseId' => \"Varchar\"\n ),\n\n // The columns that have numeric data types\n array(\n 'Id'\n )\n\n\n );\n}", "public function change()\n {\n $this->table('news', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'biginteger', ['identity' => true])\n ->addColumn('title', 'string', ['limit' => 255])\n ->create();\n\n $this->table('news1', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'biginteger', ['identity' => true])\n ->addColumn('title', 'string', ['limit' => 255])\n ->create();\n }", "public function get_primary_column()\n {\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'title' => 'title',\n 'source_id' => 'source_id',\n 'abstract' => 'abstract',\n 'Personal_Author' => 'Personal_Author',\n 'Corporate_Author' => 'Corporate_Author',\n 'parent_literature' => 'parent_literature',\n 'conference_title' => 'conference_title',\n 'conference_date' => 'conference_date',\n 'conference_place' => 'conference_place',\n 'host_unit' => 'host_unit',\n 'keywords' => 'keywords',\n 'publishDate' => 'publishDate',\n 'file_id' => 'file_id'\n );\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'classification_name' => 'classification_name'\n );\n }", "function _get_querable_table_columns()\n {\n return array('name', 'author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand', 'comment_count');\n }", "public function get_columns() {\n\n\t\treturn array(\n\t\t\t'id' \t\t => '%d',\n\t\t\t'name' \t\t => '%s',\n\t\t\t'date_created' \t=> '%s',\n\t\t\t'date_modified' => '%s',\n\t\t\t'status'\t\t=> '%s',\n\t\t\t'ical_hash'\t\t=> '%s'\n\t\t);\n\n\t}", "public function table_attributes() {\n return static::find_by_sql(\"SHOW COLUMNS FROM \".static::$table_name);\n }", "public function addColumn()\n {\n if ($this->name || $this->timestamps) {\n $this->columns[] = [\n 'column' => $this->name,\n 'length' => $this->length,\n 'dataType' => $this->dataType,\n 'nullable' => $this->nullable,\n 'unsigned' => $this->unsigned,\n 'pk' => $this->pk,\n 'timestamps' => $this->timestamps,\n 'autoIncrement' => $this->autoIncrement,\n 'default' => $this->default,\n 'comment' => $this->comment,\n 'unique' => $this->unique,\n ];\n $this->reset();\n }\n if ($this->foreignKey) {\n $this->columns[] = [\n 'foreignKey' => $this->foreignKey,\n 'references' => $this->references,\n 'on' => $this->on,\n 'onUpdate' => $this->onUpdate,\n 'onDelete' => $this->onDelete,\n ];\n $this->reset();\n }\n }", "public function columnMap()\n {\n return array(\n 'idconfig' => 'idconfig',\n 'ip' => 'ip',\n 'usuario' => 'usuario',\n 'senha' => 'senha',\n 'dominio' => 'dominio',\n 'criado' => 'criado',\n 'modificado' => 'modificado',\n 'classe_usuario' => 'classe_usuario'\n );\n }", "function migrate()\n {\n if (!$this->object->_columns) {\n throw new E_ColumnsNotDefinedException(\"Columns not defined for {$this->get_table_name()}\");\n }\n $added = FALSE;\n $removed = FALSE;\n // Add any missing columns\n foreach ($this->object->_columns as $key => $properties) {\n if (!in_array($key, $this->object->_table_columns)) {\n if ($this->object->_add_column($key, $properties['type'], $properties['default_value'])) {\n $added = TRUE;\n }\n }\n }\n // Remove any columns not defined\n //\t\tforeach ($this->object->_table_columns as $key) {\n //\t\t\tif (!isset($this->object->_columns[$key])) {\n //\t\t\t\t$this->object->_remove_column($key);\n // $removed = TRUE;\n //\t\t\t}\n //\t\t}\n if ($added or $removed) {\n // var_dump($this->object->_table_columns);\n $this->object->lookup_columns();\n // var_dump($added, $removed);\n }\n }", "function MetaColumns($table,$normalize=true)\n\t{\n\t\tglobal $ADODB_FETCH_MODE;\n\n\t\t$schema = false;\n\t\t$false = false;\n\t\t$this->_findschema($table,$schema);\n\n\t\tif ($normalize) $table = strtolower($table);\n\n\t\t$save = $ADODB_FETCH_MODE;\n\t\t$ADODB_FETCH_MODE = ADODB_FETCH_NUM;\n\t\tif ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);\n\n\t\t$rs = $this->Execute($this->_generateMetaColumnsSQL($table, $schema));\n\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t$ADODB_FETCH_MODE = $save;\n\n\t\tif ($rs === false) {\n\t\t\treturn $false;\n\t\t}\n\t\tif (!empty($this->metaKeySQL)) {\n\t\t\t// If we want the primary keys, we have to issue a separate query\n\t\t\t// Of course, a modified version of the metaColumnsSQL query using a\n\t\t\t// LEFT JOIN would have been much more elegant, but postgres does\n\t\t\t// not support OUTER JOINS. So here is the clumsy way.\n\n\t\t\t$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;\n\n\t\t\t$rskey = $this->Execute(sprintf($this->metaKeySQL,($table)));\n\t\t\t// fetch all result in once for performance.\n\t\t\t$keys = $rskey->GetArray();\n\t\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t\t$ADODB_FETCH_MODE = $save;\n\n\t\t\t$rskey->Close();\n\t\t\tunset($rskey);\n\t\t}\n\n\t\t$rsdefa = array();\n\t\tif (!empty($this->metaDefaultsSQL)) {\n\t\t\t$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;\n\t\t\t$sql = sprintf($this->metaDefaultsSQL, ($table));\n\t\t\t$rsdef = $this->Execute($sql);\n\t\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t\t$ADODB_FETCH_MODE = $save;\n\n\t\t\tif ($rsdef) {\n\t\t\t\twhile (!$rsdef->EOF) {\n\t\t\t\t\t$num = $rsdef->fields['num'];\n\t\t\t\t\t$s = $rsdef->fields['def'];\n\t\t\t\t\tif (strpos($s,'::')===false && substr($s, 0, 1) == \"'\") { /* quoted strings hack... for now... fixme */\n\t\t\t\t\t\t$s = substr($s, 1);\n\t\t\t\t\t\t$s = substr($s, 0, strlen($s) - 1);\n\t\t\t\t\t}\n\n\t\t\t\t\t$rsdefa[$num] = $s;\n\t\t\t\t\t$rsdef->MoveNext();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tADOConnection::outp( \"==> SQL => \" . $sql);\n\t\t\t}\n\t\t\tunset($rsdef);\n\t\t}\n\n\t\t$retarr = array();\n\t\twhile (!$rs->EOF) {\n\t\t\t$fld = new ADOFieldObject();\n\t\t\t$fld->name = $rs->fields[0];\n\t\t\t$fld->type = $rs->fields[1];\n\t\t\t$fld->max_length = $rs->fields[2];\n\t\t\t$fld->attnum = $rs->fields[6];\n\n\t\t\tif ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;\n\t\t\tif ($fld->max_length <= 0) $fld->max_length = -1;\n\t\t\tif ($fld->type == 'numeric') {\n\t\t\t\t$fld->scale = $fld->max_length & 0xFFFF;\n\t\t\t\t$fld->max_length >>= 16;\n\t\t\t}\n\t\t\t// dannym\n\t\t\t// 5 hasdefault; 6 num-of-column\n\t\t\t$fld->has_default = ($rs->fields[5] == 't');\n\t\t\tif ($fld->has_default) {\n\t\t\t\t$fld->default_value = $rsdefa[$rs->fields[6]];\n\t\t\t}\n\n\t\t\t//Freek\n\t\t\t$fld->not_null = $rs->fields[4] == 't';\n\n\n\t\t\t// Freek\n\t\t\tif (is_array($keys)) {\n\t\t\t\tforeach($keys as $key) {\n\t\t\t\t\tif ($fld->name == $key['column_name'] AND $key['primary_key'] == 't')\n\t\t\t\t\t\t$fld->primary_key = true;\n\t\t\t\t\tif ($fld->name == $key['column_name'] AND $key['unique_key'] == 't')\n\t\t\t\t\t\t$fld->unique = true; // What name is more compatible?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;\n\t\t\telse $retarr[($normalize) ? strtoupper($fld->name) : $fld->name] = $fld;\n\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\t$rs->Close();\n\t\tif (empty($retarr))\n\t\t\treturn $false;\n\t\telse\n\t\t\treturn $retarr;\n\n\t}", "public function createColumn($name, array $options = []);", "public static function getDefaultColumns()\n {\n return array('id', 'related');\n }", "function get_primary_key_column()\n {\n return $this->object->_primary_key_column;\n }", "public function columnMap()\n {\n return array(\n 'sess_id' => 'sess_id',\n 'created' => 'created',\n 'changed' => 'changed',\n 'ip' => 'ip',\n 'vars' => 'vars'\n );\n }", "public function columnMap()\n {\n return [\n 'imageid' => 'imageid',\n 'galleryid' => 'galleryid',\n 'visible' => 'visible'\n ];\n }", "public function columns(): array\n {\n return [\n 'id',\n 'title',\n 'description',\n 'url',\n 'read',\n 'created_at',\n ];\n }", "public function columnMap()\n {\n return array(\n 'rec_id' => 'rec_id',\n 'user_id' => 'user_id',\n 'email' => 'email',\n 'link_man' => 'link_man',\n 'tel' => 'tel',\n 'goods_id' => 'goods_id',\n 'goods_desc' => 'goods_desc',\n 'goods_number' => 'goods_number',\n 'booking_time' => 'booking_time',\n 'is_dispose' => 'is_dispose',\n 'dispose_user' => 'dispose_user',\n 'dispose_time' => 'dispose_time',\n 'dispose_note' => 'dispose_note'\n );\n }", "public function primary_key(){\n $table_columns = $this->meta();\n\n $primary_key_column = NULL;\n foreach ($table_columns as $col) :\n if($col->primary_key):\n $primary_key_column = $col->name;\n endif;\n endforeach;\n\n return $primary_key_column; \n }", "public function getAutoIncrement()\n\t{\n\t\treturn 'application_value_id';\n\t}", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'level' => 'level',\n 'name' => 'name',\n 'sort' => 'sort',\n 'type' => 'type',\n 'value' => 'value',\n 'token' => 'token',\n 'pid' => 'pid'\n ];\n }", "public function optimisticLockingCol()\n {\n return $this->optimisticLockingCol;\n }", "private function createOptionTable(){\r\n\t\t$query= \" CREATE TABLE `tbl_option` (`option_id` INT NOT NULL AUTO_INCREMENT ,`question_id` INT NOT NULL ,`option` VARCHAR( 255 ) NOT NULL ,PRIMARY KEY ( `option_id` )) ENGINE = MYISAM \";\r\n\t\t$result = $this->mdb2->query($query) or die('An unknown error occurred while updating the data');\r\n\tif(MDB2::isError($result)){\r\n\t\treturn false;\r\n\t}else{\r\n\t\treturn true;\r\n\t}\r\n\t}", "public function getSelectColumns(): array\n {\n return [\n 'question_id',\n 'slug',\n 'user_id',\n 'subject',\n 'headline',\n 'message',\n 'views',\n 'views_not_bot_one_month',\n 'answer_count_cached',\n 'created_datetime',\n 'created_name',\n 'created_ip',\n 'modified_user_id',\n 'modified_datetime',\n 'modified_reason',\n 'moved_datetime',\n 'moved_user_id',\n 'moved_country',\n 'moved_language',\n 'moved_question_id',\n 'deleted_datetime',\n 'deleted_user_id',\n 'deleted_reason',\n ];\n }", "public function hasPrimaryKeyColumns(){\n return $this->_has(4);\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'name' => 'name',\n 'type' => 'type',\n 'expression' => 'expression',\n 'description' => 'description',\n 'start_time' => 'start_time',\n 'end_time' => 'end_time',\n 'is_close' => 'is_close',\n 'group' => 'group',\n 'prom_img' => 'prom_img',\n 'goods_ids' => 'goods_ids'\n ];\n }", "public function columnMap()\n {\n return array(\n 'name' => 'name', \n 'description' => 'description', \n );\n }", "public function up(){\r\n $this->dbforge->add_field(array( //creacion del vector que contiene los campos de la tabla\r\n 'SCHO_PK' => array( //columna SCHO_PK tipo int, tamaño 10, auto icremental, solo positivos\r\n 'type' => 'INT',\r\n 'constraint' => 10,\r\n 'unsigned' => TRUE,\r\n 'auto_increment' => TRUE\r\n ),\r\n 'SCHO_identification' => array( //columna SCHO_PK tipo int, tamaño 10, auto icremental, solo positivos\r\n 'type' => 'INT',\r\n 'constraint' => 10,\r\n 'unsigned' => TRUE,\r\n ),\r\n 'SCHO_name_long' => array( //columna SCHO_username tipo VARCHAR, tamaño 45\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n ),\r\n 'SCHO_name_short' => array( //columna SCHO_username tipo VARCHAR, tamaño 45\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n ),\r\n 'SCHO_initials' => array( //columna SCHO_names tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),\r\n 'SCHO_telephone' => array( //columna SCHO_lastnames tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),'SCHO_facebook' => array( //columna SCHO_lastnames tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),'SCHO_instagram' => array( //columna SCHO_lastnames tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),'SCHO_youtube' => array( //columna SCHO_lastnames tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),\r\n 'SCHO_email' => array( //columna SCHO_email tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),\r\n 'SCHO_date_create' => array( //columna SCHO_address tipo VARCHAR, tamaño 45\r\n 'type' => 'DATETIME',\r\n ),\r\n 'SCHO_date_update' => array( //columna SCHO_telephone tipo VARCHAR, tamaño 45\r\n 'type' => 'DATETIME',\r\n ),\r\n 'SCHO_PK_create' => array( //columna SCHO_address tipo VARCHAR, tamaño 45\r\n 'type' => 'INT',\r\n ),\r\n 'SCHO_PK_update' => array( //columna SCHO_telephone tipo VARCHAR, tamaño 45\r\n 'type' => 'INT',\r\n ),\r\n 'SCHO_FK_state' => array( //columna SCHO_FK_state tipo int, tamaño 10, solo positivos\r\n 'type' => 'INT',\r\n 'constraint' => 10,\r\n 'unsigned' => TRUE,\r\n ),\r\n ));\r\n $this->dbforge->add_key('SCHO_PK', TRUE); //agregar atributo de llave primaria al campo SCHO_PK \r\n $this->dbforge->create_table('schools'); //creacion de la tabla users con los atributos y columnas\r\n $this->dbforge->add_column('schools',[\r\n 'CONSTRAINT SCHO_FK_state FOREIGN KEY(SCHO_FK_state) REFERENCES states_schools(STSC_PK)',\r\n ]); //creacion de relacion a la tabla genders\r\n }", "protected function getColumn()\n {\n return DB::select(\n 'SELECT\n\t\t\t\t\t\t\t c.COLUMN_NAME\n\t\t\t\t\t\t\t,c.COLUMN_DEFAULT\n\t\t\t\t\t\t\t,c.IS_NULLABLE\n\t\t\t\t\t\t\t,c.DATA_TYPE\n\t\t\t\t\t\t\t,c.CHARACTER_MAXIMUM_LENGTH\n\t\t\t\t\t\t\t,pk.CONSTRAINT_TYPE AS EXTRA\n\t\t\t\t\t\t\tFROM INFORMATION_SCHEMA.COLUMNS AS c\n\t\t\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\t\t SELECT ku.TABLE_CATALOG,ku.TABLE_SCHEMA,ku.TABLE_NAME,ku.COLUMN_NAME, tc.CONSTRAINT_TYPE\n\t\t\t\t\t\t\t FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc\n\t\t\t\t\t\t\t INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS ku ON tc.CONSTRAINT_NAME = ku.CONSTRAINT_NAME\n\t\t\t\t\t\t\t) AS pk ON c.TABLE_CATALOG = pk.TABLE_CATALOG\n\t\t\t\t\t\t\t AND c.TABLE_SCHEMA = pk.TABLE_SCHEMA\n\t\t\t\t\t\t\t AND c.TABLE_NAME = pk.TABLE_NAME\n\t\t\t\t\t\t\t AND c.COLUMN_NAME = pk.COLUMN_NAME\n\t\t\t\t\t\t\tWHERE c.TABLE_NAME = ? AND c.TABLE_CATALOG = ? ',\n [$this->tableName, $this->databaseName]\n );\n }", "public function columnMap()\n {\n return array(\n 'idprodutoArea' => 'idprodutoArea',\n 'cd_tabela' => 'cd_tabela',\n 'precoBase' => 'precoBase',\n 'produto_cd_produto' => 'produto_cd_produto',\n 'referencia' => 'referencia',\n 'area_cd_area' => 'area_cd_area',\n 'unidade_negocio_cd_unidade' => 'unidade_negocio_cd_unidade',\n 'markup_minimo' => 'markup_minimo',\n 'pedido_minimo' => 'pedido_minimo',\n 'aplicar_desconto_cliente' => 'aplicar_desconto_cliente',\n 'observacao' => 'observacao',\n 'old_id' => 'old_id'\n );\n }", "abstract public static function get_column_key(): string;", "protected function get_column_info()\n {\n }", "protected function get_column_info()\n {\n }", "public function columnMap()\n {\n return [\n 'id_categoria' => 'id_categoria',\n 'titulo' => 'titulo',\n 'descripcion' => 'descripcion'\n ];\n }", "function get_primary_key_column()\n {\n return $this->_primary_key_column;\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'purchase_invoices_id' => 'purchase_invoices_id',\n 'product_id' => 'product_id',\n 'quantity' => 'quantity',\n 'price' => 'price',\n 'total' => 'total',\n 'created_at' => 'created_at'\n ];\n }", "public function columns(): array\n {\n return [\n 'is_slow',\n 'content',\n 'created_at',\n ];\n }", "function lookup_columns()\n {\n // Avoid doing multiple SHOW COLUMNS if we can help it\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE);\n if (!$this->_table_columns) {\n $this->object->update_columns_cache();\n }\n return $this->_table_columns;\n }", "private function setField()\n {\n $sql = '';\n $sql = rtrim($sql , ', ');\n\n foreach (array_keys($this->data) as $key){\n $sql .= '`' . $key . '` = ?, ';\n }\n\n $sql = rtrim($sql , ', ');\n return $sql;\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }" ]
[ "0.6460414", "0.61287063", "0.6087116", "0.60394865", "0.59596384", "0.5958163", "0.5924684", "0.59150743", "0.58910376", "0.5882412", "0.58157384", "0.58117324", "0.5807184", "0.579776", "0.57877064", "0.5784621", "0.5756197", "0.5743156", "0.5738453", "0.57273495", "0.57124233", "0.5708697", "0.57084477", "0.5681659", "0.5676398", "0.56731033", "0.56693393", "0.5669157", "0.5657262", "0.56539327", "0.56463486", "0.5641453", "0.5638482", "0.56358105", "0.5628054", "0.56189424", "0.5608638", "0.56070584", "0.56063735", "0.56055415", "0.5601748", "0.5600025", "0.55982745", "0.5595007", "0.55948484", "0.55948484", "0.5594715", "0.5590972", "0.5589057", "0.5586067", "0.55840063", "0.55838543", "0.5576249", "0.5575134", "0.55697066", "0.55624217", "0.5555597", "0.5553091", "0.55529803", "0.5552883", "0.5551206", "0.55427426", "0.55369955", "0.552797", "0.5527761", "0.55247825", "0.5523076", "0.55201477", "0.55157465", "0.5513056", "0.5511223", "0.5510766", "0.5503449", "0.5498203", "0.5484077", "0.5478509", "0.5478105", "0.54699576", "0.54672205", "0.5464043", "0.54570836", "0.54552066", "0.5454027", "0.54529256", "0.5444093", "0.5443966", "0.5439627", "0.5436303", "0.5435344", "0.543154", "0.54305303", "0.54305303", "0.54305303", "0.54305303", "0.54305303", "0.54305303", "0.54290974", "0.54290974", "0.54290974", "0.5428036", "0.5428036" ]
0.0
-1
Verifica se existe esse registro no cache
public static function findById($id) { if(Cache::store('alunos')->has($id)) { //Caso exista, registra o hit event(new AlunosCacheHit); //E retorna o registro do cache return Cache::store('alunos')->get($id); } else { //Caso não exista, registra o miss event(new AlunosCacheMissed); //Procura na base $aluno = parent::find($id); //Sleep para simular uma consulta mais demorada sleep(1); //Insere no cache, com a chave primária Cache::store('alunos')->forever($id, $aluno); //Retorna o registro return $aluno; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isExistInCache($key);", "function cacheObjectExists ()\n {\n return is_file($this->cacheObjectId);\n }", "function exists() {\n \n return !empty($this->cache);\n \n }", "public function isCached(): bool;", "public function VerificaCache($filename) {\n\t\t$caminho = '../cache_dia/';\n\t\t$filename = $caminho.$filename;\n\t\tif (file_exists($filename)) {\n\t\t\t$data_arquivo = date (\"d\", filemtime($filename));\n\t\t\tif($data_arquivo != date('d')){\n\t\t\t\tunlink($filename);\n\t\t\t}\t\n\t\t}\n\t\tif($data_arquivo != date('d')) return false;\n\t\telse return true;\n\t}", "protected function _cached_exists()\n {\n return file_exists($this->cached_file);\n }", "public function PageEnCache()\n\t\t{\n\t\t\tif($this->cache_refresh)\n\t\t\t{\n\t\t\t\t//On supprime l'ancien cache\n\t\t\t\t$filename = $this->getCacheFileNameOfDate($this->cache_date_tableau);\n\t\t\t\tif(file_exists($this->chemin_dossier_cache.$filename))\n\t\t\t\t\tunlink($this->chemin_dossier_cache.$filename);\n\n\t\t\t\t//On indique qu'il n'y a pas de cache pour cette page pour en generer une nouvelle\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif(!is_writable($this->chemin_dossier_cache))\n\t\t\t{\n\t\t\t\techo 'Le dossier '.$this->chemin_dossier_cache.' est inaccessible en écriture. Aucun fichier ne pourra être mit en cache dans la situation actuelle, modifier les chmod du dossier. - CLASS:'.__CLASS__.' - Fonction:'.__FUNCTION__;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$filename = $this->getCacheFileNameOfDate($this->cache_date_tableau);\n\t\t\tif(file_exists($this->chemin_dossier_cache.$filename))\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}", "public function isCached() {}", "public function isCacheExists()\n {\n if(file_exists($this->cachedPath))\n return true;\n else\n return false;\n }", "private function check_cache() {\n if (!file_exists($this->cache_file)) {\n return false;\n }\n if (filemtime($this->cache_file) >= strtotime(\"-\" . CACHE_EXPIRATION . \" seconds\")) {\n return true;\n } else {\n return false;\n }\n }", "public function pegaImagemDoCacheSeExistir($nome, Cache $cache) {\n\t\tif($cache->busca('image_' . $nome)) {\n\t\t\treturn $this->headerImagem($cache->busca('image_' . $nome), $cache->busca('type_image_' . $nome));\n\t\t} else return false;\n\t}", "public function wasCached();", "function buscar() //funcion para ver si el registro existe \n\t{\n\t$sql=\"select * from slc_unid_medida where nomenc_unid_medida= '$this->abr' and desc_unid_medida= '$this->des'\"; \n\t $result=mysql_query($sql,$this->conexion);\n\t $n=mysql_num_rows($result);\n\t if($n==0)\n\t\t\t return 'false';\n\t\t\telse\n\t\t\t return 'true';\n\t}", "public function checkCache() {\n \tif (file_exists(dirname($this->cache_file)) || !is_writable(dirname($this->cache_file))) {\n \t\t$this->createCacheDirectory();\n \t}\n \tif (file_exists($this->cache_file)) {\n \t\t$this->mod_time = filemtime($this->cache_file) + $this->cache_time;\n \t\tif ($this->mod_time > time()) {\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t} else {\n \t\treturn false;\n \t}\n \n }", "public function cacheCheck(){\n \n if(file_exists($this->cacheName)){\n\t \n $cTime = intval(filemtime($this->cacheName));\n \n if( $cTime + $this->cacheTime > time() ) {\n\t \n echo file_get_contents( $this->cacheName );\n \n ob_end_flush();\n \n exit;}\t\t\t\t\t\n \n \t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n return false;\n \n}", "public function testRemoveNonExistentObjectFromCache() {\n\t\t$this->assertFalse(Core\\Cache::remove('foobar'));\n\t}", "public function cacheExists()\n {\n $cacheFile = $this->getCacheFile();\n if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {\n return(true);\n } else {\n return(false);\n }\n }", "private function checkCache()\n {\n if ($this->createFolder()) {//if folder already exists\n\n $cache_time = time() - filemtime($this->cacheFile); //check to see how long since cached\n\n if ($cache_time > 60 * $this->cacheTime) {\n return true;//cache the file again\n }\n } else {\n $this->createFolder();\n return true;\n }\n }", "function deleteCacheObject ()\n {\n if (!$this->cacheObjectLocked() && is_file($this->cacheObjectId)) {\n if (unlink($this->cacheObjectId)) {\n $return = TRUE;\n } else {\n $return = FALSE;\n }\n } else {\n $return = TRUE;\n }\n\n return $return;\n }", "public static function hasCache() {\n\t\treturn false;\n\t}", "function no_existe_versiculo_en_referencia($versiculo_id, $cita)\n{\n $dato = torrefuerte\\Models\\Referencia::where('versiculo_id', $versiculo_id)\n ->where('cita', $cita)->first();\n\n if( is_null($dato)){\n return true;\n }else{\n return false;\n }\n}", "static function is_cache()\n\t{\n\t\tif (file_exists(Cache::$path))\n\t\t{\n\t\t\tif(Cache::$time>0)\n\t\t\t{\n\t\t\t\t$info_file=stat(Cache::$path);\n\t\t\t\tif(time() > $info_file[9]+Cache::$time)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tCache::delete();\n\t\t\t\t\tCache::$time=0;\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "public function hasCacheStore(): bool;", "function cacheObjectLocked ()\n {\n return is_file($this->cacheObjectId.'.lock');\n }", "function exists() {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\t$sql = \"SELECT post_id FROM $this->cacheTable WHERE post_id = \" . $this->db->escape( $this->postID ) . \"\";\n\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( $results[0] )\n\t\t\treturn true;\n\t\t\t\n\t\treturn false;\n\t\t\n\t}", "public function isAlreadyExist(){\n \n $query = \"SELECT *\n FROM \" . $this->table . \" \n WHERE email='\".$this->email.\"'\";\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n // execute query\n $stmt->execute();\n if($stmt->rowCount() > 0){\n return true;\n }else{\n return false;\n }\n }", "public static function hasDefaultCache();", "public function verificarLoteExistente()\r\n {\r\n $datos = $_SESSION['idLote'];\r\n $anoImpositivo = $datos[0]->ano_impositivo;\r\n $rangoInicial = $datos[0]->rango_inicial;\r\n $rangoFinal = $datos[0]->rango_final;\r\n \r\n \r\n $busquedaLote = Calcomania::find()\r\n \r\n\r\n ->select('*')\r\n \r\n ->where('nro_calcomania between '. $rangoInicial .' and '.$rangoFinal)\r\n ->andWhere('estatus =:estatus' , [':estatus' => 0])\r\n ->andWhere('ano_impositivo =:ano_impositivo' , [':ano_impositivo' => $anoImpositivo])\r\n ->all();\r\n\r\n\r\n if ($busquedaLote == true){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "function exists()\n {\n return false;\n }", "private function checkCacheFolder(){\n if (file_exists($this->folder_path)) {\n $this->cacheCreated = true;\n }else{\n $this->cacheCreated = false;\n }\n }", "protected function _loadCache()\n {\n return false;\n }", "public static function cache_exists($name) {\n if(self::$adapter === false)\n throw new rcException('The Cache system is not initialized');\n return self::$adapter->cache_exists($name);\n }", "function check_cache ( $url ) {\n $this->ERROR = \"\";\n $filename = $this->file_name( $url );\n \n if ( file_exists( $filename ) ) {\n // find how long ago the file was added to the cache\n // and whether that is longer then MAX_AGE\n $mtime = filemtime( $filename );\n $age = time() - $mtime;\n if ( $this->MAX_AGE > $age ) {\n // object exists and is current\n return 'HIT';\n }\n else {\n // object exists but is old\n return 'STALE';\n }\n }\n else {\n // object does not exist\n return 'MISS';\n }\n }", "public function hasCache(): bool\n {\n return isset($this->contents);\n }", "private function isCacheFileExists($key, $id)\n {\n return is_readable(RL_CACHE . $key . '_' . $id);\n }", "public function testHas()\n {\n $this->assertFalse(self::$cache->has('Potato'), 'Has does not return false on missing file.');\n\n //Test with expired date\n self::$cache->set('Toaster', 'Test', -5);\n\n $this->assertFalse(self::$cache->has('Toaster'), 'File not counted as expired by Has.');\n\n //Test with okay file\n self::$cache->set('Toaster', 'Test', 5);\n\n $this->assertTrue(self::$cache->has('Toaster'), 'Has did not take into acount that the file is there.');\n }", "function checkCache($name){\n\t\t$database = mysqli_connect('localhost', NAME, PASSWORD, 'leaguedata');\n\t\t$result = mysqli_query($database, \"SELECT * FROM cache WHERE name = '$name' LIMIT 1\") or die(mysqli_error($database));\n\t\tif(mysqli_num_rows($result) == 0){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\t$row = mysqli_fetch_array($result);\n\t\t\treturn time() - $row['lastUpdate'] > WAIT_TIME ? 2 : 3;\n\t\t}\n\t}", "function checkKeys()\n{\n $cache = Cache::get()->first();\n\n if (!$cache) {\n $cache = new Cache();\n refreshKeys($cache);\n }\n else { \n if (time() > $cache->timeout){\n refreshKeys($cache);\n }\n }\n}", "function exists() {\r\n\t\t$sql_inicio \t= \" select * from \".$this->table.\" where \";\r\n\t\t$sql_fim \t\t= \" \".($this->get($this->pk) ? \" and \".$this->pk.\" <> \".$this->get($this->pk) : \"\").\" limit 1 \";\r\n\t\t\r\n\t\t$sql \t= \"con_id = \".$this->get(\"con_id\").\" and exa_id = \".$this->get(\"exa_id\").\" \";\r\n\t\tif (mysql_num_rows(Db::sql($sql_inicio.$sql.$sql_fim))){\r\n\t\t\t$this->propertySetError (\"con_id\", \"Já existe no banco de dados.\");\r\n\t\t\t$this->propertySetError (\"exa_id\", \"Já existe no banco de dados.\");\r\n\t\t}\r\n\t}", "function cacheObjectTimedOut ()\n {\n if ($this->cacheObjectExists()) {\n if (time() - filemtime($this->cacheObjectId) > $this->timeout) {\n $return = TRUE;\n } else {\n $return = FALSE;\n }\n } else {\n $return = TRUE;\n }\n\n return $return;\n }", "protected static function cacheExsits($key)\n {\n \t$class = get_called_class();\n \treturn isset(BaseEntityAbstract::$_entityCache[$class]) && isset(BaseEntityAbstract::$_entityCache[$class][$key]);\n }", "function clear_cache()\n\t{\n\t\treturn true;\n\t}", "public function existe (){\n\t\t$req = $this->bdd->prepare('SELECT COUNT(id) FROM `Article` WHERE id = ?');\n\t\t$req->execute(array($this->id));\n\t\t$donnees = $req->fetch();\n\t\t$req->closeCursor(); // Important : on libère le curseur pour la prochaine requête\n\t\tif ($donnees[0] == 0){ // Si l'id n'est pas dans la base de donnée, l'article n'existe pas\n\t\t\treturn false;\n\t\t}\n\t\treturn true ;\n\t}", "final public function isHit(): bool\n\t{\n\t\tif ($stm = $this->_prepare('SELECT COUNT(*) AS `found` FROM `Cache` WHERE `key` = :key LIMIT 1;')) {\n\t\t\t$stm->execute(['key' => $this->getkey()]);\n\t\t\t$result = $stm->fetchObject();\n\t\t\tvar_dump($result);\n\t\t\treturn $result->found === '1';\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function publicacaoReabrir()\r\n {\r\n try\r\n {\r\n $resposta = $this->conexao->Conectar()->prepare(\"UPDATE tbmissao SET id_usuario_concluir = null, data_conclusao = null, status = 0, data = NOW(), conclusao = null\"\r\n . \" WHERE id_missao = ?\");\r\n $resposta->bindValue(1, $this->getIdMissao(), PDO::PARAM_STR);\r\n //$resposta->bindValue(3, $this->getData(), PDO::PARAM_STR);\r\n if($resposta->execute())\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n catch (PDOException $e)\r\n {\r\n return $e->getMenssage();\r\n }\r\n }", "public static function has($key){\n return \\Illuminate\\Cache\\Repository::has($key);\n }", "private function save_cache() : bool {\n\t\tif ($this->use_cache) {\n\t\t\tif (!$this->cache_path) {\n\t\t\t\tthrow new Exception('Cannot save cache when $cache_path is not set.');\n\t\t\t}\n\n\t\t\tfile_put_contents($this->cache_path, json_encode($this->posts, JSON_UNESCAPED_UNICODE));\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function MustUseCache()\n {\n if ($this->cacheLifetime == 0)\n {\n return false;\n }\n if (!File::Exists($this->file))\n {\n return false;\n }\n $now = Date::Now();\n $lastMod = File::GetLastModified($this->file);\n if ($now->TimeStamp() - $lastMod->TimeStamp() < $this->cacheLifetime)\n {\n return true;\n }\n return false;\n }", "public function isCacheEnabled(){\n return(true);\n }", "public function isCacheEnabled(){\n return(true);\n }", "public function cache()\n {\n\n $route = Route::requireRoueFiiles();\n if (file_put_contents($this->cacheFile, serialize($route))) {\n echo 'OK';\n } else {\n echo 'ERROR';\n }\n }", "public function isCacheClearEnabled(): bool;", "private function lookUpNonceInCache():bool\n {\n if (!$this->di->has('cache')) {\n throw new Exception(\n \"Nonce backend 'cache' requires cache service to be configured.\"\n );\n }\n return $this->cache->get($this->nonceCacheKey);\n }", "private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }", "private function isCached()\n {\n return Cache::has($this->cacheKey());\n }", "private function getExistProductRecount() {\n return false;\n }", "public function has()\n\t{\n\t\t$name = $this->name();\n\n\t\tif(($has = Cache::has($name)) && $this->forget)\n\t\t{\n\t\t\tCache::forget($name);\n\n\t\t\t// We don't want to return the cached assets because we cleared\n\t\t\t// the cache and we want a new fresh copy of the assets returned.\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $has;\n\t}", "function expired() {\r\n if(!file_exists($this->cachefile)) return true;\r\n # compare new m5d to existing cached md5\r\n elseif($this->hash !== $this->get_current_hash()) return true;\r\n else return false;\r\n }", "function existe($id_desig){\r\n $sql=\"select * from suplente where id_desig_suplente=$id_desig\";\r\n $res=toba::db('designa')->consultar($sql);\r\n \r\n if(count($res)>0){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "public function isExistPeriode($idMois, $idVille){\n $database = new database;\n $connection = $database->getConnection();\n $sql =(\"select * from periode where idVille = \".$idVille.\" and mois = \".$idMois.\";\");\n $request = $connection->prepare($sql);\n $request->execute();\n $resultat = $request->rowCount();\n // var_dump($resultat);\n $resultat = ($resultat > 0) ? true : false;\n return $resultat ;\n }", "function isAlreadyExist(){\n $query = \"SELECT *\n FROM\n \" . $this->db_table . \" \n WHERE\n username='\".$this->username.\"'\";\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n // execute query\n $stmt->execute();\n if($stmt->rowCount() > 0){\n return true;\n }\n else{\n return false;\n }\n }", "function delete($key) {\n\t\t\t$file = CACHE_DIR.md5($key).\".cache\";\n\t\t\tif(@file_exists($file)) {\n\t\t\t\t@unlink($file);\n\t\t\t\t$this->db->delete(\"fileCache\",\"WHERE key='\".md5($key).\"'\");\n\t\t\t\tdebugLog(\"Cache file deleted\",\"Cache file wurde erfolgreich gel&ouml;scht - KEY: '\".$key.\"'\",$file);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function exists()\n {\n return false;\n }", "private function isCacheExpired(): bool\n\t{\n\t\t$path = $this->_cacheFolder . $this->generateCacheName();\n\t\tif (file_exists($path)) {\n\t\t\t$filetime = filemtime($path);\n\t\t\treturn $filetime < (time() - $this->_cacheTtl);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "private function check_cache()\n\t{\n\t\t$cache_file = Kohana::config($this->type.'.cache_folder').'/'.md5($this->file).EXT;\n\t\t$this->skip = FALSE;\n\t\t\n\t\tif (is_file($cache_file))\n\t\t{\n\t\t\t// touch file. helps determine if template was modified\n\t\t\ttouch($cache_file);\n\t\t\t// check if template has been mofilemtime($cache_file)dified and is newer than cache\n\t\t\t// allow $cache_time difference\n\t\t\tif ((filemtime($this->file)) > (filemtime($cache_file)+$this->cache_time))\n\t\t\t\t$this->skip = TRUE;\n\t\t}\n\t\t\n\t\treturn $cache_file;\n\t}", "private function _getCache($term) {\n\t\t// find our search term\n\t\t$result = $this->db->get_where('Cache', array('Term' => $term, 'Expires >' => date(\"Y-m-d H:i:s\")))->row_array();\n\t\t// did we get one that isn't expired?\n\t\tif ($result) { \n\t\t\t// cache hit\n\t\t\treturn $result['Data'];\n\t\t}\n\t\t// cache miss\n\t\treturn false;\n\t}", "public function isExistById($id){\n//\t\tprint_r(\"##Count=##\");\n//\t\tprint_r($this->find($id)->count());\n return $this->find($id)->count() ;\n }", "public function clear_cache() {\n\t\t$cache = $this->modx->getCacheManager();\n if ($cache->clearCache(array('xflickr/'))) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public function memCached() { return true; }", "public function isCacheEnabled(){\n return(false);\n }", "protected function saveToCache() {}", "public function exists($key)\n\t{\n\t\t$result = $this->cacheLayer->exists($key);\n\t\tLogger::getInstance()->log(LoggerEntry::CACHE, 'Cache', 'Try to find key [' . $key . '] into cache: ' . ($result ? 'true' : 'false'));\n\t\treturn $result;\n\t}", "public function saveToCacheForever();", "function isCreated($name){\n\t\t$name = md5($name);\n $file = $this->_tmp_path.$this->_type.$name.'.cache';\n return is_file($file);\n\t}", "function existenNotasRegistradas($matricula){\n return false;\n }", "public function testCacheGet() \n\t{\n\t\t$key = uniqid('key_');\n\t\t$value = uniqid('value_');\n\t\t$this->assertFalse(\\Cache\\Cache::get($key));\n\n\t\t\\Cache\\Cache::set($key, $value);\n\t\t$this->assertEquals(\\Cache\\Cache::get($key), $value);\n\t}", "function usuario_existe($usuario){\n\t$sql = \"SELECT id FROM usuarios WHERE usuario = '$usuario'\";\n\n\t$resultado = query($sql);\n\n\tif(contar_filas($resultado) == 1){\n\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n\n}", "function existeUsuario($usuario){\n\tif (hasKey(BUCKET_USUARIOS,$usuario))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "public function isNotFound();", "public function deleteCache() {\n\t\tif($this -> cacheExists()) {\n\t\t\tif(unlink($this -> sCacheDir . $this -> sCacheFile)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function is_cached($template, $cache_id=null)\n {\n // insert the condition to check the cache here!\n // if (functioncheckdb($this -> module)) {\n // return parent :: clear_cache($template, $this -> cache_id);\n //}\n\t $this->_setup_template($template);\n\n\t\tif ($cache_id) {\n\t\t\t$cache_id = $this->module . '|' . $cache_id;\n\t\t} else {\n\t\t\t$cache_id = $this->module . '|' . $this->cache_id;\n\t\t}\n\n return parent::is_cached($template, $cache_id);\n }", "function _can_cache() {\n\t\treturn true;\n\t}", "protected function exists() {}", "function exists($name, $key=null) {\n if ($key) {\n if(!$this->cache[$name]) {\n return false;\n }\n return array_key_exists($key, $this->cache[$name]);\n }\n return array_key_exists($name, $this->cache);\n }", "private function check_cache($hash)\n {\n $cache_file = Config::$cache_path.\"/\".$hash;\n \n if (file_exists($cache_file))\n {\n $handle = fopen($cache_file, 'r');\n $cache_time = fgets($handle);\n \n $cache_age = (time() - $cache_time) / 60;\n \n if ($cache_age > Config::$cache_time)\n {\n fclose($handle);\n unlink($cache_file);\n \n return false;\n }\n \n return true;\n }\n else return false;\n }", "function Atv_getRepoKegiatanTambahan(): object\n{\n return Cache::remember('repo-kegiatan-tambahan', (60 * 60 * 2/* 2 hours */), function () {\n return Kegiatan::getKegiatanTambahan()->get()->map->kegiatanResourceMap();\n });\n}", "public function Exists();", "public function dirty()\n\t{\n\t\tif ( ! $this->app['files']->exists($this->cacheFilePath))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function testRemoveCachedObject() {\n\t\t// Now remove the file\n\t\t$this->assertTrue(Core\\Cache::remove('foo'));\n\n\t\t// The file exists?\n\t\t$this->assertFalse(Core\\Cache::has('foo'));\n\t}", "function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }", "private function cacheFileExists($key) {\n if (file_exists($fileName = $this->getCacheFileByKey($key))) {\n return $fileName;\n }\n return false;\n }", "public function verificaSeImagemExisteNoCache($imagem, Cache $cache) {\n\t\t$atributos_imagem\t= pathinfo($imagem);\n\t\t$dados_imagem\t\t= getimagesize($imagem);\n\t\t$mime_type\t\t\t= end($dados_imagem);\n\t\t$nome\t\t\t\t= $atributos_imagem['filename'];\n\t\tif($cache->busca('image_' . $nome)) {\n\t\t\treturn $this->headerImagem($cache->busca('image_' . $nome), $cache->busca('type_image_' . $nome));\n\t\t} else {\n\t\t\t$imagem = $this->headerImagem($imagem);\n\t\t\t$cache->atribui('type_image_' . $nome, $mime_type);\n\t\t\treturn $cache->atribui('image_' . $nome, $imagem);\n\t\t}\n\t}", "public function cacheUpToDate()\n\t{\n\t\t$expiredSites = $this->getExpiredCacheSites();\n\n\t\treturn empty($expiredSites);\n\t}", "public function existeLugar(){\n $modelSearch = new LugarSearch();\n $resultado = $modelSearch->busquedadGeneral($this->attributes);\n if($resultado->getTotalCount()){ \n foreach ($resultado->models as $modeloEncontrado){\n $modeloEncontrado = $modeloEncontrado->toArray();\n $lugar[\"id\"]=$modeloEncontrado['id']; \n #borramos el id, ya que el modelo a registrar aun no tiene id\n $modeloEncontrado['id']=\"\";\n \n //si $this viene con id cargado, nunca va a encontrar el parecido\n if($this->attributes==$modeloEncontrado){\n $this->addError(\"notificacion\", \"El lugar a registrar ya existe!\");\n $this->addError(\"lugarEncontrado\", $lugar);\n }\n }\n }\n }", "function verificar_existencia_profesor_espacio(){\n\t\t$sql_verif= \"SELECT * FROM \n \t\t\t\tPROF_ESPACIO\n \t\t\tWHERE(\n \t\t\t\tCODESPACIO = '$this->CODESPACIO'\n \t\t\t)\n \t\t\t\";\n\nreturn $this->mysqli->query($sql_verif)->num_rows>=1;\n\n}", "public function exists() {\n\t\ttry {\n\t\t\t$this->load();\n\t\t\treturn true;\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\t}", "protected function _checkCache($data) {\n\t\t$file = sha1(serialize($data)).'.png';\n\t\tif (is_file($this->cachePath.$file)) {\n\t\t\treturn $this->Html->image($this->cacheImagePath.$file );\n\t\t}\n\n\t\treturn false;\n\t}", "public function cacheExists($bForce = false) {\n\t\tif(!file_exists($this -> sCacheDir . $this -> sCacheFile) || $bForce == true) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function isValidCache( $maxAge=24 ) {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\tif ( $this->exists() && ( $this->lastUpdate() < $maxAge ) )\n\t\t\treturn true;\n\t\t\t\n\t\treturn false; \n\t}", "public function existe()\n\t{\n\t\treturn CADModelo::existePorId($this->id);\n\t}" ]
[ "0.68570995", "0.6849608", "0.66467255", "0.6588022", "0.6519929", "0.6474882", "0.6390156", "0.6356531", "0.62487155", "0.6239915", "0.6234094", "0.6206231", "0.61965746", "0.61682737", "0.61428005", "0.6137727", "0.6130565", "0.61065924", "0.6102486", "0.6057535", "0.6044504", "0.60264045", "0.6003379", "0.5969072", "0.59673166", "0.5958339", "0.59511703", "0.59496576", "0.5949638", "0.59358144", "0.5916542", "0.59095085", "0.5897634", "0.58730793", "0.58601326", "0.58597034", "0.5856826", "0.58487064", "0.5833081", "0.5809641", "0.5798962", "0.5789387", "0.5783147", "0.57824385", "0.5782302", "0.57787555", "0.5778593", "0.5775166", "0.5764355", "0.575462", "0.575462", "0.5735155", "0.57269794", "0.57212806", "0.57201755", "0.571863", "0.57155097", "0.57151306", "0.571176", "0.571154", "0.5707725", "0.56946516", "0.5669514", "0.56681615", "0.5667255", "0.56338376", "0.5627513", "0.5627246", "0.56233597", "0.5618503", "0.56169224", "0.56133085", "0.5610639", "0.5609824", "0.5609783", "0.5607386", "0.5599916", "0.5599202", "0.55957687", "0.5593839", "0.5589131", "0.55827606", "0.5575584", "0.557098", "0.55690634", "0.556766", "0.5566436", "0.5562594", "0.5561024", "0.55560905", "0.55508584", "0.5544713", "0.554065", "0.5539985", "0.5539542", "0.5534547", "0.55297226", "0.55281204", "0.5527726", "0.5526149", "0.5518347" ]
0.0
-1
A basic feature test employee.
public function test_list() { $response = $this->get('/api/employees'); $response->assertStatus(200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateEmployee()\n {\n }", "public function testGetEmployee()\n {\n }", "public function testGetEmployees()\n {\n }", "public function testEmployee()\n {\n $this->get('/api/employee');\n $this->assertEquals(\n Response::HTTP_OK,\n $this->response->getStatusCode()\n );\n }", "function testEmployee()\n{\n\t//adds employees to the database\n\tcreateEmployee('SE', 'b.zucker', 'Developer', 'bz', 'Brent', 'Zucker', '4045801384', '[email protected]', 'Columbia St', 'Milledgeville', 'GA');\n\tcreateEmployee('SE', 'd.rhodes', 'Developer', 'bz', 'Brent', 'Zucker', '4045801384', '[email protected]', 'Columbia St', 'Milledgeville', 'GA');\n\tcreateEmployee('SE', 't.land', 'Developer', 'bz', 'Brent', 'Zucker', '4045801384', '[email protected]', 'Columbia St', 'Milledgeville', 'GA');\n\tcreateEmployee('SE', 'm.graessle', 'Developer', 'bz', 'Brent', 'Zucker', '4045801384', '[email protected]', 'Columbia St', 'Milledgeville', 'GA');\n\n\t//gets user's information\n\techo \"<h3>Developers</h3>\";\n\ttest(\"SELECT * \n\tFROM Developer \n\tLEFT JOIN Contact \n\tON Developer.Username = Contact.Username\n\tLEFT JOIN Credentials \n\tON Developer.Username = Credentials.Username\n\t\");\n\t\n\t//deletes employees\n\tdeleteEmployee(\"b.zucker\");\n\tdeleteEmployee(\"d.rhodes\");\n\tdeleteEmployee(\"t.land\");\n\tdeleteEmployee(\"m.graessle\");\n\n\t//gets user's information\n\ttest(\"SELECT * \n\tFROM Developer \n\tLEFT JOIN Contact \n\tON Developer.Username = Contact.Username\n\tLEFT JOIN Credentials \n\tON Developer.Username = Credentials.Username\n\t\");\n}", "public function testEmployeeCreate()\n {\n $user = factory(User::class)->create();\n $company_id = factory(Company::class)->create()->id;\n\n $response = $this->actingAs($user)->JSON('POST', '/employees', ['first_name' => 'Adam', 'last_name' => 'Kovalski','email' => '[email protected]', 'phone' => '+48123456789', 'company_id' => $company_id]);\n $response->assertStatus(302);\n }", "public function show(Abz_Employees $sample_data)\n {\n //\n }", "public function show(employee $employee)\n {\n //\n }", "function get_employee()\n\t\t{\n\t\t\treturn EmployeeFactory::createEmployee($this->empID);\n\t\t}", "public function getAllEmployees();", "public function testExample()\n {\n $this->actingAs( \\App\\User::first() )\n ->visit('/city')\n ->see('City List');\n }", "public function isEmployee()\n {\n return (\\Auth::user()->role == 'employee');\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function run() : void\n {\n if (!Employee::whereUsername('cashier')->first())\n $this->mockCashierEmployee();\n\n if (!Employee::whereUsername('rose')->first())\n $this->mockCashierEmployee('rose', \"Rose\", \"Petal\");\n\n if (!Employee::whereUsername('jack')->first())\n $this->mockCashierEmployee('jack', 'Jack', \"Stone\");\n }", "public function successfullyRecordedNewEmployee()\n {\n $payload = [];\n\n $this->post('/', $payload);\n\n $this->assertDatabaseHas('users', $payload);\n }", "public function testCreatePerson()\n {\n }", "public function run()\n {\n $employees = [\n ['E1','John', 'Doe', '18 Kepler Road', '#2', 'Natick','MA','01902','5085670909',30,'Male','',''],\n\t\t\t['E2','Jane', 'Doe', '12 Foreest Road', '#1', 'Stoughton','MA','01902','7085670909',45,'Female','',''],\n\t\t\t['E3','Mike', 'Pal', '10 Wellesly Road', '#1', 'Stoughton','MA','01902','7085670909',50,'Male','',''],\n ];\n\t\t\n\t\t$count = count($employees);\n\t\t\n\t\t foreach ($employees as $key => $employeeData) {\n\n\n $employee = new Employee();\n $employee->created_at = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n $employee->updated_at = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n \n\t\t\t$employee->identification = $employeeData[0];\n\t\t\t$employee->first_name = $employeeData[1];\n $employee->last_name = $employeeData[2];\n $employee->address_line_1 = $employeeData[3];\n $employee->address_line_2 = $employeeData[4];\n $employee->city = $employeeData[5];\n $employee->state = $employeeData[6];\n $employee->zip_code = $employeeData[7];\n $employee->telephone_number = $employeeData[8];\n $employee->age = $employeeData[9];\n\t\t\t$employee->sex = $employeeData[10];\n\t\t\t$employee->start_date = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n\t\t\t$employee->end_date = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n\t\t\n $employee->save();\n $count--;\n }\n }", "function test_basic_example()\n {\n $user = factory(App\\Entities\\User::class)->create([\n 'name' => 'Valentin Plechuc',\n ]);\n\n $this->actingAs($user, 'api');\n\n $this->visit('/api/user')\n ->see('Valentin Plechuc');\n\n }", "public function testGetPerson()\n {\n }", "public function __construct($employee)\n {\n $this->employee = $employee;\n }", "public static function isEmployee(): bool\n\t{\n\t if(in_array('employee', self::getUserRole()) || in_array('administrator', self::getUserRole())) return true;\n\t return false;\n\t}", "public function testShowSuccessfully()\n {\n $this->seed(\\UserTableSeeder::class);\n\n $employer = User::query()->where('email', '[email protected]')->first();\n Passport::actingAs(\n $employer,\n ['employer']\n );\n\n $response = $this->get('https://api.belsaa.com/employer/employer');\n $response->assertStatus(200);\n $response->assertJsonStructure(['id', 'company_name', 'user_attributes' => ['bio', 'legal_document_url', 'office_photo_url']]);\n $response->assertJsonFragment(['id' => $employer->id]);\n }", "public function createEmployee()\n {\n $this->view('employees/create');\n }", "public function __construct(Employee $employee)\n {\n $this->employee = $employee ;\n }", "public function getEmployeeInfo() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n\n $GLOBALS[\"employee\"] = $employeeModel->getOneByEmployeeID($_SESSION[\"workerID\"]);\n }", "public function testWebinarAbsentees()\n {\n }", "public function testGetExpert()\n {\n }", "public function testBasicTest()\n {\n $user=factory(\\App\\User::class)->create([\n 'name'=>'Duilio Palacios',\n ]);\n\n $this->actingAs($user,'api')\n ->visit('api/user')\n ->see('Duilio Palacios');\n }", "function set_employee($emp)\n\t\t{\n\t\t\t$this->employee = $emp;\n\t\t}", "public function testInfoUser()\n {\n }", "public function testRole()\n {\n }", "public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }", "public function testListUserEnrollments()\n {\n }", "public function testExample()\n {\n }", "public function testExample()\n {\n $this->visit('ticket')\n ->see('Listado de Tickets')\n ->seeLink('Ver Ticket') \n ->visit('ticket/1')\n ->see('Quod et autem sed')\n ->seeLink('Ver todos los tickets')\n ->click('Ver todos los tickets')\n ->see('Listado de Tickets')\n ->seeLink('Agregar un ticket', 'ticket/crear');\n }", "public function testExample()\n {\n # 会员\n $oUser = \\App\\Models\\User::orderBy(\"id\", \"desc\")->first();\n\n # step 2. 会员登入\n $this->UserLogin($oUser->name, \"123qwe\"); \n\n\n # step 3. 遊戲列表\n $sUrl = \"/api/games\";\n $sMethod = \"GET\";\n\n # 傳送參數設定\n $this->aHeader[\"currency\"] = \"VND\";\n $aData = [];\n # 測試接口\n $response = $this->withHeaders($this->aHeader)->json($sMethod, $sUrl, $aData); \n \n\n $sUrl = \"/api/games/9/login\";\n $sMethod = \"POST\";\n\n # 傳送參數設定\n $this->aHeader[\"currency\"] = \"VND\";\n $this->aHeader[\"device\"] = \"1\";\n $aData = [];\n # 測試接口\n $response = $this->withHeaders($this->aHeader)->json($sMethod, $sUrl, $aData);\n\n $response->assertStatus(200);\n }", "public function testSetCodeEmploye() {\n\n $obj = new PointBonTrav();\n\n $obj->setCodeEmploye(\"codeEmploye\");\n $this->assertEquals(\"codeEmploye\", $obj->getCodeEmploye());\n }", "public function show(Employees $employees)\n {\n //\n }", "public function testEditUser()\n {\n }", "public function add_employee()\n\t{\n\t\t\n\t\n\t\t//this is calling the view page employee_details to insert the employee's details\n\t\t$this->load->view('employee_details');\n\t}", "public function show(RequireEmployee $requireEmployee)\n {\n //\n }", "public function testEditUser()\n {\n\n }", "public function testExample()\n {\n $response = $this->get('/api/users');\n $response->assertStatus(200)\n\t\t ->assertJsonStructure([\n\t\t \t\t[\n\t\t \t\t\t'id',\n\t\t \t\t\t'name',\n\t\t \t\t\t'last_name',\n\t\t \t\t\t'age',\n\t\t \t\t\t'phone',\n\t\t \t\t\t'photo',\n\t\t \t\t\t'admission_date'\n\t\t \t\t]\n\t\t ]);\n }", "public function testGetExpedicao()\n {\n }", "public function testAddUser()\n {\n\n }", "public function testListExperts()\n {\n }", "private function mockEmployee()\n {\n $this->employeeS = $this->getMockBuilder('Employee')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->employeeS\n ->method('can')\n ->willReturn(true);\n }", "public function testAddUser()\n {\n }", "public function testListPeople()\n {\n }", "static function isEmployee()\n {\n if(!Auth::check())\n return false;\n $user = Auth::User();\n if(stristr($user->type, 'Employee'))\n return true;\n return false;\n }", "public function testShowUser()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/1');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n \"data\" => [\n \"id\",\n \"employee_code\",\n \"name\",\n \"email\",\n \"team\",\n \"role\",\n \"total_borrowed\",\n \"total_donated\"\n ]\n \n ])->assertStatus(Response::HTTP_OK);\n }", "protected function getTestEvent($isOneEmployeeAllowed = true)\n {\n $employees = new ArrayCollection();\n\n for ($i = 0; $i < 3; $i++) {\n $empUser = new User();\n $empUser->setId('1234-' . $i);\n $perm = new EmployeePermissions(EmployeePermissionsInterface::JOBS_VIEW);\n if (2 == $i && $isOneEmployeeAllowed) {\n $perm->grant(EmployeePermissionsInterface::JOBS_CREATE);\n }\n $emp = new Employee($empUser, $perm);\n\n $employees->add($emp);\n }\n\n $org = $this->getMockBuilder('\\Organizations\\Entity\\OrganizationReference')\n ->disableOriginalConstructor()\n ->getMock();\n\n $org->expects($this->once())\n ->method('hasAssociation')\n ->willReturn(true);\n\n $org->expects($this->once())\n ->method('isOwner')\n ->willReturn(false);\n\n $org->expects($this->once())\n ->method('getEmployees')\n ->willReturn($employees);\n\n $role = new User();\n $role->setId('1234-2');\n $role->setOrganization($org);\n\n $e = new AssertionEvent();\n $e->setRole($role);\n\n return $e;\n }", "public function show(EmployeeInfo $employee)\n {\n\n }", "public function testUpdateEmployee()\n {\n }", "public function testName()\n {\n // $this->assertTrue(true);\n //create user\n $user=Posts::create([\n 'id'=>'1',\n 'fname'=>'shamim', 'sname'=>'Nakayiza', 'sex'=>'female','amount'=>10000]);\n $this->assertEquals('Nakayiza', $user->sname);\n }", "private function addEmployee()\n\t{\n\t\tif (false === $this->flag)\n\t\t{\n\t\t\tif (isset($this->dataArray))\n\t\t\t{\n\t\t\t\tif ('' === $this->dataArray['pass_employee'])\n\t\t\t\t{\n\t\t\t\t\t$this->error['ERROR_PASS'] = ERROR_EMPTY;\n\t\t\t\t\t$pass = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (false === $this->validatorObj\n\t\t\t\t\t\t\t->checkPass($this->dataArray['pass_employee']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->error['ERROR_PASS'] = ERROR_WRONG_DATA;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$pass = $this->dataArray['pass_employee'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ('' === $this->dataArray['name_employee'])\n\t\t\t\t{\n\t\t\t\t\t$this->error['ERROR_NAME'] = ERROR_EMPTY;\n\t\t\t\t\t$name = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (false === $this->validatorObj\n\t\t\t\t\t\t\t->checkForm($this->dataArray['name_employee']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->error['ERROR_NAME'] = ERROR_WRONG_DATA;\n\t\t\t\t\t\t$name = false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$name = $this->dataArray['name_employee'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ('' === $this->dataArray['email_employee'])\n\t\t\t\t{\n\t\t\t\t\t$this->error['ERROR_EMAIL'] = ERROR_EMPTY;\n\t\t\t\t\t$email = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (false === $this->validatorObj\n\t\t\t\t\t\t\t->checkEmail($this->dataArray['email_employee']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->error['ERROR_EMAIL'] = ERROR_WRONG_DATA;\n\t\t\t\t\t\t$email = false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$email = $this->dataArray['email_employee'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (false !== $name && false !== $pass && false !== $email)\n\t\t\t\t{\n\t\t\t\t\t$arr = $this->queryToDbObj\n\t\t\t\t\t\t->getEmployeeForCheckExists($email);\n\t\t\t\t\tif (!empty($arr))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->error['ERROR_STATUS'] = ERROR_EXISTS;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$key_employee = $this->encodeObj->generateCode($name);\n\t\t\t\t\t\t$pass = md5($key_employee . $pass . SALT);\n\t\t\t\t\t\t$arr = $this->queryToDbObj\n\t\t\t\t\t\t\t->setNewEmployee($name, $pass, $email,\n\t\t\t\t\t\t\t\t$key_employee);\n\t\t\t\t\t\tif ($arr)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$success['ADD'] = 'User add';\n\n\t\t\t\t\t\t\treturn $success;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!empty($this->error))\n\t\t{\n\t\t\treturn $this->error;\n\t\t}\n\t\treturn true;\n\t}", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->assertSee('Авторизация');\n });\n\n $user = User::factory()->create([\n 'email' => '[email protected]',\n 'password' => Hash::make('password'),\n ]);\n\n $this->browse(function ($browser) {\n $browser->visit('/login')\n ->type('email', '[email protected]')\n ->type('password', 'password')\n ->press('Авторизоваться')\n ->assertPathIs('/dashboard')\n ->assertSee('Главная');\n });\n\n }", "public function testExample()\n {\n $society1 = factory(App\\Society::class)->create([\n 'id' => 2005,\n 'name' => 'cs',\n 'catagory' => 'Academic',\n ]);\n\n $user1 = factory(App\\User::class)->create([\n 'id' => 2005,\n 'name' => 'Wil',\n 'email' => '[email protected]',\n ]);\n\n \\SocietyWrapper::joinSociety(2005,2005);\n $testinsoc = \\SocietyWrapper::isInSociety(2005,2005);\n $this->assertEquals(1,$testinsoc);\n\n $test = \\SocietyWrapper::getSocietiesForUser(2005)->first();\n $this->assertEquals(2005,$test->society_id);\n\n $test = \\SocietyWrapper::getAllSocietyMembers(2005);\n $this->assertEquals(2005,$test[0]->id);\n $this->assertEquals('Wil',$test[0]->name);\n $this->assertEquals('[email protected]',$test[0]->email);\n\n \\SocietyWrapper::quitSociety(2005,2005);\n\n App\\User::destroy(2005);\n \\SocietyWrapper::deleteSociety(2005);\n }", "public function create_employee()\n {\n //get dropdown data\n $functional_units = [];\n $data = [];\n $this->get_data($data, $functional_units);\n\n return view('accounts.create_employee')->with([\n 'functional_units' => $functional_units, \n 'data' => $data\n ]);\n }", "public function testCreateExpedicao()\n {\n }", "public function getCompanyEmployees();", "public function testJobList()\n {\n\n }", "public function testReportsSkillv1reportsjohariusersuserId()\n {\n\n }", "public function isEmployee(){\n if(isset($this->staffId)){\n return TRUE;\n }\n else{\n return FALSE;\n }\n }", "public function test() {\n\n\t}", "public function testBasics() {\n\t\t$model = new AElasticRecord;\n\t\t$model->id = 123;\n\t\t$model->name = \"test item\";\n\t\t$this->assertEquals(123, $model->id);\n\t\t$this->assertEquals(\"test item\",$model->name);\n\t}", "public function testGetUser()\n {\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $a = [\n 'last_name' => 'Catacutan',\n 'first_name' => 'Romeo',\n 'middle_name' => 'Dimaandal',\n 'sex' => 'M',\n 'mobile' => '9876543210',\n 'email' => '[email protected]',\n 'qualification_id' => Qualification::first()->qualification_id\n ];\n $browser->visit(route('applications.create'))\n ->type('last_name', $a['last_name'])\n ->assertSee('Laravel');\n });\n }", "public function testAddAnonymus()\n {\n \t$user = factory(User::class)->create()''\n \t$response = $this->get('add');\n \t$response->assertStatus(200);\n \n }", "public function run()\n {\n factory(Employee::class, 10) -> create(); //il 50 è riferito al numero di employee che mi interessa avere nella tabella\n }", "public function testGetUser()\n {\n\n }", "public function test_addCustomerAudit() {\n\n }", "private function addTestUser(): void\n {\n $this->terminus(sprintf('site:team:add %s %s', $this->getSiteName(), $this->getUserEmail()));\n }", "public function testSetCodeEmploye() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setCodeEmploye(\"codeEmploye\");\n $this->assertEquals(\"codeEmploye\", $obj->getCodeEmploye());\n }", "public function run()\n {\n $faker = Faker::create();\n foreach(range(1,10) as $index) {\n \tEmployee::create([\n \t\t'name'=>$faker->name(),\n \t\t'code'=>$faker->unique()->randomDigit,\n \t\t'designation'=>$faker->randomElement($array=array('Developer','Desginer','Tester','Businees Analyist','Admin','HR','Recuirtment','House Keeping')),\n \t\t'department'=>$faker->jobTitle,\n \t\t'status'=>$faker->randomElement($status = [0,1]), \t\t\n \t\t'location'=>$faker->country\n \t\t]);\n }\n }", "public function run()\n {\n Employee::forceCreate([\n 'last_name' => 'Harangozó',\n 'first_name' => 'Dóra',\n 'birth' =>'1994-04-20',\n 'image' =>'default.jpg',\n 'email' =>'[email protected]',\n 'address' => 'Sopron, Kőszegi út 20.',\n 'phone_number' => '06306089097',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'mérnök',\n 'comment'=> null,\n 'user_id'=>1,\n 'site_id'=>1,\n ]);\n Employee::forceCreate([\n 'last_name' => 'Nagy',\n 'first_name' => 'Péter',\n 'birth' =>'1980-08-08',\n 'image' =>'default.jpg',\n 'email' =>'[email protected]',\n 'address' => 'Sopron, Kossuth út 20.',\n 'phone_number' => '06301234569',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'menedzser',\n 'comment'=> null,\n 'user_id'=>2,\n 'site_id'=>1,\n ]);\n\n Employee::create([\n 'last_name' => 'Nagy',\n 'first_name' => 'Luca',\n 'birth' =>'1990-11-24',\n 'image' =>'default.jpg',\n 'email' =>'[email protected]',\n 'address' => 'Sopron, Baross út 20.',\n 'phone_number' => '06306666666',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'telephely vezető',\n 'comment'=> null,\n 'user_id'=>4,\n 'site_id'=>2,\n ]);\n Employee::create([\n 'last_name' => 'Nagy',\n 'first_name' => 'Lili',\n 'birth' =>'1990-07-01',\n 'image' =>'default.jpg',\n 'email' =>'[email protected]',\n 'address' => 'Sopron, Szív utca 20.',\n 'phone_number' => '06303333333',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'adminisztrátor',\n 'comment'=> null,\n 'user_id'=>3,\n 'site_id'=>2,\n ]);\n }", "public function testJobAdd()\n {\n\n }", "public function test_employee_index_page_has_header()\n {\n //$response = $this->call('GET', 'department.index'); \n $response = $this->get('/employees/index'); \n \n $response\n ->assertStatus(200)\n ->assertSee('Employee')\n ->assertSuccessful(); \n }", "public function initialize()\n {\n // attributes\n $this->setName('employee');\n $this->setPhpName('Employee');\n $this->setIdentifierQuoting(false);\n $this->setClassName('\\\\lwops\\\\lwops\\\\Employee');\n $this->setPackage('lwops.lwops');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('oid', 'Oid', 'INTEGER', true, null, null);\n $this->addColumn('firstName', 'Firstname', 'VARCHAR', true, 20, null);\n $this->addColumn('middleInitial', 'Middleinitial', 'VARCHAR', false, 1, 'X');\n $this->addColumn('lastName', 'Lastname', 'VARCHAR', true, 20, null);\n $this->addColumn('nationalID', 'Nationalid', 'CHAR', true, 10, '1000000001');\n $this->addColumn('mobileNbr', 'Mobilenbr', 'CHAR', true, 10, '0720000000');\n $this->addColumn('resident', 'Resident', 'BOOLEAN', true, 1, false);\n $this->addColumn('elecDeduction', 'Elecdeduction', 'BOOLEAN', true, 1, true);\n $this->addColumn('ePayment', 'Epayment', 'BOOLEAN', true, 1, false);\n $this->addColumn('active', 'Active', 'BOOLEAN', true, 1, true);\n $this->addColumn('startDt', 'Startdt', 'DATE', true, null, null);\n $this->addColumn('gender', 'Gender', 'CHAR', true, null, 'M');\n $this->addColumn('terminated', 'Terminated', 'BOOLEAN', true, 1, false);\n $this->addColumn('dateOfBirth', 'Dateofbirth', 'DATE', true, null, null);\n $this->addColumn('maritalStatus', 'Maritalstatus', 'VARCHAR', true, 1, null);\n $this->addColumn('spouseFirstNm', 'Spousefirstnm', 'VARCHAR', false, 45, null);\n $this->addColumn('spouseLastNm', 'Spouselastnm', 'VARCHAR', false, 45, null);\n $this->addColumn('spouseMobNbr', 'Spousemobnbr', 'VARCHAR', false, 10, null);\n $this->addColumn('prevEmployerName', 'Prevemployername', 'VARCHAR', true, 45, null);\n $this->addColumn('prevEmployerTelNbr', 'Prevemployertelnbr', 'VARCHAR', true, 45, null);\n $this->addColumn('prevEmployerStartDt', 'Prevemployerstartdt', 'DATE', true, null, null);\n $this->addColumn('prevEmployerEndDt', 'Prevemployerenddt', 'DATE', true, null, null);\n $this->addColumn('prevEmployerLeavingReason', 'Prevemployerleavingreason', 'VARCHAR', true, 100, null);\n $this->addColumn('prevEmployerLocation', 'Prevemployerlocation', 'VARCHAR', true, 100, null);\n $this->addColumn('workDoneAtPrevEmployer', 'Workdoneatprevemployer', 'VARCHAR', true, 150, null);\n $this->addColumn('nxtOfKinFirstNm', 'Nxtofkinfirstnm', 'VARCHAR', true, 45, null);\n $this->addColumn('nxtOfKinLastNm', 'Nxtofkinlastnm', 'VARCHAR', true, 45, null);\n $this->addColumn('nxtOfKinMobileNbr', 'Nxtofkinmobilenbr', 'VARCHAR', true, 10, null);\n $this->addColumn('nxtOfKinResidence', 'Nxtofkinresidence', 'VARCHAR', true, 45, null);\n $this->addColumn('nxtOfKinRelationship', 'Nxtofkinrelationship', 'VARCHAR', true, 10, null);\n $this->addColumn('nxtOfKinPlaceOfWork', 'Nxtofkinplaceofwork', 'VARCHAR', true, 75, null);\n $this->addColumn('comment', 'Comment', 'VARCHAR', false, 255, null);\n $this->addColumn('createTmstp', 'Createtmstp', 'TIMESTAMP', true, null, 'CURRENT_TIMESTAMP');\n $this->addColumn('updtTmstp', 'Updttmstp', 'TIMESTAMP', false, null, null);\n }", "public function testBasicExample()\n {\n $user = User::first();\n $this->be($user);\n $this->visit('/')\n ->see('Welcome Back');\n\n }", "final public function test_hotel_seeder()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n\n }", "public function run()\n {\n\n Employee::factory(10)->create();\n\n // Employee::create([\n // 'name' => Str::random(10),\n // 'region' => Str::random(10),\n // 'city' => Str::random(20),\n // 'dateOfJoin' => Carbon::now(),\n // 'department' => Str::random(15),\n // 'created_at' => Carbon::now(),\n // 'updated_at' =>Carbon::now(),\n // ]);\n // }\n }", "public function testCreateUser()\n {\n }", "public function run()\n {\n $faker = Faker::create();\n\n $employees = [\n [\n 'ssn' => '101101001',\n 'first_name' => 'John',\n 'last_name' => 'Smith',\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => '24 Sussex Drive',\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 1,\n ],\n [\n 'ssn' => '101101002',\n 'first_name' => 'Jane',\n 'last_name' => 'Doe',\n 'dob' => '1970-01-01',\n 'gender' => 'female',\n 'address' => '24 Sussex Drive',\n 'postal_code' => 'b2b2b2',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 1,\n ],\n [\n 'ssn' => '101101003',\n 'first_name' => 'Jack',\n 'last_name' => 'Jones',\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => '24 Sussex Drive',\n 'postal_code' => 'c3c3c3',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 1,\n ],\n [\n 'ssn' => '202202002',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 2,\n ],\n [\n 'ssn' => '202202003',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 2,\n ],\n [\n 'ssn' => '303303002',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 3,\n ],\n [\n 'ssn' => '303303003',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 3,\n ],\n [\n 'ssn' => '404404002',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 4,\n ],\n [\n 'ssn' => '404404003',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 4,\n ],\n [\n 'ssn' => '505505002',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 5,\n ],\n [\n 'ssn' => '505505003',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 5,\n ],\n [\n 'ssn' => '606606002',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 6,\n ],\n [\n 'ssn' => '606606003',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 6,\n ],\n [\n 'ssn' => '707707002',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 7,\n ],\n [\n 'ssn' => '707707003',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 7,\n ],\n [\n 'ssn' => '808808002',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 8,\n ],\n [\n 'ssn' => '808808003',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 8,\n ],\n [\n 'ssn' => '909909001',\n 'first_name' => 'Frank',\n 'last_name' => 'Eves',\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 9,\n ],\n [\n 'ssn' => '909909002',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 9,\n ],\n [\n 'ssn' => '909909003',\n 'first_name' => $faker->firstname,\n 'last_name' => $faker->lastName,\n 'dob' => '1970-01-01',\n 'gender' => 'male',\n 'address' => $faker->streetAddress,\n 'postal_code' => 'a1a1a1',\n 'city' => 'Calgary',\n 'province' => 'Alberta',\n 'country' => 'Canada',\n 'department_id' => 9,\n ],\n ];\n\n foreach ($employees as $employee) {\n App\\Employee::create($employee);\n\n App\\User::create([\n 'email' => strtolower($employee['first_name'] . '.' . $employee['last_name']) . '@test.com',\n 'password' => '$2y$10$Lzt4uB1kjHFTw0GrfZmoBOpsnAluJ9Kt.oDnYJ76tE1BJOcJ71QfC', // 12345678\n 'employee_ssn' => $employee['ssn'],\n ]);\n\n if (substr($employee['ssn'], -1) === '2') {\n App\\Secretary::create([\n 'ssn' => $employee['ssn'],\n 'office' => substr($employee['ssn'], 0, 3) . 'b'\n ]);\n } else if (substr($employee['ssn'], -1) === '3') {\n App\\Manager::create([\n 'ssn' => $employee['ssn'],\n 'office' => substr($employee['ssn'], 0, 3) . 'c'\n ]);\n }\n\n if ($employee['department_id'] == 9) {\n App\\FinancialExpert::create([\n 'ssn' => $employee['ssn'],\n 'office' => '909z'\n ]);\n }\n }\n }", "public function testBasicFeatures()\n {\n return $this->doTheRealTest(false);\n }", "public function test()\n {\n $this->executeScenario();\n }", "public function testExample(){\n //create admin account\n $admin = factory(User::class)->create([\n 'id' => 999,\n 'name' => \"Sue\",\n 'email' => '[email protected]',\n 'password' => Hash::make(\"secret\"),\n 'role' => 'admin'\n ]);\n\n //login with the admin account\n $login = $this->call('POST', 'api/auth/login',\n [\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]\n );\n $login->assertStatus(200);\n\n\n // return 'location not found' message if the location id doesn't exits in the database\n $response = $this->call('GET', 'api/locations/1');\n $response->assertStatus(404);\n\n\n // insert location details into database\n factory(Location::class)->create([\n 'id' => 1,\n 'address' => \"78-56 Victoria St, Carlton VIC 3053\",\n 'latitude' => -37.806717,\n 'longitude' => 144.965405,\n 'slot' => 5,\n 'current_car_num' => 2\n ]);\n\n\n // See location details\n $response = $this->call('GET', 'api/locations/1',\n $this->transformHeadersToServerVars([ 'Authorization' => $login->json(\"access_token\")])\n );\n $response->assertStatus(200);\n\n }", "public function testFindUsers()\n {\n\n }" ]
[ "0.7746978", "0.73320866", "0.7323037", "0.6891005", "0.6851987", "0.6510909", "0.64976203", "0.62110114", "0.60784596", "0.6024902", "0.6017864", "0.5994299", "0.5990741", "0.5990741", "0.5990741", "0.5990741", "0.5990741", "0.5990741", "0.5990741", "0.5990741", "0.5990741", "0.5990741", "0.5990741", "0.5990741", "0.5940682", "0.5935608", "0.59353113", "0.5934951", "0.5931341", "0.5925468", "0.58785844", "0.58754116", "0.58733135", "0.58188456", "0.58148485", "0.5811209", "0.57863903", "0.5782507", "0.57812726", "0.5777893", "0.57738626", "0.576383", "0.57445747", "0.57396126", "0.5738091", "0.57379866", "0.57319903", "0.5727672", "0.5727668", "0.57103986", "0.5701221", "0.5692802", "0.56819624", "0.5680174", "0.5674503", "0.5671442", "0.5669962", "0.566207", "0.5661993", "0.56618315", "0.5661585", "0.5660552", "0.5640584", "0.56399995", "0.5629133", "0.562655", "0.5621279", "0.56103694", "0.56056774", "0.560232", "0.5598646", "0.55964434", "0.55937105", "0.5582754", "0.5582", "0.5574511", "0.55708057", "0.55638826", "0.5559448", "0.5556953", "0.5549863", "0.55424404", "0.55397105", "0.5537433", "0.55339193", "0.5531522", "0.5523135", "0.5522839", "0.55151314", "0.551365", "0.55108535", "0.5508865", "0.55047053", "0.550197", "0.5501313", "0.55007434", "0.5495382", "0.5494535", "0.54937357", "0.549342" ]
0.59793156
24
this up() migration is autogenerated, please modify it to your needs
public function up(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE objectif ADD commercial_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE objectif ADD CONSTRAINT FK_E2F868517854071C FOREIGN KEY (commercial_id) REFERENCES user (id)'); $this->addSql('CREATE INDEX IDX_E2F868517854071C ON objectif (commercial_id)'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function up();", "abstract public function up();", "abstract public function up();", "abstract public function up();", "public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNED NULL COMMENT 'person',\n CHANGE `tcmn_tmed_id` `tcmn_tmed_id` TINYINT(4) UNSIGNED NULL COMMENT 'medijs';\n \");\n }", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function up()\n {\n $this->execute(\"\n\n ALTER TABLE `cucp_user_company_position` \n ADD COLUMN `cucp_role` CHAR(20) NULL AFTER `cucp_name`;\n\n \");\n }", "public function up()\n\t{\n\t\t$this->dbforge->add_column($this->table, $this->field);\n\t}", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }", "public function up()\n\t{\n\t\t$this->dbforge->modify_column($this->table, $this->field);\n\t}", "public function safeUp()\n {\n $this->createTable(\n $this->tableName,\n [\n 'id' => $this->primaryKey(),\n 'user_id' => $this->integer(). ' UNSIGNED NOT NULL' ,\n 'source' => $this->string()->notNull(),\n 'source_id' => $this->string()->notNull(),\n ],\n 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'\n );\n\n $this->addForeignKey('fk_social_auth_user_id_to_user_id', $this->tableName, 'user_id', '{{%user}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n }", "public function up()\n {\n $user = $this->table('products', ['collation' => 'utf8mb4_persian_ci', 'engine' => 'InnoDB']);\n $user\n ->addColumn('name', STRING, [LIMIT => 20])\n ->addColumn('count', STRING, [LIMIT => 75])\n ->addColumn('code', STRING, [LIMIT => 100])\n ->addColumn('buy_price', STRING, [LIMIT => 30])\n ->addColumn('sell_price', STRING, [LIMIT => 30])\n ->addColumn('aed_price', STRING, [LIMIT => 50])\n ->addTimestamps()\n ->save();\n }", "public function up()\n {\n // Drop table 'table_name' if it exists\n $this->dbforge->drop_table('lecturer', true);\n\n // Table structure for table 'table_name'\n $this->dbforge->add_field(array(\n 'nip' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => true,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'nik' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => false,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'name' => array(\n 'type' => 'VARCHAR(24)',\n 'null' => false,\n ),\n\t\t\t'id_study_program' => array(\n\t\t\t\t'type' => 'VARCHAR(24)',\n\t\t\t\t'null' => false,\n\t\t\t)\n\n ));\n $this->dbforge->add_key('nik', true);\n $this->dbforge->create_table('lecturer');\n }", "public function up()\n\t{\n\t\t// are not setting the foreign key constraint, to allow the examination module to work without the intravitreal\n\t\t// injection module being installed\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'left_treatment_id', 'int(10) unsigned');\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'right_treatment_id', 'int(10) unsigned');\n\t}", "public function safeUp()\n {\n $this->createTable('tbl_hand_made_item',\n [\n \"id\" => \"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY\",\n \"price\" => \"integer\",\n \"discount\" => \"integer\",\n \"preview_id\" => \"integer\",\n \"name\" => \"string\",\n \"description\" => \"text\",\n \"short_description\" => \"text\",\n \"slug\" => \"string\",\n ]\n );\n }", "public function preUp()\n {\n }", "public function up()\n\t{\n\t\t// create the purchase_order_details table\n\t\tSchema::create('purchase_order_details', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\t\t \n\t\t $table->integer('purchase_order_id')->unsigned();//->foreign()->references('id')->on('orders');\n\t\t $table->integer('product_id')->unsigned();//->foreign()->references('id')->on('products');\n\t\t $table->integer('quantity');\t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \n\t\t $table->integer('updated_by')->unsigned();\n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function up()\n {\n if (!$this->isEdu()) {\n return;\n }\n \n $this->edu_up();\n }", "public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}", "public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }", "public function up()\n {\n $this->addForeignKey('tours_fk', 'tours', 'id', 'tour_to_hotel', 'tour_id');\n\n $this->addForeignKey('t2h_fkh', 'tour_to_hotel', 'hotel_id', 'hotels', 'id');\n $this->addForeignKey('t2h_fkt', 'tour_to_hotel', 'tour_id', 'tours', 'id');\n }", "public function safeUp()\r\n {\r\n $this->createTable('tbl_job_application', array(\r\n 'id' => 'pk',\r\n 'job_id' => 'integer NOT NULL',\r\n 'user_id' => 'integer NULL',\r\n 'name' => 'string NOT NULL',\r\n 'email' => 'text NOT NULL',\r\n 'phone' => 'text NOT NULL',\r\n 'resume_details' => 'text NOT NULL',\r\n 'create_date' => 'datetime NOT NULL',\r\n 'update_date' => 'datetime NULL',\r\n ));\r\n }", "public function up()\n {\n $fields = array(\n 'first_login' => array('type' => 'char', 'constraint' => '1', 'default' => '1'),\n );\n $this->dbforge->add_column('user', $fields);\n }", "public function safeUp() {\n\n $this->createTable('word', [\n 'word_id' => Schema::TYPE_PK,\n 'word_lang_id' => $this->integer(),\n 'word_name' => $this->string(500) . ' NOT NULL',\n 'word_detais' => $this->string(1000),\n ]);\n\n // Add foreign key\n $this->addForeignKey('fk_language_word_1', 'word',\n 'word_lang_id', 'language', 'lang_id', 'CASCADE', 'NO ACTION');\n \n // Create index of foreign key\n $this->createIndex('word_lang_id_idx', 'word', 'word_lang_id');\n }", "public function safeUp()\n {\n $this->alterColumn('item_keuangan', 'created_at', \"TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00'\");\n\n /* Tambah Field */\n $this->addColumn('item_keuangan', 'status', \"TINYINT(1) NOT NULL DEFAULT '1' COMMENT '0=tidak aktif; 1=aktif;' AFTER `jenis`\");\n }", "public function up()\n {\n $this->addForeignKey(\n 'fk_category_product_from_category',\n 'category_product',\n 'category_id',\n 'category',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n\n $this->addForeignKey(\n 'fk_category_product_from_product',\n 'category_product',\n 'product_id',\n 'product',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n\t\t$this->dropColumn('korzet','utca'); \n\t\t$this->addColumn('korzet','utca','string NOT NULL');\n\t}", "public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }", "public function up()\n {\n Schema::table($this->table, function (Blueprint $table) {\n // $table->bigInteger('user_id')->default(0)->after('id'); // Example\n $table->dropColumn([\n // 'user_id', // Example\n ]);\n });\n }", "public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }", "public function up(): void\n {\n try {\n // SM: We NEVER delete this table.\n if ($this->db->tableExists('prom2_pages')) {\n return;\n }\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"CREATE TABLE `prom2_pages` (\n `cntPageID` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `txtRelativeURL` varchar(255) NOT NULL COMMENT 'Relative URL',\n `txtTitle` varchar(70) NOT NULL COMMENT 'Title',\n `txtContent` text NOT NULL COMMENT 'Content',\n `blnRobots_DoNotAllow` bit(1) NOT NULL DEFAULT b'1',\n PRIMARY KEY (`cntPageID`),\n UNIQUE KEY `txtRelativeURL` (`txtRelativeURL`),\n KEY `txtTitle` (`txtTitle`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function up()\n\t{\n\t\t// Add data to committee-members\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Brian O\\'Sullivan',\n\t\t\t'role' => 'Chairman',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Anthony Barker',\n\t\t\t'role' => 'PRO',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\t\t\n\t}", "public function up()\n {\n $this->query(\"UPDATE `subscription_types` SET `user_label` = `name` WHERE `user_label` = '' OR `user_label` IS NULL;\");\n\n $this->table('subscription_types')\n ->changeColumn('user_label', 'string', ['null' => false])\n ->update();\n }", "public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}", "public function up()\n\t{\n\t\techo $this->migration('up');\n\n\t\tci('o_role_model')->migration_add('Cookie Admin', 'Cookie Designer and Eater', $this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function up()\n {\n\t\t$this->addColumn('{{%user}}', 'is_super', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `status`\");\n\t\t\n\t\t//Add new column for Option Group table\n\t\t$this->addColumn('{{%option_group}}', 'option_type', Schema::TYPE_STRING . \"(25) NULL DEFAULT 'text' AFTER `title`\");\n\t\t\n\t\t//Add new column for Order table\n\t\t$this->addColumn('{{%order}}', 'is_readed', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `shipment_method`\");\n }", "public function up()\n {\n $this->addColumn(\\backend\\models\\VodProfile::tableName(), 'language', \"char(5) not null default 'en-US'\");\n }", "public function up()\n {\n if (!Schema::hasTable($this->table))\n Schema::create($this->table, function (Blueprint $table)\n {\n $table->integer('parent_id')->unsigned()->index();\n $table->foreign('parent_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->integer('child_id')->unsigned()->index();\n $table->foreign('child_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->primary(['parent_id','child_id'],'organisation_relations_primary');\n\n $table->timestamps();\n $table->softDeletes();\n\n $table->engine = 'InnoDB';\n });\n }", "public function up(){\n $table = $this->table('users', array('id'=>false, 'primary_key'=>'id'));\n $table->addColumn('id', 'integer', array('identity'=>true, 'signed'=>false));\n $table->addColumn('email', 'string', array('limit'=>100));\n $table->save();\n }", "public function up() { return $this->run('up'); }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t// examples:\n\t\t\t\t'l_label' => 'VARCHAR(200) NULL DEFAULT NULL',\n\t\t\t\t'l_announce' => 'TEXT NULL DEFAULT NULL',\n\t\t\t\t//'l_content' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_principles_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_principles_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t// create the purchase_orders table\n\t\tSchema::create('purchase_orders', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\n\t\t $table->string('order_number', 128);\n\t\t $table->string('approved',50);\n\t\t $table->date('purchase_date');\t\t \t \t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \t\t \n\t\t $table->integer('updated_by')->unsigned();\t\t \n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'label' => 'VARCHAR(20) NULL DEFAULT NULL COMMENT \"language label\"',\n\t\t\t\t'code' => 'VARCHAR(5) NOT NULL COMMENT \"language code\"',\n\t\t\t\t'locale' => 'VARCHAR (5) NULL DEFAULT NULL',\n\n\t\t\t\t'visible' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not visible; 1 - visible\"',\n\t\t\t\t'published' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not published; 1 - published\"',\n\t\t\t\t'position' => 'INT UNSIGNED NOT NULL DEFAULT 0 COMMENT \"order by position DESC\"',\n\t\t\t\t'created' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - creation time\"',\n\t\t\t\t'modified' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - last entity modified time\"',\n\n\t\t\t\t'UNIQUE key_unique_code (code)',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\n\t\t$this->insert('{{language}}', array(\n\t\t\t'label' => 'рус',\n\t\t\t'code' => 'ru',\n\t\t\t'locale' => 'ru',\n\t\t));\n\t}", "public function up()\n {\n $this->execute('Update goods SET price_rub = price WHERE currency_id = 1');\n }", "public function up()\n\t{\n $this->dropColumn('calculo','fecha');\n\n //add column fecha in producto\n $this->addColumn('producto','fecha','date');\n\t}", "public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('value', 'entry_value');\n });\n }", "public function safeUp() {\n\t$this->createTable('post', array(\n 'id' =>\"int(11) NOT NULL AUTO_INCREMENT\",\n 'created_on' =>\"int(11) NOT NULL\",\n 'title' =>\"varchar(255) NOT NULL\",\n 'context' =>\"text NOT NULL\",\n \"PRIMARY KEY (`id`)\"\n\t),'ENGINE=InnoDB DEFAULT CHARSET=utf8');\n }", "public function getUpSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` TEXT NOT NULL AFTER `positive_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function safeUp()\n {\n $this->addColumn('{{%organization}}', 'legal_entity', $this->string()->null());\n $this->addColumn('{{%organization}}', 'contact_name', $this->string()->null());\n $this->addColumn('{{%organization}}', 'about', $this->text()->null());\n $this->addColumn('{{%organization}}', 'picture', $this->string()->null());\n }", "public function up()\n {\n $this->table('agent_order_consignee_address')\n ->addColumn(Column::string('order_number')->setUnique()->setComment('订单编号'))\n \t\t->addColumn(Column::integer('agent_id')->setComment('代理商ID'))\n\t ->addColumn(Column::integer('create_time')->setDefault(1)->setComment('创建时间'))\n\t \n\t ->addColumn(Column::string('consignee_name')->setComment('收货人姓名'))\n\t ->addColumn(Column::string('consignee_phone')->setComment('收货人电话'))\n\t ->addColumn(Column::string('province')->setComment('省份'))\n\t ->addColumn(Column::string('city')->setComment('城市'))\n\t ->addColumn(Column::string('area')->setComment('地区'))\n\t ->addColumn(Column::string('address')->setComment('收货人详细地址'))\n ->create(); \n }", "public function up()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t'l_value' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_configuration_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_configuration_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function safeUp()\r\n {\r\n $this->up();\r\n }", "public function up(){\n // $table->table('kelas')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('NamaKelas', 'varchar', \"100\")\n // ->create();\n }", "public function safeUp()\n\t{\n\t\t$this->createTable('pesquisa', array(\n\t\t\t'id' => 'serial NOT NULL primary key',\n\t\t\t'nome' => 'varchar',\n\t\t));\n\t}", "public function safeUp()\n\t{\n\t\t$this->up();\n\t}", "public function up(){\n // $table->table('kelassiswa')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('Kelas_Id', 'int', \"11\")\n // ->addColumn('Peserta_Id', 'int', \"11\")\n // ->addForeignKey('Peserta_Id', 'peserta', \"Id\", \"CASCADE\")\n // ->addForeignKey('Kelas_Id', 'kelas', \"Id\")\n // ->create();\n\n }", "public function safeUp()\n {\n $this->up();\n }", "public function safeUp()\n {\n $this->up();\n }", "public function up()\n\t{\n\t\tSchema::table('project_sections', function($t){\n\t\t\t$t->integer('created_by_project_id')->nullable()->unsigned();\n\t\t\t$t->boolean('public')->default(0);\n\n $t->foreign('created_by_project_id')->references('id')->on('projects')->on_delete('SET NULL');\n\t\t});\n\t}", "public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}", "public function up()\n {\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_create');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_mods');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_modpacks');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->boolean('solder_keys')->default(0);\n $table->boolean('solder_clients')->default(0);\n $table->boolean('modpacks_create')->default(0);\n $table->boolean('modpacks_manage')->default(0);\n $table->boolean('modpacks_delete')->default(0);\n });\n }", "public function up()\n {\n Schema::dropIfExists('db_question_new.t_answer_type');\n Schema::create('db_question_new.t_answer_type', function (Blueprint $table){\n $table->increments('id');\n t_field($table->integer('answer_type_no'),\"答案序号\");\n t_field($table->string('name'),\"步骤名字\");\n t_field($table->integer('subject'),\"科目id\");\n t_field($table->integer('open_flag')->default(1),\"开启与否\");\n }); \n }", "public function up()\n\t{\n\t\t$sql = \"create table tbl_rights\n\t\t\t\t(\n\t\t\t\t\titemname varchar(64) not null,\n\t\t\t\t\ttype integer not null,\n\t\t\t\t\tweight integer not null,\n\t\t\t\t\tprimary key (itemname),\n\t\t\t\t\tforeign key (itemname) references tbl_auth_item (name) on delete cascade on update cascade\n\t\t\t\t)\";\n\t\t $this->execute($sql);\n\t\t \n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable( 'tbl_auth_item', array(\n\t\t \"name\" => \"varchar(64) not null\",\n\t\t \"type\" => \"integer not null\",\n\t\t \"description\" => \"text\",\n\t\t \"bizrule\" => \"text\",\n\t\t \"data\" => \"text\",\n\t\t \"primary key (name)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_item_child\", array(\n \t\t\"parent\" => \" varchar(64) not null\",\n\t\t\"child\" => \" varchar(64) not null\",\n \t\t\"primary key (parent,child)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_assignment\",array(\n \t\t\"itemname\" => \"varchar(64) not null\",\n \t\t\"userid\" => \"varchar(64) not null\",\n \t\t\"bizrule\" => \"text\",\n \t\t\"data\"\t => \"text\",\n \t\t\"primary key (itemname,userid)\",\n\t\t));\n\n\t\t$this->addForeignKey('fk_auth_item_child_parent','tbl_auth_item_child','parent','tbl_auth_item','name','CASCADE','CASCADE');\n\t\t$this->addForeignKey('fk_auth_assignment_itemname','tbl_auth_assignment','itemname','tbl_auth_item','name');\n\t\t$this->addForeignKey('fk_auth_assignment_userid','tbl_auth_assignment','userid','tbl_user','id');\n\t}", "public function up()\n {\n // add foreign key for table `articles`\n $this->addForeignKey(\n 'fk-comments-article_id',\n 'comments',\n 'article_id',\n 'article',\n 'id'\n );\n }", "public function safeUp()\r\n\t{\r\n\t\t$this->up();\r\n\t}", "public function up()\n {\n\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable($this->createTableName, [\n 'id' => $this->primaryKey(),\n 'name' => $this->string()->notNull(),\n 'type' => $this->integer(1)->notNull(),\n 'location' => $this->text()->defaultValue(null),\n 'description' => $this->text()->defaultValue(null),\n 'created_by' => $this->integer()->notNull(),\n 'start_at' => $this->integer()->defaultValue(null),\n 'active' => $this->boolean()->defaultValue(true),\n\n ],$tableOptions);\n\n\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n\n $moduleInvite = Module::findOne(['name' => 'Actioncalendar', 'slug' => 'actioncalendar']);\n if(empty($moduleInvite)) {\n $this->batchInsert('{{%module}}', ['parent_id', 'name', 'slug', 'visible', 'sorting'], [\n [null, 'Actioncalendar', 'actioncalendar', 1, 22],\n ]);\n }\n\n }", "public function up()\n\t{\n\t\tSchema::table('user_hasil', function($table)\n\t\t{\n\t\t\t$table->create();\n\t\t\t$table->integer('user_id');\n\t\t\t$table->string('grade', 2);\n\t\t\t$table->decimal('hasil', 5, 2);\n\t\t\t$table->year('tahun');\n\t\t\t$table->timestamps();\n\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->on_update('cascade');\n\t\t});\n\t}", "public function safeUp()\r\n {\r\n $tableOptions = null;\r\n if ($this->db->driverName === 'mysql') {\r\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';\r\n }\r\n\r\n $this->createTable('{{%contact_msg}}', [\r\n 'id' => Schema::TYPE_PK,\r\n 'from_email' => Schema::TYPE_STRING . \"(320) NOT NULL\",\r\n 'to_email' => Schema::TYPE_STRING . \"(320) NULL\",\r\n 'subject' => Schema::TYPE_STRING . \"(300) NOT NULL\",\r\n 'text' => Schema::TYPE_TEXT,\r\n 'viewed' => Schema::TYPE_BOOLEAN . \"(1) NOT NULL DEFAULT '0'\",\r\n 'created_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n 'updated_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n ], $tableOptions);\r\n }", "public function up()\n {\n $this->alterColumn('{{%hystorical_data}}', 'project_id', $this->integer());\n\n $this->dropForeignKey('fk-hystorical_data-project_id',\n '{{%hystorical_data}}');\n\n $this->addForeignKey(\n 'fk-hystorical_data-project_id',\n '{{%hystorical_data}}',\n 'project_id',\n '{{%projects}}',\n 'id',\n 'SET NULL'\n );\n }", "public function safeUp()\n {\n $this->createTable('site_phrase', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'phrase' => 'string NOT NULL',\n 'hash' => 'varchar(32)',\n 'price' => 'decimal(10,2) NOT NULL',\n 'active' => self::MYSQL_TYPE_BOOLEAN,\n ));\n\n $this->addForeignKey('site_phrase_site_id', 'site_phrase', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n }", "public function up()\n\t{\n\t\tSchema::create('flows_steps', function($table) {\n\n\t\t\t$table->engine = 'InnoDB';\n\n\t\t $table->increments('stepid');\n\t\t $table->integer('flowid');\n\t\t $table->string('step', 100);\n\t\t $table->integer('roleid');\n\t\t $table->integer('parentid');\n\t\t $table->integer('state');\n\t\t $table->integer('page');\n\t\t $table->integer('condition2');\n\t\t $table->timestamps();\n\n\t\t});\n\t}", "public function up()\n\t{\n\t\tSchema::table('devices', function($table)\n\t\t{\n\t\t\t$table->string('uuid')->unique;\n\t\t\t$table->drop_column('uid');\n\t\t});\n\t}", "public function up()\n\t{\n\t\t$this->execute(\"\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.*', 0, 'Edit invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.View', 0, 'View invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.*', 0, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.View', 0, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitem` VALUES('InvoiceEdit', 2, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('InvoiceView', 2, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FiitInvoiceItem.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FiitInvoiceItem.View');\n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FinvInvoice.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FinvInvoice.View');\n \");\n\t}", "public function up()\n {\n $this->createTable('post',[\n 'id' => $this->primaryKey(),\n 'author_id' => $this->integer(),\n 'title' => $this->string(255)->notNull()->unique(),\n 'content' => $this->text(),\n 'published_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'updated_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'status' => \"ENUM('draft','published')\",\n 'image' => $this->string(255)\n ]); \n\n $this->addForeignKey(\n 'fk_post_author_id',\n 'post',\n 'author_id',\n 'user',\n 'id',\n 'CASCADE',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n// $import->import();\n\t}", "public function up()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{rights}}\")){\n\t\t\t$this->dropTable(\"authItem\");\n\t\t}\n\n\t\t$this->createTable(\"{{rights}}\", array(\n\t\t\t\"itemname\" => \"varchar(64) CHARACTER SET UTF8 NOT NULL\",\n\t\t\t\"type\"\t => \"int not null\",\n\t\t\t\"weight\" => \"int not null\",\n\t\t\t\"PRIMARY KEY (itemname)\"\n\t\t\t));\n\t}", "public function up() {\r\n\t\t// UP\r\n\t\t$column = parent::Column();\r\n\t\t$column->setName('id')\r\n\t\t\t\t->setType('biginteger')\r\n\t\t\t\t->setIdentity(true);\r\n\t\tif (!$this->hasTable('propertystorage')) {\r\n\t\t\t$this->table('propertystorage', [\r\n\t\t\t\t\t\t'id' => false,\r\n\t\t\t\t\t\t'primary_key' => 'id'\r\n\t\t\t\t\t])->addColumn($column)\r\n\t\t\t\t\t->addColumn('path', 'text', ['limit' => 1024])\r\n\t\t\t\t\t->addColumn('name', 'text', ['limit' => 100])\r\n\t\t\t\t\t->addColumn('valuetype', 'integer',[])\r\n\t\t\t\t\t->addColumn('value', 'text', [])\r\n\t\t\t\t\t->create();\r\n\t\t}\r\n\t}", "public function up()\n {\n $perfis = [\n [\n 'id' => 1,\n 'perfil' => 'Genérico',\n 'ativo' => 1\n ]\n ];\n\n $this->insert('singular_perfil', $perfis);\n\n $usuarios = [\n [\n 'id' => 1,\n 'nome' => 'Singular Framework',\n 'login' => 'singular',\n 'senha' => 'singular',\n 'perfil_id' => 1\n ]\n ];\n\n $this->insert('singular_usuario', $usuarios);\n }", "public function safeUp()\n {\n $this->createTable('user', array(\n 'name' => 'string',\n 'username' => 'string NOT NULL',\n 'password' => 'VARCHAR(32) NOT NULL',\n 'salt' => 'VARCHAR(32) NOT NULL',\n 'role' => \"ENUM('partner', 'admin')\"\n ));\n }", "public function up()\n\t{\n\t\t$demoUser = new User();\n\t\t$demoUser->username = \"demo\";\n\t\t$demoUser->email = '[email protected]';\n\t\t$demoUser->password = 'password';\n\t\t$demoUser->create_time = new CDbExpression('NOW()');\n\t\t$demoUser->update_time = new CDbExpression('NOW()');\n\n\t\t$demoUser->save();\n\n\t\t$adminUser = new User();\n\t\t$adminUser->username = \"admin\";\n\t\t$adminUser->email = '[email protected]';\n\t\t$adminUser->password = 'password';\n\t\t$adminUser->create_time = new CDbExpression('NOW()');\n\t\t$adminUser->update_time = new CDbExpression('NOW()');\n\n\t\t$adminUser->save();\n\n\t}", "public function safeUp()\n {\n $tables = Yii::$app->db->schema->getTableNames();\n $dbType = $this->db->driverName;\n $tableOptions_mysql = \"CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB\";\n\n /* MYSQL */\n if (!in_array('question_tag', $tables)) {\n if ($dbType == \"mysql\") {\n $this->createTable('{{%question_tag}}', [\n 'question_id' => 'INT(11) NOT NULL',\n 'tag_id' => 'INT(11) NOT NULL',\n ], $tableOptions_mysql);\n }\n }\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t'like',\n\t\t\tarray(\n\t\t\t\t'id'=>'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',\n\t\t\t\t'user_id' => 'int(11) UNSIGNED NOT NULL',\n\t\t\t\t'post_id' => 'int (11) NOT NULL',\n\t\t\t\t'status' => 'TINYINT(1)',\n\t\t\t\t'created_at' => 'int(11)',\n\t\t\t\t'updated_at' => 'int(11)',\n\t\t\t\t'PRIMARY KEY (id)',\n\t\t\t\t),\n\t\t\t'ENGINE=InnoDB'\n\n\t\t\t);\n\t}", "public function up()\n\t{\n\t\tSchema::table('entries', function($table) {\n $table->create();\n $table->increments('id');\n $table->string('title', 128);\n $table->string('body');\n $table->integer('users_id')->unsigned();\n $table->index('users_id');\n $table->integer('last_edited_by');\n $table->foreign('users_id')->references('id')->on('users')->on_delete('no action');\n $table->timestamps();\n });\n\t}", "public function up()\n {\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'password', $this->string()->null());\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'status', $this->integer()->null());\n }", "public function up()\n {\n\t\t$tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\t\t\n\t\t$TABLE_NAME = 'HaberDeneme12';\n $this->createTable($TABLE_NAME, [\n 'HaberID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(12)->notNull(),\n 'Baslik' => $this->string(128)->notNull(),\n 'Ozet' => $this->text()->notNull(),\n 'Detay' => $this->text()->notNull(),\n 'Resim' => $this->text()->notNull(),\n 'EklenmeTarihi' => $this->date(),\n 'GuncellenmeTarihi' => $this->date()\n ], $tableOptions);\n\t\t\n\t\t\n\t\t$TABLE_NAME = 'HaberKategoriDeneme12';\n\t\t $this->createTable($TABLE_NAME, [\n 'KategoriID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(20)->notNull()\n ], $tableOptions);\n\t\t\n }", "public function up()\n\t{\n\t\t$fields = array(\n \"`piezas` DECIMAL(3,2) DEFAULT NULL\",\n\n\t\t);\n\t\t$this->dbforge->add_column('rel_monto_servicios', $fields);\n\n\t}", "public function up()\n {\n $this->insert('key_value', [\n 'key' => 'day_feed_count_dnr',\n 'value' => '15',\n ]);\n }", "public function up()\n {\n // 创建操作记录表\n $tables = $this->table('history');\n // 用户动作\n $tables->addColumn('action', 'string', ['limit' => 20])\n ->addColumn('ip', 'string', ['limit' => 129])\n // 建立用户\n ->addColumn('user_id', 'integer')\n // 登录时间\n ->addColumn('operation_time', 'datetime')\n // 操作详情\n ->addColumn('desc', 'string',['limit'=>500,'null' => true])\n ->create();\n }", "public function up()\n {\n $table = $this->table('vehicle_model_suggestions');\n\n if (!$table->exists()) {\n $table\n ->addPrimaryKey('id')\n ->addColumn('vehicle_id', 'integer', ['null' => false])\n ->addColumn('vehicle_model_id', 'integer', ['null' => false])\n ->addColumn('suggestion', 'text')\n ->addTimestamps()\n ->addColumn('deleted_at', 'datetime')\n ->create();\n }\n }", "public function safeUp()\n {\n $this->insert('category',['name'=>'Uncategorized', 'slug'=>'uncategorized', 'description'=>'Default Category', 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()')]);\n $this->insert('user',['username'=>'Administrator', 'password_hash'=>'$2y$13$6yoLjvVORp/7EO1u8phYTuWYzhMSM4LVVsebZgcqEKj/EQLvo5nJK',\n 'email'=>'[email protected]',\n 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()'),\n 'status'=>1\n ]\n );\n }", "public function safeUp()\n {\n $this->createTable($this->tableName, [\n 'post_id' => $this->bigInteger()->notNull(),\n 'category_id' => $this->bigInteger()->notNull(),\n ]);\n\n $this->addForeignKey('post_category_post_id_fk', $this->tableName, 'post_id', '{{%post}}', 'id', 'CASCADE', 'CASCADE');\n $this->addForeignKey('post_category_category_id_fk', $this->tableName, 'category_id', '{{%category}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n Schema::table('categories', function(Blueprint $table)\n {\n $table->integer('parent_id', false, true)->nullable()->after('cat_order');\n });\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'application_id' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Ид приложения\"',\n\n\t\t\t\t'message' => 'TEXT NOT NULL DEFAULT \"\" COMMENT \"Оригинал\"',\n\t\t\t\t'category' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Категория\"',\n\t\t\t\t'language' => 'VARCHAR(5) NOT NULL DEFAULT \"\" COMMENT \"Язык\"',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t//\n\t\tSchema::create('options',function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->boolean('activate_pn');\n\t\t\t$table->string('basic_name');\n\t\t\t$table->string('basic_pass');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\t$o = new Option;\n\t\t$o->activate_pn = 0;\n\t\t$o->save();\n\t}", "public function up() {\n\t\t$this->dbforge->add_field(array(\n\t\t\t'id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t\t'auto_increment' => TRUE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t),\n\t\t\t'path' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t)\n\t\t));\n\t\t$this->dbforge->add_key('id', TRUE);\n\t\t$this->dbforge->add_key('path');\n\t\t$this->dbforge->create_table('categories');\n\n\t\t// Table structure for table 'event_categories'\n\t\t$this->dbforge->add_field(array(\n\t\t\t'event_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t),\n\t\t\t'category_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t),\n\t\t));\n\t\t$this->dbforge->add_key('event_id', TRUE);\n\t\t$this->dbforge->add_key('category_id', TRUE);\n\t\t$this->dbforge->create_table('event_categories');\n\t}", "public function up()\n {\n $this->createTable('usuario_refeicao', [\n 'id' => $this->primaryKey(),\n 'usuario_id' => $this->integer(),\n 'refeicao_id' => $this->integer(),\n 'alimento_id' => $this->integer(),\n 'data_consumo' => $this->date(),\n 'horario_consumo' => $this->time(),\n 'quantidade' => $this->double(5,2),\n 'created_at' => $this->integer(),\n 'updated_at' => $this->integer() \n ]);\n\n $this->addForeignKey('fk_usuariorefeicao_usuario_id', 'usuario_refeicao', 'usuario_id', \n 'user', 'id', 'CASCADE');\n $this->addForeignKey('fk_usuariorefeicao_refeicao_id', 'usuario_refeicao', 'refeicao_id', \n 'refeicoes', 'id', 'CASCADE');\n $this->addForeignKey('fk_usuariorefeicao_alimento_id', 'usuario_refeicao', \n 'alimento_id', 'alimentos', 'id', 'CASCADE');\n }" ]
[ "0.8006627", "0.791524", "0.791524", "0.791524", "0.75730014", "0.75629234", "0.7529499", "0.7499871", "0.7494279", "0.74551433", "0.7447644", "0.7435697", "0.7432973", "0.7429338", "0.74190396", "0.73792154", "0.73769516", "0.73694724", "0.7365056", "0.7352234", "0.73305804", "0.73145753", "0.73004", "0.72967255", "0.72934073", "0.7293224", "0.72929984", "0.7286086", "0.72858834", "0.72744155", "0.7274093", "0.726757", "0.72637796", "0.7263359", "0.7258198", "0.7251566", "0.7249874", "0.72460544", "0.7242336", "0.72390556", "0.7220414", "0.7219169", "0.7206133", "0.72048616", "0.719763", "0.7192553", "0.7191949", "0.7178122", "0.71772486", "0.7168088", "0.7165854", "0.7165854", "0.7161322", "0.7149261", "0.71376073", "0.71309835", "0.7126766", "0.71254545", "0.71179867", "0.7106621", "0.7105991", "0.7105991", "0.7097945", "0.7094479", "0.70903504", "0.7088142", "0.7087532", "0.70846665", "0.7083984", "0.7079035", "0.7072098", "0.70709205", "0.7067515", "0.706364", "0.7060826", "0.70599985", "0.7057598", "0.7056473", "0.7056405", "0.70516217", "0.7049624", "0.7049068", "0.7047871", "0.7046788", "0.70444274", "0.70403147", "0.7039841", "0.7038223", "0.70360017", "0.7034038", "0.70333934", "0.70276994", "0.70157754", "0.7012181", "0.7007616", "0.6990435", "0.6985937", "0.69645053", "0.69627804", "0.6959676", "0.6959529" ]
0.0
-1
this down() migration is autogenerated, please modify it to your needs
public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE objectif DROP FOREIGN KEY FK_E2F868517854071C'); $this->addSql('DROP INDEX IDX_E2F868517854071C ON objectif'); $this->addSql('ALTER TABLE objectif DROP commercial_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function down()\n {\n //add your migration here \n }", "public function down()\n {\n //add your migration here\n }", "public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo','fecha','date');\n\t}", "public function down()\n {\n \t\n \t$this->createTable('os', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n \t$this->insert('os', ['id' => 1, 'name' => 'Any']);\n \t$this->insert('os', ['id' => 2, 'name' => 'CentOS']);\n \t$this->insert('os', ['id' => 3, 'name' => 'RHEL']);\n \t$this->insert('os', ['id' => 4, 'name' => 'Fedora']);\n \t \n \t$this->createTable('os_bit', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n\n return false;\n }", "public function down()\n {\n //Schema::dropIfExists('c');//回滚时执行\n\n }", "public function down()\n {\n $this->dbforge->drop_column('user', 'created_at');\n }", "public function down()\n {\n $this->dropForeignKey(\n 'fk-video-blog_id',\n 'video'\n );\n\n\n echo \"m160820_150846_video_create reverted.\\n\";\n\n }", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "public function down()\n\t{\n\t\t// Remove data from committee_members\n\t\tDB::table('committee_members')->where('id', '<', 3)->delete();\t\n\t}", "public function down(){\n $this->dropTable('users');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` INTEGER NOT NULL AFTER `quality_tweet`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n {\n Schema::table('attachments', function(Blueprint $table) {\n\n $table->dropColumn('viewable_id');\n $table->dropColumn('viewable_type');\n\n\n });\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}", "public function down()\n\t{\n\t\t// nothing to do here.\n\t}", "public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }", "public function down()\n\t{\n\t\tSchema::drop('student');\n\t\t//\n\t}", "public function down()\n{\n\nSchema::drop('event_user');\nSchema::drop('events');\nSchema::drop('file');\nSchema::drop('file_ref');\nSchema::drop('groups');\nSchema::drop('project_user');\nSchema::drop('projects');\nSchema::drop('quicknote');\nSchema::drop('subtasks');\nSchema::drop('task_user');\nSchema::drop('tasks');\nSchema::drop('throttle');\nSchema::drop('timesheet');\nSchema::drop('todos');\nSchema::drop('user_profile');\nSchema::drop('users');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\n\n}", "public function down() \n {\n \n }", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n {\n $this->table('contents')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('education');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('l_wardrobe_table');\n\t}", "public function down()\n\t{\n\t\techo $this->migration('down');\n\n\t\tci('o_role_model')->migration_remove($this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}", "public function down()\n {\n\tSchema::drop('quizzes');\n }", "public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }", "public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }", "public function down ()\n {\n }", "abstract public function down();", "abstract public function down();", "abstract public function down();", "public function down()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }", "public function down() {\n\n\t}", "public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }", "public function down()\n\t{\n\t\tSchema::drop('flows_steps');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE galaxiee (id INT AUTO_INCREMENT NOT NULL, idu_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8576D2AF376A6230 (idu_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE trou_noir (id INT AUTO_INCREMENT NOT NULL, id_g_id INT DEFAULT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_AB27242D95951086 (id_g_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE galaxiee ADD CONSTRAINT FK_8576D2AF376A6230 FOREIGN KEY (idu_id) REFERENCES univers (id)');\n $this->addSql('ALTER TABLE trou_noir ADD CONSTRAINT FK_AB27242D95951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('DROP TABLE trounoir');\n $this->addSql('ALTER TABLE galaxie DROP FOREIGN KEY FK_1C880711376A6230');\n $this->addSql('DROP INDEX IDX_1C880711376A6230 ON galaxie');\n $this->addSql('ALTER TABLE galaxie CHANGE idu_id id_u_id INT NOT NULL');\n $this->addSql('ALTER TABLE galaxie ADD CONSTRAINT FK_1C8807116F858F92 FOREIGN KEY (id_u_id) REFERENCES univers (id)');\n $this->addSql('CREATE INDEX IDX_1C8807116F858F92 ON galaxie (id_u_id)');\n $this->addSql('ALTER TABLE planete DROP FOREIGN KEY FK_490E3E5712013DEC');\n $this->addSql('DROP INDEX IDX_490E3E5712013DEC ON planete');\n $this->addSql('ALTER TABLE planete ADD id_s_id INT NOT NULL, ADD nb_sattelite INT NOT NULL, DROP ids_id, DROP nb_satelite');\n $this->addSql('ALTER TABLE planete ADD CONSTRAINT FK_490E3E574AEED04E FOREIGN KEY (id_s_id) REFERENCES systeme (id)');\n $this->addSql('CREATE INDEX IDX_490E3E574AEED04E ON planete (id_s_id)');\n $this->addSql('ALTER TABLE systeme DROP FOREIGN KEY FK_95796DE3CD7AFD24');\n $this->addSql('DROP INDEX IDX_95796DE3CD7AFD24 ON systeme');\n $this->addSql('ALTER TABLE systeme CHANGE idg_id id_g_id INT NOT NULL');\n $this->addSql('ALTER TABLE systeme ADD CONSTRAINT FK_95796DE395951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('CREATE INDEX IDX_95796DE395951086 ON systeme (id_g_id)');\n }", "public function down() {\n $this->dbforge->drop_column('timesheets_items', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'reason_desc', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'reason_desc', TRUE);\n\n // change reason to note\n $fields = array(\n 'reason' => array(\n 'name' => 'note',\n 'type' => \"VARCHAR\",\n 'constraint' => 200,\n 'null' => TRUE\n )\n );\n $this->dbforge->modify_column('timesheets_items', $fields);\n $this->dbforge->modify_column('timesheets_expenses', $fields);\n }", "public function down(): void\n {\n // Remove your data\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_orders');\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function down()\n {\n\tSchema::drop('activities');\n }", "public function down()\n {\n //return false;\n\t\t\n\t\t$TABLE_NAME = 'Haber';\n $this->dropTable($TABLE_NAME);\n\t\t\n\t\t$TABLE_NAME = 'HaberKategori';\n $this->dropTable($TABLE_NAME);\n }", "public function down(){\n $this->dbforge->drop_table('subcategories_news'); //eliminacion de la tabla subcategories_news\n }", "public function down()\n {\n }", "public function down()\n {\n }", "public function down()\n\t{\n\t\tDB::table('professor')->where('professor_id', '=', 1)->delete();\n\t\tDB::table('professor')->where('professor_id', '=', 2)->delete();\n\t\tDB::query('ALTER TABLE professor AUTO_INCREMENT = 1');\n\n\t\t//\n\t}", "public function down(): bool {\n\t\t// Remove & add logic to revert the migration here.\n\t\techo \"M230123030315BaseTables cannot be rolled back.\\n\";\n\t\treturn false;\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n\t\t//return false;\n\t}", "public function down(): void\n {\n try {\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"DROP TABLE IF EXISTS prom2_pages\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function down()\n\t{\n\t\t//\n\t\tSchema::drop('options');\n\t}", "public function change()\n {\n $this->schema->table('recurring_expenses',function($table){\n $table->date('end_repeat')->nullable();\n $table->boolean('ended')->default(false);\n $table->enum('repeat',['0','1','7','14','30','365'])->nullable();\n });\n\n $this->schema->table('expenses',function($table){\n $table->dropColumn('end_repeat');\n $table->dropColumn('repeat');\n $table->integer('parent_id')->nullable();\n $table->foreign('parent_id')->references('id')->on('expenses')->onDelete('cascade');\n });\n }", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->dropForeign('users_id_turma_foreign');\n });\n\n Schema::table('contato', function (Blueprint $table) {\n $table->dropForeign('contato_id_usuario_foreign');\n });\n\n Schema::table('monitores', function (Blueprint $table) {\n $table->dropForeign('monitores_id_turma_foreign');\n $table->dropForeign('monitores_id_usuario_foreign');\n });\n\n Schema::table('galeria_portifolio', function (Blueprint $table) {\n $table->dropForeign('galeria_portifolio_id_portifolio_foreign');\n });\n\n Schema::table('portifolio_alunos', function (Blueprint $table) {\n $table->dropForeign('portifolio_alunos_id_portifolio_foreign');\n $table->dropForeign('portifolio_alunos_id_usuario_foreign');\n });\n\n Schema::table('cobranca', function (Blueprint $table) {\n $table->dropForeign('cobranca_id_aluno_foreign');\n });\n\n Schema::table('lista_de_presenca', function (Blueprint $table) {\n $table->dropForeign('lista_de_presenca_id_usuario_foreign');\n });\n\n Schema::table('forum_da_turma', function (Blueprint $table) {\n $table->dropForeign('forum_da_turma_id_usuario_foreign');\n });\n\n Schema::table('posts_do_site', function (Blueprint $table) {\n $table->dropForeign('posts_do_site_id_usuario_foreign');\n });\n\n Schema::table('posts_do_forum', function (Blueprint $table) {\n $table->dropForeign('posts_do_forum_id_topico_foreign');\n $table->dropForeign('posts_do_forum_id_usuario_foreign');\n });\n }", "public function down()\n\t{\n\t\t$this->dropForeignKey('FK_task_creator','tbl_task');\n\n\t\t$this->dropTable('tbl_task');\n\t}", "public function down()\n {\n $this->table('articles')->drop()->save();\n $this->table('categories')->drop()->save();\n $this->table('football_ragistrations')->drop()->save();\n $this->table('friends')->drop()->save();\n $this->table('menus')->drop()->save();\n $this->table('picnic_ragistrations')->drop()->save();\n $this->table('products')->drop()->save();\n $this->table('profiles')->drop()->save();\n $this->table('skills')->drop()->save();\n $this->table('spouses')->drop()->save();\n $this->table('students')->drop()->save();\n $this->table('submenus')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down(){\n\t\tSchema::dropIfExists('cargo');\n\t}", "public function down()\n {\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )->save();\n\n $this->table('users')\n ->removeIndexByName('FK_users_roles')\n ->update();\n\n $this->table('users')\n ->addColumn('can_edit', 'boolean', [\n 'after' => 'enabled',\n 'default' => '0',\n 'length' => null,\n 'null' => false,\n ])\n ->removeColumn('role_id')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'string', [\n 'default' => null,\n 'length' => 255,\n 'null' => true,\n ])\n ->removeColumn('loggedInNote')\n ->update();\n\n $this->table('roles')->drop()->save();\n }", "public function down()\n\t{\n\t\t//\n\t\tDB::query('TRUNCATE TABLE app_user_apps_publishes CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_fbapps CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_applications CASCADE');\n\t}", "protected abstract function do_down();", "public function down()\n\t{\n\t\t// Drop Table\n\t\tSchema::drop('activities_types');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE encherir_acheteur (encherir_id INT NOT NULL, acheteur_id INT NOT NULL, INDEX IDX_41ABAAFBB0BA17BB (encherir_id), INDEX IDX_41ABAAFB96A7BB5F (acheteur_id), PRIMARY KEY(encherir_id, acheteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE encherir_lot (encherir_id INT NOT NULL, lot_id INT NOT NULL, INDEX IDX_3C56919BB0BA17BB (encherir_id), INDEX IDX_3C56919BA8CBA5F7 (lot_id), PRIMARY KEY(encherir_id, lot_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFB96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES acheteur (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFBB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BA8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EB576A8');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EFC101A');\n $this->addSql('DROP INDEX IDX_503B7C878EB576A8 ON encherir');\n $this->addSql('DROP INDEX IDX_503B7C878EFC101A ON encherir');\n $this->addSql('ALTER TABLE encherir DROP id_acheteur_id, DROP id_lot_id');\n }", "public function down()\n {\n $this->table('accounting_entries')\n ->dropForeignKey(\n 'accounting_entry_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('associations_events')\n ->dropForeignKey(\n 'event_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('events')\n ->dropForeignKey(\n 'event_type_id'\n )->save();\n\n $this->table('members')\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics')\n ->dropForeignKey(\n 'statistics_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics_event')\n ->dropForeignKey(\n 'statistics_id'\n )\n ->dropForeignKey(\n 'event_id'\n )->save();\n\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('accounting_entries')->drop()->save();\n $this->table('accounting_entry_type')->drop()->save();\n $this->table('associations')->drop()->save();\n $this->table('associations_events')->drop()->save();\n $this->table('event_type')->drop()->save();\n $this->table('events')->drop()->save();\n $this->table('members')->drop()->save();\n $this->table('roles')->drop()->save();\n $this->table('statistics')->drop()->save();\n $this->table('statistics_event')->drop()->save();\n $this->table('statistics_type')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{user_block}}\")){\n\t\t\t$this->dropTable(\"{{user_block}}\");\n\t\t}\n\n\t}", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user_login`;\n\nALTER TABLE `user` DROP `user_mname`;\n\nALTER TABLE `user` DROP `user_user`;\n\nALTER TABLE `user` DROP `user_password`;\n\nALTER TABLE `user` DROP `user_date_lastlogin`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n\t{\n\t\tSchema::table('officers', function($t){\n\t\t\t$t->drop_column('role');\n\t\t});\n\t}", "public function safeDown()\n {\n $this->down();\n }", "public function safeDown()\n {\n $this->down();\n }", "public function down()\n\t{\n\t\tSchema::drop('refs');\n\t}", "public function down () {\n\t\treturn $this->rename_column ('headline', 'title', 'string', array ('limit' => 72));\n\t}", "public function down()\n\t{\n\t\tSchema::drop('appeals');\n\t}", "public function safeDown()\r\n {\r\n $this->down();\r\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n<<<<<<< HEAD\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n $this->addSql('ALTER TABLE liste_affaire_affaire DROP FOREIGN KEY FK_CA81ADF3F082E755');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152EBF396750');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E65450D2529');\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E6584CF0CF');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2FF631228');\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCE2687AC3');\n $this->addSql('ALTER TABLE sejour DROP FOREIGN KEY FK_96F52028E2687AC3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152E46135043');\n $this->addSql('DROP TABLE affaire');\n<<<<<<< HEAD\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE responsable_legal');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('DROP TABLE enfant');\n $this->addSql('DROP TABLE enfant_sejour');\n $this->addSql('DROP TABLE sejour');\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE etablissement');\n $this->addSql('DROP TABLE liste_affaire');\n $this->addSql('DROP TABLE responsable_legal');\n $this->addSql('DROP TABLE user');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user`;\n\nDROP TABLE IF EXISTS `question`;\n\nDROP TABLE IF EXISTS `answer`;\n\nDROP TABLE IF EXISTS `image`;\n\nDROP TABLE IF EXISTS `vote`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function down()\n {\n $this->table('mail_contents')->drop()->save();\n }", "public function down() {\n\t}", "public function down() {\n\t}", "public function down() {\n\t}", "public function down()\n {\n Schema::dropIfExists('reunion');\n }", "public function down(): void\n {\n $this->table('services')\n ->dropForeignKey(\n ['currency_id','billing_period_id']\n )->save();\n $this->execute('DELETE FROM currencies');\n $this->execute('DELETE FROM billing_periods');\n $this->table('services')->drop()->save();\n $this->table('currencies')->drop()->save();\n $this->table('billing_periods')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('article_category');\n\t}", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->renameColumn('first_name', 'name');\n $table->dropIndex('users_first_name_index');\n $table->dropIndex('users_created_at_index');\n $table->dropIndex('users_updated_at_index');\n $table->dropColumn(\"last_name\");\n $table->dropColumn(\"username\");\n $table->dropColumn(\"provider\");\n $table->dropColumn(\"provider_id\");\n $table->dropColumn(\"api_token\");\n $table->dropColumn(\"code\");\n $table->dropColumn(\"remember_token\");\n $table->dropColumn(\"role_id\");\n $table->dropColumn(\"last_login\");\n $table->dropColumn(\"status\");\n $table->dropColumn(\"root\");\n $table->dropColumn('backend');\n $table->dropColumn(\"photo_id\");\n $table->dropColumn(\"lang\");\n $table->dropColumn(\"color\");\n $table->dropColumn(\"about\");\n $table->dropColumn(\"facebook\");\n $table->dropColumn(\"twitter\");\n $table->dropColumn(\"linked_in\");\n $table->dropColumn(\"google_plus\");\n });\n }", "public function down()\n\t{\n\t\tSchema::drop('entries');\n\t}", "public function down()\n\t{\n\t\tSchema::table('precios_aterrizajes_despegues', function(Blueprint $table)\n\t\t{\n\t\t\t//\n\t\t});\n\t}", "public function down()\n{\nSchema::drop('statustype');\nSchema::drop('area');\nSchema::drop('region');\nSchema::drop('territory');\nSchema::drop('trackedevent');\nSchema::drop('zip_territory');\nSchema::drop('messagetype');\nSchema::drop('optintype');\nSchema::drop('representative');\nSchema::drop('pediatrician');\nSchema::drop('application_messagestatus');\nSchema::drop('application_optin');\nSchema::drop('application_trackedevent');\nSchema::drop('application');\n}", "public function down()\n\t{\n\t\tSchema::drop(Config::get('sentry::sentry.table.users_metadata'));\n\t}", "protected function tearDown(): void {\n $migration = include __DIR__.'/../database/migrations/create_all_visitors_tables.php.stub';\n $migration->down();\n\n $migrationTest = include __DIR__.'/Support/migrations/2023_01_12_000000_create_test_models_table.php';\n $migrationTest->down();\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_350001418F5EA509');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8B8F5EA509');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA148F5EA509');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0E8F5EA509');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9CF46CD258');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8BF46CD258');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14F46CD258');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7F46CD258');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9A21BD112');\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_35000141A21BD112');\n $this->addSql('ALTER TABLE contacte DROP FOREIGN KEY FK_C794A022A21BD112');\n $this->addSql('ALTER TABLE demande DROP FOREIGN KEY FK_2694D7A5A21BD112');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14A6CC7B2');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7A21BD112');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EE455FCC0');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EBDDFA3C9');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EDC304035');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9E3797A94');\n $this->addSql('ALTER TABLE personne DROP FOREIGN KEY FK_FCEC9EFA76ED395');\n $this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');\n $this->addSql('DROP TABLE absence');\n $this->addSql('DROP TABLE classe');\n $this->addSql('DROP TABLE classe_personne');\n $this->addSql('DROP TABLE contacte');\n $this->addSql('DROP TABLE cours');\n $this->addSql('DROP TABLE demande');\n $this->addSql('DROP TABLE matiere');\n $this->addSql('DROP TABLE matiere_classe');\n $this->addSql('DROP TABLE news');\n $this->addSql('DROP TABLE note');\n $this->addSql('DROP TABLE personne');\n $this->addSql('DROP TABLE personne_matiere');\n $this->addSql('DROP TABLE reset_password_request');\n $this->addSql('DROP TABLE salle');\n $this->addSql('DROP TABLE seance');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n\t{\n\t\tSchema::drop('stor_mem');\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDEA76ED395');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDE19FCD424');\n $this->addSql('DROP TABLE booking');\n $this->addSql('DROP TABLE product_image');\n $this->addSql('DROP TABLE family_page_container');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE time_line');\n $this->addSql('ALTER TABLE family DROP FOREIGN KEY FK_A5E6215B727ACA70');\n $this->addSql('DROP INDEX IDX_A5E6215B727ACA70 ON family');\n $this->addSql('ALTER TABLE family ADD page_content_id INT NOT NULL, DROP parent_id, DROP has_uniques_prices, DROP has_seasonal_products');\n $this->addSql('ALTER TABLE family ADD CONSTRAINT FK_A5E6215B8F409273 FOREIGN KEY (page_content_id) REFERENCES page_content (id)');\n $this->addSql('CREATE INDEX IDX_A5E6215B8F409273 ON family (page_content_id)');\n $this->addSql('ALTER TABLE link ADD page_container_id INT DEFAULT NULL, DROP url');\n $this->addSql('ALTER TABLE link ADD CONSTRAINT FK_36AC99F123D5B0C FOREIGN KEY (page_container_id) REFERENCES page_container (id)');\n $this->addSql('CREATE INDEX IDX_36AC99F123D5B0C ON link (page_container_id)');\n $this->addSql('ALTER TABLE product DROP content, DROP order_by, DROP is_generic, DROP type, CHANGE title label VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci');\n $this->addSql('ALTER TABLE unit DROP duration');\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398F5B7AF75');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95C8486F9AC');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6498486F9AC');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660D629F605');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660E308AC6F');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46CFFE9AD6');\n $this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADEE45BDBF');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95CEE45BDBF');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649EE45BDBF');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F464584665A');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C544584665A');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649D60322AC');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46DCD6110');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F462ADD6D8C');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C5459027487');\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398A76ED395');\n $this->addSql('DROP TABLE address');\n $this->addSql('DROP TABLE format');\n $this->addSql('DROP TABLE material');\n $this->addSql('DROP TABLE `order`');\n $this->addSql('DROP TABLE order_detail');\n $this->addSql('DROP TABLE picture');\n $this->addSql('DROP TABLE product');\n $this->addSql('DROP TABLE product_theme');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE stock');\n $this->addSql('DROP TABLE suppliers');\n $this->addSql('DROP TABLE theme');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n {\n Schema::dropIfExists('data');\n }", "public function down()\n\t{\n\t\tSchema::create('jobs',function($table){$table->increments('id');});\n\t\tSchema::create('job_location',function($table){$table->increments('id');});\n\t\tSchema::create('job_skill',function($table){$table->increments('id');});\n\t\tSchema::create('locations',function($table){$table->increments('id');});\n\t\tSchema::create('location_program',function($table){$table->increments('id');});\n\t\tSchema::create('location_scholarship',function($table){$table->increments('id');});\n\t\tSchema::create('positions',function($table){$table->increments('id');});\n\t\tSchema::create('programs',function($table){$table->increments('id');});\n\t\tSchema::create('program_subject',function($table){$table->increments('id');});\n\t\tSchema::create('scholarships',function($table){$table->increments('id');});\n\t\tSchema::create('scholarship_subject',function($table){$table->increments('id');});\n\t\tSchema::create('skills',function($table){$table->increments('id');});\n\t\tSchema::create('subjects',function($table){$table->increments('id');});\n\t}" ]
[ "0.7950277", "0.78636813", "0.76065636", "0.7493955", "0.7320625", "0.7245268", "0.7187498", "0.71543235", "0.715298", "0.7141911", "0.7135835", "0.71214414", "0.71154845", "0.71057886", "0.7098064", "0.70800334", "0.7078775", "0.70729095", "0.7068331", "0.7066272", "0.7053364", "0.7053364", "0.7042174", "0.7042174", "0.7042174", "0.7041765", "0.7040102", "0.7028846", "0.70253754", "0.7021679", "0.6988633", "0.6986877", "0.6978061", "0.6971848", "0.6944203", "0.6944203", "0.6944203", "0.6942135", "0.6941429", "0.6939214", "0.6935277", "0.69334567", "0.6928689", "0.6924838", "0.6924794", "0.6913486", "0.6902361", "0.6897891", "0.6897845", "0.6897824", "0.6897824", "0.68886673", "0.688262", "0.6874051", "0.6869844", "0.6863713", "0.6858435", "0.68545175", "0.68440175", "0.6842142", "0.6836981", "0.6836124", "0.6834763", "0.68303466", "0.68297166", "0.68282366", "0.6826686", "0.6824025", "0.68185335", "0.6811099", "0.68078107", "0.68056506", "0.68056506", "0.6789167", "0.67755204", "0.67742497", "0.6765081", "0.67597127", "0.67596203", "0.67564446", "0.67564446", "0.67564446", "0.6753443", "0.6753351", "0.6753351", "0.6753351", "0.6752681", "0.674581", "0.6743746", "0.67387754", "0.6733766", "0.67331296", "0.6731279", "0.67302275", "0.6727377", "0.67273724", "0.672722", "0.672607", "0.67173517", "0.67139125", "0.671303" ]
0.0
-1
part of MStreaming bots functions
function echo_ok() { ob_start(); echo 'ok'; $length = ob_get_length(); header('Connection: close'); header("Content-Length: " . $length); header("Content-Encoding: none"); header("Accept-Ranges: bytes"); ob_end_flush(); ob_flush(); flush(); //fastcgi_finish_request(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callBackUpdate($_TELEGRAM, $th, $tc){\n // YOUR BOT CODE GOES HERE\n if ($_TELEGRAM['text'] == \"/start\")\n {\n send($_TELEGRAM['cid'], \"Hi! Welcome on MTgBot Example!\\nThis message was sent by Thread #$th.\\nThe Thread #$th sent $tc messages.\");\n }\n\n}", "function onTextmessage(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3_Node_Host $host)\n{\n global $ts3, $name, $debug; \n $msg = $event[\"msg\"];\n $invoker = $event[\"invokername\"];\n \n if($invoker != $name) {\n \n if($debug) echo($invoker.\": \".$msg.\"\\n\");\n \n if($debug) echo(\"User \".$invoker.\" passed security check\\n\");\n \n $invoker_db = $ts3->clientGetByName($invoker);\n \n if($invoker_db[\"client_unique_identifier\"] == \"DOgQ0YV9+wZ9YMdD3JPfhvlv/xqM=\" OR $invoker_db[\"client_unique_identifier\"] == \"gWszaxdv1W+8KlIHafUe+ZdOaiI=\") {\n\n // preparing the command arguments\n $block = array(11, 26, 2);\n $values[1] = intval( $uid );\n $id_a = $ts3->getId();\n $arguments = explode(\" \", $msg);\n if($debug) echo(\"Arguments:\\n\"); print_r($arguments);echo(\"\\n\"); \n switch ($arguments[0]) {\n\tcase \"!ping\":\n\t\tgizisent(\"Pong!\",$ts3,$id_a);\n\t\tbreak;\n\tcase \"!add\":\n\t\tif (in_array($arguments[1], $block)){\n\t\tgizisent(\"Access denied\",$ts3,$id_a);\n\t\t} else {\n\t\t$ts3->serverGroupClientAdd($arguments[1],$arguments[2]);\t\t\n\t\tgizisent(\"Rank was add\",$ts3,$id_a);\n\t\t}\n\t\tbreak;\t \n\tcase \"!del\":\n\t\tif (in_array($arguments[1], $block)){\n\t\tgizisent(\"Access denied\",$ts3,$id_a);\n\t\t} else {\n\t\t$ts3->serverGroupClientDel($arguments[1],$arguments[2]);\t\t\n\t\tgizisent(\"Rank was remove\",$ts3,$id_a);\n\t\t}\n\t\tbreak;\t\t\t\n\tcase \"!info\":\n\t\tgizisent(\"Project GzPro.net\",$ts3,$id_a);\n\t\tbreak;\t \n\tcase \"!help\":\n\t\tgizisent(\"Commands:\n\t\t!ping - test\n\t\t!add <id ServerGroup> <dbid user> - Giving Rank\n\t\t!del <id ServerGroup> <dbid user> - Remove Rank\n\t\t!info - Information Bot\",$ts3,$id_a);\n }\n \n}\n}\n}", "function recruitPlayer($cxn,$player,$request)\r\n {\r\n \r\n }", "function msgsrv_send ($target, $cmd, $content, $link) {}", "function getStreamURL($item_id) {\n\n $mixcloud_url='https://www.mixcloud.com/';\n $url=$mixcloud_url.preg_replace('/^\\//','',$item_id);\n\n //echo $url.\"<br/>\";\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: www.mixcloud.com'));\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.27 Safari/537.36');\n curl_setopt($ch, CURLOPT_REFERER,$mixcloud_url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // bad style, I know...\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_TIMEOUT, 15);\n curl_setopt($ch, CURLOPT_HEADER, 1);\n\n $tmpfname = ROOT . 'cached/cookie_mixcloud.txt';\n curl_setopt($ch, CURLOPT_COOKIEJAR, $tmpfname);\n curl_setopt($ch, CURLOPT_COOKIEFILE, $tmpfname);\n\n $result = curl_exec($ch);\n\n if (preg_match('/m-p-ref=\"cloudcast_page\" m-play-info=\"(.*)\" m-preview=/',$result,$m)) {\n $playInfo=base64_decode($m[1]);\n $magicString=base64_decode('cGxlYXNlZG9udGRvd25sb2Fkb3VybXVzaWN0aGVhcnRpc3Rzd29udGdldHBhaWQ=');\n //echo $magicString;\n $magicString.=$magicString;\n $magicString.=$magicString;\n\n $total=strlen($playInfo);\n $playInfoArray=array();\n for($i=0;$i<$total;$i++) {\n $playInfoArray[]=substr($playInfo,$i,1);\n }\n\n $total=strlen($magicString);\n $magicStringArray=array();\n for($i=0;$i<$total;$i++) {\n $magicStringArray[]=substr($magicString,$i,1);\n }\n\n $zipped=$this->zip($magicStringArray,$playInfoArray);\n $total = count($zipped);\n $res='';\n for ($i = 0; $i < $total; $i++) {\n $res.=chr(ord($zipped[$i][0]) ^ ord($zipped[$i][1]));\n }\n $result=json_decode($res,true);\n if (is_array($result)) {\n //print_r($result);\n $stream_id=$result['id'];\n $ping_session_id=$result['html5_ping_session_id']; // TODO: should we ping this periodically?\n $stream_url=$result['stream_url'];\n $stream_url=str_replace('https://', 'http://', $stream_url);\n\n //$url='http://api.mixcloud.com'.$item_id;\n //echo \"$url<br/>\";\n //$data=$this->get_cloudcasts($url);\n //print_r($data);\n\n return $stream_url;\n }\n }\n return '';\n }", "public function getNextMessage(){\r\n }", "function smsmediafailed(){\n $getsender=rawurlencode(\"256703744226\");\n $getsms=rawurlencode(\"No sms recieved, check usesmsmedia.php\");\n\n \n $url='http://lambda.smsmedia.ug/api/capi/send.php?sender='.$getsender.'&dest=8198&user=alimulondo&pass=alimulondo&code=alimulondo&content='.$getsms.''; \n\n $ch = curl_init();\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_URL, $url);\n $content = curl_exec($ch);\n exec(GET);\n \n }", "function run($map)\n\t{\n\t\t//set up variables from parameters\n\t\t$channel_name=array_key_exists('name',$map)?$map['name']:'holleywoodstudio';\n\t\t$channel_title=array_key_exists('title',$map)?$map['title']:'';\n\t\t$channel_tempmain=array_key_exists('template_main',$map)?$map['template_main']:'';\n\t\tif ($channel_tempmain) $channel_tempmain=\"_\".$channel_tempmain;\n\t\t$channel_templatemain=\"BLOCK_YOUTUBE_CHANNEL\" . $channel_tempmain;\n\t\t$channel_tempstyle=array_key_exists('template_style',$map)?$map['template_style']:'';\n\t\tif ($channel_tempstyle) $channel_tempstyle=\"_\".$channel_tempstyle;\n\t\t$channel_templatestyle=\"BLOCK_YOUTUBE_CHANNEL_STYLE\" . $channel_tempstyle;\n\t\t$channel_startvideo=array_key_exists('start_video',$map)?$map['start_video']:'1';\n\t\t$channel_maxvideos=array_key_exists('max_videos',$map)?$map['max_videos']:'25';\n\t\t$channel_orderby=array_key_exists('orderby',$map)?$map['orderby']:'1';\n\t\t$channel_showplayer=array_key_exists('show_player',$map)?$map['show_player']:'1';\n\t\t$channel_embedallowed=array_key_exists('embed_allowed',$map)?$map['embed_allowed']:'1';\n\t\t$channel_playeralign=strtolower(array_key_exists('player_align',$map)?$map['player_align']:'center');\n\t\t$channel_playerwidth=array_key_exists('player_width',$map)?$map['player_width']:'480';\n\t\t$channel_playerheight=array_key_exists('player_height',$map)?$map['player_height']:'270';\n\t\t$channel_style=array_key_exists('style',$map)?$map['style']:'1';\n\t\t$channel_nothumbplayer=array_key_exists('nothumbplayer',$map)?$map['nothumbplayer']:'0';\n\t\t$channel_formorelead=array_key_exists('formorelead',$map)?$map['formorelead']:'';\n\t\t$channel_formoretext=array_key_exists('formoretext',$map)?$map['formoretext']:'';\n\t\t$channel_formoreurl=array_key_exists('formoreurl',$map)?$map['formoreurl']:'';\n\t\t$channel_url='http://www.youtube.com/user/'.$channel_name;\n\t\t$channel_thumbnail=array_key_exists('thumbnail',$map)?$map['thumbnail']:'0';\n\n\t\t//create some working variables for working in foreach loop\n\t\t$temp_showplayer = $channel_showplayer;\n\t\t$temp_nothumbplayer = $channel_nothumbplayer;\n\n\t\t//set blank variable that can be set to an error message.\n\t\t$channel_error = '';\n\n\t\t//sanity checks on some critical input - if out of range or unknown values are detected, set them to a default value\n\t\tif ($channel_startvideo < 1) $channel_startvideo = 1;\n\t\tif ($channel_maxvideos < 1 || $channel_maxvideos > 50) $channel_maxvideos = 25;\n\t\tif ($channel_orderby < 1 || $channel_orderby > 3) $channel_orderby = 1;\n\t\tif ($channel_showplayer < 0 || $channel_showplayer > 2) $channel_showplayer = 1;\n\t\tif ($channel_playeralign != 'center' || $channel_playeralign != 'left' || $channel_playeralign != 'right') $channel_playeralign = 'center';\n\t\t//if ($channel_style < 1 || $channel_style > 3) $channel_style = 1;\n\t\tif ($channel_nothumbplayer < 0 || $channel_nothumbplayer > 1) $channel_nothumbplayer = 0;\n\n\n\t\t//if orderby is specified, YouTube API may return cached results. Default for channel feed is to return results ordered by published date.\n\t\t//We don't want cached results from API for default orderby, so we don't pass the orderby for published date and only pass it when ordering by view count or rating.\n\t\t//\n\t\t//Set default API request string\n\t\t$api_v2 = \"http://gdata.youtube.com/feeds/api/users/$channel_name/uploads?max-results=$channel_maxvideos&start-index=$channel_startvideo&v=2\"; \n\t\t//If orderby parameter is set to 2, set API request string for viewCount\n\t\tif ($channel_orderby == \"2\") {\n\t\t\t$orderby = 'viewCount';\n\t\t\t$api_v2 = \"http://gdata.youtube.com/feeds/api/users/$channel_name/uploads?max-results=$channel_maxvideos&start-index=$channel_startvideo&orderby=$orderby&v=2\"; \n\t\t}\n\t\t//If orderby parameter is set to 3, set API request string for rating\n\t\tif ($channel_orderby == \"3\") {\n\t\t\t$orderby = 'rating';\n\t\t\t$api_v2 = \"http://gdata.youtube.com/feeds/api/users/$channel_name/uploads?max-results=$channel_maxvideos&start-index=$channel_startvideo&orderby=$orderby&v=2\"; \n\t\t}\n\n\t\t$content=new ocp_tempcode();\n\n\t\t//$i will count the iterations through the foreach loop\n\t\t$i = 1;\n\n\t\t//load YouTube API JSON request into $result so we can check if we actually get a usable result and set an error if we don't get a usable result\n\t\t$result = json_decode(@file_get_contents(\"$api_v2&alt=json\"));\n\n\t\t//if we get a usable result, parse out the meta information for each video and pass it to the style template\n\t\tif (isset($result->feed->entry)) {\n\t\t\tforeach ($result->feed->entry as $entry) { \n\t \t\t // meta information for the video\n\t\t\t //get video title\n\t\t\t if (isset($entry->title->{'$t'})) $title = $entry->title->{'$t'};\n\t\t\t else $title = \"\";\n\t\t\t \n\t\t\t //get video description\n\t\t\t if (isset($entry->{'media$group'}->{'media$description'}->{'$t'})) $description = $entry->{'media$group'}->{'media$description'}->{'$t'};\n\t\t\t else $description = \"\";\n\n\t\t\t //get video view count\n\t\t\t if (isset($entry->{'yt$statistics'}->viewCount)) $views = $entry->{'yt$statistics'}->viewCount;\n\t\t\t else $views = strval(0);\n\n\t\t\t //get video favorite count\n\t\t\t if (isset($entry->{'yt$statistics'}->favoriteCount)) $favoritecount = $entry->{'yt$statistics'}->favoriteCount;\n\t\t\t else $favoritecount = strval(0);\n\t\t\t \n\t\t\t $thumbnails = $entry->{'media$group'}->{'media$thumbnail'}; \t\t\t\t\t\t//get video thumbnails\n\t\t\t $accesscontrols = $entry->{'yt$accessControl'};\t\t\t\t\t\t\t\t\t//get video access controls - used to find out if video can be embedded\n\t\t\t $vidurl = $entry->{'media$group'}->{'media$player'}; \t\t\t\t\t\t\t\t//get video youtube page url\n\t\t\t $uploaded = $entry->{'media$group'}->{'yt$uploaded'}->{'$t'};\t\t\t\t\t\t//get video upload date/time\n\t\t\t $video_id = $entry->{'media$group'}->{'yt$videoid'}->{'$t'};\t\t\t\t\t\t//get video id\n\n\t\t\t if (isset($entry->{'yt$rating'})) $likes = $entry->{'yt$rating'}->numLikes;\t\t//if video has been liked, get number of likes\n\t\t\t else $likes = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if video has no likes, node will not be available - manually set it to 0\n\t\t\t \n\t\t\t if (isset($entry->{'yt$rating'})) $dislikes = $entry->{'yt$rating'}->numDislikes;\t//if video has been disliked, get number of dislikes\n\t\t\t else $dislikes = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if video has no dislikes, node will not be available - manually set it to 0\n\t\t\t \n\t\t\t $ratingstotal = $likes + $dislikes;\t\t\t\t\t\t\t\t\t\t\t\t//generate total number of likes and dislikes\n\t\t\t if ($ratingstotal > 0) $likespercent = round(($likes/$ratingstotal)*100);\t\t\t//generate percentage of likes\n\t\t\t else $likespercent = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if no likes or dislikes, set percentage of likes to 0\n\t\t\t \n\t\t\t if (isset($entry->{'gd$rating'})) $rating = $entry->{'gd$rating'}->average;\t\t//if video has likes or dislikes, get the average rating (can be used for half star ratings of 1 to 5 stars)\n\t\t\t else $rating = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if video has no likes or dislikes, node will not be available - manually set rating is set to 0\n\t\t\t if ($rating > 0) $ratingstars = round($rating);\t\t\t\t\t\t\t\t\t//generate full star rating of 1 to 5 stars (no half stars)\n\t\t\t else $ratingstars = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if no likes or dislikes, set full star rating to 0\n\t\t\t \n\t\t\t $minutes = 0; $seconds = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t//initialize minutes and seconds to 0\n\t\t\t $seconds = $entry->{'media$group'}->{'yt$duration'}->seconds; \t\t\t\t\t//get video duration in seconds\n\t\t\t if ($seconds > 1) $duration_text = \"$seconds seconds\";\t\t\t\t\t\t\t//if more than one second, use plural - seconds\n\t\t\t else $duration_text = \"$seconds second\";\t\t\t\t\t\t\t\t\t\t\t//if only one second, use singular - second\n\n\t\t\t //check the permission to see if embedding is allowed for video\n\t\t\t $allowembedding = '0';\n\t\t\t foreach ($accesscontrols as $accesscontrol) {\n\t\t\t\tif (($accesscontrol->{'action'} == \"embed\") && ($accesscontrol->{'permission'} == \"allowed\")) $allowembedding = '1';\n\t\t\t\t}\n\n\t\t\t //if video is more than 59 seconds, use minutes and seconds, and distinguish between singular and plural for both seconds and minutes.\n\t\t\t if ($seconds > 59) { \n\t\t\t\t$minutes = floor($seconds/60);\n\t\t\t\t$seconds = $seconds - ($minutes*60);\n\t\t\t\tif ($minutes > 1) $minutes_text=\"minutes\";\n\t\t\t\telse $minutes_text=\"minute\";\n\t\t\t\tif ($seconds > 1) $seconds_text=\"seconds\";\n\t\t\t\telse $seconds_text=\"second\";\n\t\t\t\tif ($seconds == 0) $duration_text = \"$minutes $minutes_text\";\n\t\t\t\telse $duration_text = \"$minutes $minutes_text, $seconds $seconds_text\";\n\t\t\t }\n\n\t\t\t //prepend zero(s) to minutes, if needed, when using numeric time format so we have 2-digit format\n\t\t\t if ($minutes < 1) $minutes = '00';\n\t\t\t elseif ($minutes > 0 && $minutes < 10) $minutes = \"0\".$minutes;\n\t\n\t\t\t //prepend zero(s) to seconds, if needed, when using numeric time format so we have 2-digit format\n\t\t\t if ($seconds < 1) $seconds = '00';\n\t\t\t elseif ($seconds > 0 && $seconds < 10) $seconds = \"0\".$seconds;\n\n\t\t\t $duration_numeric = \"$minutes:$seconds\";\t\t\t\t\t\t\t\t\t\t//generate numeric time format mm:ss\n\n\t\t\t $embedvideo = 'http://www.youtube.com/embed/' . $video_id;\t\t\t\t\t//generate embedded video player url\n\n\t\t\t //generate the iframe YouTube Player embed code\n\t\t\t $videoplayer = \"<iframe width=\\\"$channel_playerwidth\\\" height=\\\"$channel_playerheight\\\" src=\\\"$embedvideo\\\" frameborder=\\\"0\\\" allowfullscreen></iframe>\";\n\n\t\t\t // few different thumbnail image choice here: \n\t\t\t // 0 => default image, low res - \"default\" \n\t\t\t // 1 => default image, medium res - \"mqdefault\" \n\t\t\t // 2 => default image, higher res - \"hqdefault\" \n\t\t\t // 3 => beginning of vid, low res - \"start\" \n\t\t\t // 4 => middle of vid, low res - \"middle\" \n\t\t\t // 5 => end of vid, low res - \"end\" \n\t\t\t $thumb_img = $thumbnails[$channel_thumbnail];\n\t\t\t $thumb_img_0 = $thumbnails[0];\n\t\t\t $thumb_img_1 = $thumbnails[1];\n\t\t\t $thumb_img_2 = $thumbnails[2];\n\t\t\t $thumb_img_3 = $thumbnails[3];\n\t\t\t $thumb_img_4 = $thumbnails[4];\n\t\t\t $thumb_img_5 = $thumbnails[5];\n\t\t\t $thumbalt = $thumb_img->{'yt$name'};\n\t\t\t $thumbalt_0 = $thumb_img_0->{'yt$name'};\n\t\t\t $thumbalt_1 = $thumb_img_1->{'yt$name'};\n\t\t\t $thumbalt_2 = $thumb_img_2->{'yt$name'};\n\t\t\t $thumbalt_3 = $thumb_img_3->{'yt$name'};\n\t\t\t $thumbalt_4 = $thumb_img_4->{'yt$name'};\n\t\t\t $thumbalt_5 = $thumb_img_5->{'yt$name'};\n\t\n\t\t\t //if show player parameter is greater than 0, pass SHOWPLAYER set to 1 to template.\n\t\t\t if ($temp_showplayer > 0 && $i <= $temp_showplayer) $channel_showplayer = '1';\n\t\t\t else $channel_showplayer = '0';\n\n\t\t\t //Disable thumbnail when player is enabled, enable thumbnail when player is disabled.\n\t\t\t if ($temp_nothumbplayer == 0 && $channel_showplayer == 1) $channel_nothumbplayer = '0';\n\t\t\t if ($temp_nothumbplayer == 0 && $channel_showplayer == 0) $channel_nothumbplayer = '1';\n\n\t\t\t //style all of the meta info using the Style template and store it all in the content variable which is passed to the main template \n\t\t\t $content->attach(do_template(\"$channel_templatestyle\",array(\n\t\t\t \t'EMBED_ALLOWED'=>$channel_embedallowed,\n\t\t\t \t'EMBEDPLAYER_ALLOWED'=>$allowembedding,\n\t\t\t \t'VIDEO_ID'=>$video_id,\n\t\t\t \t'MAX_VIDEOS'=>$channel_maxvideos,\n\t\t\t \t'COUNT'=>strval($i),\n\t\t\t \t'VIDEO_URL'=>$vidurl->url,\n\t\t\t \t'CHANNEL_TITLE'=>$channel_title,\n\t\t\t \t'VIDEO_TITLE'=>$title,\n\t\t\t \t'RATING_STARS'=>strval($ratingstars),\n\t\t\t \t'RATING_LIKE_PERCENT'=>strval($likespercent),\n\t\t\t \t'RATING_NUM_RATES'=>strval($ratingstotal),\n\t\t\t \t'RATING_DISLIKES'=>strval($dislikes),\n\t\t\t \t'RATING_LIKES'=>strval($likes),\n\t\t\t \t'RATING_NUMERIC'=>strval($rating),\n\t\t\t \t'FAVORITE_COUNT'=>strval($favoritecount),\n\t\t\t \t'CHANNEL_URL'=>$channel_url,\n\t\t\t \t'CHANNEL_NAME'=>$channel_name,\n\t\t\t \t'UPLOAD_DATE'=>$uploaded,\n\t\t\t \t'DESCRIPTION'=>$description,\n\t\t\t \t'VIEWS'=>$views,\n\t\t\t \t'DURATION_TEXT'=>$duration_text,\n\t\t\t \t'DURATION_NUMERIC'=>$duration_numeric,\n\t\t\t \t'THUMBNAIL'=>$thumb_img->url,\n\t\t\t \t'THUMBWIDTH'=>strval($thumb_img->width),\n\t\t\t \t'THUMBHEIGHT'=>strval($thumb_img->height),\n\t\t\t \t'THUMBALT'=>$thumbalt,\n\t\t\t \t'THUMBNAIL_0'=>$thumb_img_0->url,\n\t\t\t \t'THUMBWIDTH_0'=>strval($thumb_img_0->width),\n\t\t\t \t'THUMBHEIGHT_0'=>strval($thumb_img_0->height),\n\t\t\t \t'THUMBALT_0'=>$thumbalt_0,\n\t\t\t \t'THUMBNAIL_1'=>$thumb_img_1->url,\n\t\t\t \t'THUMBWIDTH_1'=>strval($thumb_img_1->width),\n\t\t\t \t'THUMBHEIGHT_1'=>strval($thumb_img_1->height),\n\t\t\t \t'THUMBALT_1'=>$thumbalt_1,\n\t\t\t \t'THUMBNAIL_2'=>$thumb_img_2->url,\n\t\t\t \t'THUMBWIDTH_2'=>strval($thumb_img_2->width),\n\t\t\t \t'THUMBHEIGHT_2'=>strval($thumb_img_2->height),\n\t\t\t \t'THUMBALT_2'=>$thumbalt_2,\n\t\t\t \t'THUMBNAIL_3'=>$thumb_img_3->url,\n\t\t\t \t'THUMBWIDTH_3'=>strval($thumb_img_3->width),\n\t\t\t \t'THUMBHEIGHT_3'=>strval($thumb_img_3->height),\n\t\t\t \t'THUMBALT_3'=>$thumbalt_3,\n\t\t\t \t'THUMBNAIL_4'=>$thumb_img_4->url,\n\t\t\t \t'THUMBWIDTH_4'=>strval($thumb_img_4->width),\n\t\t\t \t'THUMBHEIGHT_4'=>strval($thumb_img_4->height),\n\t\t\t \t'THUMBALT_4'=>$thumbalt_4,\n\t\t\t \t'THUMBNAIL_5'=>$thumb_img_5->url,\n\t\t\t \t'THUMBWIDTH_5'=>strval($thumb_img_5->width),\n\t\t\t \t'THUMBHEIGHT_5'=>strval($thumb_img_5->height),\n\t\t\t \t'THUMBALT_5'=>$thumbalt_5,\n\t\t\t \t'PLAYERALIGN'=>$channel_playeralign,\n\t\t\t \t'PLAYERHEIGHT'=>$channel_playerheight,\n\t\t\t \t'PLAYERWIDTH'=>$channel_playerwidth,\n\t\t\t \t'EMBEDVIDEO'=>$embedvideo,\n\t\t\t \t'VIDEO_PLAYER'=>$videoplayer,\n\t\t\t \t'SHOWPLAYER'=>$channel_showplayer,\n\t\t\t \t'STYLE'=>strval($channel_style),\n\t\t\t \t'NOTHUMBPLAYER'=>$channel_nothumbplayer,\n\t\t\t \t'FOR_MORE_LEAD'=>$channel_formorelead,\n\t\t\t \t'FOR_MORE_TEXT'=>$channel_formoretext,\n\t\t\t \t'FOR_MORE_URL'=>$channel_formoreurl )));\n\t\t\t $i++;\n\t\t\t} \n\t\t}\n\t\telse $channel_error = \"Channel not found or possibly the YouTube API request limit is exceded!\"; //set error if channel request doesn't return a channel result\n\n\t\t//send styled content to the main template\n\t\treturn do_template(\"$channel_templatemain\",array(\n\t\t\t'CHANNEL_ERROR'=>$channel_error,\n\t\t\t'CHANNEL_TITLE'=>$channel_title,\n\t\t\t'CHANNEL_NAME'=>$channel_name,\n\t\t\t'CHANNEL_URL'=>$channel_url,\n\t\t\t'CONTENT'=>$content));\n\t}", "function tell_rosbot($msg, $channel)\n{\n $data = array\n (\n \"msg\" => ($msg)\n );\n $data_string = json_encode($data);\n\n $url = 'http://localhost:8080/hubot/automessage/' . $channel;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n return ($result == 'OK');\n}", "function onStream(&$man, $cmd, $input) {\r\n\t\treturn true;\r\n\t}", "function get_chtrm($chatid){\r\n\r\n}", "function getUrlForSend($type)\n{\n return \"https://api.telegram.org/bot\".CHAT_BOT.\"/\".$type;\n}", "private function callBot(): string\n {\n $owner_id = null;\n $user_id = $this->info['user_id'];\n $username = $this->info['user_username'];\n $first_name = $this->info['user_first_name'];\n\n switch ( true ) {\n // Help file\n case preg_match( '/\\b(' . $this->lang['command']['help'] . ')\\b/iu', $this->info['msg_text'] ):\n $path = $_SERVER['DOCUMENT_ROOT'] . $this->lang['respond']['help_file'];\n $tmpl = file_get_contents( $path, true );\n $karma_plus = $this->lang['command']['karma_plus'][0];\n $lies = $this->lang['command']['lies'][0];\n $find = [ \n '{{ url }}', '{{ bot_name }}', '{{ chat_name }}',\n '{{ ask_bio }}', '{{ save_bio }}', '{{ karma }}',\n '{{ add_sticker }}', '{{ add_set }}', '{{ my_stickers }}',\n '{{ all_stickers }}','{{ karma_plus }}','{{ karma_minus }}', \n '{{ lies }}', '{{ not_liar }}',\n ];\n $replace = [ \n 'url' => 'github.com/junkym0nk3y/TS-telegram-bot/',\n 'bot_name' => $this->bot['first_name'], \n 'chat_name' => $this->info['chat_title'],\n 'ask_bio' => $this->lang['command']['ask_bio'],\n 'save_bio' => $this->lang['command']['save_bio'], \n 'karma' => $this->lang['command']['karma'],\n 'add_sticker' => $this->lang['command']['add_sticker'],\n 'add_set' => $this->lang['command']['add_set'],\n 'my_stickers' => $this->lang['command']['my_stickers'],\n 'all_stickers' => $this->lang['command']['all_stickers'],\n 'karma_plus' => $karma_plus,\n 'karma_minus' => $this->lang['command']['karma_minus'][0],\n 'lies' => $lies,\n 'not_liar' => $this->lang['command']['not_liar'],\n ];\n return str_replace( $find, $replace, $tmpl );\n case preg_match( '/\\b(' . $this->lang['command']['karma'] . ')\\b/iu', $this->info['msg_text'] ):\n return $this->userKarma( $user_id, $username ); // Karma\n case preg_match( '/\\b(' . $this->lang['command']['ask_bio'] . ')\\b/iu', $this->info['msg_text'] ):\n return $this->userBio( $user_id, $username ); // Bio \n case preg_match( '/\\b(' . $this->lang['command']['add_set'] . ')\\b/iu', $this->info['msg_text'] ):\n $file = $_SERVER['DOCUMENT_ROOT'] . '/style/sticker_logo.png';\n $slugify = $this->slugifySet( $this->lang['command']['add_set'] );\n if ( mb_strlen($slugify[0]) < 4 ) {\n return $this->lang['respond']['sticker']['change_setname'];\n } else\n return $this->newStickerSet( $file, $slugify ); // Add new stickerset\n case preg_match( '/\\b(' . $this->lang['command']['add_sticker2'] . ')\\b/iu', $this->info['msg_text'] ):\n case preg_match( '/\\b(' . $this->lang['command']['add_sticker'] . ')\\b/iu', $this->info['msg_text'] ):\n return $this->lang['respond']['sticker']['noreply']; // Add new sticker \n case preg_match( '/\\b(' . $this->lang['command']['my_stickers'] . ')\\b/iu', $this->info['msg_text'] ):\n $owner_id = $user_id;\n case preg_match( '/\\b(' . $this->lang['command']['all_stickers'] . ')\\b/iu', $this->info['msg_text'] ):\n $sticker_list = $this->db->getStickerSets( $owner_id );\n if ( $sticker_list != 'no stickers' ){\n $list = '';\n foreach ( $sticker_list as $set ) {\n $find = [ '{{ url }}', '{{ title }}', '{{ total }}', '{{ owner }}', '{{ owner_id }}' ];\n $replace = [\n 'url' => 't.me/addstickers/' . $set['set_url'] . '_by_' . $this->bot['username'],\n 'title' => $set['set_title'], \n 'total' => $set['stickers'],\n 'owner' => $set['owner'],\n 'owner_id' => $set['owner_id'],\n ];\n $list .= str_replace( $find, $replace, $this->lang['respond']['sticker']['row'] );\n }\n return $this->lang['respond']['sticker']['find_sets'] . $list; // List of stickersets\n } else\n return $this->lang['respond']['sticker']['not_found']; \n case preg_match('/(\\w+) (==|===|!==|!=) (\\w+)/u', $this->info['msg_text'], $output_array);\n $random = mt_rand( 0, count($this->lang['dialog']['true_or_false']) -1 );\n return $this->lang['dialog']['true_or_false'][$random]; // True or false game\n case preg_match( '/\\b(' . $this->lang['command']['tanos'] . ')\\b/iu', $this->info['msg_text'] ):\n if ( !$this->is_admin )\n return $this->lang['respond']['not_admin'];\n\n $wait_for_collect = 60;\n $passed = $this->daysPassed( $this->db->botAddDate() );\n $days = $passed[0] . ' ' . $passed[1];\n $pattern = '/[^a-zа-яёй0-9\\@\\(\\)\\?\\,\\s\\-\\–\\.\\_\\!]/iu';\n $max_users = 70;\n $i = $to_kick = 0;\n $not_exist_users = [];\n $tmpl = $this->lang['respond']['tanos']['list'] . PHP_EOL;\n\n if ( $passed[0] <= $wait_for_collect ) {\n $find = [ '{{ days }}', '{{ wait_for_collect }}' ];\n $replace = compact( 'days', 'wait_for_collect' );\n return str_replace( $find, $replace, $this->lang['respond']['tanos']['wait_for_it'] );\n }\n\n $list = $this->db->getUsers( true, strtotime('-120 day') ); //('-1 day') );//\n\n if( $list == 'no users' )\n return $this->lang['respond']['tanos']['no_users'];\n\n $length = count( $list );\n\n foreach ( $list as $user_id => $username ) {\n $i++;\n $status = $this->tg->getStatus( $this->info['chat_id'], $user_id );\n\n switch ($status) {\n case 'administrator':\n break;\n case 'left':\n case 'kicked':\n case 'Bad Request: USER_ID_INVALID':\n $not_exist_users[] = $user_id;\n break;\n default:\n $to_kick++;\n $find = [ '{{ user_id }}', '{{ username }}' ];\n $replace = ['user_id' => $user_id, 'username' => preg_replace( $pattern, '', $username ) ];\n if ( $to_kick > 1 )\n $tmpl .= ', ';\n\n $tmpl .= str_replace( $find, $replace, $this->lang['respond']['tanos']['row'] );\n break; \n }\n \n if ( $to_kick == $max_users || $i == $length ){\n $this->db_post->kickUsers( $not_exist_users );\n \n if ( $to_kick == 0 )\n return $i . ' мёртвых душ было удалено';\n \n return $tmpl.$this->lang['respond']['tanos']['ask'];\n }\n }\n\n return 'всё пошло по пизде';\n // Bot dialogs\n case preg_match( '/\\b(' . $this->lang['dialog']['ask_1'] . ')\\b/iu', $this->info['msg_text'] ):\n return $this->lang['dialog']['answer_1'];\n case preg_match( '/\\b(' . $this->lang['dialog']['ask_2'] . ')\\b/iu', $this->info['msg_text'] ):\n return $this->lang['dialog']['answer_2'];\n case preg_match( '/\\b(' . $this->lang['dialog']['ask_3'] . ')\\b/iu', $this->info['msg_text'] ):\n case preg_match( '/\\b(' . $this->lang['dialog']['ask_4'] . ')\\b/iu', $this->info['msg_text'] ):\n return $this->lang['dialog']['answer_3_4'];\n case preg_match( '/\\b(' . $this->lang['command']['ping'] . ')\\b/iu', $this->info['msg_text'] ):\n $passed = $this->daysPassed( $this->db->botAddDate() );\n $days = $passed[0] . ' ' . $passed[1];\n $bot_name = $this->bot['first_name'];\n $help = $this->lang['command']['help'];\n $find = [ '{{ username }}', '{{ days }}', '{{ bot_name }}', '{{ help }}' ];\n $replace = compact( 'username', 'days', 'bot_name', 'help' );\n $find = [ '{{ user_id }}', '{{ username }}', '{{ days }}', '{{ bot_name }}', '{{ help }}' ];\n $replace = compact( 'user_id', 'username', 'days', 'bot_name', 'help' );\n return str_replace( $find, $replace, $this->lang['respond']['hello'] );\n default:\n exit('ok');\n }\n }", "function guild_twitch_streams() {\n\t$streamers = array( \n\t\t'phazius' \t\t\t=> 'phazius', \n\t\t'atropos' \t\t\t=> 'atropos_nyx', \n\t\t'nybling' \t\t\t=> 'nybling',\n\t\t'erlexx' \t\t\t=> 'erlexx', \n\t);\n\t$streams = array();\n\t\n\t// Check the status of each user's channel\n\tforeach ( $streamers as $user_name => $streamer ) {\n\t\t$twitch_response = @file_get_contents(\"http://api.justin.tv/api/stream/list.json?channel=\" . $streamer , 0 , null , null );\n\t\t$stream_array = json_decode( $twitch_response , true );\n\t\t$streams[$user_name] = array_pop( $stream_array );\n\t}\n\t\n\techo '<ul id=\"er-twitch-streams\">';\n\t// Loop through each channel and display some info\n\tforeach ( $streams as $user_name => $stream ) {\n\t\tif ( empty( $streams[$user_name] ) ) {\n\t\t\techo '<li class=\"er-streamer\"><a href=\"http://twitch.tv/'. $streamers[$user_name] . '\" title=\"Visit Channel\" target=\"_blank\">' . $user_name . '</a><span class=\"stream-status offline\">OFFLINE</span></li>';\n\t\t} else {\n\t\t\t$title = $streams[$user_name]['title'];\n\t\t\t$url = $streams[$user_name]['channel']['channel_url'];\n\t\t\t$count = $streams[$user_name]['stream_count'];\n\t\t\techo '<li class=\"er-streamer\"><a href=\"' . $url . '\" title=\"Now Playing: ' . $title . '\" target=\"_blank\">' . $user_name . '</a><span class=\"stream-viewers\">' . $count . '</span><span class=\"stream-status online\">ONLINE</span></li>';\n\t\t}\n\t}\n\techo '</ul>';\n}", "function msg_processing_commands($context) {\n if($context->is_callback()) {\n if(isset($context->memory[MYGAMES_SWITCH_KEY])) {\n if(!$context->verify_callback()) {\n return false;\n }\n\n if(preg_match_all('/^switch (\\d*) (0|1)$/', $context->callback->data, $matches, PREG_PATTERN_ORDER) >= 1) {\n $target_id = intval($matches[1][0]);\n $target_admin = (bool)$matches[2][0];\n\n Logger::info(\"Switching to game #{$target_id} as admin \" . b2s($target_admin), __FILE__, $context);\n\n $context->set_active_game($target_id, $target_admin);\n\n $context->comm->reply(\"Done!\");\n }\n\n $context->memory[MYGAMES_SWITCH_KEY] = null;\n\n return true;\n }\n }\n\n else if($context->is_message()) {\n $text = $context->message->text;\n\n // HELP\n if($text === '/help') {\n $context->comm->reply(__('cmd_help'));\n\n return true;\n }\n // START\n else if(starts_with($text, '/start')) {\n $payload = extract_command_payload($text);\n\n Logger::debug(\"Start command with payload '{$payload}'\", __FILE__, $context);\n\n if($payload === '') {\n // Naked /start message\n if($context->game && $context->game->group_state) {\n $context->comm->reply(__('cmd_start_registered'));\n\n msg_processing_handle_group_state($context);\n }\n else {\n $context->comm->reply(__('cmd_start_new'));\n }\n }\n else if($payload === 'test') {\n // Test message from docs website\n $context->comm->reply(__('cmd_test'));\n }\n else {\n $code_info = db_row_query(sprintf(\n \"SELECT `type`, `event_id`, `game_id`, `location_id`, `is_disabled` FROM `code_lookup` WHERE `code` = '%s'\",\n db_escape($payload)\n ));\n\n if($code_info === false) {\n $context->comm->reply(__('failure_general'));\n return true;\n }\n if($code_info == null) {\n Logger::warning(\"Unknown /start payload received: '{$payload}'\", __FILE__, $context);\n $context->comm->reply(__('cmd_start_wrong_payload'));\n return true;\n }\n else if($code_info[4] == 1) {\n // Code has been disabled\n $context->comm->reply(__('cmd_start_wrong_payload'));\n return true;\n }\n\n Logger::debug(\"Code '{$payload}' for {$code_info[0]} scanned\", __FILE__, $context);\n\n $event_id = intval($code_info[1]);\n $game_id = intval($code_info[2]);\n $location_id = intval($code_info[3]);\n\n switch($code_info[0]) {\n case 'creation':\n Logger::debug(\"Creation code scanned for event #{$event_id}\", __FILE__, $context);\n\n msg_processing_init_game_creation($context, $event_id);\n\n break;\n\n case 'registration':\n Logger::debug(\"Registration code scanned for game #{$game_id}\", __FILE__, $context);\n\n $result = bot_register($context, $game_id);\n if($result === true) {\n $context->comm->reply(__('cmd_register_confirm'));\n msg_processing_handle_group_state($context);\n }\n else if($result === 'already_registered') {\n $context->comm->reply(__('cmd_register_registered'));\n msg_processing_handle_group_state($context);\n }\n else if($result === 'unallowed_event_not_ready') {\n $context->comm->reply(__('cmd_register_game_unallowed_event_not_ready'));\n }\n else if($result === 'unallowed_event_over') {\n $context->comm->reply(__('cmd_register_game_unallowed_event'));\n }\n else if($result === 'unallowed_game_over') {\n $context->comm->reply(__('cmd_register_game_unallowed'));\n }\n else if($result === 'unallowed_game_not_ready') {\n $context->comm->reply(__('cmd_register_game_unallowed_not_ready'));\n }\n else {\n $context->comm->reply(__('failure_general'));\n }\n break;\n\n case 'location':\n Logger::debug(\"Location code scanned for location #{$location_id}, game #{$game_id}\", __FILE__, $context);\n\n $result = bot_reach_location($context, $location_id, $game_id);\n if($result === false) {\n $context->comm->reply(__('failure_general'));\n }\n else if($result === 'unexpected') {\n $context->comm->reply(__('cmd_start_location_unexpected'));\n }\n else if($result === 'wrong') {\n $context->comm->reply(__('cmd_start_location_wrong'));\n }\n else if($result === 'unallowed_event_not_ready') {\n $context->comm->reply(__('failure_event_not_ready'));\n }\n else if($result === 'unallowed_event_over') {\n $context->comm->reply(__('failure_event_over'));\n }\n else if($result === 'unallowed_game_not_ready') {\n $context->comm->reply(__('failure_game_not_ready'));\n }\n else if($result === 'unallowed_game_over') {\n $context->comm->reply(__('failure_game_dead'));\n }\n else {\n if($result === 'first') {\n $context->comm->reply(__('cmd_start_location_reached_first'));\n }\n else if($result === 'last') {\n $context->comm->reply(__('cmd_start_location_reached_last'));\n }\n else {\n $context->comm->reply(__('cmd_start_location_reached'));\n }\n\n msg_processing_handle_group_state($context);\n }\n break;\n\n case 'victory':\n Logger::debug(\"Victory code scanned for game #{$game_id}, event #{$event_id}\", __FILE__, $context);\n\n msg_process_victory($context, $event_id, $game_id);\n\n break;\n\n default:\n Logger::error(\"Code '{$payload}' matches unknown type {$code_info[0]}\", __FILE__, $context);\n\n $context->comm->reply(__('cmd_start_wrong_payload'));\n\n break;\n }\n }\n\n return true;\n }\n // STATUS\n else if($text === '/status') {\n if(!$context->game) {\n $context->comm->reply(\"You are new to me. Hello! 🙂\");\n return true;\n }\n\n $status = \"%FIRST_NAME%, you are \" . (($context->game->is_admin) ? '<b>administering</b>' : 'playing') . \" game <code>#%GAME_ID%</code> “%GAME_NAME%”, in the event <code>#%EVENT_ID%</code> “%EVENT_NAME%”.\\n\";\n\n if($context->game->is_admin) {\n $status .= 'The game is <code>' . map_state_to_string(GAME_STATE_READABLE_MAP, $context->game->game_state) . '</code>.';\n }\n else {\n $status .= 'Your team “%GROUP_NAME%” is in state: <code>' . map_state_to_string(STATE_READABLE_MAP, $context->game->group_state) . '</code>.';\n }\n\n $context->comm->reply($status);\n\n return true;\n }\n // MY GAMES\n else if($text === '/mygames') {\n $games = bot_get_associated_games($context);\n\n $text = '';\n $game_keyboard = array();\n $seen_admin = false;\n $seen_player = false;\n $i = 0;\n foreach($games as $game) {\n if($game[3] && !$seen_admin) {\n $seen_admin = true;\n $text .= \"👑 <b>Administered games:</b>\\n\";\n }\n if(!$game[3] && !$seen_player) {\n $seen_player = true;\n $text .= \"👤 <b>Played games:</b>\\n\";\n }\n\n $text .= \"<code>#{$game[0]}</code> \" . (($game[1]) ? \"“{$game[1]}”\" : \"No name\") . \" (\" . map_state_to_string(GAME_STATE_READABLE_MAP, $game[2]) . \")\";\n if($context->game->game_id == $game[0] && $context->game->is_admin == $game[3]) {\n $text .= \" ✅\";\n }\n\n $text .= \"\\n\";\n\n if($i % 3 == 0) {\n $game_keyboard[] = array();\n }\n $game_keyboard[sizeof($game_keyboard) - 1][] = array(\n 'text' => (($game[3]) ? '👑 Admin #' : '👤 Play #') . $game[0],\n 'callback_data' => \"switch {$game[0]} \" . (int)$game[3]\n );\n $i++;\n }\n\n $text .= \"\\nTo which game do you want to switch?\";\n\n $context->memorize_callback($context->comm->reply($text, null, array(\n 'reply_markup' => array(\n 'inline_keyboard' => $game_keyboard\n )\n )));\n\n $context->memory[MYGAMES_SWITCH_KEY] = true;\n\n return true;\n }\n }\n\n return false;\n}", "public function channel()\n {\n }", "function process_unlock_perk($socket, $data)\n{\n global $player_array;\n\n if ($socket->process === true) {\n list($slug, $user_id, $guild_id, $user_name, $quantity) = explode('`', $data);\n $user_id = (int) $user_id;\n $guild_id = (int) $guild_id;\n start_perk($slug, $user_id, $guild_id, time() + ($quantity * 3600));\n $player = id_to_player($user_id, false);\n $display_name = userify($player, $user_name);\n\n if ($guild_id !== 0) {\n if (strpos($slug, 'guild_') === 0) {\n $type = ucfirst(explode('_', $slug)[1]);\n $duration = format_duration($quantity * 3600);\n $msg = \"$display_name unlocked $type mode for your guild for $duration!\";\n send_to_guild($guild_id, \"systemChat`$msg\");\n } elseif ($slug === 'happy_hour') {\n global $chat_room_array;\n\n $hh_lang = $quantity > 1 ? \"$quantity Happy Hours\" : 'a Happy Hour';\n if (isset($chat_room_array['main'])) {\n $main = $chat_room_array['main'];\n $main->sendChat(\"systemChat`$display_name just triggered $hh_lang!\");\n foreach ($player_array as $player) {\n if (isset($player->chat_room) && $player->chat_room !== $main) {\n $player->write(\"systemChat`$display_name just triggered $hh_lang!\");\n }\n }\n } else {\n sendToAll_players(\"systemChat`$display_name just triggered $hh_lang!\");\n }\n }\n }\n\n $socket->write('{\"status\":\"ok\"}');\n }\n}", "public static function chatbot()\n {\n // no code needed.\n }", "public function testChannelsReplies()\n {\n }", "public function run()\n\t{\n\t\tif (count($this->liste_attente) > 0)\n\t\t\t$this->analyser_liste_attente();\n\n\t\t// Envoyer une rumeur de temps en temps\n\t\tif ($this->enabled)\n\t\t\t$this->lancer_rumeur();\n\n\t\t// Vérifier les derniers sujets du tobozon\n\t\tif ($this->enabled)\n\t\t\t$this->verifier_tobozon();\n\n\t\t// Vérifier les dernières parties de plouk\n\t\tif ($this->enabled)\n\t\t\t$this->verifier_plouk();\n\n\t\t// On regarde si il faut recharger la config\n\t\tif (file_exists('update_config'))\n\t\t{\n\t\t\t$this->lire_config();\n\t\t\t@unlink('update_config');\n\t\t}\n\t\t\t\n\t\t// On enlève les chut ban qui ont fait leur temps\n\t\t$this->supprimer_chut_bans();\n\t\t\n\t\tif ($this->buffer() === false)\n\t\t\treturn;\n\t\t\t\n\t\tswitch ($this->buffer('event'))\n\t\t{\n\t\t\t// On dit bonjour aux nouveaux arrivants\n\t\t\tcase 'JOIN':\n\t\t\t\tif ($this->buffer('text') == $this->bot->config('chan') && $this->enabled)\n\t\t\t\t{\n\t\t\t\t\tif ($this->autovoice)\n\t\t\t\t\t\t$this->command('MODE '.$this->bot->config('chan').' +v '.$this->buffer('nick'));\n\n\t\t\t\t\t$this->ajouter_bonjour();\n\t\t\t\t\t$this->lignes[$this->buffer('nick')] = '';\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// On réponds aux messages\n\t\t\tcase 'PRIVMSG':\n\t\t\t\t// Message privé\n\t\t\t\t$params = $this->buffer('params');\n\t\t\t\t\n\t\t\t\tif ($params[0] == $this->bot->config('nick'))\n\t\t\t\t\t$this->analyse_prive();\n\n\t\t\t\t// On analyse les messages publiques\n\t\t\t\telse if ($params[0] == $this->bot->config('chan'))\n\t\t\t\t{\n\t\t\t\t\tif ($this->enabled)\n\t\t\t\t\t\t$this->analyse_publique();\n\n\t\t\t\t\t$this->lignes[$this->buffer('nick')] = $this->buffer('text');\n\t\t\t\t\t$this->analyse_admin();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tbreak;\n\n\t\t\t// Notices\n\t\t\tcase 'NOTICE':\n\t\t\t\t$params = $this->buffer('params');\n\n\t\t\t\tif ($params[0] == $this->bot->config('nick'))\n\t\t\t\t\t$this->analyse_admin();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'KICK':\n\t\t\t\t// On rejoint le chan si le bot se fait kicker\n\t\t\t\t$params = $this->buffer('params');\n\t\t\t\t\n\t\t\t\tif ($params[0] == $this->bot->config('chan') && $params[1] == $this->bot->config('nick'))\n\t\t\t\t{\n\t\t\t\t\t$this->bot->join_chan();\n\t\t\t\t\t$this->ajouter_liste_attente('Merci beaucoup '.$this->buffer('nick').'...', 3);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "private function send_msg() {\r\n }", "public function execute() {\n \n $message = $this->getMessage(); // Get Message object\n\n $chat_id = $message->getChat()->getId(); // Get the current Chat ID\n $nama = $message->getFrom()->getFirstName() .' '. $message->getFrom()->getLastName();\n\t$host = trim($message->getText(true));\n\n\tif($host === '') {\n\t\t$host = \"ilkom2017bot.herokuapp.com\";\n\t}\n \n $start = microtime(true);\n \t$fp = fsockopen($host, 80, $errorCode, $errorCode, 5);\n \t$end = microtime(true);\n \t\tif($fp === false){\n \t\t$hasil = \"Koneksi gagal\";\n \t\t}\n \tfclose($fp);\n \t$diff = $end - $start;\n\t$hasil = $diff * 1000 . \" ms\";\n\t\n\t$text = \"Hasil: $hasil\";\n\t\n Request::sendChatAction([\n \n 'chat_id'=> $chat_id,\n 'action' => 'typing'\n ]);\n \n $kirimpesan = [\n 'chat_id' => $chat_id,\n 'parse_mode' => 'HTML',\n 'text' => $text\n ];\n \n return Request::sendMessage($kirimpesan);\n }", "function meditation() {\n$header = new header();\n$header->music(\"Nhạc thiền\");\n\nif(isset($_REQUEST['id'])){\n\tif($_REQUEST['id']=='nhacphat')\n\t{\n\t\t$url='http://nhacthien.net/nhacphat.htm';\n\t}\n}\n\nelse {\n$path = \"/\";\n$url=\"http://www.nhacthien.net/\";\n}\n$indexpage = \"?nhacthien\"; \n\n$trans= new web_transfer();\n$indexpage='/';\n$base='/';\n$trans->initiate_news ($url,$indexpage); \n$trans->converturl($url,$base);\n$content ='';\n$trans->start_transfer(\"www.nhacthien.net\");\n$trans->getcontent($content);\n\n//start social plugin\n$content=str_replace('<div id=\"controls\">','<div class=\"social\"><a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-lang=\"en\">Tweet</a><div data-size=\"medium\" class=\"g-plusone\"></div><div class=\"fb-like\" data-href=\"http://myweb.pro.vn/music/meditation/\" data-layout=\"button_count\" data-action=\"recommend\" data-show-faces=\"true\" data-share=\"true\"></div></div>',$content);\n//end social plugin\n\n//hide right element\n$content=str_replace('<a href=\"\" class=\"music-button\">','<a href=\"http://myweb.pro.vn/music/meditation/\" class=\"music-button\">',$content);\n$content=str_replace('<a href=\"xem-video.html\" class=\"video-button\">','<a href=\"xem-video.html\" style=\"display:none\" class=\"video-button\">',$content);\n//end\n\n$content=str_replace('<li><a href=\"http://www.cakhucbathu.com\">CA KHÚC BẤT HỦ</a></li>','<li style=\"dislay:none\" id=\"cakhucbathu\"><a href=\"http://www.cakhucbathu.com\">CA KHÚC BẤT HỦ</a></li><script>document.getElementById(\"cakhucbathu\").remove();</script>',$content);\n$content=str_replace('<li><a href=\"http://www.petalia.org\">PETALIA NETWORK</a>','<a style=\"display:none\" id=\"petalia_temp_remove\" href=\"http://www.petalia.org\">PETALIA NETWORK</a></li><script>document.getElementById(\"petalia_temp_remove\").remove();</script>',$content);\n$content=str_replace('<div id=\"social\">','<div id=\"social\" style=\"display:none\">',$content);\n$content=str_replace('style=\"width:100%;display:inline-block;\"','id=\"fb_album_remove\" style=\"display:none\"',$content);\n$content=str_replace('http://www.facebook.com/nhackhongloi','https://www.facebook.com/elearningsocialvn?ref=hl',$content);\n\n//start change the url\n$content=str_replace('<a href=\"http://www.nhacthien.net\">TRỞ LẠI NHẠC THIỀN</a>','<a href=\"http://myweb.pro.vn/music/meditation/\">TRỞ LẠI NHẠC THIỀN</a>',$content);\n$content=str_replace('<a href=\"http://www.mangamnhac.net\">MẠNG ÂM NHẠC</a>','<a href=\"http://myweb.pro.vn/music/general/\">TỔNG HỢP</a>',$content);\n$content=str_replace('Nhạc thiền trên Facebook','Học tập và giải trí',$content);\n$content=str_replace('data-href=\"http://nhacthien.net\"','data-href=\"http://myweb.pro.vn/music/meditation/\"',$content);\n$content=str_replace('www.facebook.com/nhacthien','www.facebook.com/elearningsocialvn?ref=hl',$content);\n$content=str_replace('nhackhongloi.org','myweb.pro.vn/music/nhackhongloi',$content);\n$content=str_replace('www.tinhkhucbathu.com','myweb.pro.vn/music/tinhkhucbathu',$content);\n$content=str_replace('www.nhacphap.com','myweb.pro.vn/music/nhacphap',$content);\n$content=str_replace('http://nhacthien.net/nhacphat.htm','http://myweb.pro.vn/music/meditation?id=nhacphat',$content);\n$content=str_replace('www.nhacdance.net','myweb.pro.vn/music/dance/',$content);\n//end change the url\n\n$content=str_replace('/skins','http://www.nhackhongloi.org/skins/',$content);\n$content=str_replace('</body>','<p class=\"append_footer_iframe\"><p/></body>',$content);\npreg_match_all('/<body>(.*?)<p class=\"append_footer_iframe\">/s',$content,$matches,PREG_SET_ORDER);\nforeach($matches as $key_music);\n$data['content']=$key_music[0];\n//start analytic\n$analytic = new analytic();\n$analytic->myweb('general');\n//end analytic\n$this->load->view('/music/nhacthien',$data);\n}", "function startRelaying() { }", "protected function send() {}", "protected function collectDataTalk()\n {\n $threadURL = $this->getInput('url');\n $onlyWithUrl = $this->getInput('only_with_url');\n\n // Get Thread ID from url passed in parameter\n $threadSearch = preg_match('/-([0-9]{1,20})$/', $threadURL, $matches);\n\n // Show an error message if we can't find the thread ID in the URL sent by the user\n if ($threadSearch !== 1) {\n returnClientError($this->i8n('thread-error'));\n }\n $threadID = $matches[1];\n\n $url = $this->i8n('bridge-uri') . 'graphql';\n\n // Get Cookies header to do the query\n $cookies = $this->getCookies($url);\n\n // GraphQL String\n // This was extracted from https://www.dealabs.com/assets/js/modern/common_211b99.js\n // This string was extracted during a Website visit, and minified using this neat tool :\n // https://codepen.io/dangodev/pen/Baoqmoy\n $graphqlString = <<<'HEREDOC'\nquery comments($filter:CommentFilter!,$limit:Int,$page:Int){comments(filter:$filter,limit:$limit,page:$page){\nitems{...commentFields}pagination{...paginationFields}}}fragment commentFields on Comment{commentId threadId url \npreparedHtmlContent user{...userMediumAvatarFields...userNameFields...userPersonaFields bestBadge{...badgeFields}}\nreactionCounts{type count}deletable currentUserReaction{type}reported reportable source status createdAt updatedAt \nignored popular deletedBy{username}notes{content createdAt user{username}}lastEdit{reason timeAgo userId}}fragment \nuserMediumAvatarFields on User{userId isDeletedOrPendingDeletion imageUrls(slot:\"default\",variations:\n[\"user_small_avatar\"])}fragment userNameFields on User{userId username isUserProfileHidden isDeletedOrPendingDeletion}\nfragment userPersonaFields on User{persona{type text}}fragment badgeFields on Badge{badgeId level{...badgeLevelFields}}\nfragment badgeLevelFields on BadgeLevel{key name description}fragment paginationFields on Pagination{count current last\n next previous size order}\nHEREDOC;\n\n // Construct the JSON object to send to the Website\n $queryArray = [\n 'query' => $graphqlString,\n 'variables' => [\n 'filter' => [\n 'threadId' => [\n 'eq' => $threadID,\n ],\n 'order' => [\n 'direction' => 'Descending',\n ],\n\n ],\n 'page' => 1,\n ],\n ];\n $queryJSON = json_encode($queryArray);\n\n // HTTP headers\n $header = [\n 'Content-Type: application/json',\n 'Accept: application/json, text/plain, */*',\n 'X-Pepper-Txn: threads.show',\n 'X-Request-Type: application/vnd.pepper.v1+json',\n 'X-Requested-With: XMLHttpRequest',\n $cookies,\n ];\n // CURL Options\n $opts = [\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $queryJSON\n ];\n $json = getContents($url, $header, $opts);\n $objects = json_decode($json);\n foreach ($objects->data->comments->items as $comment) {\n $item = [];\n $item['uri'] = $comment->url;\n $item['title'] = $comment->user->username . ' - ' . $comment->createdAt;\n $item['author'] = $comment->user->username;\n $item['content'] = $comment->preparedHtmlContent;\n $item['uid'] = $comment->commentId;\n // Timestamp handling needs a new parsing function\n if ($onlyWithUrl == true) {\n // Count Links and Quote Links\n $content = str_get_html($item['content']);\n $countLinks = count($content->find('a[href]'));\n $countQuoteLinks = count($content->find('a[href][class=userHtml-quote-source]'));\n // Only add element if there are Links ans more links tant Quote links\n if ($countLinks > 0 && $countLinks > $countQuoteLinks) {\n $this->items[] = $item;\n }\n } else {\n $this->items[] = $item;\n }\n }\n }", "function sen_sms($to,$text)///ส่ง sms\n{ //create client with api key and secret\n $rest = substr($to, 1);\n $client = new Nexmo\\Client(new Nexmo\\Client\\Credentials\\Basic('c21feb7d', 'yrxEwwXERXj8yv7L'));\n $message = $client->message()->send([\n 'to' => '66'.$rest,\n 'from' => 'RFLpang',\n 'text' => $text,\n 'type' => 'unicode'\n ]);\n //array access provides response data\n //echo \"Sent message to \" . $message['to'] . \". Balance is now \" . $message['remaining-balance'] . PHP_EOL;\n\n return \"Sent message to \" . $message['to'] . \". Balance is now \" . $message['remaining-balance'] . PHP_EOL;\n}", "function usage()\n{\nob_start(); \n?>\nCheck whether PM in 'sent' folder is read by recipient.\nParameters (use one of them):\nmessage_id - ID of private messsage (provided by Friends module as {message_id})\ncopy_id - ID of PM copy in 'sent' folder (provided by Messaging module as {message_id})\n\nReturns tagdata if message is read, and no results if it's not read yet.\n\n{exp:messaging:private_messages folder=\"sent\"}\n{exp:is_message_read:check copy_id=\"{message_id}\"}\n{if no_results}\n&lt;div class=\"unread\"&gt;\n{/if}\n&lt;div class=\"read\"&gt;\n{/exp:is_message_read:check}\n{subject}&lt;/div&gt;\n{/exp:messaging:private_messages}\n\n<?php\n$buffer = ob_get_contents();\n\t\nob_end_clean(); \n\nreturn $buffer;\n}", "protected abstract function _message();", "function printDirectMessages($settings)\r\n{\r\n$url = 'https://api.twitter.com/1.1/direct_messages/sent.json';\r\n$getfield = '?count=20';\r\n$requestMethod = 'GET';\r\n$twitter = new TwitterAPIExchange($settings);\r\n$string = json_decode($twitter->setGetfield($getfield)\r\n->buildOauth($url, $requestMethod)\r\n->performRequest(),$assoc = TRUE);\r\n\r\nforeach($string as $items)\r\n {\r\n echo \"Recipient \".$items['recipient_screen_name'].\"<br />\";\r\n echo \"Message\". $items['text'].\"<br /><hr />\";\r\n }\r\n}", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n $this->logMessage($postStr);\n\n $messageHandler=new MessageHandler();\n $messageBase=$messageHandler.serialize($postStr);\n $messageToReturn=new MessageBase();\n $messageToReturn->ToUserName=$messageBase->FromUserName;\n $messageToReturn->FromUserName=$messageBase->ToUserName;\n $messageToReturn->CreateTime=time();\n\n if($messageBase->MsgType == \"text\"){\n $messageToReturn->MsgType=\"image\";\n $messageBase->Message=new imageMessage();\n $stor = new SaeStorage();\n $url = $stor->getUrl($domain,$fileDataName);\n $messageBase->Message->PicUrl=$url;\n\n }else{\n $messageToReturn->MsgType=\"text\";\n $messageBase->Message=new textMessage();\n $messageBase->Message->Content=\"try send text message.\";\n\n }\n\n echo $messageHandler->deserialize($messageToReturn);\n/*\n\n\n //extract post data\n if (!empty($postStr)){\n\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml><ToUserName><![CDATA[%s]]></ToUserName><FromUserName><![CDATA[%s]]></FromUserName><CreateTime>%s</CreateTime><MsgType><![CDATA[%s]]></MsgType><Content><![CDATA[%s]]></Content></xml>\"; \n if(!empty( $keyword ))\n {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else{\n echo \"Input something...\";\n }\n\n }else {\n echo \"\";\n exit;\n }*/\n}", "public function execute() {\n\t\t// a mistake and did a negative, or you were trying to un-mute someone. I'll be nice about it\n\t\t// and let the mod/admin know what to do.\n\t\tif ($this->time < 0) {\n\t\t\t$chat = new WhisperCommand($this->server, ServerChatClient::getClient(), array($this->client),\n\t\t\t\t\"Cannot give a negative mute. Use /unmute <display name> to un-mute someone.\");\n\t\t\t$chat->execute();\n\n\t\t\treturn;\n\t\t}\n\n\t\t// If the person isn't muted yet, message them privately so we don't have a bunch of folks\n\t\t// bitch about why someone was muted. Don't make it public knowledge.\n\t\tif (!$this->recipient->isMuted()) {\n\t\t\t$chat = new WhisperCommand($this->server, ServerChatClient::getClient(), array($this->recipient),\n\t\t\t\t\"You have been muted for spam/offensive chat.\");\n\t\t\t$chat->execute();\n\t\t}\n\n\t\t// Add time on the recipient so that they can get the punishment that they deserve.\n\t\t$this->recipient->addMuteTime($this->time);\n\n\t\t// Message the administrator or moderator that the mute has successfully gone through.\n\t\t$chat = new WhisperCommand($this->server, ServerChatClient::getClient(), array($this->client),\n\t\t\t\"You have successfully muted \" . $this->recipient->getDisplayName() . \".\");\n\t\t$chat->execute();\n\t}", "public function user_conversation_fun(){\n require_once REALTEO_PLUGIN_DIR . '/includes/user_conversation.php';\n }", "function mars_video_meta() {}", "function messager($m){\r\n\t\tif($m['immediacy']){\r\n\t\t\t$this->boinkIt($m['url']);\r\n\t\t}else {\r\n\t\t\tif($m['goon']){\r\n\t\t\t\tif($m['hl'] == '')$m['hl'] = 'hlRed';\r\n\t\t\t\treturn array($m['title'], $m['text'], $m['hl']);\r\n\t\t\t}else {\r\n\t\t\t\t$w = str_replace(\"<%TITLE%>\", $m['title'], $this->skin->wrapMsg);\r\n\t\t\t\t$w = str_replace(\"<%TEXT%>\", $m['text'], $w);\r\n\t\t\t\t$w = str_replace(\"<%URL%>\", $m['url'], $w);\r\n\t\t\t\t$w = str_replace(\"<%SEC%>\", $m['sec'], $w);\r\n\t\t\t\t$this->export($w);\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function get_mention(){retrun($id_local_mention); }", "function mark_human($socket, $data) {\r\n\tif($socket->process == true) {\r\n\t\t$ip = $data;\r\n\t\tglobal $player_array;\r\n\t\tforeach( $player_array as $player ) {\r\n\t\t\tif($player->ip == $ip && $player->human == false) {\r\n\t\t\t\t$player->human = true;\r\n\t\t\t\t$exp_gain = $player->hostage_exp_points + 250;\r\n\t\t\t\t$player->inc_exp($exp_gain);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function OGSPlugin_Traitement_Galaxyraw(){\r\n\r\n\tglobal $db, $fp, $is_ogsplugin, $pub_galaxy, $pub_system, $pub_content, $pub_who, $who, $pub_what, $what, $ogspy_server_version, $log_ogsgalview, $system, $galaxy;\r\n\t$lines = stripslashes(utf8_decode($pub_content));\r\n\tif (defined(\"OGS_PLUGIN_DEBUG\")) fwrite($fp,\"galaxyraw: \".$lines.\"\\n\");\r\n\t$lines = explode(chr(10), $lines);\r\n\t$system_added = galaxy_system($lines);\r\n\t// voir majs stats galaxy\r\n\t//log_(\"load_system\", array($galaxy, $system));\r\n\t//log_plugin_(\"load_system\",$num_spyadded);\r\n\tif (isset($system_added[0]) && $system_added[0]!=\"\" && isset($system_added[1]) && $system_added[1]!=\"\") {\r\n\t\tif ($log_ogsgalview==true)\r\n\t\t\tlog_plugin_(\"load_system_OGS\", array($galaxy.\":\".$system. \"(\".$system_added[0].\":\".$system_added[1].\")\", /*$system_added[0].\":\".$system_added[1]*/(((int)$system_added[0]==$galaxy && (int)$system_added[1]==$system)? 15:0 ) ));\r\n\t\tSendHttpStatusCode(\"701\");\r\n\t}\r\n\tSendHttpStatusCode(\"702\");\r\n}", "function replyMessage ($message) {\n /*\n * Instantiate Recast.AI SDK, just for connect service\n */\n $request = Client::Request($_ENV[\"REQUEST_TOKEN\"]);\n\n /*\n * Get text from message received\n */\n $text = $message->content;\n\n /*\n * Get senderId to catch unique conversation_token\n */\n $senderId = $message->senderId;\n\n /*\n * Call Recast.AI SDK, through /converse route\n */\n $response = $request->converseText($text, [ 'conversation_token' => $senderId ]);\n\n /*\n * Here, you can add your own process.\n * Ex: You can call any external API\n * Or: Update your DB\n * etc...\n */\n $server = \"localhost\";\n$dbusername = \"root\";\n$dbpassword = \"root\";\n$dbname = \"phplms\";\nif ($response->action->slug == 'greetings') {\n // Do your code\necho \"Greetings User!\";\n\n\n$usernametext = \"sid\";\n$passwordtext = \"sid\";\n//array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n\n$conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\n// Check connection\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n} \nelse{\n$sql = \"SELECT * from register where username = 'sid' and password = 'sid';\";\n$result = $conn->query($sql);\n\n//if ($result->num_rows > 0) {\nif($result!=null){\n //array_push($response->replies, \"Inside rows > 0\");\n // output data of each row\n while($row = $result->fetch_assoc()) {\n //array_push($response->replies, \"Inside While\");\n //echo \"id: \" . $row[\"id\"]. \" - Name: \" . $row[\"firstname\"]. \" \" . $row[\"lastname\"]. \"<br>\";\n if($usernametext==$row[\"username\"]){\n if($passwordtext==$row[\"password\"]){\n //session_start();\n echo \"User found! Username = \".$row['username'].\"\\n\";\n echo \"Password = \".$row['password'].\"\\n\";\n //array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n //$_SESSION['username']=$usernametext;\n //$_SESSION['name']=$row[\"name\"];\n //header('Location: Auth.php');\n $conn->close();\n //exit;\n }\n }\n }\n}\nelse{\n echo \"0 results\";\n $conn->close();\n}\n}\n}\n\nif ($response->action->slug == 'online-test-marks') {\n $sql = \"\";\n $test_number = $response->memory->number->scalar;\n $username = $response->memory->username->value;\n if($username==null){\n array_push($response->replies, \"Code : Username is missing\");\n }\n //array_push($response->replies, \"Test number = \".$test_number);\n else if($test_number==null){\n //array_push($response->replies, \"Test number null\");\n\n \n }else{\n $sql = \"select * from onlinetest\".$test_number.\" where username = '\".$username.\"';\";\n $conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n} \nelse{\n$result = $conn->query($sql);\n\n//if ($result->num_rows > 0) {\nif($result!=null){\n array_push($response->replies, \"Your onlinetest\".$test_number.\" marks :\");\n // output data of each row\n while($row = $result->fetch_assoc()) {\n //echo \"id: \" . $row[\"id\"]. \" - Name: \" . $row[\"firstname\"]. \" \" . $row[\"lastname\"]. \"<br>\";\n array_push($response->replies, $row[\"cname\"].\" - \".$row[\"marks\"]);\n }\n }\n}\n}\n}\n\nif ($response->action->slug == 'login-1') {\n\n\n$usernametext = $response->memory->username->value;\n$passwordtext = $response->memory->password->value;\narray_push($response->replies, \"Username :\".$usernametext.\"END Password :\".$passwordtext.\"END\");\n//array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n//$result = null;\n$conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\n// Check connection\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n}\nelse{\n$sql = \"SELECT * from register where username = '.$usernametext.' and password = '.$passwordtext.';\";\n$result = $conn->query($sql);\narray_push($response->replies, \"No. of rows : \".mysqli_num_rows($result));\n//if ($result->num_rows > 0) {\nif($result!=null){\n//if(mysqli_num_rows($result)>0){\n array_push($response->replies, \"Code : Successfully logged in as \".$usernametext);\n array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n $conn->close();\n}\nelse{\n array_push($response->replies, \"Code : Username or password is wrong! Please log in again.\");\n $conn->close();\n}\n}\n}\n\nif ($response->action->slug == 'my-details') {\n $usernametext = $response->memory->username->value;\n $passwordtext = $response->memory->password->value;\n array_push($response->replies, \"Username : \".$usernametext.\" Password : \".$passwordtext);\n }\n /*\n * Add each replies received from API to replies stack\n */\n foreach ($response->replies as $reply) {\n $message->addReply([(object)['type' => 'text', 'content' => $reply]]);\n }\n\n $message->reply();\n}", "function process_unlock_set_djinn($socket, $data)\n{\n if ($socket->process === true) {\n $user_id = $data;\n $player = id_to_player($user_id, false);\n if (isset($player)) {\n $player->gainPart('head', 35, true);\n $player->gainPart('body', 35, true);\n $player->gainPart('feet', 35, true);\n $player->gainPart('eHead', 35);\n $player->gainPart('eBody', 35);\n $player->gainPart('eFeet', 35);\n $player->sendCustomizeInfo();\n }\n $socket->write('{\"status\":\"ok\"}');\n }\n}", "function foward_message($msg) {\n\n\t\tglobal $front_queue_get, $back_queue_get, $file_back;\n\n\t\t// this is what will be called when a new message is received from\n\t\t// the next consumer.\n\t\t$func = function($str) {\n global $front_queue_get, $back_queue_get;\n\n\t\t\techo \" [x] Received from server in '$back_queue_get' : $str\\n\";\n\n\t\t\t$body = \"NULL\";\n\t\t\tif ($str && $str != \"NULL\")\n\t\t\t\t$body = format_body($str);\n\n\t\t\techo \" [x] Forwarded to client in '$front_queue_get' : $body\\n\";\n\t\t\treturn $body;\n\t\t};\n\t\t// end of function\n\n\t\techo \" [x] Received from client in '$front_queue_get' : $msg\\n\";\n\n\t\t// replace an underscores with spaces\n\t\t$refined_title = refine_title($msg);\n\n\t\techo \" [x] Forwarded to server in '$back_queue_get' : $refined_title\\n\";\n\n\t\t// $rpcClient = new RpcClient($file_back);\n\t\tglobal $rpcClient;\n\t\t$response = $rpcClient->call($back_queue_get, $refined_title, $func);\n\n\t\treturn $response;\n\n\t}", "function sms_messenger($sms){\n\n//username from SMSAPI\n $username = 'bsgh-iquipe';\n//or 'password' => md5('open-text-password'),\n $password = 'passwd82';\n//destination number\n $to = $sms['to'];\n//sender name has to be active\n $from = 'smartpay';\n//message content\n $message = $sms['msg'];\n//API http\n\n $url = 'http://sms.bernsergsolutions.com:8080/bulksms/bulksms?';\n\n $c = curl_init();\n curl_setopt($c,CURLOPT_URL,$url);\n curl_setopt($c,CURLOPT_POST,true);\n curl_setopt($c,CURLOPT_POSTFIELDS, 'username='.$username.\n '&password='.$password.\n '&type=0&dlr=1&destination='.$to.\n '&source='.$from.\n '&message='.$message);\n curl_setopt($c,CURLOPT_RETURNTRANSFER,true);\n $content = curl_exec($c);\n curl_close($c);\n//echo $content;\n\n $str_total = strlen($content);\n $text = 4 - $str_total;\n\n $msg = substr($content,0,$text);\n\n if ($msg == 1701){\n\n return true;\n }else{\n return false;\n }\n}", "function medias_autoriser(){}", "public function telegram($mensagem) {\n// Criar bot na api do telegram\n$tele_key = \"1339299608:AAHtPXXEh4nqdlDbdhKfasSw8RtfYULn9mo\";\n// ID pego na Classe TelegramBotHandler dando um var_dump no $result\n$tele_channel = \"-1001264785539\";\n// Setar a classe do telegram\n$tele_handler = new TelegramBotHandler(\n // API key\n $tele_key,\n // Channel\n $tele_channel,\n // Level\n Logger::INFO\n );\n\n $tele_handler->setFormatter( new LineFormatter(\"%level_name%: %message%\"));\n $this->logger->pushHandler($tele_handler);\n $this->logger->info( '|Nome do cliente: '. $mensagem['name'] . \n '|Telefone: ' . $mensagem['telefone'] . \n '|Email: ' . $mensagem['email'] .\n '|assunto: ' . $mensagem['assunto'] .\n '|Mensagem: ' . $mensagem['mensagem']\n , ['info' => true] );\n\n }", "function onBeforeStream(&$man, $cmd, $input) {\r\n\t\treturn true;\r\n\t}", "abstract function doSend();", "public function testChannelsInfo()\n {\n }", "function websend_command($action, $cmd = '', $target_player = null) {\n // this is the mandatory structure of the data passed to Websend.\n // changing this here will break the system.\n\n $websend_array = array(\n 'action' => $action,\n 'targetPlayer' => $target_player,\n 'command' => $cmd,\n );\n\n $json = json_encode($websend_array) . CHR(10);\n print($json);\n}", "function msgsrv_request ($target, $cmd, $content, $link, $timeout = 30000) {}", "function executeCallbacks() {\n\n\t\t// receive callbacks with a timeout (default: 2 ms)\n\t\t$this->client->resetError();\n\t\t$this->client->readCB();\n\n\t\t// now get the responses out of the 'buffer'\n\t\t$calls = $this->client->getCBResponses();\n\t\tif ($this->client->isError()) {\n\t\t\ttrigger_error('ExecCallbacks XMLRPC Error [' . $this->client->getErrorCode() . '] - ' . $this->client->getErrorMessage(), E_USER_ERROR);\n\t\t}\n\n\t\tif (!empty($calls)) {\n\t\t\twhile ($call = array_shift($calls)) {\n\t\t\t\tswitch ($call[0]) {\n\t\t\t\t\tcase 'TrackMania.PlayerConnect': // [0]=Login, [1]=IsSpectator\n\t\t\t\t\t\t$this->playerConnect($call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerDisconnect': // [0]=Login\n\t\t\t\t\t\t$this->playerDisconnect($call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerChat': // [0]=PlayerUid, [1]=Login, [2]=Text, [3]=IsRegistredCmd\n\t\t\t\t\t\t$this->playerChat($call[1]);\n\t\t\t\t\t\t$this->releaseEvent('onChat', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerCheckpoint': // [0]=PlayerUid, [1]=Login, [2]=TimeOrScore, [3]=CurLap, [4]=CheckpointIndex\n\t\t\t\t\t\tif (!$this->server->isrelay)\n\t\t\t\t\t\t\t$this->releaseEvent('onCheckpoint', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerFinish': // [0]=PlayerUid, [1]=Login, [2]=TimeOrScore\n\t\t\t\t\t\t$this->playerFinish($call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.BeginRace': // [0]=Challenge\n\t\t\t\t\t\t// ignore, use BeginChallenge\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.EndRace': // [0]=Rankings[], [1]=Challenge\n\t\t\t\t\t\t// ignore, use BeginChallenge\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.BeginRound': // none\n\t\t\t\t\t\t$this->beginRound();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.EndRound': // none\n\t\t\t\t\t\t$this->endRound();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.StatusChanged': // [0]=StatusCode, [1]=StatusName\n\t\t\t\t\t\t// update status changes\n\t\t\t\t\t\t$this->prevstatus = $this->currstatus;\n\t\t\t\t\t\t$this->currstatus = $call[1][0];\n\t\t\t\t\t\t// check WarmUp state\n\t\t\t\t\t\tif ($this->currstatus == 3 || $this->currstatus == 5) {\n\t\t\t\t\t\t\t$this->client->query('GetWarmUp');\n\t\t\t\t\t\t\t$this->warmup_phase = $this->client->getResponse();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->currstatus == 4) { // Running - Play\n\t\t\t\t\t\t\t$this->runningPlay();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->releaseEvent('onStatusChangeTo' . $this->currstatus, $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.BeginChallenge': // [0]=Challenge, [1]=WarmUp, [2]=MatchContinuation\n\t\t\t\t\t\t$this->beginMap($call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.EndChallenge': // [0]=Rankings[], [1]=Challenge, [2]=WasWarmUp, [3]=MatchContinuesOnNextChallenge, [4]=RestartChallenge\n\t\t\t\t\t\t$this->endMap($call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerManialinkPageAnswer': // [0]=PlayerUid, [1]=Login, [2]=Answer, [3]=Entries\n\t\t\t\t\t\t$this->releaseEvent('onPlayerManialinkPageAnswer', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.BillUpdated': // [0]=BillId, [1]=State, [2]=StateName, [3]=TransactionId\n\t\t\t\t\t\t$this->releaseEvent('onBillUpdated', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.ChallengeListModified': // [0]=CurChallengeIndex, [1]=NextChallengeIndex, [2]=IsListModified\n\t\t\t\t\t\t$this->releaseEvent('onMapListModified', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerInfoChanged': // [0]=PlayerInfo\n\t\t\t\t\t\t$this->playerInfoChanged($call[1][0]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerIncoherence': // [0]=PlayerUid, [1]=Login\n\t\t\t\t\t\t$this->releaseEvent('onPlayerIncoherence', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.TunnelDataReceived': // [0]=PlayerUid, [1]=Login, [2]=Data\n\t\t\t\t\t\t$this->releaseEvent('onTunnelDataReceived', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.Echo': // [0]=Internal, [1]=Public\n\t\t\t\t\t\t$this->releaseEvent('onEcho', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.ManualFlowControlTransition': // [0]=Transition\n\t\t\t\t\t\t$this->releaseEvent('onManualFlowControlTransition', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.VoteUpdated': // [0]=StateName, [1]=Login, [2]=CmdName, [3]=CmdParam\n\t\t\t\t\t\t$this->releaseEvent('onVoteUpdated', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// new MP callbacks:\n\n\t\t\t\t\tcase 'TrackMania.RulesScriptCallback': // [0]=Param1, [1]=Param2\n\t\t\t\t\t\t$this->releaseEvent('onRulesScriptCallback', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// do nothing\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $calls;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function process_unlock_set_queen($socket, $data)\n{\n if ($socket->process === true) {\n $user_id = $data;\n $player = id_to_player($user_id, false);\n if (isset($player)) {\n $player->gainPart('head', 29, true);\n $player->gainPart('body', 27, true);\n $player->gainPart('feet', 25, true);\n $player->gainPart('eHead', 29);\n $player->gainPart('eBody', 27);\n $player->gainPart('eFeet', 25);\n $player->sendCustomizeInfo();\n }\n $socket->write('{\"status\":\"ok\"}');\n }\n}", "public function messages();", "public function messages();", "public function messages();", "function buildr_messages_script()\n{\n require_lang('buildr');\n require_lang('chat');\n require_css('buildr');\n\n $member_id = get_member();\n $rows = $GLOBALS['SITE_DB']->query_select('w_members', array('location_realm', 'location_x', 'location_y'), array('id' => $member_id), '', 1);\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n list($realm, $x, $y) = array($rows[0]['location_realm'], $rows[0]['location_x'], $rows[0]['location_y']);\n\n $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'w_messages WHERE location_x=' . strval($x) . ' AND location_y=' . strval($y) . ' AND location_realm=' . strval($realm) . ' AND (destination=' . strval($member_id) . ' OR destination IS NULL OR originator_id=' . strval($member_id) . ') ORDER BY m_datetime DESC');\n $messages = new Tempcode();\n foreach ($rows as $myrow) {\n $message_sender = $GLOBALS['FORUM_DRIVER']->get_username($myrow['originator_id']);\n if (is_null($message_sender)) {\n $message_sender = do_lang('UNKNOWN');\n }\n $messages->attach(do_template('W_MESSAGE_' . (is_null($myrow['destination']) ? 'ALL' : 'TO'), array('MESSAGESENDER' => $message_sender, 'MESSAGE' => comcode_to_tempcode($myrow['m_message'], $myrow['originator_id']), 'DATETIME' => get_timezoned_date($myrow['m_datetime']))));\n }\n\n $tpl = do_template('W_MESSAGES_HTML_WRAP', array('_GUID' => '05b40c794578d3221e2775895ecf8dbb', 'MESSAGES' => $messages));\n $tpl->evaluate_echo();\n}", "public function createTwilm()\n {\n $response = new Twiml();\n $response->say('Hello');\n $response->play('https://api.twilio.com/cowbell.mp3', array(\"loop\" => 5));\n print $response;\n }", "function inc_spipmotion_encodage_direct_dist(){\n\tif(function_exists('fsockopen')){\n\t\tspip_log('Appel de spipmotion_encoder en fsokopen ','spipmotion');\n\t\t$url = generer_url_action('spipmotion_encoder');\n\t\t$parts=parse_url($url);\n\t\t$fp = fsockopen($parts['host'],\n\t isset($parts['port'])?$parts['port']:80,\n\t $errno, $errstr, 30);\n\t\tif ($fp) {\n\t \t$out = \"GET \".$parts['path'].\"?\".$parts['query'].\" HTTP/1.1\\r\\n\";\n \t\t$out.= \"Host: \".$parts['host'].\"\\r\\n\";\n \t\t$out.= \"Connection: Close\\r\\n\\r\\n\";\n\t\t\tfwrite($fp, $out);\n\t\t\tfclose($fp);\n\t\t}\n\t}\n\treturn;\n}", "function process_unlock_rank_token_rental($socket, $data)\n{\n if ($socket->process === true) {\n $data = json_decode($data);\n\n global $player_array;\n foreach ($player_array as $player) {\n if ($player->user_id === $data->user_id || $player->guild_id === $data->guild_id) {\n $player->activateRankToken($data->quantity);\n }\n }\n\n $socket->write('{\"status\":\"ok\"}');\n }\n}", "function broadcast_manager($db,$telegram,$current)\r\n{\t\r\n\t\t\t\tdate_default_timezone_set('Europe/Rome');\r\n\t\t\t\t$today = date(\"Y-m-d H:i:s\");\r\n\r\n\t\t\t\t$message= limit_text($current);\r\n\t\t\t\t\r\n\t\t\t\t//commmentare qui se si vuole inibire le notifiche automatiche\r\n\t\t\t\tsendMessagetoAll($db,$telegram,'message',$message); \r\n\t\t\t\t\r\n\t\t\t\t//registro l'allerta nel DB\r\n\t\t\t\t$statement = \"INSERT INTO \" . DB_TABLE_LOG .\" (date, text, chat_id, user_id, location, reply_to_msg) VALUES ('\" . $today . \"','\" . $load_data[0] . \"','\" . $load_data[1] . \"','\" . \"all\" . \"','\" . \" \" . \"','\" . \" \" . \"')\";\r\n\t\t\t\t$db->exec($statement);\r\n\t\t\t\t\r\n\t\t\t\t//update file\r\n\t\t\t\techo \"Allarme inviato\";\t\t\t\t\r\n}", "function mark_robot( $socket, $data ) {\r\n\tif($socket->process == true) {\r\n\t\t$ip = $data;\r\n\t\tglobal $player_array;\r\n\t\tRobots::add($ip);\r\n\t\tforeach( $player_array as $player ) {\r\n\t\t\tif($player->ip == $ip) {\r\n\t\t\t\t$player->human = false;\r\n\t\t\t\t$player->hostage_exp_points = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function replay()\n { \n $friend_id = isset($_GET['friend_id'])?$_GET['friend_id']:\"\";\n $userid = isset($_GET['user_id'])?$_GET['user_id']:\"\";\n $subject = isset($_GET['subject'])?$_GET['subject']:\"\"; \n $message = isset($_GET['message'])?$_GET['message']:\"\";\n $output['success'] = FALSE;\n $ceklogin = $this->cek_session->islogin();\n $output['logged_in'] = $ceklogin;\n if($ceklogin)\n {\n $this->mongo_db->select_db(\"Users\");\n $this->mongo_db->select_collection(\"Inbox\"); \n $datatinsert = array( \n \"friend_id\" => (string)$friend_id, \n \"user_id\" => (string)$userid,\n \"sender\" => (string)$userid,\n 'type'=>'inbox',\n 'read'=>FALSE,\n 'subject'=>$subject,\n 'message'=>$message,\n 'datetime' => $this->mongo_db->time(strtotime(date(\"Y-m-d H:i:s\"))),\n );\n $this->mongo_db->insert($datatinsert);\n $datatinsert=array(\n \"friend_id\" => (string)$friend_id, \n \"sender\" => (string)$userid,\n \"user_id\" => (string)$userid,\n 'type'=>'send',\n 'read'=>TRUE,\n 'subject'=>$subject,\n 'message'=>$message,\n 'datetime' => $this->mongo_db->time(strtotime(date(\"Y-m-d H:i:s\"))),\n ); \n $this->mongo_db->insert($datatinsert);\n $output['success'] = TRUE;\n $url = current_url();\n $this->m_user->tulis_log(\"Send & Replay Message\",$url,\"API Unity\");\n }\n echo json_encode($output);\n }", "function process_unlock_set_king($socket, $data)\n{\n if ($socket->process === true) {\n $user_id = $data;\n $player = id_to_player($user_id, false);\n if (isset($player)) {\n $player->gainPart('head', 28, true);\n $player->gainPart('body', 26, true);\n $player->gainPart('feet', 24, true);\n $player->gainPart('eHead', 28);\n $player->gainPart('eBody', 26);\n $player->gainPart('eFeet', 24);\n $player->sendCustomizeInfo();\n }\n $socket->write('{\"status\":\"ok\"}');\n }\n}", "function sendMessagetoAll($db,$telegram,$type,$content){\r\n\r\n\t\tdate_default_timezone_set('Europe/Rome');\r\n\t\t$today = date(\"Y-m-d H:i:s\");\r\n\t\t\r\n $statement = \"SELECT * FROM \".DB_TABLE;\r\n $user = $db->query($statement);\r\n $user = $user->fetchAll();\r\n \r\n //remove duplicates \r\n $user_uni=array_unique($user,SORT_REGULAR);\r\n print_r($content);\r\n $i = 0;\r\n foreach ($user_uni as $users) {\r\n \t\t\r\n \t\t//COMMENT TO AVOID BRODCAST\r\n \t\t$telegram->sendMessageAll($type, $users['user_id'], $content);\r\n $i++;\r\n }\r\n \r\n \t$log=$today. \";Sent message \".$content. \" to \".$i.\" subscribers\\n\";\r\n \tfile_put_contents(LOG_FILE, $log, FILE_APPEND | LOCK_EX);\t\r\n}", "function readChannel () {\n $output = shell_exec(\"\n curl -X GET \\\n 'https://api.go-tellm.com/api/v3/posts/channel?channel=\" . CHANNEL . \"' \\\n -H 'Accept: */*' \\\n -H 'Accept-Encoding: gzip, deflate' \\\n -H 'Authorization: Bearer \" . API_KEY . \"' \\\n -H 'Cache-Control: no-cache' \\\n -H 'Connection: keep-alive' \\\n -H 'Host: api.go-tellm.com' \\\n -H 'cache-control: no-cache'\n \");\n}", "function recruitTeam($cxn,$player,$request)\r\n {\r\n \r\n }", "public function testChannelsHistory()\n {\n }", "function dx_process($conn, $bot, $input){\n //set a name for user\n if (mb_substr($input, 0, 1, 'utf-8') == '!')\n $bot -> setName($input);\n\n //get the time for user\n else if(strpos($input, 'time') || $input == 'time')\n $bot -> getTime($input);\n\n //train the bot\n else if (substr($input, 0, 6) == 'train:') {\n $bot -> trainBot($conn, $input);\n }\n\n //display bot data\n else if($input == 'aboutbot')\n $bot -> getBotData();\n\n else if( strpos($input, 'date') || $input == 'date'){\n echo 'Today is '.date('D.').' the '.date('jS M, ').date('Y');\n exit();\n }\n\n //respond to input such as hello, hi etc\n else if(str_word_count($input) == 1 && $input != 'time' && $input != 'date' && $input != 'aboutbot' && $input != 'help')\n $bot -> response($input);\n\n //show help\n else if($input == 'help')\n $bot -> showHelp();\n\n else\n $bot -> respondToQuestion($conn, $input);\n\n\n }", "function getBotInfo() {\n $bot_version = 1.01;\n return \"This is Vector, version \" .$bot_version;\n}", "abstract function send();", "protected function beforeSending()\n {\n }", "function sendGet($arrayRestInputs){\n if((file_exists($arrayRestInputs['enginebasedir'] . '/lib/Send.php')) && (file_exists($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php')) ){\n require_once($arrayRestInputs['enginebasedir'] . '/lib/Send.php');\n require_once($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php');\n $objectToken = new NodeToken ();\n if(($objectToken->retrieveToken($arrayRestInputs['token'])) && (count($arrayRestInputs['arguments']) > 0)){\n $arguments = $arrayRestInputs['arguments'];\n $toUser = new User($arguments[0]);\n $objectSend = new Send();\n $sendReturn = $objectSend->getMessages($objectToken->uid, $toUser->getUserID());\n if($sendReturn < 0){\n return '';\n }\n else{\n if(is_array($sendReturn)){\n $limit = count($sendReturn);\n for($i = 0; $i < $limit; $i++){\n $sendReturn[$i]['sent'] = date(DATE_ATOM, $sendReturn[$i]['sent']);\n $sendReturn[$i]['seen'] = date(DATE_ATOM, $sendReturn[$i]['seen']);\n $sendReturn[$i]['requestinguser'] = $objectToken->username;\n }\n }\n return $sendReturn;\n }\n }\n else{\n return ''; /* BUG: If the client does not send a token, an empty string is returned. An invalid token should result in an error somewhere. */\n }\n }\n else{\n return '';\n }\n}", "function executeCallbacks() {\n\n\t\t// receive callbacks with a timeout of 1 second ...\n\t\t$this->client->readCB(2000);\n\n\t\t// now get the responses out of the 'buffer' ...\n\t\t$calls = $this->client->getCBResponses();\n\n\t\tif (!empty($calls)) {\n\t\t\twhile ($call = array_shift($calls)) {\n\t\t\t\tswitch ($call[0]) {\n\t\t\t\t\tcase 'TrackMania.PlayerConnect':\n\t\t\t\t\t\t// event is released in the function!\n\t\t\t\t\t\t$this->playerConnect($call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerDisconnect':\n\t\t\t\t\t\t// event is released in the function!\n\t\t\t\t\t\t$this->playerDisconnect($call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerManialinkPageAnswer':\n\t\t\t\t\t\t$this->playerServerMessageAnswer($call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.BillUpdated':\n\t\t\t\t\t\t$this->releaseEvent('onBillUpdated', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerFinish':\n\t\t\t\t\t\t$this->playerFinish($call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerChat':\n\t\t\t\t\t\t$this->playerChat($call[1]);\n\t\t\t\t\t\t$this->releaseEvent('onChat', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.BeginRace':\n\t\t\t\t\t\t$this->beginRace($call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.EndRace':\n\t\t\t\t\t\t$this->endRace($call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerCheckpoint':\n\t\t\t\t\t\t$this->releaseEvent('onCheckpoint', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.PlayerIncoherence':\n\t\t\t\t\t\t$this->releaseEvent('onPlayerIncoherence', $call[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.BeginRound':\n\t\t\t\t\t\t$this->beginRound();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'TrackMania.StatusChanged':\n//\t\t\t\t\t\t$this->console_text($call[1][0].\" - \".$call[1][1]);\n\t\t\t\t\t\tif ( $call[1][0] == 4 )\t\t// Running - Play\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->runningPlay();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( $call[1][0] == 3 )\t\t// Synchronisation (always)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdisplayAllPlayerInfo($this, $this->server->challenge);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( $call[1][0] == 2 )\t\t// Launching (new map)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( $call[1][0] == 5 )\t\t// Finish (always)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// do nothing ...\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $calls;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function botman()\n {\n $botman = app('botman');\n\n $botman->middleware->received(ApiAi::create(config('services.dialogflow.key'))->listenForAction());\n\n $botman->hears('{something}', __CLASS__ . '@telegram');\n\n $botman->listen();\n }", "function warquest_home_messages() {\r\n \r\n\t/* input */\r\n\tglobal $mid;\r\n\tglobal $sid;\r\n\tglobal $offset;\r\n\t\r\n\t/* output */\r\n\tglobal $page;\r\n\tglobal $player;\r\n\tglobal $output;\r\n\t\r\n\t/* Clear new flag */\r\n\t$player->comment_notification=0;\r\n\t\t\r\n\t$output->title = t('HOME_MESSAGES_TITLE');\r\n\t\r\n\t$limit=30;\r\n\t\r\n\t$query = 'select pid1 from comment where pid2='.$player->pid.' and deleted=0';\r\n\t$result = warquest_db_query($query); \r\n\t$total = warquest_db_num_rows($result);\r\n\t\r\n\t$query = 'select a.id, a.pid1, a.pid2, a.date, a.comment, a.cid, b.name, b.country from comment a, player b ';\r\n $query .= 'where ((a.pid1=b.pid and pid2='.$player->pid.') or (a.pid2=b.pid and pid1='.$player->pid.')) ';\r\n\t$query .= 'and deleted=0 order by a.date desc ';\r\n\t$query .= 'limit '.$offset.','.$limit;\r\n\t$result = warquest_db_query($query);\r\n\t$count = warquest_db_num_rows($result);\r\n\t\t\t\r\n\t$page .= '<div class=\"subparagraph\">'.t('HOME_MESSAGES_TITLE').'</div>';\r\n\t\r\n\tif ($count==0) {\r\n\t\t\r\n\t\t$page .= warquest_box_icon(\"info\",t('HOME_NO_MESSAGES'));\r\n\t\t\r\n\t} else {\r\n\t\t\r\n\t\t$page .= '<div class=\"box rows\">';\r\n\t\r\n\t\t$count=0;\r\n\t\t\r\n\t\t$page .= warquest_page_control($offset, $limit, $total, 1);\r\n\t\t\r\n\t\t$page .= '<table>';\r\n\t\t\r\n\t\t$page .= '<tr>';\r\n\t\t$page .= '<th width=\"75\" >'.t('GENERAL_AGO').'</th>';\r\n\t\t$page .= '<th width=\"390\">'.t('GENERAL_MESSAGE').'</th>';\r\n\t\t$page .= '<th width=\"55\" align=\"right\">'.t('GENERAL_ACTION').'</th>';\r\n\t\t$page .= '</tr>';\r\n\t\t\r\n\t\twhile ($data=warquest_db_fetch_object($result)) {\r\n\t\r\n\t\t\t$count++;\r\n\t\t\r\n\t\t\t$page .= '<tr valign=\"top\">';\r\n\t\t\t$page .= '<td>';\r\n\t\t\t$page .= warquest_ui_ago($data->date);\r\n\t\t\t$page .= '</td>';\r\n\t\t\t\r\n\t\t\t$page .= '<td>';\r\n\t\t\t\r\n\t\t\t$page .= '<span class=\"subparagraph2\">';\r\n\t\t\tif ($player->pid==$data->pid2) {\r\n\t\t\t\t$page .= player_format($data->pid1, $data->name, $data->country);\r\n\t\t\t\t$page .= ' -> '.player_format($player->pid, $player->name, $player->country);\r\n\t\t\t} else {\r\n\t\t\t\t$page .= player_format($player->pid, $player->name, $player->country);\r\n\t\t\t\t$page .= ' -> ';\r\n\t\t\t\t\r\n\t\t\t\tif ($data->cid > 0) {\r\n\t\t\t\t\t$clan = warquest_db_clan($data->cid);\r\n\t\t\t\t\t$page .= clan_format($clan).' clan';\r\n\t\t\t\t\t\r\n\t\t\t\t} else if ($data->pid2==0) {\r\n\t\t\t\t\t$page .= t('GENERAL_ALL');\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$page .= player_format($data->pid2, $data->name, $data->country);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$page .= '</span>';\r\n\t\t\t$page .= '<br/>';\r\n\t\t\t$page .= warquest_parse_smilies(wordwrap($data->comment, 40, \"\\n\\r\", true));\r\n\t\t\t\r\n\t\t\t$page .= '</td>';\r\n\t\t\t\r\n\t\t\t$page .= '<td align=\"right\">';\r\n\t\t\t\r\n\t\t\tif ($player->pid==$data->pid2) {\r\n\t\t\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_EDIT.'&oid='.$data->pid1, t('LINK_REPLY'), \"reply\".$count);\t\r\n\t\t\t} else if ($player->pid==$data->pid1) {\r\n\t\t\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_EDIT.'&oid='.$data->pid2.'&uid='.$data->id, t('LINK_EDIT'), 'edit'.$count);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$page .= '</td>';\r\n\t\t\t\r\n\t\t\t$page .= '</tr>';\r\n\t\t}\r\n\t\t\r\n\t\t$page .= '</table>';\r\n\t\t\r\n\t\t$page .= warquest_page_control($offset, $limit, $total, 0);\r\n\t\t$page .= '</div>';\n\t\r\n\t} \r\n}", "public function testChannelsKick()\n {\n }", "private function repect_ech_m(){\t\n\t\t\t\n\t\t\tif($this->get_request_method() != \"GET\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t\n\t\t\t$result=repect_ech_m();\n\t\t\t$this->response($this->json($result), 200);\n\t\t\t$this->response('',204);\t\n\t\t}", "function send_message_to_player( $socket, $data ) {\r\n\tif($socket->process == true) {\r\n\t\t$obj = json_decode( $data );\r\n\t\t$user_id = $obj->user_id;\r\n\t\t$message = $obj->message;\r\n\t\t\r\n\t\t$player = id_to_player( $user_id, false );\r\n\t\tif( isset($player) ) {\r\n\t\t\t$player->write( 'message`' . $message );\r\n\t\t}\r\n\t\t$socket->write('{\"status\":\"ok\"}');\r\n\t}\r\n}", "function botSpawEditorInit() {\n}", "function playerStatus()\n\t\t{\n\t\t\t$request = $_SESSION['mac'].\" status 0 100 \\n \";\n\t\t\t$mySqueezeCLI = new SqueezeCLI($request);\n\t\t\t$response = $mySqueezeCLI->receiveCLI();\n\t\t\t//echo \"la réponse non traité : $response \\n\";\n\t\t\t//parfois le retour CLI change attention\n\t\t\t//$response = get_string_between($response,\" mode:\",\"rate:\");\n\t\t\t$response = substr($response, strpos($response, \"mode:\"));\n\t\t\t$response = substr($response, 0, strpos($response, \" \"));\n\t\t\t$response = substr($response, 5);\n\n\t\t\treturn $response;\n\t\t}", "public function run()\n {\n //['name','code','status',[hd/sd]]\n\n\n {\n $this->createChannel();\n }\n }", "public function execute() {\n // $result = $sayService->hello('jack');\n // var_dump($result);exit;\n // echo date(\"Y-m-d H:i:s\",time());\n // echo json_encode(array('url'=>'/d1/p3/2016/05/11/dc/ae/dcaee5986f03730a88503f19e3f863dc.jpg','width'=>80,'height'=>30,'content'=>666));\n $subjectService = new \\mia\\miagroup\\Service\\Album();\n $result = $subjectService->getArticleList('1508587', 4);\n // $result = $subjectService->getAlbumNum(array('1508587'));\n $result = $subjectService->getRecommendAlbumArticleList();\n // var_dump(empty(0));die;\n // $subjectService = new \\mia\\miagroup\\Service\\Subject();\n // $result = $subjectService->getBatchSubjectInfos(array('11082','11082'));\n echo \"<pre>\";\n print_r($result);exit;\n \n /*\n $client = $this->ice->mainApp->proxy_service->get('demo-local', 'Say');\n return $this->ice->mainApp->proxy_filter->get('(map){\n code(int);\n data(map){\n uid(int);\n uname(str);\n service(map){\n code(int);\n data(str);\n };\n user(map){\n id(int);\n name(str);\n location(str);\n }\n }\n }')->filter(array(\n 'code' => 0,\n 'data' => array(\n 'uid' => 5012470,\n 'uname' => 'goosman-lei',\n 'service' => $client->hello('Jack'),\n 'user' => $uinfo,\n ),\n ));*/\n }", "public function index()\n\t{\n\n\t\t$this->config->load('bot');\n\n\t\t$botToken = $this->config->item('botToken');\n\t\t$website = \"https://api.telegram.org/bot\".$botToken;\n\n\t\t//$last_id = intval(file_get_contents('./lastid.txt'))+1;\n\t\t$last_id = 1;\n\n\t\t$update = file_get_contents($website.\"/getupdates?offset=$last_id\");\n\n\t\t//cuando se cambie a servidor SSL hay que poner esto\n\t\t//$update = file_get_contents(\"php://input\");\n\t\t//y no hace falta recorrer los mensajes porque te mandan un post por mensaje\n\n\t\techo \"<pre>\";\n\t\tprint_r(json_decode($update));\n\t\t$data = json_decode($update);\n\n\t\t/* \n\n\t\t//esto es un data de ejemplo\n\n\t\tstdClass Object\n\t\t(\n\t\t [ok] => 1\n\t\t [result] => Array\n\t\t (\n\t\t [0] => stdClass Object\n\t\t (\n\t\t [update_id] => 911242039\n\t\t [message] => stdClass Object\n\t\t (\n\t\t [message_id] => 63\n\t\t [from] => stdClass Object\n\t\t (\n\t\t [id] => 8908013\n\t\t [first_name] => Guillermo - Killer\n\t\t [username] => killer415\n\t\t )\n\n\t\t [chat] => stdClass Object\n\t\t (\n\t\t [id] => -12658615\n\t\t [title] => Airsoft partidas club\n\t\t )\n\n\t\t [date] => 1441465223\n\t\t [text] => /crearpartida\n\t\t )\n\n\t\t )\n\n\t\t*/\n\n\t\tforeach ($data->result as $key => $msg){\n\n\t\t\techo \"Analyzing message $key<br>\";\n\n\t\t\t//datos grupo\n\t\t\t$in_group = !isset($msg->message->chat->username);\n\t\t\t$last_update_id = $msg->update_id;\n\n\t\t\t//solo permitimos hablar en grupo\t\t\n\t\t\t//if (!$in_group) continue;\n\t\t\t//echo \"mensaje a grupo :\". intval($in_group) .\"<br>\";\n\n\t\t\t//datos mensaje\n\t\t\t$group_id \t= $msg->message->chat->id;\n\t\t\t$from_id\t= $msg->message->from->id;\n\t\t\t$from_username\t= $msg->message->from->username;\n\t\t\t$text \t\t= $msg->message->text;\n\n\t\t\t//lista de commands disponibles\n\t\t\t$commands = array(\n\t\t\t\t'crearpartida' => '/(\\/crearpartida)$/',\n\t\t\t\t'cancelarpartida' => '/(\\/cancelarpartida)$/',\n\t\t\t\t'infopartida' => '/(\\/infopartida)$/',\n\t\t\t);\n\n\t\t\t$matches = null;\n\t\t\tforeach ($commands as $commandkey => $commandexp){\n\n\t\t\t\t$returnValue = preg_match($commandexp, $text, $matches);\n\n\t\t\t\t//print_r($matches);\n\n\t\t\t\tif (!empty($matches)) {\n\n\t\t\t\t\tswitch($commandkey){\n\n\t\t\t\t\t\tcase \"crearpartida\":\n\t\t\t\t\t\t\techo \"command $commandkey<br>\";\n\t\t\t\t\t\t\tfile_get_contents($website.\"/sendMessage?chat_id=$group_id&text=@$from_username: command crearpartida leído\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase \"cancelarpartida\":\n\t\t\t\t\t\t\techo \"command $commandkey<br>\";\n\t\t\t\t\t\t\tfile_get_contents($website.\"/sendMessage?chat_id=$group_id&text=@$from_username: command cerrarpartida leído.\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase \"infopartida\":\n\t\t\t\t\t\t\techo \"command $commandkey<br>\";\n\t\t\t\t\t\t\tfile_get_contents($website.\"/sendMessage?chat_id=$group_id&text=@$from_username: command infopartida leído.\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$matches = null;\n\t\t\t\t//$last_id = file_put_contents('./lastid.txt',$last_update_id);\n\n\t\t\t}\n\n\t\t}\n\n\n\t}", "public function testChannelsMark()\n {\n }", "protected abstract function receive();", "function runRouteChat()\n{\n echo \"Running RouteChat...\\n\";\n global $client;\n\n // start the bidirectional streaming call\n $call = $client->RouteChat();\n\n $notes = array(\n array(1, 1, 'first message'),\n array(1, 2, 'second message'),\n array(2, 1, 'third message'),\n array(1, 1, 'fourth message'),\n array(1, 1, 'fifth message'),\n );\n\n foreach ($notes as $n) {\n $point = new Routeguide\\Point();\n $point->setLatitude($lat = $n[0]);\n $point->setLongitude($long = $n[1]);\n\n $route_note = new Routeguide\\RouteNote();\n $route_note->setLocation($point);\n $route_note->setMessage($message = $n[2]);\n\n echo sprintf(\n \"Sending message: '%s' at (%d, %d)\\n\",\n $message,\n $lat,\n $long\n );\n // send a bunch of messages to the server\n $call->write($route_note);\n }\n $call->writesDone();\n\n // read from the server until there's no more\n while ($route_note_reply = $call->read()) {\n echo sprintf(\n \"Previous left message at (%d, %d): '%s'\\n\",\n $route_note_reply->getLocation()->getLatitude(),\n $route_note_reply->getLocation()->getLongitude(),\n $route_note_reply->getMessage()\n );\n }\n}", "public function ownStream()\n {\n try {\n self::log('Own stream');\n self::$current_download_operation = 'Getting own stream';\n self::ppb();\n $stream = json_decode($this->sc->get('me/activities/tracks/affiliated'));\n $this->processStream($stream);\n } catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {\n self::log('Unknown error with message ' . $e->getMessage());\n }\n\n }", "function makeCurl($method,$datas=[]) //make and receive requests to bot\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,\"https://api.telegram.org/bot365628024:AAH8l35wfRQacP6GZRi586lRu0UiJXSFrCM/{$method}\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($datas));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $server_output = curl_exec ($ch);\n curl_close ($ch);\n return $server_output;\n}", "public function run($sms,$title)\n { \n\n }", "public function talk();", "public function doExecute() {\n\t\t$uid = intval($_COOKIE['uid']);\n\t\t$isUnRead = intval($_GET['unread']);\n\t\t$getFriendMsg = '';\n\n\t\tif ($isUnRead === 1) {\n\t\t\t// unread messages\n\t\t\t$getFriendMsg = 'SELECT u.firstname, u.lastname,u.photo, m.* FROM receive_msg rm, message m, user u WHERE rm.mid = m.mid AND u.uid = m.uid AND is_read = 0 AND (m.tid = 1 or m.tid = 3) AND rm.uid = ' . $uid . ';'; \n\n\t\t} else {\n\t\t\t// all messages from friends\n\t\t\t$getFriendMsg = 'SELECT u.firstname, u.lastname,u.photo, m.* FROM receive_msg rm, message m, user u WHERE rm.mid = m.mid AND u.uid = m.uid AND (m.tid = 1 or m.tid = 3) AND rm.uid = ' . $uid . ';'; \n\t\t}\n\n\t\t$query = mysqli_query($this->conn, $getFriendMsg);\n\t\t$data = mysqli_fetch_all($query, MYSQLI_ASSOC);\n\n\t\tforeach ($data as $key => $value) {\n\t\t\t$mid = $value['mid'];\n\t\t\t$replyMessage = 'SELECT u.firstname, u.lastname, u.photo, r.* FROM receive_reply rr, reply r, user u WHERE rr.rid = r.rid AND r.uid = u.uid AND rr.uid= ' . $uid . ' AND r.mid = ' .$mid . ';';\n\n\t\t\t$query = mysqli_query($this->conn, $replyMessage);\n\t\t\t$replyData = mysqli_fetch_all($query, MYSQLI_ASSOC);\n\t\t\t$data[$key]['reply'] = $replyData;\n\t\t}\n\n\t\treturn $data;\n\t}", "function schreibe_Telegram($message, $channel_id)\n{\n $send_message = '';\n // prüfe, ob channel_id vorgegeben wurde\n if (!$channel_id) {\n return;\n }\n //\n $telegram_api_token = Config::get('konstanten.telegram.api_token');\n $telegram_bot_username = Config::get('konstanten.telegram.bot_username');\n $telegram_channel_signature = Config::get('konstanten.telegram.channel_signature');\n //\n $message .= $telegram_channel_signature;\n //\n $send_message = implode(\"\\n\", explode('<br />', $message));\n //\n $telegram_apiRUL = 'https://api.telegram.org/bot' . $telegram_api_token . '/';\n //\n $client = new Client(['base_uri' => $telegram_apiRUL]);\n //\n $client->post('sendMessage',\n [\n 'query' =>\n [\n 'chat_id' => $channel_id,\n 'text' => $send_message,\n 'parse_mode' => 'HTML',\n ]\n ]\n );\n}", "public function sendMessage(){\n\n\n }", "function mediahub_upgrade_processing() {\n\tif ( current_user_can( 'manage_options' ) && ( ! isset($_GET['mediahub_upgrade'] ) || ! wp_verify_nonce( $_GET['mediahub_upgrade'], 'mediahub_upgrade' ) ) ) {\n\t\treturn;\n\t}\n\n\t// Switch the API to use version 4\n\t$keys = get_option( 'mhca_api_key');\n\t$keys['mediahub_api_url'] = 'https://api.demediahub.nl/v4/';\n\tupdate_option( 'mhca_api_key', $keys );\n\n}", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $dbname = \"zhongwei\";\n $host = \"58.215.187.8\";\n $user = \"zhongwei\";\n $pass = \"623610577\";\n \n \n //如果是新关注用户\n if($postObj->Event == 'subscribe'){\n //send_back(MENU);\n $con = mysql_connect(\"$host\",\"$user\",\"$pass\");\n if (!$con)\n {\n die('Could not connect: ' . mysql_error());\n }\n mysql_select_db(\"$dbname\", $con);\n $result = mysql_query(\"SELECT s.*,sf.* FROM uchome_space s LEFT JOIN uchome_spacefield sf ON s.uid=sf.uid WHERE s.wxkey='\".$toUsername.\"' \");\n mysql_query(\"SET NAMES 'utf8'\");\n if($row = mysql_fetch_array($result)){\n \n \n \n $v5 = mysql_query(\"SELECT a.*,m.* FROM uchome_appset a LEFT JOIN uchome_menuset m ON a.num=m.menusetid WHERE a.uid='$row[uid]' and a.appstatus='1'\");\n while($v52= mysql_fetch_array($v5)){\n $a[] = \"$v52[num]\";\n $b[] = \"$v52[subject]\";\n\n }\n \n \n $msgType = \"news\";\n if($row[name]){\n $name=$row[name];\n }else{\n $name=$row[username];\n }\n $appurl = \"http://v5.home3d.cn/home/capi/space.php?do=app&uid=$row[uid]\";\n $app = file_get_contents($appurl,0,null,null);\n $app_output = json_decode($app);\n $count=$app_output->data->count;\n $zhong2 = mysql_query(\"SELECT * FROM uchome_weixinmenutop WHERE uid='$row[uid]' and type='image'\");\n $wei2 = mysql_fetch_array($zhong2);\n if($wei2){\n $name=$wei2[name];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $result1 = mysql_query(\"SELECT * FROM uchome_weixinmenutop WHERE uid='$row[uid]' and type='frist' \");\n $result2 = mysql_query(\"SELECT * FROM uchome_weixinmenutop WHERE uid='$row[uid]' and type='second' \");\n mysql_query(\"SET NAMES 'utf8'\");\n if($weixin = mysql_fetch_array($result1)){\n $wei=explode(\".\",$weixin['number']);\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=$wei[0]&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=\".$wei[0].\"id&type=\".$wei[0].\"&moblieclicknum=$row[moblieclicknum]\";\n if($wei[0]==\"introduce\"){\n $subject=$app_output->data->introduce->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->introduce->image1url;\n }elseif($wei[0]==\"product\"){\n $subject=$app_output->data->product->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->product->image1url;\n }elseif($wei[0]==\"industry\"){\n $subject=$app_output->data->industry->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->industry->image1url;\n }elseif($wei[0]==\"cases\"){\n $subject=$app_output->data->cases->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->cases->image1url;\n }elseif($wei[0]==\"job\"){\n $subject=$app_output->data->job->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->job->image1url;\n }elseif($wei[0]==\"development\"){\n $subject=$app_output->data->development->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->development->image1url;\n }elseif($wei[0]==\"branch\"){\n $subject=$app_output->data->branch->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->branch->image1url;\n }elseif($wei[0]==\"goods\"){\n $subject=$app_output->data->goods->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->goods->image1url;\n }\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n \n if($weixin = mysql_fetch_array($result2)){\n $wei=explode(\".\",$weixin['number']);\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=$wei[0]&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&wxkey=\".$fromUsername.\"&id=\".$wei[1].\"&uid=$row[uid]&idtype=\".$wei[0].\"id&type=\".$wei[0].\"&moblieclicknum=$row[moblieclicknum]\";\n if($wei[0]==\"introduce\"){\n $subject=$app_output->data->introduce->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->introduce->image1url;\n }elseif($wei[0]==\"product\"){\n $subject=$app_output->data->product->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->product->image1url;\n }elseif($wei[0]==\"industry\"){\n $subject=$app_output->data->industry->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->industry->image1url;\n }elseif($wei[0]==\"cases\"){\n $subject=$app_output->data->cases->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->cases->image1url;\n }elseif($wei[0]==\"job\"){\n $subject=$app_output->data->job->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->job->image1url;\n }elseif($wei[0]==\"development\"){\n $subject=$app_output->data->development->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->development->image1url;\n }elseif($wei[0]==\"branch\"){\n $subject=$app_output->data->branch->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->branch->image1url;\n }elseif($wei[0]==\"goods\"){\n $subject=$app_output->data->goods->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->goods->image1url;\n }\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n \n }\n }else{\n $appurl = \"http://v5.home3d.cn/home/capi/space.php?do=app&uid=$row[uid]\";\n $app = file_get_contents($appurl,0,null,null);\n $app_output = json_decode($app);\n $count=$app_output->data->count;\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2['imageurl'];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n for($i=0;$i<$count;$i++){\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->app[$i]->english;\n if($app_output->data->app[$i]->newname){\n $subject=$app_output->data->app[$i]->newname;\n }else{\n $subject=$app_output->data->app[$i]->subject;\n }\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->app[$i]->image1url;\n\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n } \n \n if($app_output->data->highapp){\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->highapp[0]->english;\n if($app_output->data->highapp[0]->newname){\n $subject=$app_output->data->highapp[0]->newname;\n }else{\n $subject=$app_output->data->highapp[0]->subject;\n }\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->highapp[0]->image1url;\n\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n include_once( 'weibo/config.php' );\n require_once '../common.php';\n require_once 'wx_common.php';\n include_once( CONNECT_ROOT.'/saetv2.ex.class.php' );\n require_once CONNECT_ROOT.\"/common/jtee.inc.php\";\n require_once CONNECT_ROOT.\"/common/siteUserRegister.class.php\";\n require_once('Weixin.class.php');\n $rst = mysql_query(\"SELECT * FROM uchome_wxkey WHERE wxkey='$fromUsername'\");\n $row1 = mysql_fetch_array($rst);\n $rst1 = mysql_query(\"SELECT * FROM uchome_space WHERE wxkey='$fromUsername'\");\n $row2 = mysql_fetch_array($rst1);\n if($row1||$row2){\n loaducenter();\n //showmessage(\"$row[uid]\");\n //include_once(S_ROOT.'./source/function_cp.php');\n //updateuserstat('hot');\n if($row1){\n $user = uc_get_user($row1['uid'], 1); \n uc_user_synlogin($row1['uid']); \n }\n if($row2){\n $user = uc_get_user($row2['uid'], 1); \n uc_user_synlogin($row2['uid']); \n } \n \n $auth = setSession($user[0],$user[1]);\n $weixinuid=$row['uid'];\n $m_auth=rawurlencode($auth);\n $friendurl = \"http://v5.home3d.cn/home/capi/cp.php?ac=friend&op=add&uid=$weixinuid&gid=0&addsubmit=true&note=微信用户关注&m_auth=$m_auth\";\n $friend = file_get_contents($friendurl,0,null,null);\n $friend_output = json_decode($friend);\n \n \n }else{\n //include_once(S_ROOT.'./source/function_cp.php');\n //updateuserstat('hot');\n $nextuid=$row['uid'];\n $d = get_obj_by_xiaoquid($nextuid);\n $info = $d->getNewWXUser(); \n $fakeid=$info['id'];\n $query = mysql_query(\"SELECT * FROM uchome_space WHERE fakeid='$fakeid'\");\n $value = mysql_fetch_array($query);\n if($value){\n loaducenter();\n //include_once(S_ROOT.'./source/function_cp.php');\n //updateuserstat('hot'); \n $user = uc_get_user($value['uid'], 1); \n uc_user_synlogin($value['uid']);\n $auth = setSession($user[0],$user[1]);\n $weixinuid=$row['uid'];\n $m_auth=rawurlencode($auth);\n $friendurl = \"http://v5.home3d.cn/home/capi/cp.php?ac=friend&op=add&uid=$weixinuid&gid=0&addsubmit=true&note=微信用户关注&m_auth=$m_auth\";\n $friend = file_get_contents($friendurl,0,null,null);\n $friend_output = json_decode($friend);\n inserttable(\"wxkey\",array('wxkey'=>$fromUsername,'fakeid'=>$fakeid,'uid'=>$value['uid']));\n\n }else{\n $username =$fromUsername;\n $name = $fromUsername;\n $password = \"weixin\";\n $email = isemail($_REQUEST['email']) ? $_REQUEST['email'] : $username.\"@v5.com.cn\";\n $data = array();\n require_once CONNECT_ROOT.\"/common/siteUserRegister.class.php\";\n $regClass = new siteUserRegister();\n $uid = $regClass->reg($username, $email, $password);\n \n $nextuid=$row['uid'];\n $d = get_obj_by_xiaoquid($nextuid);\n $info = $d->getNewWXUser(); \n $setarr = array(\n 'name' => $info['nick_name'],\n 'fakeid'=>$info['id'],\n 'namestatus' => '1',\n 'wxkey' => $fromUsername,\n 'fatheruid'=>$nextuid\n );\n updatetable('space', $setarr, array('uid'=>$uid ));\n loaducenter();\n $user = uc_get_user($uid, 1); \n uc_user_synlogin($uid);\n $weixinuid=$row['uid'];\n $auth = setSession($user[0],$user[1]);\n $friendurl = \"http://v5.home3d.cn/home/capi/cp.php?ac=friend&op=add&uid=$row[uid]&gid=0&addsubmit=true&note=微信用户关注&m_auth=$m_auth\";\n $friend = file_get_contents($friendurl,0,null,null);\n $friend_output = json_decode($friend);\n }\n }\n \n\n \n \n }else{\n $contentStr.=\"未填写微信id\";\n $msgType = \"text\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }\n }\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $eventkey=$postObj->EventKey;\n\n //判断是否已经有帐号\n $textTpl = \"<xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n <FuncFlag>0</FuncFlag>\n </xml>\"; \n\n $con = mysql_connect(\"$host\",\"$user\",\"$pass\");\n if (!$con)\n {\n die('Could not connect: ' . mysql_error());\n }\n mysql_select_db(\"$dbname\", $con);\n $result = mysql_query(\"SELECT s.*,sf.* FROM uchome_space s LEFT JOIN uchome_spacefield sf ON s.uid=sf.uid WHERE s.wxkey='\".$toUsername.\"' \");\n mysql_query(\"SET NAMES 'utf8'\");\n if($row = mysql_fetch_array($result)){\n if($eventkey){\n $msgType = \"news\";\n $wei=explode(\".\",$eventkey);\n if($wei[0]==\"introduce\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_introduce\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=$value[introduceid]&uid=$row[uid]&viewuid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=introduceid&type=introduce&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=$wei[0]&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=\".$wei[1].\"&uid=$row[uid]&viewuid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=\".$wei[0].\"id&type=\".$wei[0].\"&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->introduce->subject;\n $message1=$app_output->data->introduce->message1;\n //$message1=strtolower($message1);\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n /* $pic = $matches[1][0];*/\n /* if($app_output->data->introduce->pic){\n $pic =\"http://v5.home3d.cn/home/attachment/\".$app_output->data->introduce->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/attachment/\",\"http://v5.home3d.cn/home/attachment/\",$pic);\n $pic = str_replace(\"http://v5.home3d.cn/home/attachment/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n $pic = str_replace(\"http://v5.home3d.cn/home/attachment/attachment/\",\"http://v5.home3d.cn/home/attachment/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic=\"http://v5.home3d.cn/home/\".$app_output->data->introduce->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n }elseif($wei[0]==\"branch\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_branch\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[branchid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=branchid&type=branch&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=branch&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&viewuid=$row[uid]&idtype=branchid&type=branch&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->branch->subject;\n $message1=$app_output->data->branch->message1;\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n //$pic = $matches[1][0];\n /*if($app_output->data->branch->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->branch->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->branch->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n /* if($app_output->data->branch->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->branch->pic;\n }else{\n $pic=\"\";\n }*/\n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n } elseif($wei[0]==\"industry\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_industry\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[industryid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=industryid&type=industry&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=industry&wxkey=\".$fromUsername.\"&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=\".$wei[1].\"&uid=$row[uid]&viewuid=$row[uid]&idtype=industryid&type=industry&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->industry->subject;\n $message1=$app_output->data->industry->message1;\n $message1=strtolower($message1);\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n //$pic = $matches[1][0];\n /* if($app_output->data->industry->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->industry->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->industry->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n /* if($app_output->data->industry->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->industry->pic;\n }else{\n $pic=\"\";\n }*/\n $articles[] = makeArticleItem($subject, $message2, $pic, $url);\n } \n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n } elseif($wei[0]==\"job\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_job\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[jobid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=jobid&type=job&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=job&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=jobid&type=job&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->job->subject;\n $message1=$app_output->data->industry->message1;\n $message1=strtolower($message1);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n } elseif($wei[0]==\"product\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_product\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[productid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=productid&type=product&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=product&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=productid&type=product&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->product->subject;\n $message1=$app_output->data->product->message1;\n preg_match_all(\"<src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n //$pic = $matches[1][0];\n /*if($app_output->data->product->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->product->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->product->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n }elseif($wei[0]==\"development\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_development\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[developmentid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=developmentid&type=development&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=development&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=developmentid&type=development&moblieclicknum=$row[moblieclicknum]\";\n $message1=$app_output->data->development->message1;\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n //$pic = $matches[1][0];\n /*if($app_output->data->development->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->development->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->development->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n $subject=$app_output->data->development->subject;\n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n }elseif($wei[0]==\"goods\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_goods\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[goodsid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=goodsid&type=goods&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=goods&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=goodsid&type=goods&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->goods->subject;\n $message1=$app_output->data->goods->message1;\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n /*$pic = $matches[1][0];*/\n /* if($app_output->data->goods->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->goods->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->goods->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n /*if($app_output->data->goods->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->goods->pic;\n }else{\n $pic=\"\";\n }*/\n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n } elseif($wei[0]==\"cases\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_cases\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[casesid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=casesid&type=cases&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=cases&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=casesid&type=cases&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->cases->subject;\n $message1=$app_output->data->cases->message1;\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n /* $pic = $matches[1][0];*/\n /*if($app_output->data->cases->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->cases->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->cases->imageurl;\n\n $pic = str_replace(\" \",\"%20\",$pic); \n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n } \n \n \n\n \n }\n \n }else{\n $contentStr.=\"$toUsername\";\n $msgType = \"text\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }\n \n \n if(!empty( $keyword ))\n { \n \n if ($keyword=='Hello2BizUser'){ \n \n $contentStr.=\"过期的通知方式\";\n \n \n \n \n \n \n \n \n $msgType = \"text\";\n \n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n \n }elseif($keyword==\"绑定\"){\n $msgType = \"news\";\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=bind&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"\";\n $subject=\"输入帐号密码与微信进行绑定\";\n $pic = \"\";\n $articles[] = makeArticleItem($subject, $subject, $pic, $url);\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n }elseif($keyword==\"z\"){\n $msgType = \"text\";\n $contentStr.=\"$fromUsername\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }elseif($keyword==\"w\"){\n $msgType = \"text\";\n $contentStr.=\"$toUsername\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else{\n $zhong = mysql_query(\"SELECT a.*,m.* FROM uchome_appset a LEFT JOIN uchome_menuset m ON a.num=m.menusetid WHERE a.uid='$row[uid]'and a.num='$keyword'\");\n $wei = mysql_fetch_array($zhong);\n \n $result = mysql_query(\"SELECT s.*,sf.* FROM uchome_space s LEFT JOIN uchome_spacefield sf ON s.uid=sf.uid WHERE s.wxkey='\".$toUsername.\"' \");\n $row = mysql_fetch_array($result);\n $msgType = \"news\";\n if($row[name]){\n $name=$row[name];\n }else{\n $name=$row[username];\n }\n $appurl = \"http://v5.home3d.cn/home/capi/space.php?do=app&uid=$row[uid]\";\n $app = file_get_contents($appurl,0,null,null);\n $app_output = json_decode($app);\n $count=$app_output->data->count;\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n if($count>7){\n $count='7';\n $more='1';\n }\n for($i=0;$i<$count;$i++){ \n \n //$url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->app[$i]->english;\n $menusetcount=$app_output->data->app[$i]->count;\n if($menusetcount=='1'){\n $idtype=$app_output->data->app[$i]->english;\n $idtypeid=$idtype.\"id\";\n $table=\"uchome_\".$idtype;\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid]\");\n $value = mysql_fetch_array($query);\n $id=$value[\"$idtypeid\"];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$id&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=$idtypeid&type=$idtype&moblieclicknum=$row[moblieclicknum]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->app[$i]->english; \n }\n /* if($menusetcount=='1'){\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->app[$i]->english;\n }else{\n $id=$app_output->data->app[$i]->id;\n $idtype=$app_output->data->app[$i]->english;\n $idtypeid=$idtype.\"id\";\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=$id&uid=$row[uid]&idtype=$idtypeid&type=$idtype&moblieclicknum=$row[moblieclicknum]\"; \n }*/\n if($app_output->data->app[$i]->newname){\n $subject=$app_output->data->app[$i]->newname;\n }else{\n $subject=$app_output->data->app[$i]->subject;\n }\n \n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->app[$i]->image1url;\n\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n } \n \n if($app_output->data->highapp){\n $menusetcount=$app_output->data->highapp[$i]->count;\n if($menusetcount=='1'){\n $idtype=$app_output->data->highapp[$i]->english;\n $idtypeid=$idtype.\"id\";\n $table=\"uchome_\".$idtype;\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid]\");\n $value = mysql_fetch_array($query);\n $id=$value[\"$idtypeid\"];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$id&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=$idtypeid&type=$idtype&moblieclicknum=$row[moblieclicknum]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->highapp[0]->english;\n }\n \n if($app_output->data->highapp[0]->newname){\n $subject=$app_output->data->highapp[0]->newname;\n }else{\n $subject=$app_output->data->highapp[0]->subject;\n }\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->highapp[0]->image1url;\n\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n if(!empty($more)){\n $subject=\"更多\";\n $url=\"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=home&num=rand()&wxkey=\".$fromUsername;\n $pic=\"http://v5.home3d.cn/home/./upload/menuset/small/menuset1379386329communicate.jpg\";\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n } \n \n \n \n \n \n \n \n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n }\n }else{\n echo \"Input something...\";\n }\n\n }else {\n echo \"\";\n exit;\n }\n }", "public function messagefrom($usercheck)\n {\n \t\n\n }", "function presence($pubnub, $presence) {\n }", "function presence($pubnub, $presence) {\n }", "public function onTrackPlayed(){\n $this->request->validate([\n 'type' => 'string|in:song,episode',\n ]);\n\n if($this->request->input('type') == 'song') {\n $song = Song::findOrFail($this->request->input('id'));\n $song->increment('plays');\n if(isset($song->artists[0])) {\n $artist_id = $song->artists[0]->id;\n //Insert song statistic\n DB::statement(\"INSERT INTO \" . DB::getTablePrefix() . \"popular (`song_id`, `artist_id`, `plays`, `created_at`) VALUES (\" . intval($song->id). \", '\" . $artist_id . \"', '1', '\" . Carbon::now() . \"') ON DUPLICATE KEY UPDATE plays=plays+1\");\n }\n\n if ($song->user_id && config('settings.monetization') && Role::getUserValue('monetization_streaming', $song->user_id)) {\n\n if ($song->user_id && config('settings.monetization') && Role::getUserValue('monetization_streaming', $song->user_id)) {\n if(request()->ip()) {\n if(! Stream::where('streamable_id', $song->id)->where('streamable_type', (new Song)->getMorphClass())->where('ip', request()->ip())->exists()) {\n $revenue = Role::getUserValue('monetization_streaming_rate', $song->user_id);\n $steam = new Stream();\n $steam->user_id = $song->user_id;\n $steam->streamable_id = $song->id;\n $steam->streamable_type = (new Song)->getMorphClass();\n $steam->revenue = $revenue;\n $steam->ip = request()->ip();\n $steam->save();\n $song->user()->increment('balance', $revenue);\n }\n }\n }\n\n }\n\n if(auth()->check())\n {\n if($song->user_id) {\n $song->user()->increment('balance', Role::getUserValue('monetization_streaming_rate', $song->user_id));\n }\n makeActivity(auth()->user()->id, $song->id, (new Song)->getMorphClass(), 'playSong', $song->id);\n History::updateOrCreate(\n [\n 'user_id' => auth()->user()->id,\n 'historyable_id' => $song->id,\n 'historyable_type' => (new Song)->getMorphClass(),\n ],\n [\n 'created_at' => Carbon::now(),\n 'ownerable_type' => (new Artist)->getMorphClass(),\n 'ownerable_id' => isset($song->artists[0]) ? $song->artists[0]->id : null,\n 'interaction_count' => DB::raw('interaction_count + 1')\n ]\n );\n }\n\n return response()->json(array('success' => true));\n\n } else {\n $episode = Episode::findOrFail($this->request->input('id'));\n $episode->increment('plays');\n\n if ($episode->user_id && config('settings.monetization') && Role::getUserValue('monetization_streaming', $episode->user_id)) {\n if(request()->ip()) {\n if(! Stream::where('streamable_id', $episode->id)->where('streamable_type', (new Episode)->getMorphClass())->where('ip', request()->ip())->exists()) {\n $revenue = Role::getUserValue('monetization_streaming_rate', $episode->user_id);\n $steam = new Stream();\n $steam->user_id = $episode->user_id;\n $steam->streamable_id = $episode->id;\n $steam->streamable_type = (new Episode)->getMorphClass();\n $steam->revenue = $revenue;\n $steam->ip = request()->ip();\n $steam->save();\n $episode->user()->increment('balance', $revenue);\n }\n }\n }\n\n return response()->json(array('success' => true));\n }\n }", "public function newsStream($limit=25, $query='') {\n\t\t$this->construct();\n\t\tif (empty($_SESSION['tokens']['fb'])) return false;\n\t\ttry {\n\t\t\t$url = \"{$this->urls['stream']}&limit=$limit\";\n\t\t\tif (!empty($query)) $url .= \"&$query\";\n\t\t\tlist($headers, $stream) = httpWorker::get($url);\n\t\t\tpreg_match(\"'^HTTP/1\\.\\d+ (\\d+) '\", $headers[0], $matches);\n\t\t\tif ((int) ($matches[1] / 100) != 2) {\n\t\t\t\terror_log(__METHOD__ . \": HTTP Status {$matches[1]}\");\n\t\t\t\terror_log(print_r($stream, true));\n\t\t\t\tif ((int) ($matches[1] / 100) == 4) {\n\t\t\t\t\tunset($_SESSION['tokens']['fb']);\n\t\t\t\t\theader('HTTP/1.1 403 Forbidden');\n\t\t\t\t\theader('Location: /login?service=fb');\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$stream = json_decode($stream, true);\n\t\t\tif (isset($stream['error'])) {\n\t\t\t\terror_log(__METHOD__ . ': ' . $stream['error']);\n\t\t\t\t$_SESSION['error'] = $stream['error'];\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!empty($stream['paging']['next']) and !in_array($stream['paging']['next'], $this->paging['next']))\n\t\t\t\t$this->paging['next']['stream'] = $stream['paging']['next'];\n\t\t\tif (!empty($stream['paging']['prev']) and !in_array($stream['paging']['prev'], $this->paging['prev']))\n\t\t\t\t$this->paging['prev']['stream'] = $stream['paging']['prev'];\n// TODO: Ask for Like on Each Item\n\t\t\treturn $stream['data'];\n\t\t} catch (Exception $e) {\n\t\t\t$_SESSION['error'] = $e->getMessage();\n\t\t}\n\t\treturn false;\n\t}", "public function toTalk(): string;", "function wsOnReceive($clientID, $message, $messageLength, $binary) {\r\n\tglobal $Server;\r\n\r\n\t$message = json_decode($message, true);\r\n\t$command = $message['command'];\r\n\t$argument = $message['argument'];\r\n\r\n\t// check if message length is 0\r\n\tif ($messageLength == 0) {\r\n\t\t$Server->wsClose($clientID);\r\n\t\treturn;\r\n\t}\r\n\t$command($clientID, $argument);\r\n\r\n\t//The speaker is the only person in the room. Don't let them feel lonely.\r\n\t/*foreach ( $Server->wsClients as $id => $client )\r\n\t\tif ( $id != $clientID )\r\n\t\t\t$Server->wsSend($id, \"Visitor $clientID ($ip) said \\\"$message\\\"\");\r\n\t*/\r\n}" ]
[ "0.5854321", "0.58326393", "0.55366373", "0.5429408", "0.540141", "0.5376116", "0.53582835", "0.5343861", "0.5341707", "0.5325995", "0.53125864", "0.52734315", "0.52492565", "0.52455246", "0.5244981", "0.52270246", "0.5210585", "0.5197693", "0.51762086", "0.5164471", "0.51385385", "0.51070136", "0.51064223", "0.51023537", "0.510073", "0.5090645", "0.5087003", "0.50867033", "0.5069959", "0.5065159", "0.5056165", "0.5050357", "0.5049839", "0.50375473", "0.5036428", "0.50256926", "0.50214523", "0.50183827", "0.50145304", "0.50141716", "0.5001881", "0.5000663", "0.49883106", "0.49811393", "0.49699524", "0.49678963", "0.4962882", "0.49538475", "0.4947667", "0.4945656", "0.49431857", "0.49420455", "0.49420455", "0.49420455", "0.49411044", "0.493958", "0.4939335", "0.49211732", "0.49192777", "0.4917241", "0.49171877", "0.49163496", "0.49047214", "0.49011257", "0.49001992", "0.4897343", "0.48949602", "0.4884766", "0.4883049", "0.48811808", "0.48727193", "0.48725894", "0.48716107", "0.48637554", "0.485499", "0.48542756", "0.4853551", "0.48424858", "0.48355445", "0.48344275", "0.48333028", "0.4833078", "0.48301715", "0.4815966", "0.481534", "0.4815172", "0.48119995", "0.48116776", "0.4810952", "0.4810245", "0.48101938", "0.4805869", "0.48056805", "0.48034397", "0.48010287", "0.47982848", "0.47982848", "0.4796768", "0.4789399", "0.47893733", "0.47886813" ]
0.0
-1
constructor function that is used when an instance of the SUV class is created (instantiated)
function __construct() { echo "Constructor called<br />"; $SUVSafety = $this->safetyRating; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _construct() {\n \t\n\t\t\n\t}", "function _construct(){ }", "function __construct() ;", "function __constructor(){}", "function __construct(){\n\t\t// nowt much...\n\t}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct (){\n\t\t}", "public function __construct()\n {\n parent::__construct(new Tv());\n }", "function __construct(){}", "function __construct(){}", "function __construct(){}", "public function fn_construct_class() {\n\t}", "public function _construct()\n\t{\n\n\t}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "function __construct() {\n\n\t\t}", "function __construct(){\n //constructor vacio\n }", "public function __construct()\n\t\t{\n\t\t\t# code...\n\t\t}", "function __construct(){\n\n\t\t}", "public function __init(){}", "function __construct() {\n\t\t\t\n\t\t}", "function __construct()\n\t{\n\t\t# code...\n\t}", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "private final function __construct() {}", "public function construct()\n\t\t{\n\t\t}", "function __construct() {}", "private function __construct()\t{}", "protected abstract function __construct();", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "final private function __construct(){\r\r\n\t}", "final private function __construct() {}", "final private function __construct() {}", "public function __construct() { \n\t\t\n\n\t\t}", "public function __construct()\n\t\t{\n\t\t\t//\n\t\t}", "public function __construct(){\n\t\t//asi poder tener dispoble la vista que le pertenece a esta clase\n\t\tparent::__construct();\n\t}", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "final private function __construct() {\n\t\t\t}", "public function __construct (){}", "public function __construct() {\n $this->Init();\n $this->Unique();\n }", "function __construct(){\n\t\t}", "private function __construct () {}", "function __construct(){\r\n\t\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "private function __construct(){\n\t\n\t}", "public function _construct(){\n\t\t$this->marque = 'Peugeot';\n\t\t$this->couleur = 'blanc';\n\t\t$this->vitesse = 50;\n\t}", "function __construct()\n\t{\n\n\t}", "function __construct()\r\n\t{\r\n\t}", "public function __construct() {\n\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\t// Other code to run when object is instantiated\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "final private function __construct()\n {\n \t$this->init();\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.73626226", "0.73085785", "0.7210464", "0.71857744", "0.7153384", "0.7034896", "0.7034896", "0.7034896", "0.7034896", "0.7034896", "0.7034896", "0.70122004", "0.6992978", "0.69800043", "0.69800043", "0.69800043", "0.6970457", "0.6967426", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.69580746", "0.6956533", "0.6949166", "0.6946267", "0.69334704", "0.69293916", "0.6918084", "0.69165653", "0.69100195", "0.6899708", "0.68923664", "0.6891341", "0.6889551", "0.6887088", "0.6885993", "0.68857753", "0.68560016", "0.6853046", "0.6852743", "0.6852743", "0.684728", "0.6844731", "0.68413585", "0.68401045", "0.68370646", "0.6830471", "0.6829209", "0.6827231", "0.6817215", "0.68068737", "0.68063545", "0.6795793", "0.67932206", "0.67929715", "0.6789901", "0.677986", "0.6776644", "0.6773874", "0.67623496", "0.6762198", "0.67605394", "0.6750702", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221", "0.6750221" ]
0.68767816
50
get index location of last item in string
function stringAddTwo($num) { $lastNum = strlen($num) - 1; $finalNum = ""; //turn string into array $num = str_split($num); //if the last number is less than nine then simply add 1 and you're done if($num[$lastNum] < 9) { $num[$lastNum]++; foreach($num as $digit) { $finalNum .= $digit; return $finalNum; } //else } else { $indexFirstNonNine = getFirstNonNineIndex($num); $num[$indexFirstNonNine]++; for($i = ($indexFirstNonNine + 1); $i < count($num); $i++) { $num[$i] = "0"; } foreach($num as $digit) { $finalNum .= $digit; return $finalNum; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastCharIndex() {}", "function lastIndexOf($sourceString, $searchString) \r\n{\r\n\t$index = strpos(strrev($sourceString), strrev($searchString));\r\n\t$index = strlen($sourceString) - strlen($index) - $index;\r\n\treturn $index;\r\n}", "public function indexOfLast($needle, $offset = 0)\n {\n return UTF8::strrpos($this->str, (string) $needle, (int) $offset, $this->encoding);\n }", "public function last(string $str) {\n\n }", "function getFromLast($string, $delimiter){\n\t\t$lastOccurrence = strrpos($string, $delimiter);\n\t\tif($lastOccurrence === false)\n\t\t\treturn $string;\n\t\treturn substr($string, $lastOccurrence+1);\n\t}", "public function lastIndexOf($item) {\n $lastIndex = -1;\n\n for ($i = 0; $i < $this->count; $i++) {\n if ($this->items[$i] == $item) {\n $lastIndex = $i;\n }\n }\n return $lastIndex;\n }", "public function testLastIndexOf() {\n\t\t$array = array(1, 2, 3, 1, 2, 3, 1, 2, 3);\n\t\t$result = _::lastIndexOf($array, 3);\n\t\t$this->assertEquals(8, $result);\n\n\t\t// test not finding index of last occurence of an element\n\t\t$result = _::lastIndexOf($array, 4);\n\t\t$this->assertEquals(-1, $result);\n\n\t\t// test finding index of last occurence of an element,\n\t\t// using a \"from\" value\n\t\t$array = array(1, 2, 3, 1, 2, 3, 1, 2, 3);\n\t\t$result = _::lastIndexOf($array, 3, 6);\n\t\t$this->assertEquals(5, $result);\n\t}", "protected function lastIndexOf($sourceString, $searchString) {\n\t\t$index = strpos(strrev($sourceString), strrev($searchString));\n\t\t$index = strlen($sourceString) - strlen($index) - $index;\n\t\treturn $index;\n\t}", "public function indexOfLast($needle, $offset = 0)\n {\n return UTF8::strrpos\n (\n $this->scalarString,\n (string)$needle,\n (int)$offset,\n $this->encoding\n );\n }", "public function lastIndexOf ($item)\n {\n $indexis = array_keys($this->data, $item);\n if (empty($indexis)) {\n return -1;\n }\n return $indexis[count($indexis) - 1];\n }", "public function getLastIndex()\n {\n return $this->index - 1;\n }", "function strpos_last($haystack, $needle) {\r\n\t\tif(strlen($needle) === 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$len_haystack = strlen($haystack);\r\n\t\t$len_needle = strlen($needle);\t\t\r\n\t\t$pos = strpos(strrev($haystack), strrev($needle));\r\n\t\tif($pos === false) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn $len_haystack - $pos - $len_needle;\r\n\t}", "function getArrayLastIndex($arr) {\n\t$result = '';\n\tforeach ($arr as $key => $value) {\n\t\t$result = $key;\n\t}\n\treturn $result;\n}", "function lastCharOf($s1, $chars){\n\t\t$array = preg_split('//u', $s1, -1, PREG_SPLIT_NO_EMPTY);\n\t\t$array = array_reverse($array);\n\t\tforeach($array as $ch){\n\t\t\tif(in_array($ch, $chars)){\n\t\t\t\treturn $ch;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "function getLastSlash($str) {\n\n\n\n $arr = explode(\"/\", $str);\n\n\n\n return $arr[count($arr) - 1];\n }", "function str_after_last($search, $string)\n {\n return str::afterLast($search, $string);\n }", "function getSubstrAfterLastSlash($str)\n{\n $slashPos = strrpos($str, '/');\n $substr = $slashPos === false ? $str : substr($str, $slashPos + 1);\n\n return $substr;\n}", "public function getPreviousPosition(string $string): ?int;", "function last_segment()\n{\n\t$CI =& get_instance();\n\t// get url segments\n\t$segments = $CI->uri->segment_array();\n\t// set array to last item\n\tend($segments);\n\t// return last item\n\treturn $segments[key($segments)];\n}", "function str_last($str, $del = '\\\\')\n {\n $str = explode($del, $str);\n\n return $str[count($str) - 1];\n }", "public function getEndPosition()\n\t{\n\t\treturn -1;\n\t}", "public function getLastMarker()\n {\n $this->currentMarker = count($this->markers) - 1;\n return $this->getCurrentMarker();\n }", "public function lastPosition($needle,$offset)\n {\n return $this->provider->lastPosition($needle,$offset);\n }", "function get_item($s, $index)\n{\n\t$head = 0;\n\tfor ($i = 0; $i < $index; $i++)\n\t{\n\t\t$head = strpos($s, \"\\t\", $head + 1);\n\t}\n\t$tail = strpos($s, \"\\t\", $head + 1);\n\t$ret = substr($s, $head + 1, $tail - $head - 1);\n\t//\techo \"$head - $tail = '$ret'\\n\";\n\n\treturn $ret;\n}", "function my_strrpos($haystack, $needle)\n{\n\t$index = strpos(strrev($haystack), strrev($needle));\n\tif($index === false)\n\t\treturn false;\n\t$index = strlen($haystack) - strlen($needle) - $index;\n\treturn $index;\n}", "public function getLastPosition(): ?int;", "public function getEndPosition($position) {\n $endPosition = $position;\n for ($i = $position; $i < $this->length; $i++) {\n if ($this->words[$i]['processed'] || $this->isModifierPosition($i)) {\n $endPosition = $i - 1;\n break;\n }\n $endPosition = $i;\n }\n return $endPosition;\n }", "public function last()\n {\n if($this->length()>0)\n {\n return $this->getAt(($this->length()-1));\n }\n throw new \\OutOfBoundsException();\n }", "public function afterLast($string, $search)\n {\n return $search === '' ? $string : ltrim(array_reverse(explode($search, $string))[0]);\n }", "public function getNextPosition(string $string): ?int;", "static function afterLast(string $s, string $search): string {\n $p = mb_strrpos($s, $search);\n\n return $p ? mb_substr($s, $p + mb_strlen($search)) : '';\n }", "protected function findEnd($str, $open, $end){\n\t\t$opens = 1;\n\t\t$ends = 0;\n\t\tfor($i=0; $i<strlen($str); $i++){\n\t\t\tif($str[$i]===$end )$ends++;\n\t\t\tif($opens==$ends)\n\t\t\t\tbreak;\n\t\t\tif($str[$i]===$open)$opens++;\n\t\t}\n\t\treturn $i;\n\t}", "public function GetLastIndexInPage()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return ($this->GetFirstIndexInPage() + $this->GetNumberOfResultsInThisPage()) - 1;\n }", "static function last_word($sentence){\n if(!isset($sentence)){\n $result = '0';\n }else{\n $all_word=explode(\" \", $sentence);\n $last_word=$all_word[count(explode(\" \", $sentence))-1];\n $result = strlen($last_word);\n\n }\n return $result;\n }", "public function getLastWord()\n {\n return $this->lastword;\n }", "function pos(string $string) {\n $result = \"\";\n\n for ($x = strlen($string) - 1; $x >= 0; $x--) {\n $result .= substr($string, $x, 1);\n }\n return $result;\n}", "public function last($n)\n {\n $stringy = static::create($this->str, $this->encoding);\n\n if ($n <= 0) {\n $stringy->str = '';\n } else {\n return $stringy->substr(-$n);\n }\n\n return $stringy;\n }", "public function afterLast($search) {\n return $this->sideInternal('mb_strrpos', $search, 1);\n }", "public function last()\n {\n $this->cursor = $this->length - 1;\n\n return $this->current();\n }", "public static function getLast($string = \"\", $sep = \"/\")\n {\n $lpos = strrpos($string, $sep);\n if ($lpos === false) {\n return $string;\n }\n\n return substr($string, $lpos + strlen($sep));\n }", "public static function segmentsLast($str, $delimiter, $count = 1)\n {\n $p = 0;\n while ($count-- && $p !== false) {\n $p = strrpos($str, $delimiter, -$p - 1);\n }\n if ($p === false) {\n return $str;\n }\n return substr($str, $p + 1);\n }", "public function getEndIndex()\n {\n return $this->end_index;\n }", "public static function afterLast(string $haystack, string $needle): string\n {\n if ($needle === '') {\n return $haystack;\n }\n $position = strrpos($haystack, $needle);\n return $position !== false ? substr($haystack, $position + strlen($needle)) : $haystack;\n }", "public static function last()\n {\n return end(static::$titles);\n }", "function getIDAt ( $index = 0 )\n\t{\n\t\t$item = $this->getAt($index) ;\n\t\t\n\t\treturn !is_null ( $item ) ? str_get_last_int ($str) : null ;\n\t}", "function lengthOfLastWord($str)\n{\n if (strlen($str)==0) {\n return;\n }\n $arr = explode(\" \", $str);\n $result = array_diff($arr, array(''));\n $result = strlen($result[count($result)-1]);\n return $result;\n}", "function strrpos_ex($haystack, $needle, $offset=0) {\n\t\t$pos_rule = ($offset<0)?strlen($haystack)+($offset-1):$offset;\n\t\t$last_pos = false; $first_run = true;\n\t\tdo {\n\t\t\t$pos=strpos($haystack, $needle, (intval($last_pos)+(($first_run)?0:strlen($needle))));\n\t\t\tif ($pos!==false && (($offset<0 && $pos <= $pos_rule)||$offset >= 0)) {\n\t\t\t\t$last_pos = $pos;\n\t\t\t} else { break; }\n\t\t\t$first_run = false;\n\t\t} while ($pos !== false);\n\t\tif ($offset>0 && $last_pos<$pos_rule) { $last_pos = false; }\n\t\treturn $last_pos;\n\t}", "public function last()\n {\n if ($this->getNumParts() < 1) {\n return null;\n }\n\n return end($this->identifierParts);\n }", "public function lastElement(): string {\n $len = count($this->elements);\n return $len > 0 ? $this->elements[$len - 1] : '';\n }", "public function lastIndexOf($value)\n {\n $lastIndex = -1;\n if ($indices = array_keys($this->sessionData, $value)) {\n $lastIndex = end($indices); \n }\n \n return $lastIndex;\n }", "private function getLastMethodIndex() {\n\t\tend($this->methodArray);\n\t\treturn key($this->methodArray);\n\t}", "public function getIndexEnd();", "function strrpos ($haystack, $needle, $offset)\n\t{\n\t $size = strlen ($haystack);\n\t $pos = strpos (strrev($haystack), strrev($needle), $size - $offset);\n\t \n\t if ($pos === false)\n\t return false;\n\t \n\t return $size - $pos - strlen($needle);\n\t}", "function delLastChar($string=\"\")\n{\n\t$t = substr($string, 0, -1);\n\treturn($t);\n}", "protected static function lastPart($name)\n {\n $parts = explode(':', $name);\n return end($parts);\n }", "public function getFirstCharIndex() {}", "public function Lastchar($date)\n {\n echo \"<h3><u> Returning the last two characters of string $date </h3></u>\";\n $array=str_split($date);\n $a=count($array);\n for($i=0;$i<2;$i++)\n {\n $a=$a-1;\n echo $array[$a];\n }\n echo \"<br><hr>\";\n }", "protected function getElementLastPart(string $element) {\n if (strpos($element, '.')) {\n $parts = explode('.', $element);\n return end($parts);\n }\n return $element;\n }", "public function getLastPart(): string\n {\n preg_match(\"#[^\\\\\\\\]+$#\", $this->getFqcn(), $p);\n \n return $p[0];\n }", "public function lastItem() {\n\t\treturn $this->fastForward()->current();\n\t}", "protected final function getAfterOffset ($match) {\n\t\treturn $match[1] + strlen($match[0]);\n\t}", "public function getLast()\n {\n $k = count($this);\n if ($k > 0) {\n return $this[$k - 1];\n }\n }", "public static function toIndex($value, $string = null) {\n\t\tif (is_array($value)) {\n\t\t\tforeach ($value as & $val) { // mind the reference\n\t\t\t\t$val = self::toIndex($val);\n\t\t\t}\n\t\t\tunset($val); // kill the reference\n\n\t\t\treturn $value;\n\t\t}\n\n\t\tif (is_numeric($value)) {\n\t\t\treturn self::normalize($value);\n\t\t}\n\n\t\tif (is_null($string)) {\n\t\t\t$string = self::$RING[0][0];\n\t\t}\n\n\t\treturn (int) strpos($string, $value);\n\t}", "public function getStringOffset() {}", "public function isLastPartOfStringReturnsInvalidArgumentDataProvider() {}", "public function getLastSplit()\n {\n $buffer = $this->getBuffer();\n $splits = explode(PHP_EOL, $buffer);\n return array_pop($splits);\n }", "static function beforeLast(string $s, string $search): string {\n $p = mb_strrpos($s, $search);\n\n return $p ? mb_substr($s, 0, $p) : '';\n }", "function strrevpos($instr, $needle)\n{\n $rev_pos = strpos (strrev($instr), strrev($needle));\n if ($rev_pos===false) return false;\n else return strlen($instr) - $rev_pos - strlen($needle);\n}", "function last_car($t) {\n\tif (strlen($t)>0) {\n\t\t$t = substr($t, 0, strlen($t)-1);\n\t}\n\treturn $t;\n}", "public function getColumn(){\n\n $part = substr($this->input, 0, $this->index);\n $pos = strrpos($part,\"\\n\");\n return $this->index - $pos;\n }", "function get_index($message){\r\n\tpreg_match('/^\\D*(?=\\d)/', $message, $i);\r\n\treturn isset($i[0]) ? strlen($i[0]) : false;\r\n}", "public static function lastCutterPos($smask)\n{\n return strrpos($smask, 'DA');\n}", "public function getCharEnd();", "public function beforeLast($search) {\n return $this->sideInternal('mb_strrpos', $search, -1);\n }", "public function get_last_tab_index() {\n\t\t\n\t\treturn $this->last_tab_index;\n\t\t\n\t}", "public static function beforeLast(string $haystack, string $needle): string\n {\n if ($needle === '') {\n return $haystack;\n }\n $position = strrpos($haystack, $needle);\n return $position !== false ? substr($haystack, 0, $position) : $haystack;\n }", "public function lastItem();", "public function getLastCharacter()\n {\n return $this->last_character;\n }", "public function lastLine(){\n return $this->file[array_key_last($this->file)] ?? '';\n }", "public function getLast();", "public function getLast();", "public static function getLastIndex(array $array)\n {\n $length = count($array);\n return $length > 0 ? (int) ($length - 1) : null;\n }", "public static function getLastFromSet($field)\r\n {\r\n return \"(SUBSTRING({$field}, (0-(LOCATE(',', REVERSE({$field}))-1))))\";\r\n }", "public function last()\n {\n return $this->fixedArray->offsetGet($this->currentSize - 1);\n }", "public function getLastItem() {}", "public function getLastItem() {}", "public function last($expression): static;", "public function getLast(): int {\n return $this->last;\n }", "public function get_position()\n {\n\n if ( $file = fopen($this->path,\"r\") ) {\n\n $string_number = 0;\n $position = 0;\n while(($line = fgets($file,4096)) !== false && !$position) {\n\n $string_number++;\n if(strpos($line,$this->str) !== false) {\n\n $position = strpos($line,$this->str);\n }\n }\n echo 'номер строки: ' . $string_number . ', позиция: ' . ($position+1);\n\n } else {\n\n echo 'ничего не вышло';\n\n }\n\n }", "private function getLastAttributeIndex() {\n\t\tend($this->attributesArray);\n\t\treturn key($this->attributesArray);\n\t}", "public function getLastBase() {\n\n if (\n ($bases = $this->getBases())\n && (is_array($bases))\n )\n return $bases[intval(count($bases)-1)];\n //===\n\n\n return NULL;\n //===\n\n }", "public function isLastPartOfStringReturnsTrueForMatchingFirstPartDataProvider() {}", "public static function getLastFromSet ($field)\n {\n return \"(SUBSTRING({$field}, (0-(LOCATE(',', REVERSE({$field}))-1))))\";\n }", "function getLastItem() { return $this->m_lastItem; }", "public function last(int $page): string;", "public static function splitGetLast($str, $delimiter, $count = 1)\n {\n return array_slice(explode($delimiter, $str), -$count);\n }", "public function last() {\n return end($this->list);\n }", "function strripos($haystack, $needle, $offset=0) {\n if($offset<0){\n $temp_cut = strrev( substr( $haystack, 0, abs($offset) ) );\n }\n else{\n $temp_cut = strrev( substr( $haystack, $offset ) );\n }\n $pos = strlen($haystack) - (strpos($temp_cut, strrev($needle)) + $offset + strlen($needle));\n if ($pos == strlen($haystack)) { $pos = 0; }\n \n if(strpos($temp_cut, strrev($needle))===false){\n return false;\n }\n else return $pos;\n }", "public function isLastPartOfStringReturnsFalseForNotMatchingFirstPartDataProvider() {}", "function descobrePosicaoCaracter($texto){\n\t$listaCaracteres = array(' ');\n\n\tforeach ($listaCaracteres as $item) {\n\n\t\t$posicao = strrpos($texto, $item);\n\n\t\tif($posicao != false){ //false = nome simples , true = nome composto\n\t\t\treturn $posicao+1;\n\t\t}\n\t}\n}", "public function last()\r\n\t{\r\n\t\treturn end($this->_items);\r\n\t}" ]
[ "0.7726579", "0.7648845", "0.7036031", "0.695422", "0.694326", "0.68797845", "0.68222296", "0.6802008", "0.6787976", "0.67687315", "0.6728938", "0.6704014", "0.6500268", "0.6447736", "0.6418956", "0.638407", "0.63694596", "0.62666714", "0.62383103", "0.6188142", "0.6176407", "0.6139906", "0.6119346", "0.6098139", "0.6066638", "0.6058313", "0.6030725", "0.60134286", "0.5997188", "0.5993284", "0.5981627", "0.59749985", "0.59708005", "0.5945139", "0.59271073", "0.58938813", "0.5884227", "0.58841276", "0.5873966", "0.58693594", "0.58595765", "0.58445436", "0.583825", "0.58348525", "0.5778884", "0.5766012", "0.57647955", "0.57482624", "0.57461613", "0.57455355", "0.5741204", "0.5713512", "0.56957793", "0.5685776", "0.56703717", "0.5647927", "0.56230974", "0.5611246", "0.5607066", "0.5595868", "0.55952394", "0.5583369", "0.5568392", "0.5567695", "0.55630666", "0.55506665", "0.5541396", "0.55365366", "0.55278826", "0.55187446", "0.5507834", "0.5503705", "0.54961115", "0.54929024", "0.5480662", "0.54710424", "0.54691523", "0.5454352", "0.5437283", "0.5419948", "0.5419948", "0.54135126", "0.54072833", "0.54042983", "0.540174", "0.540174", "0.53997815", "0.5388982", "0.5387691", "0.5384107", "0.5367915", "0.5367674", "0.5366482", "0.53613394", "0.5360864", "0.534626", "0.5337329", "0.5332188", "0.53235203", "0.5322277", "0.53137195" ]
0.0
-1
this will actually edit the passed variable in memory
function byRef(&$val) { $val++; return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function reassign() {\n\n\t\t}", "public function modify();", "abstract public function change();", "public function mutate();", "public function mutate();", "protected function remebmer_variable( $name, $value ){\n\t\tstatic::$instance->variables[$name] = $value;\n\t}", "abstract protected function alter_set($name,$value);", "public function edit(Python $python)\n {\n //\n }", "public function set($variable, $value);", "function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}", "function set($name, $value) {\n $this->vars[$name] = $value; //is_object($value) ? $value->fetch() : $value;\n }", "function setRef($name, &$value) {\n $this->vars[$name] =& $value; //is_object($value) ? $value->fetch() : $value;\n }", "function byref_set_value( $pFeature, $pPref = \"\", $pPackageName = NULL ) {\n\tglobal $_REQUEST, $gBitSystem, $gBitSmarty;\n\tif( isset( $_REQUEST[$pFeature] ) ) {\n\t\tif( strlen( $pPref ) > 0 ) {\n\t\t\t$gBitSystem->storeConfig( $pPref, $_REQUEST[$pFeature], $pPackageName );\n\t\t\t// also assign the ref appareantly --gongo\n\t\t\t$gBitSmarty->assign_by_ref( $pPref, $_REQUEST[$pFeature] );\n\t\t} else {\n\t\t\t$gBitSystem->storeConfig( $pFeature, $_REQUEST[$pFeature], $pPackageName );\n\t\t}\n\n\t\t$gBitSmarty->assign_by_ref( $pFeature, $_REQUEST[$pFeature] );\n\t}\n}", "public function assign($name,$value);", "function apply_fix($old_obj){\t\r\r\n\t\t// to be copied vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->{$var} = (isset( $old_obj->{$var} ) ) ? $old_obj->{$var} : '';\r\r\n\t\t}\t\t\t\t\t\r\r\n\t\t// save\r\r\n\t\t$this->save();\t\r\r\n\t}", "function RefTest(&$var) {\n\t$var = $var*2;\n}", "abstract public function set($in): void;", "function set($name, $value){\n\t\t$this->vars[$name] = $value;\n\t}", "abstract protected function setModifiedState();", "function changes(&$asset) {\n $asset[\"applicableGroups\"] = $asset[\"applicableGroups\"] . \";WWWDevelopers\";\n echo 'Applicable Groups would now be: '.$asset[\"applicableGroups\"].\"<br>\";\n}", "public function setEditable($value);", "public function replace() {\r\n//primary use is update the status when 'falling through' the state gate\r\n//instead of returning to the executive\r\n\t$clone = clone($this);\r\n\t$_SESSION[\"STATE\"][$this->thread][$this->position] = serialize($clone);\r\n}", "public function __set($var, $val) {\n\t\t$this->view_variables[$var] = $val;\n\t}", "public function setData($data){\n\t\t$this->_storage = $data;\n\t\t\n\t\t// set update flag\n\t\t$this->_isModified = true;\n\t\t\n\t\t// new data available\n\t\t$this->_dataAvailable = true;\n\t}", "protected function doSet($value)\n {\n }", "abstract protected function update ();", "function axWFactoryChangeVariable() {\r\n\tglobal $wgRequest, $wgUser, $wgOut;\r\n\r\n\tif ( !$wgUser->isAllowed( 'wikifactory' ) ) {\r\n\t\t$wgOut->readOnlyPage(); #--- FIXME: later change to something reasonable\r\n\t\treturn;\r\n\t}\r\n\r\n\t$cv_id = $wgRequest->getVal(\"varid\");\r\n\t$city_id = $wgRequest->getVal(\"wiki\");\r\n\r\n\t$oTmpl = new EasyTemplate( dirname( __FILE__ ) . \"/templates/\" );\r\n\r\n\t$variable = WikiFactory::getVarById( $cv_id, $city_id );\r\n\t$vars = array(\r\n\t\t\t\"title\" => Title::makeTitle( NS_SPECIAL, 'WikiFactory' ),\r\n\t\t\t\"groups\" => WikiFactory::getGroups(),\r\n\t\t\t\"accesslevels\" => WikiFactory::$levels,\r\n\t\t\t\"types\" => WikiFactory::$types,\r\n\t\t\t\"cv_variable_id\" => $variable->cv_variable_id,\r\n\t\t\t\"cv_name\" => $variable->cv_name,\r\n\t\t\t\"cv_variable_type\" => $variable->cv_variable_type,\r\n\t\t\t\"cv_access_level\" => $variable->cv_access_level,\r\n\t\t\t\"cv_variable_group\" => $variable->cv_variable_group,\r\n\t\t\t\"cv_description\" => $variable->cv_description,\r\n\t\t);\r\n\t$oTmpl->set_vars($vars);\r\n\r\n\treturn json_encode( array(\r\n\t\t\"div-body\" => $oTmpl->render( \"change-variable\" ),\r\n\t\t\"div-name\" => \"wk-variable-form\"\r\n\t));\r\n}", "function convert(){\n global $x;\n $x ='inside';\n}", "abstract public function setValue($value);", "public function __set($var,$val)\n\t{\n\t\t$this->data[$var] = $val;\n\t}", "public static function assignByRef($key,&$value) {\r\n\t\tself::$_smarty->assignByRef($key,$value);\r\n\t}", "function modify($value)\n{\n return \\Statamic\\View\\Modify::value($value);\n}", "public function change_one_global() {\n $var_name = $GLOBALS['test_var'];\n $GLOBALS[ $var_name ] = rand_str();\n }", "abstract public function set();", "protected function change_variable($value, $escaped)\n {\n return file_put_contents($this->path(), preg_replace(\n \n \"/^{$this->key()}{$escaped}/m\",\n \n \"{$this->key()}={$value}\",\n \n file_get_contents($this->path())\n )\n );\n }", "public function __set ($variableName, $value) {\n // write\n }", "public function edit($obj) {\n\t}", "function myFunction(MyClass $foo){\n\t\t$foo->var2 = \"Bye Bye Bye!!!\";\n\t\techo $foo->var . \"\\n\";\n\t\techo $foo->var2 . \"\\n\";\n\t}", "function _set( $varname, $value, $scope='' ){\n if( $scope=='global' ){\n $this->ctx[0]['_scope_'][$varname] = $value;\n return;\n }\n\n if( $scope=='parent' ){\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) && isset($this->ctx[$x]['_scope_'][$varname]) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n }\n\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n\n }", "public function modifyValue($value, array $arguments);", "public function setUnmodified()\n {\n\t$this->modified= false;\n }", "public function setVar($key, $value);", "function set_field($field,$edit=\"\",$view=\"\")\r\n {\r\n $userID = session::get(\"user\");\r\n \r\n if ($userID)\r\n {\r\n if (!right::get_field($field))\r\n database::query(\"INSERT INTO system SET name='$field',edit='$edit',view='$view'\");\r\n else\r\n database::query(\"UPDATE system SET edit='$edit',view='$view' WHERE name='$field'\");\r\n } \r\n }", "public function set_var ($a_name, $a_value) {\n\t\t\n\t\tif ($this->loaded == 0) {\n\t\t\t$this->load();\n\t\t}\n\t\t\n\t\t$this->data[$a_name] = $a_value;\n\t\t\n\t}", "public function assign($variable , $value)\n {\n $this->data[$variable] = $value;\n }", "static function set($name,$content){\n\t\tif(! self::$enable )\n\t\t\treturn $content;\n\t\tself::init();\n\t\t$i = cacheItem::getInstance($name);\n\t\t$i->content = $content;\n\t\tself::$backend->saveItem($i);\n\t\treturn $content;\n\t}", "function __set($name, $value) {\n\t\t\t\t\tif (!empty($name)) {\n\t\t\t\t\t\t$this->vars[$name] = $value;\n\t\t\t\t\t}\n\t\t\t\t}", "public function modify($modify);", "public function __set( $variable, $value ) {\n\t\treturn $this->set($variable, $value);\n\t}", "function assign($var, $value = false)\n {\n\t\tif (is_array($var))\r\n\t\t{\r\n\t\t\tforeach ($var as $name => $value)\r\n\t\t\t{\r\n\t\t\t\t$this->_vars[$name] = $value;\r\n\t\t\t}\r\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_vars[$var] = $value;\n\t\t}\n\t}", "public function __set($var, $val) {\n\t\t$test = $this->_sanitize_arg($var,$val);\n\t\tif ($test !== null) {\n\t\t\t$this->args[$var] = $test;\n\t\t}\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 testUpdateTaskInstanceVariable()\n {\n }", "private function setVar($var)\n {\n $this->var = $var;\n }", "function update_value($value, $post_id, $field) {\n\t\t//$value = \"this overrides\";\n\t\treturn $value;\n\t}", "function Likee_upd(){\n\t\t// Make a local reference to the ExpressionEngine super object\n\t\t$this->EE =& get_instance();\n\t}", "function switching($var = \"\", $val = \"\") {\n\n $this->$var = $val;\n\n }", "public function update( &$object );", "public function __set($var, $value) { $this->{$this->_parameterMap[$var]} = $value; }", "public function __set($var, $value) { $this->{$this->_parameterMap[$var]} = $value; }", "public function __set($_name, $_value);", "public function set(string $variableName, $value): void;", "function update_setting($name, $value)\n {\n }", "public function __set($variable, $value)\n {\n $this->rowData[$variable] = $value;\n if ($this->persisted) {\n $this->persisted = false;\n }\n }", "function setVariables($pageId, $instanceId, $variables){\n\tglobal $user,$mySQLLink;\n\t\n\t$pageId = mysql_real_escape_string($pageId);\n\t$instanceId = mysql_real_escape_string($instanceId);\n\t//put old edit data into database\n\t$propQuery = mysql_query(\"SELECT * FROM `moduleProps` WHERE `instanceId` = '\".$instanceId.\"' AND `pageId` = '\".$pageId.\"'\",$mySQLLink) or die(mysql_error());\n\twhile($propRow = mysql_fetch_array($propQuery)){\n\t\t\t$oldProps[$propRow[\"propName\"]]=$propRow[\"propValue\"];\n\t}\n\t//get current highest edit ID\n\t$id = mysql_fetch_array(mysql_query(\"SELECT * FROM editHistory ORDER BY editId DESC\")); \n\t//record edits\n\t$string = \"INSERT INTO editHistory (editId, pageId, instanceId, time, ip, user) VALUES ('\".($id['editId']+1).\"','\".$pageId.\"','\".$instanceId.\"','\".time().\"','\".$_SERVER['REMOTE_ADDR'].\"','\".$user->data[\"username_clean\"].\"')\";\n\tmysql_query($string)or die(mysql_error()); //insert edit into editHistory table\n\t\n\t//for each old module property, insert a row into modulePropsHistory table with data\n\tforeach($oldProps as $name => $value){\n\t\t//echo \"INSERT INTO modulePropsHistory (editId,propName,propValue) VALUES ('\".($id['editId']+1).\"','\".$name.\"','\".$value.\"')\";\n\t\t//if($name != \"pageId\" && $name != \"instanceId\")\n\t\tif($name != \"pageId\" || $name != \"instanceId\"){\n\t\t\tmysql_query(\"INSERT INTO modulePropsHistory (editId, propName, propValue) VALUES ('\".($id['editId']+1).\"','\".mysql_real_escape_string($name).\"','\".mysql_real_escape_string(stripslashes($value)).\"')\")or die(mysql_error());\n\t\t}\n\t}\n\t\n\t//for each new property (passed on through $variables array), update current mySQL record\n\tforeach ($variables as $key => $value){ \n\t\t$exist = mysql_query(\"SELECT * FROM `moduleProps` WHERE `pageId` = '\".$pageId.\"' AND `instanceId` = '\".$instanceId.\"' AND `propName` = '\".mysql_real_escape_string($key).\"'\")or die(mysql_error());\n\t\tif(mysql_num_rows($exist) > 0){\n\t\t\tmysql_query(\"UPDATE `moduleProps` SET `propValue` = '\".mysql_real_escape_string($value).\"' WHERE `pageId` = '\".$pageId.\"' AND `instanceId` = '\".$instanceId.\"' AND `propName` = '\".mysql_real_escape_string($key).\"'\")or die(mysql_error());\n\t\t}else{\n\t\t\tmysql_query(\"INSERT INTO `moduleProps` (pageId, instanceId, propName, propValue) VALUES ('\".$pageId.\"','\".$instanceId.\"','\".mysql_real_escape_string($key).\"','\".mysql_real_escape_string($value).\"')\")or die(mysql_error());\n\t\t}\n\t}\n\t\n\treturn true;\n}", "function setParam($var, $val) {\n\t\t\t$this->obj[$var] = $val;\n\t\t}", "public function change_variable( $var ) {\n $var = rand_str();\n return $var;\n }", "private function restartParam()\n\t{\n\t\t$this ->status = 0;\n\t\t$this ->num_rows = 0;\n\t\t$this ->affected_rows = 0;\n\t\t$this ->insert_id = 0;\n\t\t$this ->data = 0;\n\t\t$this ->types = \"\";\n\t\t$this ->query = \"\";\n\t\t$this ->queryFields = \"\";\n\t\t$this ->queryTablesKeys = \"\";\n\t\t$this ->queryForeign = \"\";\n\t\t$this ->table = \"\";\n\t\t$this ->alterTable = FALSE;\n\t}", "function set($name, $value) {\r\n $this->vars[$name] = $value;\r\n }", "public function edit() {\n\t\t\t\n\t\t}", "public function set($data);", "public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }", "protected function editar()\n {\n }", "function set_property(){\n }", "function update_field($field)\n {\n }", "function update_field($field)\n {\n }", "function update_field($field)\n {\n }", "function update_field($field)\n {\n }", "abstract public function updateData();", "public function __set($varible, $value) {\n\t\t$this->$varible = $value;\n\t}", "public function offsetSet($key,$value)\n {\n if( !in_array($key,$this->_allowed_variables) )\n {\n\ttrigger_error('Modification of internal data is deprecated: '.$key,E_USER_NOTICE);\n }\n $this->_data[$key] = $value;\n }", "function changeValue (&$valueToChange, $value) {\n $valueToChange = $value;\n }", "public function __set($varName, $value) {\n\t\t$this->add($varName, $value);\n\t}", "function setVar() {\n\t\t\n\t\t$_argv = func_get_args();\n\t\t$_argc = func_num_args();\n\t\t\n\t\t// load vars\n\t\t$vars = getVars();\n\t\tif (!$_GET[\"__shared__\"][\"vars\"]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"] = array();\n\t\t}\n\t\tforeach ($vars as $varNamespace => $varArray) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$varNamespace] = $varArray;\n\t\t}\n\t\t\n\t\t// Register namespace if not existing\n\t\tif (!$_GET[\"__shared__\"][\"vars\"][$_argv[0]]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]] = array();\n\t\t}\n\t\tif ($_argc == 2) {\n\t\t\tif (is_array($_argv[1])) {\n\t\t\t\tforeach ($_argv[1] as $var => $val) {\n\t\t\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$var] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($_argc == 3) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$_argv[1]] = $_argv[2];\n\t\t}\n\t\t\n\t\t// save vars\n\t\t\n\t\tsaveVars();\n\t}", "public function __set($name, $value) {\n\t\t\tif (isset($this->object->$name) && $name != 'authority') {\n\t\t\t\t\\uri\\actions::modify($this->object, 'replace', $name, $value);\n\t\t\t\treturn $value;\n\t\t\t} else {\n\t\t\t\t$this->_err('FORBIDDEN', debug_backtrace(), $name);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}", "public function doVariable($name, &$value): void\n {\n switch ($name) {\n case 'b':\n $value = 4;\n break;\n }\n }", "function set_data($name, $value)\n {\n }", "function __set($name,$value) {\n\t\t$this->object[$name]=$value;\n\t}", "public function edit()\n\t{\n\t\t\n\t}", "function callbackSetValue($object,$field) {\n \n\n //echo get_class($object);\n switch ($field) {\n case 'name':\n // name does not set dirty flag - its a simple rename..\n $value = $object->get_text();\n if (@$this->$field == $value) {\n return;\n }\n $this->$field = $value;\n //print_r($this->data['TABLES'][$table]['FIELDS']);\n $this->table->database->dirty=true;\n break;\n case 'length':\n case 'default':\n $value = $object->get_text();\n if (@$this->$field == $value) {\n return;\n }\n // echo \"CHANGE?\";\n $this->$field = $value;\n //print_r($this->data['TABLES'][$table]['FIELDS']);\n $this->table->database->dirty=true;\n $this->dirty = true;\n break;\n case 'notnull':\n case 'isIndex':\n case 'sequence':\n case 'unique': \n $value = (int) $object->get_active();\n if (@$this->$field == $value) {\n return;\n }\n //echo \"CHANGE?\";\n $this->$field = $value;\n //print_r($this->data['TABLES'][$table]['FIELDS']);\n $this->table->database->dirty=true;\n $this->table->database->save();\n $this->setVisable();\n $this->dirty = true;\n break;\n default: \n echo \"opps forgot :$field\\n\";\n \n \n }\n //print_r(func_get_args());\n }", "public function set($var, $value){\n\t\t\t$this->template_vars[$var] = $value;\n\t\t}", "function set($key, $value)\n {\n $this->content = str_replace('${'.$key.'}', $value, $this->content);\t\n }", "function update_blog_public($old_value, $value)\n {\n }", "function procEdit($ar=NULL){\n $this->getComposedFullnam($ar);\n return parent::procEdit($ar);\n }", "function saludar(&$nombre=\"Pepe\"){\r\n echo \"Hola $nombre<br>\";\r\n $nombre = \"Marta\";\r\n}", "public function setX($x) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}" ]
[ "0.64610827", "0.6425762", "0.6217435", "0.6154967", "0.6154967", "0.5909809", "0.5775182", "0.5761422", "0.5721953", "0.56966585", "0.5663098", "0.5604173", "0.55987424", "0.55691874", "0.5538712", "0.5515438", "0.5507225", "0.549149", "0.54746205", "0.54685456", "0.5460701", "0.54587936", "0.5441499", "0.5426577", "0.5423461", "0.54149264", "0.5412381", "0.53903383", "0.5376967", "0.53763205", "0.537362", "0.5352327", "0.5345058", "0.5338464", "0.5337914", "0.53319085", "0.5330943", "0.5329316", "0.53269947", "0.53202105", "0.53123236", "0.53039885", "0.52865005", "0.5278055", "0.52680725", "0.5265897", "0.52655095", "0.5257285", "0.52467966", "0.5243757", "0.5240061", "0.52340513", "0.52318937", "0.52154315", "0.5202019", "0.5200406", "0.5199848", "0.5190366", "0.51896644", "0.51896644", "0.5186614", "0.51857334", "0.51847947", "0.5183957", "0.51834875", "0.5183474", "0.51799697", "0.51740295", "0.51628065", "0.51628", "0.51601654", "0.51594955", "0.5159183", "0.51572543", "0.51530665", "0.51530665", "0.51530665", "0.51530665", "0.5151867", "0.5150391", "0.5146722", "0.5146302", "0.5141752", "0.51408666", "0.51403797", "0.514032", "0.5139059", "0.51343167", "0.5131147", "0.5130615", "0.51299196", "0.51289606", "0.51280785", "0.5119194", "0.51189804", "0.5117725", "0.51158965", "0.51158965", "0.51158965", "0.51158965", "0.51158965" ]
0.0
-1
this will make a copy of the passed variable and edit it
function byVal($val) { $val++; return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function reassign() {\n\n\t\t}", "function apply_fix($old_obj){\t\r\r\n\t\t// to be copied vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->{$var} = (isset( $old_obj->{$var} ) ) ? $old_obj->{$var} : '';\r\r\n\t\t}\t\t\t\t\t\r\r\n\t\t// save\r\r\n\t\t$this->save();\t\r\r\n\t}", "function copy_value($v) {\r\n return $v;\r\n}", "function copyfrom($var) {\n\t\tif (is_string($var))\n\t\t\t$var=\\Base::instance()->$var;\n\t\tforeach ($var as $key=>$val)\n\t\t\t$this->set($key,$val);\n\t}", "public function copy();", "function copySameFrom ( &$otherObject ) {\n \t\t$myVars = get_object_vars($this);\n \t\t$otherVars = get_object_vars($otherObject);\n \t\t\n \t\tforeach (array_keys($myVars) as $varName) {\n \t\t\tif (key_exists($varName, $otherVars))\n\t \t\t\t$this->$varName = $otherVars[$varName];\n \t\t}\n \t}", "public function __clone()\n {\n $this->__vars = clone $this->vars();\n }", "public function __clone()\n {\n // We only care of cloning the boxed variable if the variable is an object\n if ($this->isObject()) {\n $this->value = clone $this->value;\n }\n }", "public function assign($name,$value);", "function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}", "public function mutate();", "public function mutate();", "function duplicate($obj) {\n $newObj = $obj;\n return $newObj;\n}", "public function modify();", "function copyto($key) {\n\t\t$var=&\\Base::instance()->ref($key);\n\t\tforeach ($this->item as $key=>$field)\n\t\t\t$var[$key]=$field;\n\t}", "protected function remebmer_variable( $name, $value ){\n\t\tstatic::$instance->variables[$name] = $value;\n\t}", "function copy($data)\r\n {\r\n $this->ano = $data->ano;\r\n $this->mes = $data->mes;\r\n $this->dia = $data->dia;\r\n $this->hora = $data->hora;\r\n $this->minuto = $data->minuto;\r\n $this->segundo = $data->segundo;\r\n $this->tz = $data->tz;\r\n }", "function assign($var, $value = false)\n {\n\t\tif (is_array($var))\r\n\t\t{\r\n\t\t\tforeach ($var as $name => $value)\r\n\t\t\t{\r\n\t\t\t\t$this->_vars[$name] = $value;\r\n\t\t\t}\r\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_vars[$var] = $value;\n\t\t}\n\t}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "public function change_variable( $var ) {\n $var = rand_str();\n return $var;\n }", "abstract protected function copy();", "function RefTest(&$var) {\n\t$var = $var*2;\n}", "function copyfrom($var,$func=NULL) {\n\t\tif (is_string($var))\n\t\t\t$var=\\Base::instance()->$var;\n\t\tif ($func)\n\t\t\t$var=call_user_func($func,$var);\n\t\tforeach ($var as $key=>$val)\n\t\t\t$this->set($key,$val);\n\t}", "public function change_one_global() {\n $var_name = $GLOBALS['test_var'];\n $GLOBALS[ $var_name ] = rand_str();\n }", "function myFunction(MyClass $foo){\n\t\t$foo->var2 = \"Bye Bye Bye!!!\";\n\t\techo $foo->var . \"\\n\";\n\t\techo $foo->var2 . \"\\n\";\n\t}", "protected function __clone(){}", "function &copy () {\n \t\t$newObject =& $this->shallowCopy();\n \t\treturn $newObject->postCopy();\n \t}", "private function __clone(){ }", "private function __clone(){\n\t}", "public function getCopy();", "public function getCopy();", "function copy(){ return $this->_copy(); }", "function changes(&$asset) {\n $asset[\"applicableGroups\"] = $asset[\"applicableGroups\"] . \";WWWDevelopers\";\n echo 'Applicable Groups would now be: '.$asset[\"applicableGroups\"].\"<br>\";\n}", "abstract public function get_local_copy();", "private function __clone(){\n\t\t\n\t}", "private function __clone(){\n\n }", "private function __clone(){\n }", "private function __clone(){\n }", "private function __clone() { }", "function convert(){\n global $x;\n $x ='inside';\n}", "public function __clone()\n {\n $this->pos = 0;\n }", "private function __clone() \r\n { \r\n }", "function copy($do) {\n\t\t$do = serialize($do);\n\t\treturn unserialize($do);\n\t}", "public function replace() {\r\n//primary use is update the status when 'falling through' the state gate\r\n//instead of returning to the executive\r\n\t$clone = clone($this);\r\n\t$_SESSION[\"STATE\"][$this->thread][$this->position] = serialize($clone);\r\n}", "public function assign($var, $value) {\n\t\tparent::assign($var, $value);\n\t}", "private function __clone () {}", "private function __clone()\n\t{\n\n\t}", "private function __clone()\n\t{\n\n\t}", "final public function __clone()\n {\n $this->aliased = false;\n }", "function copyto($key) {\n\t\t$var=&\\Base::instance()->ref($key);\n\t\tforeach ($this->document as $key=>$field)\n\t\t\t$var[$key]=$field;\n\t}", "private function __clone()\r\n {\r\n // ...\r\n }", "private function __clone()\n\t{\n\t}", "private function __clone()\n\t{\n\t}", "function __clone()\n {\n\t\n }", "public function assign($variable , $value)\n {\n $this->data[$variable] = $value;\n }", "public function assign($name, $value){\r\n\t\t$this->vars[$name] = $value; \r\n\t}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }" ]
[ "0.6436727", "0.6036905", "0.59472734", "0.57987446", "0.5784976", "0.577117", "0.5710328", "0.5691594", "0.56220937", "0.5592928", "0.55898035", "0.55898035", "0.55880296", "0.55396765", "0.5527977", "0.5527402", "0.5509303", "0.55054355", "0.5488795", "0.5488795", "0.5488795", "0.5488795", "0.5488795", "0.5488795", "0.5488795", "0.5488795", "0.5488795", "0.5488795", "0.5488795", "0.5475659", "0.5470498", "0.546972", "0.5462723", "0.5449004", "0.5433463", "0.54070014", "0.5392647", "0.5384754", "0.5370491", "0.5359675", "0.5359675", "0.53563756", "0.5330776", "0.5326313", "0.5318932", "0.53106505", "0.530223", "0.530223", "0.5294166", "0.52920043", "0.5267511", "0.52628624", "0.52591985", "0.5256836", "0.52558154", "0.52499473", "0.52411765", "0.52411765", "0.5232514", "0.5231985", "0.5229527", "0.52292603", "0.52292603", "0.5227421", "0.52258974", "0.522466", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.52243423", "0.5214037", "0.5214037", "0.5214037", "0.5214037", "0.5214037", "0.5214037", "0.5214037", "0.5214037", "0.5214037", "0.5214037" ]
0.0
-1
Run the database seeds.
public function run() { $customer = new Customer(); $customer->id = 1; $customer->name = "customer 1"; $customer->phone = "2018-09-26"; $customer->email = "[email protected]"; $customer->city_id = 5; $customer->save(); $customer = new Customer(); $customer->id = 2; $customer->name = "customer 2"; $customer->phone = "2018-09-26"; $customer->email = "[email protected]"; $customer->city_id = 5; $customer->save(); $customer = new Customer(); $customer->id = 3; $customer->name = "customer 3"; $customer->phone = "2018-09-26"; $customer->email = "[email protected]"; $customer->city_id = 6; $customer->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
getFoodTruckNearestLocation This method returns JSON data of all foodtrucks in a partular Latitude/Longitude retrieved from csv
public function getFoodTruckNearestLocation($lat, $lon ,$countOfLoc) { try { $rows = array_map('str_getcsv', file('../Mobile_Food_Facility_Permit.csv')); $header = array_shift($rows); $csv = array(); $counter = 1; $myJSON = array(); foreach($rows as $row) { $a = $lat - $row[14]; $b = $lon - $row[15]; $distance = sqrt(($a**2) + ($b**2)); $distances[$row[0]] = $distance; $array[$row[0]] = $row; $csv[$row[0]] = array_combine($header, $row); } asort($distances); $counter = 1; $myJSON = array(); foreach($distances as $id=>$value) { $foodTruck[] = array('name'=>$csv[$id]['Applicant'], "address"=>$csv[$id]['LocationDescription'], "facilityType"=>$csv[$id]['FacilityType']); if($counter++ >$countOfLoc) break; } } catch (Exception $e) { return json_encode(array("error"=>"true","description"=>"Exception")); } return json_encode($foodTruck); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFoodTruckNearestLocationDB($lat, $lon ,$countOfLoc) {\r\n try{\r\n $query = \"\r\n SELECT * FROM (\r\n SELECT *, \r\n (\r\n (\r\n (\r\n acos(\r\n sin(( $lat * pi() / 180))\r\n *\r\n sin(( `Latitude` * pi() / 180)) + cos(( $lat * pi() /180 ))\r\n *\r\n cos(( `Latitude` * pi() / 180)) * cos((( $lon - `Longitude`) * pi()/180)))\r\n ) * 180/pi()\r\n ) * 60 * 1.1515 * 1.609344\r\n )\r\n as distance FROM mobile_food_facility_permit\r\n ) markers order by distance asc \r\n \r\n LIMIT $countOfLoc;\";\r\n //echo $query;\r\n $result = $this->db->query($query);\r\n $foodTruck = array();\r\n if ($result->num_rows > 0) {\r\n // output data of each row\r\n $counter = 1;\r\n while($row = $result->fetch_assoc()) {\r\n $foodTrucks[] = array( \"name\"=>$row[\"Applicant\"], \r\n \"address\"=>$row[\"LocationDescription\"],\r\n \"facilityType\"=>$row[\"FacilityType\"]);\r\n if($counter++ >$countOfLoc) break;\r\n }\r\n }\r\n } catch (Exception $e) {\r\n return json_encode(array(\"error\"=>\"true\",\"description\"=>\"Exception\"));\r\n }\r\n return json_encode($foodTrucks);\r\n }", "public function nearest()\n {\n $lat = Input::get('lat');\n $lon = Input::get('lon');\n\n $location = Location::getNearestLocation($lat, $lon);\n return response()->json($location);\n }", "private function getLocation() {\n $location = false;\n \t$result = new StdClass();\n \t// $result->location = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->nearest = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->location = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $this->coordinates->latitude . ',' . $this->coordinates->longitude . '&sensor=false';\n\n \t$result = json_decode($this->getUrlContents($result->location));\n \t// $result->nearest = unserialize($this->getUrlContents($result->nearest));\n\n $location = $this->validateLocation($result);\n\n if(is_array($location))\n \t $location = $this->filterLocation($location);\n }", "function getCarParkLoc($from_lat, $from_lon){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.1;\n $sql = \"SELECT node_id, lat, lon, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_car_parkings\n ORDER BY x ASC LIMIT 1\";\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = array($row['lat'],$row['lon']);\n }\n return $arr[0];\n}", "function get_snapped_point ($lat, $lng)\n{\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/json\",\n 'method' => 'GET' \n )\n );\n \n //ATTENTION :Replace your own api_key\n $api_key=\"key\";\n $url_arr = array(\"https://roads.googleapis.com/v1/nearestRoads?points=$lat,$lng&key=\".$api_key,\n \"https://roads.googleapis.com/v1/snapToRoads?path=$lat,$lng&key=\".$api_key);\n\n $url= $url_arr[array_rand($url_arr)];\n $context = stream_context_create($options);\n\n $result = file_get_contents($url, false, $context);\n $result_arr=json_decode($result,true);\n\n \n return ($result_arr[\"snappedPoints\"][0][\"location\"]);\n}", "function findClosest($res, $curLat, $curLon) {\n // REMEMBER TO CHANGE CURLAT1 to CURLAT and CURLON1 to CURLON\n // originLan, originLon, destLan, destLon\n\n $absLoc = abs($curLat) + abs($curLon);\n\n\n // name, absLoc, latitude, longitude, rating, clean, purchase, bidet, squat, tpStash, soap\n while ($row = $res->fetch_assoc()) {\n $dbAbsLoc[] =floatval($row['absLoc']);\n }\n\n // locate the nearest absLoc point\n $i = 0;\n do {\n $tempLoc = abs($absLoc - $dbAbsLoc[$i]); \n $i++;\n } while ($i < count($dbAbsLoc) && $tempLoc > (abs($absLoc - $dbAbsLoc[$i])));\n $tempLoc = $dbAbsLoc[$i-1];\n requestClosest($tempLoc, $curLat, $curLon);\n}", "function requestClosest($tempLoc, $curLat, $curLon) {\n global $mysqli;\n global $toiletDB;\n \n $revised = $mysqli->prepare(\"SELECT * FROM $toiletDB WHERE absLoc = $tempLoc\");\n $revised->execute();\n $res = $revised->get_result();\n \n printClosest($res, $curLat, $curLon);\n \n $res->close(); \n}", "function getdistancebetweenPoints($lat=null, $lng=null, $lat1=null, $lng1=null) {\n global $token;\n global $g_key;\n global $api_googleapis;\n $file_content = ''.$api_googleapis.'origin='.$lat.'&destination='.$lng.'&alternatives=true&sensor=false&key='.$g_key.'&='.$token.'';\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $file_content);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_PROXYPORT, 3128);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $distbetween_content = curl_exec($ch);\n\n curl_close($ch);\n\n$response = json_decode($distbetween_content, true);\nif($response['status']=='OK') {\n\nforeach($response[\"routes\"] as $key => $data) {\n$route = json_encode($data[\"legs\"][0]['distance']['value'], true);\n$duration = json_encode($data[\"legs\"][0]['duration']['value'], true);\n$lat_start = json_encode($data[\"legs\"][0]['start_location']['lat'], true);\n$lng_start = json_encode($data[\"legs\"][0]['start_location']['lng'], true);\n$lat_end = json_encode($data[\"legs\"][0]['end_location']['lat'], true);\n$lng_end = json_encode($data[\"legs\"][0]['end_location']['lng'], true);\n\n $distance = array(\n 'status' => 'success',\n 'path' => array(array($lat_start, $lng_start),\n array($lat_end, $lng_end)),\n 'total_distance' => $route,\n 'total_time' => $duration);\n return $distance;\n }\n\n\n}else {\n$arr_error = array('status' => 'failure', 'error' => 'ERROR_DESCRIPTION');\necho json_encode($arr_error);\nreturn 0;\n}\n\n\n\n\n}", "function get_route($my_location){\n $route_start = $my_location[0];\n $route_end = $my_location[1];\n\n $loc_api_key = AIzaSyBFuL6yafR8BuhdbzupDAcorVH4sAO2YpE;\n //$route_url = \"https://maps.googleapis.com/maps/api/directions/json?origin=\".$route_start.\"&destination=\".$route_end.\"&key=\".$loc_api_key.\"&alternatives=true\"; this is for detours\n $route_url = \"https://maps.googleapis.com/maps/api/directions/json?origin=\".$route_start.\"&destination=\".$route_end.\"&key=\".$loc_api_key;\n\n if (!function_exists('curl_init')){\n die('Can\\'t find cURL module'); \n }\n\n $chRD = curl_init(); //RD = Route Directions\n\n if (!$chRD){\n die('Couldn\\'t initialize a cURL module'); \n }\n\n curl_setopt($chRD, CURLOPT_URL, $route_url);\n curl_setopt($chRD, CURLOPT_RETURNTRANSFER, TRUE);\n \n $dataRD = curl_exec($chRD);\n curl_close($chRD);\n\n $routes = json_decode($dataRD);\n\n return $routes;\n}", "function getLatLong($address, $city, $postalCode) {\n $combinedAddress = $address . \", \" . $postalCode . \" \" . $city;\n\n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" . urlencode($combinedAddress) . \"&key=\" . Config::GOOGLE_API_KEY;\n $context = stream_context_create();\n $result = file_get_contents($url, false, $context);\n\n if (isset($result)) {\n $parsedResult = json_decode($result, true);\n\n if (isset($parsedResult[\"results\"])) {\n $results = $parsedResult[\"results\"];\n $firstLocation = $results[0];\n return $firstLocation[\"geometry\"][\"location\"];\n } else {\n echo($result);\n }\n } else {\n echo \"HELP\";\n }\n}", "function getForceAndNhood($lat, $lng) {\n\t// My unique username and password, woo! The API requires this on every query.\n\t$userpass = POLICE_API_KEY;\n\t$url = \"http://policeapi2.rkh.co.uk/api/locate-neighbourhood?q=$lat,$lng\";\n\n\t$curl = curl_init();\n\n\t// Gotta put dat password in.\n\tcurl_setopt($curl, CURLOPT_USERPWD, $userpass);\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\n\t// Without this, we just get \"1\" or similar.\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n\n\t$data = curl_exec($curl);\n\n\tcurl_close($curl);\n\n\t// The API returns JSON, and json_decode produces an interesting mix of objects and arrays.\n\t$dataObj = json_decode($data);\n\t\n\treturn $dataObj;\n\t}", "function getBikeParkLoc($from_lat, $from_lon){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.1;\n $sql = \"SELECT node_id, lat, lon, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_bike_parkings\n ORDER BY x ASC LIMIT 1\";\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = array($row['lat'],$row['lon']);\n }\n return $arr[0];\n}", "function get_gps($mcc, $mnc, $lac, $cellid) {\r\n $gps_data = \"\";\r\n $key = \"f0d88cf6-3a80-4f12-830d-f4b8fd1f06b0\";\r\n\r\n ///JSON CODE\r\n //$URL = \"http://opencellid.org/cell/get?key=\".$key.\"&mcc=\".$mcc.\"&mnc=\".$mnc.\"&lac=\".$lac.\"&cellid=\".$cellid.\"&format=json\"; \r\n $URL = \"http://opencellid.org/cell/get?key=$key&mcc=$mcc&mnc=$mnc&lac=$lac&cellid=$cellid&format=json\";\r\n\r\n $raw = @file_get_contents($URL);\r\n $json_data = json_decode($raw);\r\n\r\n //var_dump($json_data);\r\n echo \"<br>\";\r\n //$json = '{\"foo-bar\": 12345}';\r\n //$obj = json_decode($json);\r\n //echo \"lon=\". $json_data->{'lon'}; // 12345\r\n\r\n $gps_data = $json_data->{'lat'} . \",\" . $json_data->{'lon'};\r\n return $gps_data;\r\n}", "function grabUserLocation($input){\n $user_city = $input;\n $request_url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\".$user_city.\"%20Canada&sensor=false\";\n $USERJSON = file_get_contents($request_url);\n $result = json_decode($USERJSON);\n $lat=$result->results[0]->geometry->location->lat;\n $long=$result->results[0]->geometry->location->lng;\n return compact('lat','long');\n}", "public function actionProximitycatlist($latitude, $longitude, $radius, $kind)\n {\n \n // clean term\n //$term = str_replace(',', '', $term);\n //$term = str_replace(' ', '', $term);\n //$term = str_replace(' ', '', $term);\n\t\n\t$url = \"http://ec2-54-204-2-189.compute-1.amazonaws.com/api/nearby\";\n\t$params = array('latitude' => $latitude, 'longitude' => $longitude, 'radius' => $radius, 'kind' => $kind);\n\t// Update URL to container Query String of Paramaters \n\t$url .= '?' . http_build_query($params);\n\t\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t$json = curl_exec($curl);\n\tcurl_close($curl);\n\t\t\n\t$return_array = json_decode($json);\n\t\t\n $location_service_rows = array(); \n \n\tif ($return_array) {\n $location_service_rows = $return_array->message->rows;\n\t}\n\t\t\n // Did we get some results?\n if(empty($location_service_rows)) {\n // No\n $this->_sendResponse(200, \n sprintf('No items where found.') );\n } else {\n // Prepare response\n $rows = array();\n foreach($location_service_rows as $row) {\n $id = $row->id;\n $name = $row->name;\n $address = $row->address->address;\n $address_extended = $row->address->address_extended;\n $po_box = $row->address->po_box;\n $locality = $row->address->locality;\n $region = $row->address->region;\n $post_town = $row->address->post_town;\n $admin_region = $row->address->admin_region;\n $postcode = $row->address->postcode;\n $country = $row->address->country;\n $tel = $row->address->tel;\n $fax = $row->address->fax;\n $neighbourhood = $row->address->neighbourhood;\n $website = $row->website;\n $email = $row->email;\n $category_ids = $row->category_ids;\n\t\t$category_labels = $row->category_labels;\n $status = $row->status;\n $chain_name = $row->chain_name;\n $chain_id = $row->chain_id;\n $row_longitude = $row->longitude;\n $row_latitude = $row->latitude;\n $abslongitude = $row->abslongitude;\n $abslatitude = $row->abslatitude;\n $distance = $row->distance;\n \n \n //$terms_array = explode(' ',$terms);\n //$match_count = 0;\n //foreach ($terms_array as $term) {\n //if(stripos($name, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n //if(stripos($category_labels, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n $match_count = 1;\n //}\n //$term_match_count = array('term_match_count' => $match_count);\n //array_push($row, $term_match_count);\n //$row['term_match_count'] = $match_count;\n $new_row = array(\n 'id' => $id,\n 'name' => $name,\n 'address' => $address,\n 'address_extended' => $address_extended,\n 'po_box' => $po_box,\n 'locality' => $locality,\n 'region' => $region,\n 'post_town' => $post_town,\n 'admin_region' => $admin_region,\n 'postcode' => $postcode,\n 'country' => $country,\n 'tel' => $tel,\n 'fax' => $fax,\n 'neighbourhood' => $neighbourhood,\n 'website' => $website,\n 'email' => $email,\n 'category_ids' => $category_ids,\n 'category_labels' => $category_labels,\n 'status' => $status,\n 'chain_name' => $chain_name,\n 'chain_id' => $chain_id,\n 'longitude' => $row_longitude,\n 'latitude' => $row_latitude,\n 'abslongitude' => $abslongitude,\n 'abslatitude' => $abslatitude,\n 'distance' => $distance,\n 'term_match_count' => $match_count\n );\n //if ($match_count > 0) {\n $rows[] = $new_row;\n //}\n } // end foreach location service row\n // Send the response\n $this->_sendResponse(200, CJSON::encode($rows));\n }\n }", "function getLnt($zip){\r\n $url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\r\n \".urlencode($zip).\"&sensor=false\";\r\n $result_string = file_get_contents($url);\r\n $result = json_decode($result_string, true);\r\n //print_r($result);die();\r\n return $result['results'][0]['geometry']['location'];\r\n }", "public function find($postcode){\n $inputCoordinates =$this->getCoordinates($postcode);\n\n if(!is_array($inputCoordinates))\n return $inputCoordinates;\n //Uses updateCoordinates to check if there are any new coffeedrop locations and add their lat and lon to db\n $dbpostcodes = $this->updateCoordinates();\n $distances = [];\n foreach ($dbpostcodes as $location) {\n //calculate the distances between the input and all db locations\n $distance = $this->getDistanceBetweenTwoPoints($inputCoordinates,array('latitude' => $location->latitude,'longitude' => $location->longitude));\n $distances[$location->postcode] = $distance;\n }\n //compares distances\n $closestCoffeeDrop = min(array_keys($distances, min($distances)));\n\n $closestCoffeeDropInfo = CoffeeDrop::where('postcode', $closestCoffeeDrop)->first();\n return response()->json(['information' => $closestCoffeeDropInfo]);\n }", "private function getLatLng() {\n\t\tif( $this->getAutomaticLocation() && ( $this->isChanged() || ( !$this->getLat() && !$this->getLng() ) ) ) {\n\t\t\t$addressStr = $this->getAddLine1() . ' ' . $this->getStreetName() . ',' . $this->getTown();\n\t\t\t$addressStr.= ( $this->getCity() ) ? ',' . $this->getCity() : '';\n\t\t\t$addressStr.= ( $this->getRegion() ) ? ',' . $this->getRegion() : '';\n\t\t\t$addressStr.= ',' . $this->getPostalCode() . ',' . $this->getCountryCode();\n\t\t\t$req = sprintf( 'http://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false', urlencode( $addressStr ) );\n\t\t\tif( !( $response = @file_get_contents( $req ) ) ) {\n\t\t\t\tthrow new Exception( sprintf( 'Unable to contact (%s)', $req ) );\n\t\t\t}\n\t\t\t$geoCode = json_decode( $response );\n// Do a switch here based on the possible status messages returned\n\t\t\tif( is_object( $geoCode ) ) {\n\t\t\t\tswitch( $geoCode->status ) {\n\t\t\t\t\tcase static::API_RESPONSE_ZERO_RESULTS:\n\t\t\t\t\t\t// ZERO RESULTS\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase static::API_RESPONSE_OK:\n\t\t\t\t\t\t$o = new StdClass();\n\t\t\t\t\t\t$o->Lat = $geoCode->results[0]->geometry->location->lat;\n\t\t\t\t\t\t$o->Lng = $geoCode->results[0]->geometry->location->lng;\n\t\t\t\t\t\treturn $o;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Exception( sprintf( 'Invalid response (%s) from (%s)', $response, $req ) );\n\t\t\t}\n\t\t} else {\n\t\t\t$o = new StdClass();\n\t\t\t$o->Lat = $this->getLat();\n\t\t\t$o->Lng = $this->getLng();\n\t\t\treturn $o;\n\t\t}\n\t}", "public function StopsNearLocation($latitude = null, $longitude = null) {\r\n if ($latitude == null) {\r\n throw new Exception(\"Cannot fetch \" . __METHOD__ . \" - no latitude given\");\r\n }\r\n \r\n if ($longitude == null) {\r\n throw new Exception(\"Cannot fetch \" . __METHOD__ . \" - no longitude given\");\r\n }\r\n \r\n $parameters = array(\r\n \"latitude\" => $latitude,\r\n \"longitude\" => $longitude\r\n );\r\n \r\n $return = array();\r\n \r\n foreach ($this->fetch(\"nearme\", $parameters) as $row) {\r\n $row['result']['location_name'] = trim($row['result']['location_name']);\r\n \r\n if ($row['result']['transport_type'] == \"train\" || preg_match(\"@Railway@i\", $row['result']['location_name'])) {\r\n $placeData = array(\r\n \"stop_id\" => $row['result']['stop_id'],\r\n \"stop_name\" => $row['result']['location_name'],\r\n \"stop_lat\" => $row['result']['lat'],\r\n \"stop_lon\" => $row['result']['lon'],\r\n \"wheelchair_boarding\" => 0,\r\n \"location_type\" => 1\r\n );\r\n \r\n /**\r\n * Check if this is stored in the database, and add it if it's missing\r\n */\r\n \r\n if (!in_array($row['result']['location_name'], $this->ignore_stops) && \r\n $row['result']['stop_id'] < 10000 &&\r\n !preg_match(\"@#([0-9]{0,3})@\", $row['result']['location_name'])\r\n ) {\r\n $query = sprintf(\"SELECT stop_id FROM %s_stops WHERE stop_id = %d LIMIT 1\", self::DB_PREFIX, $row['result']['stop_id']); \r\n $result = $this->adapter->query($query, Adapter::QUERY_MODE_EXECUTE); \r\n \r\n if ($result->count() === 0) {\r\n $Insert = $this->db->insert(sprintf(\"%s_stops\", self::DB_PREFIX));\r\n $Insert->values($placeData);\r\n $selectString = $this->db->getSqlStringForSqlObject($Insert);\r\n $this->adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n }\r\n \r\n $placeData['distance'] = vincentyGreatCircleDistance($row['result']['lat'], $row['result']['lon'], $latitude, $longitude);\r\n $placeData['provider'] = $this->provider;\r\n \r\n if ($placeData['distance'] <= 10000) { // Limit results to 10km from provided lat/lon\r\n $return[] = $placeData;\r\n }\r\n }\r\n }\r\n }\r\n \r\n return $return;\r\n }", "function printClosest($res, $curLat, $curLon) {\n // name, absLoc, latitude, longitude, rating, clean, purchase, bidet, squat, tpStash, soap\n // real output inc!\n \n while ($row = $res->fetch_assoc()) { \n echo '<div>';\n echo '<p>Origin: <span id=\"originLat\">'.$curLat.'</span> , \n <span id=\"originLon\">'.$curLon.'</span> </br> >>> ';\n echo 'Destination: <span id=\"destLat\">' .$row['latitude']. '</span> , \n <span id=\"destLon\">' .$row['longitude']. '</span></br></p>';\n echo '<p id = \"name\">' .$row['name']. '</p>';\n echo '<p>Rating: ' .$row['rating']. '/5 ';\n echo 'Cleanliness: ' .$row['clean']. '/5</p>';\n echo '<p>The bathroom has: ';\n if ($row['purchase']) {\n echo 'purchase required, ';\n }\n if ($row['bidet']) {\n echo 'a bidet, ';\n }\n if ($row['squat']) {\n echo 'a squat toilet, '; \n }\n if ($row['tpStash']) {\n echo 'ample toilet paper, ';\n }\n if ($row['soap']) {\n echo 'soap';\n }\n echo '</p>';\n echo '</div>';\n }\n}", "function nearbysearch($lat, $lng, $type){\r\n\t$key = \"AIzaSyA2PDrfTTbXNZKOn15K-VbWgLfdTevM3qw\";\r\n\t$url = \"https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=\".$lat.\",\".$lng.\"&radius=500&type=\".urlencode($type).\"&key=\" . $key;\r\n\t$json = file_get_contents($url);\r\n\treturn $json;\r\n}", "function get_lat_long($address){\r\n\t$API_KEY = 'AIzaSyC70LnMBiqyXcmpnQeryzq0VK12o6P5pnw';\r\n\t$address = str_replace(\" \", \"+\", $address);\r\n\t$url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".$address.\"&key=\".$API_KEY.\"\";\r\n\t$json = file_get_contents($url);\r\n\t$json = json_decode($json);\r\n\tif($json->status == 'ZERO_RESULTS'){\r\n\t\t$lat = 0;\r\n\t\t$long = 0; \t\r\n\t}else{\r\n\t\t$lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};\r\n\t\t$long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};\t\r\n\t}\r\n\t\r\n\t$location = [$lat,$long];\r\n\treturn $location;\r\n}", "public function getHotelLocation()\n {\n return $this->select('city')->groupBy('city')->orderBy('city', 'ASC')->findAll();\n }", "public function weatherLocation() {\n\t\treturn $this->get('PLZ');\n\t}", "function get_wheather_data_rounded_off($city)\n {\n $config = \\Drupal::config('weather.settings');\n $appid= $config->get('appid');\n $client = new Client();\n $response = $client->request('GET', 'https://samples.openweathermap.org/data/2.5/weather?q='.$city.'&appid='.$appid);\n $res = Json::decode($response->getBody());\n $temp_min = ceil($res['main']['temp_min']);\n $temp_max = ceil($res['main']['temp_max']);\n $pressure = ceil($res['main']['pressure']);\n $humidity = ceil($res['main']['humidity']);\n $speed = ceil($res['wind']['speed']);\n //this only for debugging purpose if whether it is rounded off or not\n \\Drupal::logger('my_module')->notice(\"temp min:\".$temp_min.\" temp max:\".$temp_max.\" pressure:\".$pressure.\" humidity:\".$humidity.\" speed:\".$speed);\n return array(\n '#temp_min' => $temp_min,\n '#temp_max' => $temp_max,\n '#pressure' => $pressure,\n '#humidity' => $humidity,\n '#wind' => $speed,\n );\n }", "function get_coordinates($object, $field_name, $request) {\n\tglobal $wpdb;\n\t$location = $wpdb->get_row('SELECT wp_geo_mashup_locations.lat, wp_geo_mashup_locations.lng FROM wp_geo_mashup_locations INNER JOIN wp_geo_mashup_location_relationships ON wp_geo_mashup_locations.id = wp_geo_mashup_location_relationships.location_id\nWHERE wp_geo_mashup_location_relationships.object_id = ' . $object[\"id\"]);\n\tif ($location) {\n\t\treturn $location->lat . \",\" . $location->lng;\n\t} else {\n\t\treturn null;\n\t}\n}", "public function getTrainDetails(){\n $day = $this->_request['day'];\n $sourceCity = $this->_request['sourceCity'];\n $destinationCity = $this->_request['destinationCity'];\n if ($day=='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train\";\n else if($day=='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity'\";\n else if($day=='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND ToStation = '$destinationCity'\";\n else if($day=='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND FromStation = '$sourceCity' AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND $day = 1\";\n else if($day!='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train where $day = 1\";\n $rows = $this->executeGenericDQLQuery($sql);\n $trainDetails= array();\n for($i=0 ; $i<sizeof($rows);$i++)\n {\n $trainDetails[$i]['TrainID'] = $rows[$i]['TrainID'];\n $trainDetails[$i]['TrainNumber'] = $rows[$i]['TrainNumber'];\n $trainDetails[$i]['TrainName'] = $rows[$i]['TrainName'];\n $trainDetails[$i]['FromStation'] = $rows[$i]['FromStation'];\n $trainDetails[$i]['ToStation'] = $rows[$i]['ToStation'];\n $trainDetails[$i]['StartAt'] = $rows[$i]['StartAt'];\n $trainDetails[$i]['ReachesAt'] = $rows[$i]['ReachesAt'];\n $trainDetails[$i]['Monday'] = $rows[$i]['Monday'];\n $trainDetails[$i]['Tuesday'] = $rows[$i]['Tuesday'];\n $trainDetails[$i]['Wednesday'] = $rows[$i]['Wednesday'];\n $trainDetails[$i]['Thursday'] = $rows[$i]['Thursday'];\n $trainDetails[$i]['Friday'] = $rows[$i]['Friday'];\n $trainDetails[$i]['Saturday'] = $rows[$i]['Saturday'];\n $trainDetails[$i]['Sunday'] = $rows[$i]['Sunday'];\n // $trainDetails[$i]['CityID'] = $rows[$i]['CityID'];\n $trainDetails[$i]['WebLink'] = $rows[$i]['WebLink'];\n }\n $this->response($this->json($trainDetails), 200);\n\n }", "function getCoordonnees($adresse){\n $apiKey = \"000824788445984525451:fkamkqgo6se\";//Indiquez ici votre clé Google maps !\n $url = \"http://maps.google.com/maps/geo?q=\".urlencode($adresse).\"&output=csv&key=\".$apiKey;\n\n $csv = file($url);\n $donnees = explode(\",\",$csv[0]); \n\t$t = array($donnees[2],$donnees[3]);\n\t\n return $t;\n\t}", "function getCoordonnees($adresse){\n $apiKey = \"000824788445984525451:fkamkqgo6se\";//Indiquez ici votre clé Google maps !\n $url = \"http://maps.google.com/maps/geo?q=\".urlencode($adresse).\"&output=csv&key=\".$apiKey;\n\n $csv = file($url);\n $donnees = explode(\",\",$csv[0]); \n\t$t = array($donnees[2],$donnees[3]);\n\t\n return $t;\n\t}", "function check_geolocation($nameofgeo){\n\t$url = \"https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=\".str_replace(\" \",\"%\",$nameofgeo).\"&inputtype=textquery&fields=photos,formatted_address,name&locationbias=circle:[email protected],-122.2226413&key=AIzaSyDQfsEll4lB-xdxkLXGZA7_a2rMCyVM4Ok\";\n\t$json = file_get_contents($url);\n\t$json_data = json_decode($json, true);\n\tif ($json_data[\"status\"]==\"ZERO_RESULTS\")\n\t\treturn(\"Numele introdus nu este o geolocatie!\");\n\telse{\n\t\t#print_r($json_data['candidates'][0]['name']);\n\t\t#echo \" este nume pentru-> \"; \n\t\t#echo \"<br><br>\";\n\t\treturn($json_data[\"status\"]);\n\t}\n}", "function generateFullPath() {\n include_once('../common/common_functions.php');\n $jsonRouteFilePath = \"cricketTraveledPath.json\";\n $error_msg = \"\";\n $result = true;\n $travelObj = new Travel();\n $tdh_db = \"CLEARDB_URL_TDH_SCRIPTS\";\n \n //Get the points from the database sorted by tripname, then date\n try{\n if($db = connect_db($tdh_db)){\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n \n $query_sel = $db->query(\"SELECT * from gps_readings order by `tripname`, `time` ASC\");\n $previousLatLong = [];\n $previousTripName = \"\";\n $tripLeg_id = 0;\n if($query_sel->rowCount() > 0){\n foreach ($query_sel as $row){\n $currentLatLong = [ $row['lat'], $row['long'] ];\n $time = $row['time'];\n if(!empty($previousLatLong)){\n //get the mapquest info\n// echo \"getting directions with \"\n// .implode(\",\",$currentLatLong)\n// .\" and \"\n// .implode(\",\",$previousLatLong)\n// .\" <br />\";\n $mqString = getMQroute($previousLatLong, $currentLatLong);\n if($mqString){\n //echo \"Got mq result <br />\";\n $mqResult = json_decode($mqString);\n if( $row['tripname'] !== $previousTripName){\n $newTrip = new Trip();\n $newTrip->name = ($row['tripname']);\n $travelObj->add_trip($newTrip);\n $previousTripName = $row['tripname'];\n }\n //Get the latest trip object from the travelObj\n $currentTrip = end($travelObj->trips);\n\n //If the points not the same make a new leg\n $distance = $mqResult->{\"route\"}->{\"distance\"};\n if($distance > 0){\n $tripLeg_id += 10;\n $newLeg = new TripLeg();\n $newLeg->id = $tripLeg_id;\n $newLeg->distance = $distance;\n $newLeg->startLatLong = $previousLatLong;\n $newLeg->endLatLong = $currentLatLong;\n $newLeg->startTime = $time;\n $newLeg->MQencodedPath = $mqResult->{\"route\"}->{\"shape\"}->{\"shapePoints\"};\n\n //add the leg to the current trip\n $currentTrip->add_leg($newLeg);\n }\n }else{ \n //Map Quest result not returned\n $error_msg = \"Map Quest result not returned\";\n $result = false;\n }\n }\n $previousLatLong = $currentLatLong;\n }\n //If none of the leg creations failed,\n //Turn the object into a json string and update the file.\n if($result){\n if($newTripsRoute = fopen($jsonRouteFilePath,\"w\")){\n fwrite($newTripsRoute, json_encode($travelObj));\n fclose($newTripsRoute);\n $result = true;\n }else{\n //error using fopen.\n $error_msg = \"Could not open file.\";\n $result = false;\n }\n }else{\n $error_msg.=\"Failed to create all legs of trip from MQ api. <br />\";\n }\n }\n }else{ //handle error\n $error_msg = \"Could not connect to database\";\n $result = false;\n }\n }catch(PDOException $ex) {\n $error_msg = \"CODE 120: Could not connect to mySQL DB<br />\"; //user friendly message\n $error_msg .= $ex->getMessage();\n $result = false; \n }\n echo $result ? \"Success! New file created.\" : $error_msg;\n return $result;\n}", "public function getLatitude(): float;", "public function getUserLocation() {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip_note = 'HTTP_CLIENT_IP='.$_SERVER['HTTP_CLIENT_IP'];\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip_note = 'HTTP_X_FORWARDED_FOR='.$_SERVER['HTTP_X_FORWARDED_FOR'];\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip_note = 'REMOTE_ADDR='.$_SERVER['REMOTE_ADDR'];\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n $ip = '117.20.119.245';\n $loc = file_get_contents(\"http://ipinfo.io/\".$ip.\"/loc\");\n\n if($loc) {\n $array_loc = explode(',', $loc);\n return ['lat'=> ((isset($array_loc[0]))? $array_loc[0]:'') ,'lon'=> ((isset($array_loc[1]))? $array_loc[1]:'')];\n }\n\n return ['lat'=>'','lon'=>''];\n\n }", "public function findMinPrice() : array {\n $minPriceFlight = null;\n foreach (range(0, $this->flexibility) as $index) {\n $fromDate = $this->incrementDate($this->startingDate, $index);\n $returnDate = $this->incrementDate($fromDate, $this->duration);\n foreach ($this->destinations as $destination) {\n $searchMinPrice = $this->flightFinder->getLowestPrice($this->startingAirport, $destination, $fromDate, $returnDate);\n $this->flights[] = compact('searchMinPrice', 'destination', 'fromDate', 'returnDate');\n if ($this->isPriceLower($minPriceFlight, $searchMinPrice)) {\n $minPriceFlight = compact('searchMinPrice', 'destination', 'fromDate', 'returnDate');\n }\n }\n }\n\n return $minPriceFlight;\n }", "function getdistance_new($vehicleid, $customerno) {\n $dm = new DeviceManager($customerno);\n $odo_reading = $dm->get_odometer_reading($vehicleid, $customerno);\n $firstodometer = $odo_reading['first_odo'];\n $lastodometer = $odo_reading['cur_odo'];\n if ($lastodometer < $firstodometer) {\n $lastodometer = $odo_reading['max_odo'] + $lastodometer;\n }\n $totaldistance = $lastodometer - $firstodometer;\n if (round($totaldistance) != 0) {\n return round(($totaldistance / 1000), 2);\n }\n return $totaldistance;\n}", "public function getLocation()\n {\n if (array_key_exists('location', $this->userInfo)) {\n return $this->userInfo['location'];\n }\n\n elseif (isset($this->response['placesLived']) && is_array($this->response['placesLived']))\n {\n foreach ($this->response['placesLived'] as $location)\n {\n if (isset($location['primary']) && $location['primary'] == 1)\n {\n if (isset($location['value']))\n {\n $loc = preg_replace('/[\\x03-\\x20]{2,}/sxSX', ' ', $location['value']);\n $glue = ',';\n\n if (strpos($location, $glue) === false) {\n $glue = ' ';\n }\n $loc = explode($glue, $loc);\n\n if(count($loc) <= 3) {\n $this->userInfo['city'] = trim($loc[0]);\n $this->userInfo['country'] = isset($loc[1]) ? isset($loc[2]) ? trim($loc[2]) : trim($loc[1]) : null;\n }\n else{\n $this->userInfo['city'] = null;\n $this->userInfo['country'] = null;\n }\n\n return $this->userInfo['location'] = $location['value'];\n }\n break;\n }\n }\n }\n\n $this->userInfo['city'] = null;\n $this->userInfo['country'] = null;\n\n return $this->userInfo['location'] = null;\n }", "function addPointToPath($newLatLong, $trip) {\n $jsonRouteFilePath = \"cricketTraveledPath.json\";\n $error_msg = \"\";\n $result = false;\n \n //read the old $lat and $long from the $jsonTravelFilePath\n $tripPaths = json_decode(file_get_contents($jsonRouteFilePath)); \n $lastLeg = end($tripPaths->{$trip});\n $lastLatLong = $lastLeg->{\"endLatLong\"};\n $lastid = $lastLeg->{\"id\"};\n \n //get a new encoded path from MapQuestAPI\n $mqString = getMQroute($lastLatLong, $newLatLong);\n if($mqString){\n $mqResult = json_decode($mqString);\n \n //create a new Leg php object\n /* looks like this in json format\n { \n \"id\": 40,\n \"startLatLong\": [ lat ,long]\n \"endLatLong\": [31.9494000, -104.6993000],\n \"distance\": 600.433,\n \"MQencodedPath\": \"}yvwEh_prQFwB??NoK??\\\\iELiDBy@???G?y@@sEAa@??G?kA?E???A`@CrG??BbABlGEnCIjCKnBGnBYjF?xBFvB`@~DRpBNpAFt@H`BDrA@d@C`GAdBGbCAtDAfA?jA?dG?jB?~@?T?xC?`CAbE?~D?pK?`H?~C?vA?`@?L?b@?fA?`D?lC?lC?vA?dB?`H@~K?rHA~B@hH?^?zE?|E?`FBzEH~E@jF?`B?lABnW?|A?fI?|A?nD?|A?zB@jT?xA?h@?xEAjC?rB@bFCxCGdBUvCUhBs@~FWpBa@|CS~AkAhI{@lGS~AGx@[fCeBlM{@nGOpAWxBg@zDoA|JSbCS|BUpFGtCC|D@vD?pBBtLBdI?pBDxL@pKBjHBdBLjI@vEDdQCff@?~A]xb@G|P?tPBd]Gx\\\\E~LA~L?xAArTFfFRhF\\\\`Fb@|EpAtHfB|HhAvDzCzJtIbYjFtPdFhPVz@x@fDj@rDf@fFJ|E?hD?nOBfTAzN@|L?V?tI?rCExBMlCGpEDhBArQ?bA?pHAbI@bICzFAfA@lDClC@vH?jI@`@CvC?rCElBG~G?fTAdRBtL?zJ@t\\\\AlQ?pQ?v_@?|B@|C?jB?`HBrRAvc@@xQ@zPAfd@??^?~a@@??DrALn@tApEVhAPjAFpCJtBBre@lC``CB|B?R|@ds@LtOArS_@lSqAhf@mB`v@YlOSdVD~JP|N|Bfx@Rv`@i@dc@_Ap\\\\IjKGpS@pnA@pc@AtCBte@@|d@?zBKfNq@xJMdAmAdJ}ExR{HpX}HhYsHfXqBtHqEdPwCdLqCnNmA|IkAdKsAhQsBbVoClVqD~VkElVqExTuD`PuO`l@qFfTeGxTgGpU{\\\\ppAeBtIcAhHm@lHYrHGhSF~PApV@|_AHb{BJdZd@j\\\\n@pZZpWBzTObR}@p^[hUIx[D`UA|i@QlQy@db@wAhd@cAv`@UpULtU`@hQd@zODjAzA`h@~@p_@\\\\jT?j\\\\F~N@z`ABrJ?vBFd^Dzi@E~L[|Oq@`LsAbMsJpv@mMjbAoI~m@eAxIeEd\\\\yC~Ts@vJUlJPdIp@tIpA~HnBtItCxHx]rs@lXdj@~GfNrC`G|AvDz@~B|@tCnBdIrArHdAxJ^vGNtHEfFOxGk@zIUpBy@`GsBdMiXndBu@jFgAjKc@rG]bHO`HG|NCt|@AtV?hAAv_@C`NEzwA@nGIdgA?fAAzXQtNOdISlIWvHI~GE`I@pFLdL`@|NPhLD~CHhLGv}CQpY]pVCtM?dIXhWPd[Adu@AdSMvrHOvN[zM_@tIo@zKg@|Fu@hIo@zFuAlKgB~KO`A_Hba@{BfN}CxQqAzIe@tDiAtKaA|M]vGc@pMMpJErHBhVBpe@@lA@~p@?~A@xUCbKB~^ApO@zn@G~lCBfgBA~M@lEAnYBtGCdDBb]BfE?|d@CvDBdFC`HDvT@b`@B~DTdERfBh@rDh@`Cz@pCtB`FzAnCxHrMjM|SvDlFtBdCjAlA\\\\TtE|D|CrCzF~E~@r@rBrBpBhCdAbBfBfD~@fCp@vB\\\\nAZbBj@dEPxBJhCHpHBtSA|V@~A?`PDzHN|JDlBl@zKR~C|@jK~@`L^nGH`EB~FK|GGtAUjEqC`[mA|Nw@hNOjEOzIK|z@?dr@EpMMjdC?xAc@t{D?hSGn]DlIJ`HXbINvCf@tGVlC`A`JtAfJnDxSt@rEvGp_@hEbWv@jE|@bHt@fHb@`Gb@vJTbIHzK@fSAfk@Exo@C~CBzNMdsDRpLXjHj@rIV`Cx@hHb@~CnArHRl@l@dCn@rC|@zCt@dCnBdGnCvHpAdD~@rCfAtC`E~KrGdQnArDbF`NhArCxU|o@lDnJzDdLfAbEp@rCj@vC`@dCd@rD\\\\xDRpCVvFDfD@|EItEeAx\\\\QdFMdFGnECrEBdHLxH^rJZxE`@tFvAvMbAbJl@fF^fDdD`ZrBpQjD`[TxB\\\\fD~AbNbBdLhCjLt@|CtBdHxAlEhDvIjDrHHPfD`GrBdDvGfJvFrH|EfHzEbIpC~FhC|F|@~BvD~KzBrIpAvFx@rEHVz@dFhA|In@zHNbCLpARdETtHF|FE~_B?pU?bB?rUCb]?npAE`KAfj@Cv~A@|IClM@rXA~ZBjENjFN`DRjCp@lG~@bGXpAZzA|@tDfD|KbA|ChEhMhXvy@fAtCzEjLhB|DlEfIvCvExEbHxApBnG|HtI~J`HlIpAxAp@n@fDfEhFfGvBfCfAjAhAxA~DtEp@|@vCfD|InKdAhArAbBdF~FdFfGtAxAnHdJlCrDjEpG~@zApDtGf@hAj@`AzCvGrB~Er@hBzCdJxAzEjCvJ|@~DdAlFbBlKjEp]^pEf@rEdBfMb@vDrBhLhAlFbC~JlAtEdEvLxBvFfDvHzBtElU~c@xCbGzPn\\\\vGzMdBfEv@jBfCnHh@jBx@rChBhHrAhG`AdGdAbId@~D`@nE`@dGZhHNnG@tI@vnB@nTAlo@KbHQfDc@lF_@rDc@zCcApFy@jDwBnI{B`Ie@lBuBrI}@dEm@hDeAfHe@`Ey@~IWtFGnBMdJ@nIFdEBx@FdCNhCl@jIZ`DZlCbAnHx@|DR~@jAnFx@|C|EnOfAxDrBdJ|@dGVnBd@|FPhDLjEDh_@NzqBDvgACtILvlBDbEPbFLdB\\\\`ED`@~@~G\\\\fBl@jCh@rBbCnIrArDxAjDpDnG|A~BjA`B|DtEj@p@pMpMj@h@rD~DtHtHpCvCrJxJb@d@~TtUlMtMz@~@jd@ne@jKnKrDxD`DlDzD|DzAbBrBhCdCnDdAbBzBfEdA~B~@|Bz@`C`AvClAxE^dB`AzEXdBl@rFb@xFNpCFfBDnC?|PAlHBdz@CvK@hKAfb@KfJChJIdFEdHu@dWGtDOjDO|EUvKCzAG~ECrECxE@tIFdHL|G\\\\tKh@hSLrDR~LVjTBrG@xIBxGArODv\\\\?rkB?nSAjAB~GC|GDpFn@xI^`CnAxE`AzC`D|HbBxDpFnLtBlErQpa@bBfEbBxDxLdXz@vBrHjPrQva@pFvLbDjGfCjEzSp\\\\tWha@lDvFzEnHnIdMhBdDnEvIpGhNrBzEfCnFtGdOdChFtCzGrClGnHtPdDfHtg@jiAfAdC|CtF|CnFfHvKhB`CpD`Fn@t@dC~BxNzL`OrLdDfCpYpU|PbNfG`EvChBvC`BtIfEbGlCbA^xAl@zCfAjElAxBp@`Dx@`Dr@jI`BpEv@zGtAtH`Bf]fHvFlArPbD~KbClAVdF~@|RhErBd@tQnDdIjBlGjA~PlDlHdBfFbBxD|A`EhBvDlBjAr@vCjB~EvDhGfF`CdClBtBvClDxCdElDtFxCtFlBbE~ArDlCnHXz@x@jCbBfGfBhIf@pCn@vEp@pEv@lINvBVdEJpDJlF@fHGloBEfJO~rDDzI^bRb@xMj@hLjApPj@xGn@rG~@hI~@rHjAdIfAjHzAdIbBhIlCfLxEnR`ChIzCjJrBvFrB|FlCjHbDtHjL|Vz@rBvJvSpCrG~BzExIzRj@pApHnOxApDrHxOvHnPr@hBhAzBnIxQpDdIpB~EtAhDzBhG~BjH~BbI`BtGdBrH|@vEzA~I~@|FjApJr@rH|@~Kb@bI\\\\jIH|FFbHBpEElJF~bAFvPPtQPxKNfGv@tVd@xMJpAdAzTnArTdAzTPrDtB``@~Ah\\\\x@bXh@nWLjJNxX?bZEzZEh[?hC?vSAnBQveD@zKE|UApV?dACbQK|CS|JSzG_@fJgAbR]hDq@dIgArKyPpxA]xDkA|Og@|J]dIOxEQpNErRN`MRhGx@lRbSfrCr@~Jv@bMJjBnAbVBzBl@rQNjGJnMJvpAA`IBrlABf]Aj\\\\FpcC?fxACjJ?|BCjzGEf}@Bjm@EfrBEft@Bxg@CjqBPr}CIpGMdGItBSzCWzC[xC_@vC[xAo@jF}Mr_AoDbWO`BYzEQbFExCAtCBlDRtGhA`QbBtYz@tMPfDr@tKXhFp@jKjBzXz@`Lb@vGV~DzCda@^zFz@fL^hHJ`EDjJ@dYCve@IxOCv[?buAGzTAhfABdMCfFBj^@`JDvb@Ilc@O~EUnBg@rDgBfLUfDiEzjAgAf[E~B?tBD|BPvD\\\\dFXrBh@rC`AdEfCzJvA|GTxATjCN`DB`A@xGC~cAOfh@GpH?tDCvHBvHAxh@F`UHxHJxQ?jQAzX?l^?pZDnf@Ad}@Uxm@EnYJ~j@LbRBtU?jqACva@BdXC`WAd_@Sh^?z]F|LNnHR~Nb@lVDnNE`IAnn@A`r@N|tBFtYDhy@@bE?tGMlM]fSOhHClCEl_@@xICby@GhF[|G[`EoBvYSzCiD|d@s@zKI|E?~F\\\\fJp@dG^zBh@xCf}@bgEnAlH\\\\xCXzCRzCN|CxKdoCnBvf@|A`_@lAj\\\\|Ab^HdD?dDMvFUdDI|@cBtM_DvSa@bEGbAKxCGrD@hw@@nBNtCR~CPbBp@|EbCvOvCpRt@hFd@~Ej@lHJfKA`DIvFItBOvB[tD{@fHoF|ZgA|GY|CSzDC|ADfEFbCj@xF|@rE`@bBnApDr@dBx@`BxB`Dt@bAvDtD|ErEfFnErFhGlA`BlBtC~DnHxAdDjBfFt@pCxF`Qh@`BbFdPb@rAhCbGfA`CjBhDtAzB~DrFxBpCfL~NtNrR`AlAbNxPdB~BxD`GrBjEz@jBhOd^zNv]hLhXvCfJd@lB~AjIf@rDr@zHXdEPnGClJIrCcAbNaBzOeAbK_Fdd@k@`GqBfYqDbf@a@|FYlGKtEA~ADlGP`Fp@zJd@xDNbAp@xDl@xCz@tDx@pCxBtI~Hf[XpAjAlJl@xFZbN@rNGl[[`G_A|Jg@rDwBtLeBnHw@jDoFpW[tBSdBe@nEMzAMlBSlGIpYD`LGfVEtwDH||@Sv{@?dSRxIf@vJRfChChYdCnWPdCL|BF~BB~B?`CA~BI~B{Czr@u@~OGl@EvAWnEo@hOyCvq@O|BSzBaHdp@sJn_AgS`nBqFli@_UrwBe@|Dw@dFSbAkAjFgA~D{AxEwBlFwDtGu@dAkFrHsOnRkAvAeLdOqAnBoBvCeEdHaDhGuHzO}@nBcL`V{AxDiB`Gc@jBc@rBe@rCc@zD]fDE`AQlEChE?xDJvD\\\\hFjA~KXhChFhf@~@~HxGpm@tGnl@XxBv@xHn@fI^|F`@bLF|DJjJCt}ACdr@Alt@Cx{@@lUEdy@Aje@EzPGpB]fHM|EEdEBjGH~Df@vLDvC?ru@A~{A@lVArS?tkBCva@CrmB@p]GhmBErsFOfH_@lGk@xFIf@}@xFw@|DwAjFuJ`\\\\qPdk@cBnFoEnOkDhLqOxh@qEjOuAfFy@pD]dBy@rFc@rDOfBOlBObDG~AGjD@jx@RhcD@ff@C|g@L~eBJvzBAfh@@bh@FpSHlFHp\\\\FfLJv`@~@||CFnb@?nLFjp@\\\\zvCOvm@Q|jA^lHr@|Er@|Cx@jChAnCbDxFry@zmA~DrGxBpF~AjGn@nFVnF@nEGfyCAd\\\\AlB?fNDfDF~BFfAXbDLtBJrB~Dji@xBfZNrB|B|Zp@tJf@fDd@pBh@nBbApCx@pBnAvBxA|B|AjBp^rd@~IvKxA`Cn@lAnAbDnAzEt@|EVrCL`DFnCB~P?fD@f`@AfB@fPOjNI|FAlD@jTApWLjsA@bHBzPA~K@tCCdL?`JD|i@H`g@?jBCj_@Bvr@@`QFfJBbCDnK@dN@bR?dCCfRArDGrBOnCi@lGmA|REhA?vB?zJ?bC?r\\\\?xBP|RBjAn@xS~@jXFbCR~FJrDD~T?dC?`O@pCBvMAdR??i@rD_@~@[h@??iDfEuBvCc@fAETM`AA^@n@H|@Jd@L\\\\\\\\l@jB`C\\\\XZNXH^FX@ZCTE\\\\Kh@YNQT]z@}A^e@TORKn@Q`@CjABpI~@~Fr@tAJrGBdEAnEAfCRNBjAP|Ad@z@ZhB`ArAz@rO~Jz@t@h@f@`@f@x@lAn@pA^`AV~@XlATzAHbAFtC?zO@bE?vNHhCJrAZtBd@vBlArDx@bClBfF|DtK`EhLbFfNr@dB|BpEfCpErBjC~ApB|AbBlBfBzAnAzFzEbNbLtC~B|JhIvBdBvDfDjH|Ff[fW|InHfIrG`CjBhA~@rPhNxAnAtPdNp\\\\vXlO`M`JrHd]~X|BhBbGrEdGdD|EjCdEtBdStKrHbEdBx@jDxAfEzAhBh@hEdAdFbAlGr@fFp@ho@fIhh@tGziBpUpZvD|SlCx@Fr@BlGAbb@BvU@zQ?dVBzp@D|g@?jO?dg@BzLFhC?|H[lOs@pBW~Bc@rBm@jBw@nDqBhB{AhHwGbA}@pLiLf[aZ|[mZzTgTbD{CfT}RbF_FpDgDxG}Fl@e@xEqDvBgBxB_B|MgKjLwIbLyItQmNnC{BzL_JfEeDrB{AlWgSpFcE`W{RdDoCfBgBna@i`@xeAycAlQqPnBgBtByApCiBxEcC~CoApDkAhEgAdCe@vBYpDYhCMlAEr\\\\IzMCvr@?jMB~fA?baCJhc@B|DFfh@FfBB`v@TvhAVbKCfTo@t`@?zJ?~gABl`A?vb@Cj}ABf~A?~_@?bC@dMAz]B`LG`J[hE]dTkBhGa@~LKzNB|GAjSAr[Fz^BzC?t`@Clp@?hQDxC@`IChEMzBQrCYbBYxXaFjjIm{AdlAmTfGqA|C}@r[cLhc@qOjVsIra@uNhnBoq@dHeCdNyEt_Ak\\\\di@aRjAe@nGuCbDsBnDgCxPmNlDmC`BaAfAk@lCkAdBk@~Bo@jDo@tBS`BIrBEzC@x@BrALbD\\\\tM`BxCX|I`AdBLjDJlRDxp@?p}@FvIBrZ?pLDlJDzCPxK~@hDPz`@DpGArh@@lC@nCC`ACjBOxC_@r@M`EgAxAc@hDwAnEoBzVaLvt@e\\\\jr@e[`j@iV`CcAfBk@|C}@rBc@hDi@dC]nCUjBI~CEvJ@jVCvfAFzOElHF|m@BbSEzP@tJAlQDzS?xl@@`NC~K@pR?t]HtG?`\\\\Hjd@Ifq@C~_A?xBBvDGnCKtAIzDa@rASzAYzA]~DeAfBm@~@_@~DeBlDmBv@e@re@_^fe@w]|JwH|m@wd@pi@ka@fKsH|MgKfSgOfAu@|A}@bB}@fBy@bCeAdDkA`HyBlGmBtHiC|L{DjNsE|g@kPzQeGbJqCtNwE`MgEnxB_s@t|@gYbMaEpr@{TdwAwd@lEkAvDg@vc@[zg@g@|ZWrJGtJDtG\\\\lARrE`AlExAdLtGlCxBnDzEfFdG`GbHz^hd@nKzM`F|FpHrJdTvWbClClEpF`L|LpB|BjHjIxFxFlGlHzHtI~RvU`IxJzAdB`BxAnAz@hAn@`An@zAp@fBn@zBn@lCZ`BJjBDbF@bUSbJAlB@pMMpDBpIb@pRr@nDVnI`@dG@hDItDUpKu@nGk@nKu@nKw@l]uAdO]jk@mA``@Sph@Q`LKvAAlO?vH`@|HdBbIlDfAr@jB~A~DdDjOtTvAnBlS|XxE~GbOhTtE|GnAtBhDpGjD`HlKnOrMjRrIrLfUp\\\\jHtKzChFtd@feA~_@l}@fSle@ls@haBhHzP|FrMbJvOzEbH~D|FzJhNxDlEtBxAdAf@`GfBtEn@p@@lIJpa@?vERpCf@bChAvDlBfCnCdAfAtCdDpGnH`EjFrGlHhExC|AfAdHvCvDlAjBZ`F`@pZNbdA?pWD|e@E`nCLbt@@pGBrZAt_@Qj^@hfAFtsBQbZKxU?fLBbKFne@@xU?|]Frk@Fp_ACvtAAx^AtKCxBCxAAdEEnTDbHFnO?xkAGpLKvFe@vHkBzEwBvFuDvDoDhJaL|HmJlOyRfByBl@u@tBgCdBsApDsAhCUxKB~RDdYGfDCpM?xCAnEB|JEnEOfCWtBY|Cq@pA_@bBm@dIiDnBu@tDkAvBe@`B]`Fq@~DYbAE|ACp{AQvz@?t]?v^Ely@Gh`BCtP?vA@fBDbADfAN~Bd@dB`@jCr@bFlB~B`AbNtFlCbAfA^vDbAlCl@fBVzCXvCTbBHfBDjP@~H?zR?xAGhBMvAQlAQfAWjA[zAg@jAe@dEuBrAq@v@a@nBu@jCs@~Bc@nFa@bMAxLAbCHvCPbKlA~BRnFTlA@~BBzDFvF@|JJfDEzCGvAQnBYfASdAW~Ai@zJwBnEeApD}@tLqC|Bi@hDy@t@QzCe@zD_@rAItEKlB?|C@fOG~a@GzB?hSGpYCpSIbB?xBD|BNxBXjCb@dDZlCLvC@j]GbD?z^IpBIjBSf@IvAMvEw@`AKnBIp\\\\MpDA`ME`GIxJCjBBrGCxGIpX]bEC|B@bE^fBR|B^tCz@v@T`Bn@hAh@vC~A~@n@`CjBjFpEv\\\\xXnCvB`DzCnBtAbB~@rAh@zA\\\\vC^t@Dj@@xBAnBQ`MuAnEe@d[iD~AOlCYxCi@rCm@vBk@t@WlG_C??dAU~Am@`A]xBeAzIyEl@YvB}@t@U`AO|AI??l@RNRLXAvADzA??FrB@|@Cv@UzCIrB??u@pHc@rFIlECvB@fE@p`@?zD@\\\\BzJBnbAAl^DvCFdBLdBr@tEd@lBl@jBt@fB|@`B|ElI|JlQvPd[tIjPrWvg@zDdJjD~HtCjHjDxGbE~G~BpDfB~ChA~AbOdVlCbFvHrNhKbRdDzGfBhE`FbMlBxEdDxHrAnCz@~Ab@x@nB~CbBrCdF`IzEtHbJnMrGfKxEdJhEbIbElIzAnDzE~NnBnF~DdIpEhIbFhI??|\\\\dm@fEfIxBtDbHzMvQv]nAfC`DzFpBxDpDdHzJnRtCtFjBzD|BlE~J`Rt\\\\no@jA~B^~@Xj@fPrVjDhF~BrDbDtDxBzB`CpB~CtBfE`CvFvB~RtGrMlEtDjBlDdCrCdCfCtCdCrDxBzD`CxGrAjEt@xBzC~IjAbFz@vG^vE\\\\pQZxZFz@DhAt@tGvBlLjArG^hBj@|Bf@fBpBjFl@lAnYfj@~IzPrEhJbBxChHhNdc@zy@|Ttb@`GlLtKvS~BrExOzYhGpLbGtLbCdEp@rAtAlCdu@fwAdN`X~h@hdAxPv[~Sr`@|g@vaArF~Jh\\\\xn@vIlPjUlc@`BlCbArAt@|@~@`AhAbAjOjLzWfSfOfLvBpAZNXCtCvAlAr@|AfApDrCtDtC`FpDfCjBnCzBlCpCJ`@j@n@nArAnBbBda@xZxc@x\\\\zi@`b@r[`VvDzBdD|A`NtFnHpCfHtC`KbE|X~KzFxBbm@bVvj@xTxd@zQd^tNjH~CnBv@lBb@`EdBfQ`HdFrBbJnDjChA~ZbMvTvIrb@tPzu@nZryAjl@nyAbl@dzAll@vIlDh^tNdp@rWlTvIfS|HbFrBfO`G`LrEdK`ElVtJnW`KvJbEfK~Df|@t]~n@zVrTtItb@|PdA\\\\bBj@|@XnB`@t@LpCT~DHjIJvCFpEBvAA`DGl@Eb@KdGClE@tEB|BCpA@rBOxANhB?bB?tD@V?f@?L?b@?D?X?t@?`C?rBAjA?b@AZ?T@R@ZFFB^J\\\\`@VD~AfAf@P^Fb@BnC?|ECvEAhE?nE?v@Fj@Jz@Xj@ZXTVV`BvBb@D??\\\\p@`BlBbAdAzUbXdBfBrFdGnArB~CnF|CrF`DlFlAlBrAxAnDtGDd@~EfIhC`E|AxBtAxAvAlAfC~AjCxAnAv@`@\\\\|B|BfArAzRfWtCzDpE|Fn@|@fAlBf@bAl@xA`ExK\\\\x@n@rAvAhCxFxHxJfMvEjGvn@by@fVd[jMtPhQbUnLrOrDpEzElGdRnVjG`IxBrChs@x~@dc@|j@v{@~hAvI`LbLjNjA|Aja@rh@~q@~|@hRlV`q@b|@jF`Hp[pa@jb@hj@hQxTtG|HxE~E~AdBXH~ApBV\\\\hDbEV\\\\X\\\\vCtDdKxMxBtCNb@tBvCxG`KlAlBlHjKn{@lhArUrZjaBhvBzOrSdg@ro@jCpDdm@`w@|NhR~AjBjVj[|G`JnHfJj]~c@dP|StHrJt~@dlAbC|CXXnAhAbBhAxBfArAh@T@zAr@zAx@`Ax@Z^l@x@V^j@nAZbA^|APfBFfB?nHBrBFtAHt@RnAVdA\\\\dAj@hAT\\\\fArAZXhAv@rAp@xFdCvBbAjAx@x@t@j@n@~@lAva@bi@fBhC~C|Et@jAbCvDzF`J~EtGxEfGvCrDtCpDjA|AfAvApCrDvEfGz@fAfCbD`LxNnEzFjGbInPdTrIzKnJzLHXhBdCbEtGvBxC`ItJpDjEdRlUfS`Vzy@rbAbNnPfPlRrp@|w@|Yx]rMjOzVvZ`j@dp@fDpC|CpBfEbBrFrApBd@vCPjCJrmAI~OH`[@bm@IhMBrp@CpKGrAApJBxg@GvRGn]Lrc@Kju@A`VEhUDrl@CZAvTL`V@xd@KvF?bSDfBBvbAGn@?jE?`E?fj@Cx`@AfB?xCLpAPpA\\\\`Bh@`GhBfCp@`Ch@t@Pf@CvJpClEtApEvA`EnAPFnDhA`@LnEtAfAZzAXl@FfAHfA@zIChGAdGAhGGpEA??ArF@xHAzD?~CCxACbAKxBCn@e@xFq@vFcAlFiAxFy@~DuEpTcBtHoGt[If@_FtVe@jBg@|D}@bE_A`IKfDEbFFv`AHxb@A~^FjaAStw@?tJHlf@DhjBChkBE~iB?djB@~X?hjCAhN?f`@Hnw@Czr@GjpAFvL?fg@B~HCvPYhLYjOU|IA~EBbyBBrnBBnLIjJ[jK_Ax]oAve@_F||AgBlp@VtXz@fv@v@ru@r@vd@n@xn@JhO?~_ACrp@Fvu@Fp\\\\Bv~AAdc@AlU@fEDd[BvMJ~G`@~SR|I`@dSj@~YRzTNhQJfLRlUHdJRnUH`IJnJDdBJpBH|@ZjCPbAf@`Cx@rCdAlCbAtBfAjBv@dAnAzA`A`A`T~Q~FbFjHrGrJnItFxE|EjEfDrCdA~@f@b@nAfAtN~LjEvDjPrNfB|AVPR?\\\\XpAhAfHjGlC|BzFbF|DhD|BnB`Ax@f@d@Z`@n@~@r@~A`@lANt@ATJ~@H`B?vB@xF?z@D\\\\@xCAvF?rF?xF?vFAxF?vF?vF?vF?tFA`F?RAdA@~K@vFAjF?nF@j^?pCAjBAjEBd\\\\AvH?hN?rU?rT?rF?|Q?f@?zGKl@?pG?pA?dBCjR?LPlAE~nA@bECfc@?nC?fLA|r@?^?V?|D??K\\\\E^A~^E~{@M~xC?rFEti@?jICxb@???p@Cbe@?lb@Era@AnM@hSIna@Xn}EA`KB`vARv}BAdZFxEPdFVzCZdDd@dDz@dFx@xDhA|DzAnEdBbFpEjMhFtO`Kn[nDlKlNda@la@fkAfSpk@`dAtwCzm@jfBdn@dgBlKnZpg@rxA|Wtu@dCjHfDvJtNda@dA~CpJjXb]xaA`_@bfA|]rbAz_@vgAlDnJjD`Kn@vBrIzZbc@t}Ad@dBbb@d{A`C`Jdo@b}Bxj@tqBjn@|zBfMfd@r\\\\nlAfB`HxBrJbiA|xFdc@|xBvN|s@hAbFpBtHdB`Gb@dBjQho@jJz[rHbXnAzElAfEhg@lhBt@dE~@dGf@jETvDRhF^~PdAtb@f@zT`DbtAb@fQfDpwAnAlf@hClfAd@lTvDv~Ar@jZVtFp@pM|HbyAbPt|CvDxr@nAhVlB|]^jHHnCFtDCdDOpGYlFwTzbC_BjRsMjxAcHpv@{OpfBuJffAg@pGQxFC|FFtETjG^vEd@lEt@rEj@tChAtEhArDbAnC|qAx~CxKpWzQdc@t@fBnB`EpBpDhT`\\\\x{BbiDlRjYhF~H|s@~fAdQxWb\\\\rf@pOtUfSnZjF~H`Ynb@lMnRtJbOlEtG~I~M~AdCh[be@fDrFhAjBbC`FjCfHd@xAxBlGtDvKnGfRdBdF`K~YbGbQrDrKlFtOvI`WpCdIlRlj@tGlRtM|_@zIfWlBxFxAdEdA|Cr@xBZfARx@RnARhBDx@FvABrA?`BAlC?j@?\\\\CnG?D?J@fC@`C?bCA|BAdC?rBFR??P?vC@b@@h@?lA@~@?\\\\?~@?jFB`JQ`GMpBK|AQbAOjB]`B_@zAc@fAc@dAc@h@[bAk@P[\\\\Uf@[lAeA~BcChHqIn@k@pA{@vAo@x@WvPuDdYgGjGuAnCk@pAY~Bg@JCVDxEu@dD]tAGjAB`AFx@LNBxAd@xAt@ZRh@XPJP?zCfB~HxEpGvDxJ~FnC~AfAp@lDtBjAp@h@ZxHnE`DlB~D`Cr@b@JFj@\\\\d@VdBdAh@ZdJpF~BvAbB`AhHjEz@f@B@lAt@hAp@xIhFhWlO~@h@HDLJh@ZJFjYzPlBjA`DlBtGxDfL~G`CtAjp@n`@`@TlVzNfAn@HPrBnAdJfGj^jTt@d@fCpAzEtB~s@nYrEhBf_Ad_@~\\\\`Ntn@zVhEbBxB|@dJpDnKpDpBv@bNjFxEnBpVtJlTzIzw@f[nIhDnIfDrd@vQzIpDzYhLfUdJpLzErLrEnOfG|KrEnBz@pNpF`ZpLfE~Aht@vYtKlEhVlJdI~CjElBzBz@zOxG~Bt@`DpA|CvAzDxBbDzBjA|@pAfAlAjAnArAlArAjAzAvPhUbClDlJ`MdA~A`FtG|P|UjOnSbB`ChDjEn^`g@nFjHlL~OhB`ClAhBvGvIxC`EtB`Dp[tb@pC~Dz@pA~BbErAxCp@hB~@pCj@nBbArE^pB^hCNjAr@lIbAhMHbAv@tIRhCLhA`@xB\\\\xAt@fCDJn@dBTf@hAzBt@jAv@bArA~An@l@rBfBnFjDZTjBhAbFbDvAx@hKxGjAr@rLlH`C~A~PvKdOhJfLlHtBnA|BzAfCxArCfBrQfLjJ`GxBxApIdF`HlEdFdDlDtBzB|AhAn@`_@nUvEzC~MpItBnAlCdBtD`CfNxIvSlMlJbGzCnBpC`B`BjAtBnAnFlDvCbBnHtExE`DxAv@~EbDtEnC|GhExCnB~MpIvKzGxCpBhBdAtAbAP?zK`HrK`HlM`IhCdBfCxApBrAtSlMdM`IvNzIdC`Bj\\\\tS|@l@lN~ItN|I^VjCbBfNrIlAz@lBnAjNtIrEzCrHvEx@l@nS~L`JzFD@hMdIlC~AhG|D`W|OpRxL~GdEfIlF|IlFvClBdIbFhIdF`ElCdKpGpLhH`HnEhDrBlInF`DnBpm@p_@nInFvFrDbV`O`NpIvRvLdAv@~AtAhAhA~@jAjA`BfAnBjAfCl@`Bj@pBt@lDfIzc@zAdJ~F|[|^vqBnHva@L^DXrAnH`ArF~Fp[bs@f|D~DrOxa@hpAl_@fiAlGnUlDtO`[vhCrE|b@pFxd@hp@x}FHl@h@tDh@tC^fB^vAv@nCl@dBl@xAlBrE|P|[tTnb@`J~PzB~DxA|B~ArBf@p@\" \n }\n */\n $distance = $mqResult->{\"route\"}->{\"distance\"};\n if($distance > 0){\n $newLeg = new TripLeg();\n $newLeg->id =$lastid+10;\n $newLeg->distance = $distance;\n $newLeg->startLatLong = $lastLatLong;\n $newLeg->endLatLong = $newLatLong;\n $newLeg->MQencodedPath = $mqResult->{\"route\"}->{\"shape\"}->{\"shapePoints\"};\n\n //echo json_encode($newLeg);\n\n //Push the leg to the end of the $tripPaths->{$trip}\n array_push($tripPaths->{$trip},$newLeg);\n //var_dump($tripPaths);\n\n if($newTripsRoute = fopen($jsonRouteFilePath,\"w\")){\n fwrite($newTripsRoute, json_encode($tripPaths));\n fclose($newTripsRoute);\n $result = TRUE;\n }else{\n //error using fopen.\n $error_msg = \"Could not open file.\";\n $result = FALSE;\n }\n }else{\n //No distance between provided point and last point. Likely the same point was provided.\n $error_msg = \"No distance travelled\";\n $result = FALSE;\n }\n }else{\n $error_msg = \"No MapQuest result given. Could not add Leg to trip.\";\n $result = FALSE;\n }\n if(!empty($error_msg)){echo $error_msg;}\n return $result;\n}", "function get_lat_long($address)\r\n{\t\r\n\t//sleep(1);\r\n $address = str_replace(\" \", \"+\", $address);\r\n $json = file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&region=$region\");\r\n $json = json_decode($json);\r\n\t// echo \"<pre>\"; print_r($json); \r\n\r\n $lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};\r\n $long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};\r\n return $lat.','.$long;\r\n}", "public function getLat();", "public function actionLocation() {\n $term = trim($_GET['term']);\n $bGeonames = (isset($_GET['geonames'])) ? true : false;\n $results = array();\n $geonamesUrl = \"http://api.geonames.org/searchJSON?maxRows=10&lang=de&username=wkoller&style=medium\";\n\n if ($bGeonames) {\n // Construct service URL\n $geonamesUrl = $geonamesUrl . \"&q=\" . urlencode($term);\n // Fetch service response\n $service_response = file_get_contents($geonamesUrl);\n if ($service_response) {\n // Decode data\n $service_data = json_decode($service_response, true);\n\n // Save response data in location table\n foreach ($service_data['geonames'] as $geoname) {\n // Check if we already have any entry\n $model_location = null;\n $model_locationGeonames = LocationGeonames::model()->find('geonameId=:geonameId', array(':geonameId' => $geoname['geonameId']));\n if ($model_locationGeonames != null) {\n $model_location = Location::model()->findByPk($model_locationGeonames->id);\n\n // update model with new location description\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n } else {\n // Create location model & save it\n $model_location = new Location;\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n // Create according geonames model & save it as well\n $model_locationGeonames = new LocationGeonames;\n $model_locationGeonames->id = $model_location->id;\n $model_locationGeonames->service_data = serialize($geoname);\n $model_locationGeonames->geonameId = $geoname['geonameId'];\n $model_locationGeonames->countryCode = $geoname['countryCode'];\n $model_locationGeonames->save();\n }\n\n // Add response to results\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n \"countryCode\" => $model_locationGeonames->countryCode\n );\n }\n }\n } else {\n // Find all fitting entries in location table\n $models_location = Location::model()->findAll('location LIKE :location', array(':location' => $term . '%'));\n if ($models_location != NULL) {\n foreach ($models_location as $model_location) {\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n );\n }\n }\n }\n\n // Output results as service response\n $this->serviceOutput($results);\n }", "function get_flight_inter_from_ws($depcode, $arvcode, $outbound_date, $inbound_date, $adult, $child, $infant, $triptype='ROUND_TRIP', $format='json'){\n\t\n\t$outbound_date = str_replace('/','-',$outbound_date);\n\t$inbound_date = isset($inbound_date) && !empty($inbound_date) ? str_replace('/','-',$inbound_date) : $outbound_date;\n\t$api_key = '70cd2199f6dc871824ea9fed45170af354ffe9e6';\n\t$supplier = 'hnh';\n\t\n\t$url = 'http://api.vemaybaynamphuong.com/index.php/apiv1/api/flight_search_inter/format/'.$format;\n\t$url .= '/supplier/'.$supplier;\n\t$url .= '/depcode/'.$depcode;\n\t$url .= '/arvcode/'.$arvcode;\n\t$url .= '/outbound_date/'.$outbound_date;\n\t$url .= '/inbound_date/'.$inbound_date;\n\t$url .= '/adult/'.$adult;\n\tif($child > 0){\n\t\t$url .= '/child/'.$child;\n\t}\n\tif($infant > 0){\n\t\t$url .= '/infant/'.$infant;\n\t}\n\t$url .= '/triptype/'.$triptype;\n\t\n\t$curl_handle = curl_init();\n\tcurl_setopt($curl_handle, CURLOPT_URL, $url);\n\tcurl_setopt($curl_handle, CURLOPT_TIMEOUT, 30);\n curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 30);\n\tcurl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('X-API-KEY: '.$api_key));\n\tcurl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n\t\n\t$buffer = curl_exec($curl_handle);\n\tcurl_close($curl_handle);\n\t$result = json_decode($buffer, true);\n\treturn $result;\n}", "public function getNearestPark($latitude, $longitude) { \n\n $stms = $this->conn->prepare(\"SELECT * FROM `parks` ORDER BY ((? - latitude)*(? - latitude)) + ((? - longitude)*(? - longitude)) ASC\"); \n $stms->bind_param('dddd', $latitude, $latitude, $longitude, $longitude); \n if ($stms->execute()) {\n\t\t\t$result = $stms->get_result();\n\t\t\twhile ($data = $result->fetch_assoc()) {\n\t\t\t\t$nearestParks[] = $data;\n\t\t\t}\n $stms->close();\n\t\t\treturn $nearestParks;\n } \n }", "function getCityAndCountry($location){\n if ($location == '') return array('city'=>'', 'country'=>'');\n \n $e = Event::model()->findByAttributes(array(\"location\"=>$location));\n if ($e){\n if ($e->country && $e->city) return array('city'=>$e->city, 'country'=>$e->country);\n }\n \n $location = str_ireplace(\"zda\", \"\", $location);\n \n $url = 'https://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($location).'&sensor=false';\n $httpClient = new elHttpClient();\n $httpClient->setUserAgent(\"ff3\");\n $httpClient->setHeaders(array(\"Accept\"=>\"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\"));\n $htmlDataObject = $httpClient->get($url);\n $result = $htmlDataObject->httpBody;\n \n $result = json_decode($result);\n \n $country = '';\n $city = '';\n \n if ($result->status == 'OK'){\n if (isset($result->results[0]->address_components)){\n $components = $result->results[0]->address_components;\n foreach ($components as $component){\n if ($component->types[0] == 'country'){\n $country = $component->long_name;\n }\n //if ($component->types[0] == 'postal_town'){\n if ($component->types[0] == 'locality'){\n $city = $component->long_name;\n }\n }\n }\n }else{\n return array('city'=>'', 'country'=>'');\n //die(print_r($result,true));\n }\n \n //die($city.\"-\".$country.\" | \".print_r($result,true));\n return array('city'=>$city, 'country'=>$country);\n }", "function generateFullPathWithGoogle() {\n include_once('../common/common_functions.php');\n $jsonRouteFilePath = \"cricketTraveledPath.json\";\n $error_msg = \"\";\n $result = false;\n $travelObj = new Travel();\n $tdh_db = \"CLEARDB_URL_TDH_SCRIPTS\";\n \n //Get the points from the database sorted by tripname, then date\n try{\n if($db = connect_db($tdh_db)){\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n \n $query_sel = $db->query(\"SELECT * from gps_readings order by `tripname`, `time` ASC\");\n $previousLatLong = [];\n $previousTripName = \"\";\n $tripLeg_id = 0;\n if($query_sel->rowCount() > 0){\n foreach ($query_sel as $row){\n $currentLatLong = [ $row['lat'], $row['long'] ];\n $time = $row['time'];\n if(!empty($previousLatLong)){\n //get the mapquest info\n $mqString = getMQroute($previousLatLong, $currentLatLong);\n if($mqString){\n $mqResult = json_decode($mqString);\n if( $row['tripname'] !== $previousTripName){\n $newTrip = new Trip();\n $newTrip->name = ($row['tripname']);\n $travelObj->add_trip($newTrip);\n $previousTripName = $row['tripname'];\n }\n //Get the latest trip object from the travelObj\n $currentTrip = end($travelObj->trips);\n\n //If the points not the same make a new leg\n $distance = $mqResult->{\"route\"}->{\"distance\"};\n if($distance > 0){\n $tripLeg_id += 10;\n $newLeg = new TripLeg();\n $newLeg->id = $tripLeg_id;\n $newLeg->distance = $distance;\n $newLeg->startLatLong = $previousLatLong;\n $newLeg->endLatLong = $currentLatLong;\n $newLeg->startTime = $time;\n $newLeg->MQencodedPath = $mqResult->{\"route\"}->{\"shape\"}->{\"shapePoints\"};\n\n //add the leg to the current trip\n $currentTrip->add_leg($newLeg);\n }\n }else{ \n //Map Quest result not returned\n $error_msg = \"Map Quest result not returned\";\n $result = false;\n \n }\n }\n $previousLatLong = $currentLatLong;\n }\n //If none of the leg creations failed,\n //Turn the object into a json string and update the file.\n if($result){\n if($newTripsRoute = fopen($jsonRouteFilePath,\"w\")){\n fwrite($newTripsRoute, json_encode($travelObj));\n fclose($newTripsRoute);\n $result = true;\n }else{\n //error using fopen.\n $error_msg = \"Could not open file.\";\n $result = false;\n }\n }\n }\n }else{ //handle error\n $error_msg = \"Could not connect to database\";\n $result = false;\n }\n }catch(PDOException $ex) {\n $error_msg = \"CODE 120: Could not connect to mySQL DB<br />\"; //user friendly message\n $error_msg .= $ex->getMessage();\n $result = false; \n }\n echo $result ? \"Success! New file created.\" : $error_msg;\n return $result;\n}", "function fetchGoogleLatitudeLocation ($user_id) {\n $r = array();\n $google_latitude_data = json_decode(file_get_contents(\"https://www.google.com/latitude/apps/badge/api?user=$user_id&type=json\"));\n $r['longitude'] = $google_latitude_data->features[0]->geometry->coordinates[0];\n $r['latitude'] = $google_latitude_data->features[0]->geometry->coordinates[1];\n $r['current_city'] = $google_latitude_data->features[0]->properties->reverseGeocode;\n $r['last_updated'] = $google_latitude_data->features[0]->properties->timeStamp;\n $r['raw'] = $google_latitude_data; // So that we have it all, if we need it.\n return $r;\n }", "public function getNearestStation() {\n return $this->get(self::NEAREST_STATION);\n }", "function getClosestSales($lat, $lng, $index, $size = 5) {\n // NOTE: Limit can not be dynamic and must be a number\n $db_conn = SqlManager::getInstance();\n $sql = \"SELECT *,SQRT(POWER(? - p.lat, 2) + POWER(? - p.lng,2)) AS Distance FROM places AS p\n\t JOIN garage_sales_places AS g_fk ON p.place_id = g_fk.place_fk_id\n JOIN (SELECT g.gsale_id FROM garage_sales AS g WHERE DATE(RIGHT(g.dates, 10)) >= CURRENT_DATE) g ON g.gsale_id = g_fk.garage_sale_fk_id\n WHERE p.place_id > ? ORDER BY Distance ASC LIMIT \" . $size;\n $params = array($lat, $lng, $index);\n $result = $db_conn->query($sql,$params);\n if (!$result->getError()) {\n return $result->getResult();\n }\n}", "private function processTruckDelivery(array $product)\n {\n $overallCalculatedDistances = [];\n foreach ($this->csvParsed['trucks'] as $truckIndex => $truck) {\n if (!$truck[TruckHelper::ORIGIN_LAT] or !$truck[TruckHelper::ORIGIN_LNG]) continue;\n\n $truckOriginToProductOriginDistance = $this->haversine->calculateDistances(\n $product,\n $truck,\n HaversineHelper::TRUCK_ORIGIN_TO_PRODUCT_ORIGIN\n );\n\n $productOriginToDestinationDistance = $this->haversine->calculateDistances(\n $product,\n $truck,\n HaversineHelper::PRODUCT_ORIGIN_TO_PRODUCT_DESTINATION\n );\n\n $truckOriginToProductDestinationDistance = $this->haversine->calculateDistances(\n $product,\n $truck,\n HaversineHelper::TRUCK_ORIGIN_TO_PRODUCT_DESTINATION\n );\n\n $overallCalculatedDistances[$truckIndex] =\n $truckOriginToProductOriginDistance +\n $productOriginToDestinationDistance +\n $truckOriginToProductDestinationDistance;\n }\n\n return $overallCalculatedDistances;\n }", "function getLongLat($postcode){\n\t//This function first checks the postcodesdetailed table for the long/lat\n\t//If not found, uses the Google Geocoding API to calculate and updates the postcodesdetailed table\n\t$db = new DB;\n\t//$postcode = \"DY5 2UA\";\n\t$object = new stdClass();\n\t\n\t$postcode = trim($postcode);\n\t//Check to see if postcode exists in postcodesdetailed table\n\t$postcode_a = strtoupper(str_replace(\" \",\"\",$postcode));\n\t$postcode_a = addslashes($postcode_a);\n\t$db->query(\"SELECT pdLat, pdLong FROM postcodesdetailed WHERE pdPostcode = '$postcode_a'\");\n\t$db->next_record();\n\tlist ($pdLat, $pdLong) = $db->Record;\n\t\n\tif (($pdLat != '') && ($pdLong != '')){\n\t\t$object->long = $pdLong;\n\t\t$object->lat = $pdLat;\n\t\t$object->status = \"OK\"; //Should return 'OK' if everything fine\n\t} else {\n\t\t\n\t\t$address = str_replace(\" \", \"+\", $postcode);\n\t\t$url = \"http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&region=UK\";\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_PROXYPORT, 3128);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\t$response_a = json_decode($response);\t\n\t\t\n\t\t$object->long = $response_a->results[0]->geometry->location->lng;\n\t\t$object->lat = $response_a->results[0]->geometry->location->lat;\n\t\t$object->status = $response_a->status; //Should return 'OK' if everything fine\n\t\t\n\t\t//If Long & Lat, INSERT into postcodesdetailed table so that next time we won't need to use the Google API\n\t\tif ($response_a->status == 'OK'){\n\t\t\t$db->query(\"INSERT INTO postcodesdetailed SET pdPostcode='\".$postcode_a.\"', pdLat='\".$object->lat.\"', pdLong='\".$object->long.\"'\");\n\t\t}\n\t}\n\t\n\t/* Status codes\n\t\t- \"OK\" - No Errors.\n\t\t- \"ZERO_RESULTS\" - successful but returned no results. Invalid address or a latlng in a remote location.\n\t\t- \"OVER_QUERY_LIMIT\" - indicates that you are over your quota.\n\t\t- \"REQUEST_DENIED\" - request was denied, generally because of lack of a sensor parameter.\n\t\t- \"INVALID_REQUEST\" - indicates that the query (address or latlng) is missing.\n\t\t- UNKNOWN_ERROR - request could not be processed due to a server error. The request may succeed if you try again.\n\t*/\n\t//var_dump($response_a);\n\treturn $object;\n}", "function index_latlng( $params, $class ) {\n\n $facet = FWP()->helper->get_facet_by_name( $params['facet_name'] );\n\n if ( false !== $facet && 'proximity' == $facet['type'] ) {\n $latlng = $params['facet_value'];\n\n // Only handle \"lat, lng\" strings\n if ( is_string( $latlng ) ) {\n $latlng = preg_replace( '/[^0-9.,-]/', '', $latlng );\n\n if ( ! empty( $facet['source_other'] ) ) {\n $other_params = $params;\n $other_params['facet_source'] = $facet['source_other'];\n $rows = $class->get_row_data( $other_params );\n\n if ( false === strpos( $latlng, ',' ) ) {\n $lng = $rows[0]['facet_display_value'];\n $lng = preg_replace( '/[^0-9.,-]/', '', $lng );\n $latlng .= ',' . $lng;\n }\n }\n\n if ( preg_match( \"/^([\\d.-]+),([\\d.-]+)$/\", $latlng ) ) {\n $latlng = explode( ',', $latlng );\n $params['facet_value'] = $latlng[0];\n $params['facet_display_value'] = $latlng[1];\n }\n }\n }\n\n return $params;\n }", "function updateFoodTruckLocation($foodTruckID, $oldLat, $oldLong, $newLat, $newLong){\n include('../db.php');\n $query = \"SELECT * FROM food_truck WHERE foodtruckid=$foodTruckID AND latitude=$oldLat AND longitude=$oldLong\";\n $results = $db->query($query);\n if ($results === false){\n // db query returns false if the call failed\n echo \"Error, test query failed.\";\n exit();\n }\n $num_query_results = $results->num_rows;\n if ($num_query_results == 0){\n printf(\"Error, No matching food trucks found. From query: id: %s oldLat: %s oldLong: %s\",\n $foodTruckID, $oldLat, $oldLong);\n exit();\n }\n // food truck info is valid, update it with the new lat and long values\n $updateQuery = \"UPDATE food_truck SET latitude=$newLat, longitude=$newLong WHERE foodtruckid=$foodTruckID\";\n $results = $db->query($updateQuery);\n if ($results === false){\n // db query returns false if the call failed\n echo \"Error, update query failed.\";\n exit();\n }\n $json[] = [\n 'message' => \"Food Truck location successfully updated.\",\n ];\n header('Content-Type: application/json');\n echo json_encode($json, JSON_PRETTY_PRINT);\n $db->close();\n}", "function get_place_JSON() {\n\n try {\n // Declare global variables;\n global $fb, $keyword, $latitude, $longitude;\n // Use Facebook SDK to code;\n // Returns a `Facebook\\FacebookResponse` object\n if(empty($latitude) || empty($longitude)) {\n $request = $fb->request('GET', '/search', ['q' => $keyword,'type' => 'place', 'fields'=>'id,name,picture.width(700).height(700)']);\n $response = $fb->getClient()->sendRequest($request);\n $arrayJSON = $response->getDecodedBody();\n $jsonObj = json_encode($arrayJSON);\n } else {\n $request = $fb->request('GET', '/search', ['q' => $keyword,'type' => 'place','center' => $latitude . \",\" . $longitude, 'fields'=>'id,name,picture.width(700).height(700)']);\n $response = $fb->getClient()->sendRequest($request);\n $arrayJSON = $response->getDecodedBody();\n $jsonObj = json_encode($arrayJSON);\n }\n\n } catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n $jsonObj = '{' . '\"error\":' . '\"'. $e . '\"' . '}';\n } catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n $jsonObj = '{' . '\"error\":' . '\"'. $e . '\"' . '}';\n } catch (Exception $e) {\n $jsonObj = '{' . '\"error\":' . '\"'. $e . '\"' . '}';\n }\n\n\n\n\n\n return $jsonObj;\n}", "private function get_json_geo_data()\n {\n $response = false;\n if ($this->ipaddress != 'UNKNOWN') {\n foreach (self::$geo_service_url as $key => $url) {\n $response = wp_remote_get($url . $this->ipaddress);\n if (is_array($response) && array_key_exists('region_code', json_decode($response['body']))) {\n continue;\n }\n }\n }\n\n if (is_array($response)) {\n $this->body = json_decode($response['body']);\n } else {\n $this->body = false;\n }\n }", "function getNameGeo($stationID) {\n $in_file = fopen(\"air-quality-data-2004-2019.csv\", \"r\") or die(\"Unable to open file!\");\n while ($data = fgets($in_file)) {\n $arr = explode(\";\", $data); // explode the line into array\n\n if ($arr[4] == $stationID) { // if a line with station Id is found\n $name = $arr[17]; // set $name and geocode\n $geocode = $arr[18];\n break;\n }\n }\n\n fclose($in_file);\n\n return [$name, $geocode];\n}", "public function trendsClosest($lat = null, $long = null)\n {\n\t// build parameters\n\t$parameters = null;\n\tif($lat != null) $parameters['lat'] = (float) $lat;\n\tif($long != null) $parameters['long'] = (float) $long;\n\n\t// make the call\n\treturn (array) $this->doCall('trends/closest.json', $parameters);\n }", "public static function getNearByDevicesUsingLatLong($input) {\n $response = false;\n if (isset($input['latitude']) && isset($input['longitude'])) {\n $url = self::getUrl('getnearbydevices');\n $request = [\n \"data\" => [\n \"latitude\" => $input['latitude'],\n \"longitude\" => $input['longitude'],\n \"radius\" => isset($input[\"radius\"]) ? $input[\"radius\"] : 50\n ]\n ];\n $request = json_encode($request);\n $response = self::getApiResponse($url, $request);\n $response = json_decode($response, true);\n if (isset($response['data'])) {\n $response = $response['data'];\n } else {\n return false;\n }\n }\n return $response;\n }", "function get_car_trips_gps($vin, $ts_start, $ts_end)\n{\n global $cars_dt;\n \n // Lecture des trajets\n // -------------------\n // ouverture du fichier de log: trajets\n $fn_car = dirname(__FILE__).CARS_FILES_DIR.$vin.'/trips.log';\n $fcar = fopen($fn_car, \"r\");\n\n // lecture des donnees\n $line = 0;\n $cars_dt[\"trips\"] = [];\n $first_ts = time();\n $last_ts = 0;\n if ($fcar) {\n while (($buffer = fgets($fcar, 4096)) !== false) {\n // extrait les timestamps debut et fin du trajet\n list($tr_tss, $tr_tse, $tr_ds, $tr_batt) = explode(\",\", $buffer);\n $tsi_s = intval($tr_tss);\n $tsi_e = intval($tr_tse);\n // selectionne les trajets selon leur date depart&arrive\n if (($tsi_s>=$ts_start) && ($tsi_s<=$ts_end)) {\n $cars_dt[\"trips\"][$line] = $buffer;\n $line = $line + 1;\n // Recherche des ts mini et maxi pour les trajets retenus\n if ($tsi_s<$first_ts)\n $first_ts = $tsi_s;\n if ($tsi_e>$last_ts)\n $last_ts = $tsi_e;\n }\n }\n }\n fclose($fcar);\n\n // Lecture des points GPS pour ces trajets\n // ---------------------------------------\n // ouverture du fichier de log: points GPS\n $fn_car = dirname(__FILE__).CARS_FILES_DIR.$vin.'/gps.log';\n $fcar = fopen($fn_car, \"r\");\n\n // lecture des donnees\n $line = 0;\n $cars_dt[\"gps\"] = [];\n if ($fcar) {\n while (($buffer = fgets($fcar, 4096)) !== false) {\n // extrait les timestamps debut et fin du trajet\n list($pts_ts, $pts_lat, $pts_lon, $pts_head, $pts_batt, $pts_mlg, $pts_moving) = explode(\",\", $buffer);\n $pts_tsi = intval($pts_ts);\n // selectionne les trajets selon leur date depart&arrive\n if (($pts_tsi>=$first_ts) && ($pts_tsi<=$last_ts)) {\n $cars_dt[\"gps\"][$line] = $buffer;\n $line = $line + 1;\n }\n }\n }\n fclose($fcar);\n // Ajoute les coordonnées du domicile pour utilisation par javascript\n $latitute=config::byKey(\"info::latitude\");\n $longitude=config::byKey(\"info::longitude\");\n $cars_dt[\"home\"] = $latitute.\",\".$longitude;\n\n //log::add('peugeotcars', 'debug', 'Ajax:get_car_trips:nb_lines'.$line);\n return;\n}", "public function getData()\n\t{\n $data = [];\n\n $temperatures = new WorldTemperatures;\n\n foreach ($this->cities as $city) {\n $temperateInCelsius = $temperatures->fromLatLng($city['name'], $city['lat'], $city['long']);\n\n $celsius = round($temperateInCelsius);\n $fahrenheit = round(($temperateInCelsius * 1.8) + 32);\n\n $data[\"{$city['name']}\"] = \"{$celsius}/{$fahrenheit}\";\n }\n\n $data['dallas_season'] = $this->currentSeason();\n\n return $data;\n\t}", "function tfnm_geocode_location( $location ){\n\t$api_key = get_option( 'tfnm_options' )[ 'g_api_key' ];\n\t$api_url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . $location . '&key=' . $api_key;\n\n\t$response = tfnm_call_api( false, $api_url );\n\n\t// Add capability to have a MapQuest (Verizon) or HERE API key\n\n\t// This is latitude && This is longitude from Google Maps API\n\tif( !empty( $response->results[0]->geometry->location->lat ) && !empty( $response->results[0]->geometry->location->lng ) ){\n\t\treturn array(\n\t\t\t'latitude' => $response->results[0]->geometry->location->lat,\n\t\t\t'longitude' => $response->results[0]->geometry->location->lng\n\t\t);\n\t} else {\n\t\t// Will return if there is not a valid city inputted through the shortcode\n\t\t// OR if the quota limit has been reached\n\t\treturn 'There was an error finding the location. Please contact the administrator.';\n\t}\n\n}", "public function getLocationByFpo($fpo_id) {\n $location_data = $this->Share_Model->getLocationByFpo( $fpo_id );\n $response = array(\"status\" => 1, \"location_data\" => $location_data);\n echo json_encode($response);\n\t}", "public function getPlaces();", "function downloadLatLongByMlNum($ml_num,$table_name){\n $latLongExists = self::where('ml_num',$ml_num)->exists();\n if(!$latLongExists){\n $apikey = env('GOOGLE_MAP_APIKEY');\n $table_type = \"\";\n if($table_name == 'vow_residential_properties'){\n $table_type = 'residential';\n }elseif($table_name=='vow_condo_properties'){\n $table_type = 'condo';\n }\n\n $raw_query = \"Select property_table.ml_num,property_table.addr,property_table.municipality,property_table.zip,property_table.county,property_table.area from $table_name as property_table where property_table.ml_num ='$ml_num' and property_table.area in ('Toronto','York','Durham','Halton','Peel') \";\n $results = DB::select(DB::raw($raw_query));\n \n foreach($results as $property) {\n \n $add = $property->addr;\n $municipality = $property->municipality;\n $zip = $property->zip;\n $county = $property->county;\n $area = $property->area;\n $ml_num= $property->ml_num;\n \n $full_address = $add.' '.$municipality.' '.$area.' '.$county.' '.$zip;\n \n //Formatted address\n $formattedAddr = $full_address;\n \n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".urlencode($formattedAddr).\"&key=\".$apikey.\"\";\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n $responseJson = curl_exec($ch);\n curl_close($ch);\n $api_response = json_decode($responseJson);\n $latitude = '';\n $longitude = '';\n \n /** Check if api responce is exit or not ***/\n if ($api_response->status == 'OK') {\n $latitude = $api_response->results[0]->geometry->location->lat;\n $longitude = $api_response->results[0]->geometry->location->lng;\n \n } elseif($api_response->status == 'ZERO_RESULTS') {\n $latitude = '';\n $longitude = '';\n }\n \n try {\n //insert query for lat long\n $latLongObj = new LatLong();\n $latLongObj->ml_num = $ml_num;\n $latLongObj->longitude = !empty($longitude)?$longitude:0.00;\n $latLongObj->latitude = !empty($latitude)?$latitude:0.00;\n $latLongObj->table_type = $table_type;\n \\Log::info(\"Downloaded latLongs for $ml_num \");\n \\Log::info(\"Api url for $ml_num is $url\");\n \\Log::info(\"Full Address for $ml_num is $full_address and lat=$latitude and lng=$longitude\");\n return $latLongObj->save() ;\n \n } catch (Exception $e) {\n \\Log::info(\"Downloaded latLongs failed $ml_num \");\n }\n \n }\n }\n return false;\n }", "function getfileLocationsLat($fileArray){\n $locationsArray = [];\n foreach($fileArray as $file){\n $locationsArray[] = $file[\"imageMediaMetadata\"][\"location\"][\"latitude\"];\n }\n return $locationsArray;\n}", "private function extractOpenWeatherMapResult($json)\n {\n // check response status field\n if (!isset($json->cod)) {\n $this->errorMsg = \"'cod' field not found in the response object!\";\n return false;\n }\n \n // check response status field has success code\n if ($json->cod !== '200') {\n $this->errorMsg = \"API error! status code=\" . $json->cod;\n return false;\n }\n\n // check main data field\n if (!isset($json->list) || count($json->list) === 0) {\n $this->errorMsg = \"Weather forecast data not found in the response object!\";\n return false;\n }\n \n // display units will be different depends on selection\n $degree_simbol = $this->unit === 'FAHRENHEIT' ? \"<span>&#8457;&nbsp;</span>\" : \"<span>&#8451;&nbsp;</span>\";\n $wind_unit = $this->unit === 'FAHRENHEIT' ? \" m/h\" : \" m/s\";\n \n // OpenWeatherMap provide forecast data for every 3 hours.\n // calculating daily min, max temperature\n $prev = '';\n $count = 0;\n foreach ($json->list as $hour_data) {\n // convert timestamp in UTC to Japan time and extract day part\n $dt = gmdate(\"Y-m-d\", intval($hour_data->dt)+9*60*60);\n if ($dt === $prev) {\n // find dialy max values\n $weather->wind = max($weather->wind, floatval($hour_data->wind->speed));\n $weather->humidity = max($weather->humidity, floatval($hour_data->main->humidity));\n $weather->temp = max($weather->temp, intval($hour_data->main->temp));\n $weather->temp_min = min($weather->temp_min, intval($hour_data->main->temp_min));\n if ($weather->temp_max < intval($hour_data->main->temp_max)) {\n $weather->temp_max = intval($hour_data->main->temp_max);\n // get icon and description for max temp\n if (count($hour_data->weather) > 0) {\n $weather->description = $hour_data->weather[0]->main;\n $weather->icon = \"https://openweathermap.org/img/wn/\" . $hour_data->weather[0]->icon . \"@2x.png\";\n }\n }\n } else {\n if ($prev !== '') {\n // format and add object to the Area, if there are previos records\n $weather->wind = number_format(floatval($weather->wind), 2) . $wind_unit;\n $weather->humidity = $weather->humidity . \"%\";\n $weather->temp = $weather->temp . $degree_simbol;\n $weather->temp_min = $weather->temp_min . $degree_simbol;\n $weather->temp_max = $weather->temp_max . $degree_simbol;\n array_push($this->forecast, $weather);\n // 3 days forecast required\n if (++$count>2) {\n break;\n }\n }\n \n // next day start\n $weather = (object)[];\n $weather->dt = $dt;\n $prev = $dt;\n $weather->wind = floatval($hour_data->wind->speed);\n $weather->humidity = floatval($hour_data->main->humidity);\n $weather->temp = intval($hour_data->main->temp);\n $weather->temp_min = intval($hour_data->main->temp_min);\n $weather->temp_max = intval($hour_data->main->temp_max);\n if (count($hour_data->weather) > 0) {\n $weather->description = $hour_data->weather[0]->main;\n $weather->icon = \"https://openweathermap.org/img/wn/\" . $hour_data->weather[0]->icon . \"@2x.png\";\n }\n }\n }\n // if days are less than 3, add last object\n if ($count<2) {\n $weather->wind = number_format(floatval($weather->wind), 2) . $wind_unit;\n $weather->humidity = $weather->humidity . \"%\";\n $weather->temp = $weather->temp . $degree_simbol;\n $weather->temp_min = $weather->temp_min . $degree_simbol;\n $weather->temp_max = $weather->temp_max . $degree_simbol;\n array_push($this->forecast, $weather);\n }\n return true;\n }", "public function getLongitude(): float;", "public function storeLocation(Request $request, $id)\n { \n $data = $request->all();\n $route_ids = $request->route('id'); \n $route_id = (int)$route_ids;\n $user = auth()->user();\n $poi_ids = array();\n foreach ($request->data_poi as $key => $value) {\n array_push($poi_ids, $value['poiid']);\n $dest_id = $value['did'];\n if(LocationPointOfInterest::where(['place_id' => $value['place'],'tenant_id' => auth()->user()->tenant_id,'tour_package_id' => $value['routes']])->doesntExist())\n {\n $route_ids = $request->route('id'); \n $route_id = (int)$route_ids; \n \n $locationPois = LocationPointOfInterest::create([\n 'name' => $value['dname'],\n 'place_id' => $value['place'],\n 'tour_package_id' => $value['routes'],\n 'location_id' => $value['did'],\n 'point_of_interest_id' => $value['poiid'],\n 'tenant_id' => $user->tenant_id,\n 'user_id' => $user->id\n ]); \n }\n }\n $poi_latitude = 0;\n $poi_longitude = 0; \n $poi_count = 0;\n foreach ($poi_ids as $value) {\n $latlong = PointOfInterest::where('id', $value)->first();\n $poi_latitude += $latlong->latitude;\n $poi_longitude += $latlong->longitude;\n $poi_count += 1;\n }\n $location_lat = $poi_latitude/$poi_count;\n $location_long = $poi_longitude/$poi_count;\n $shopping_url = file_get_contents('https://api.tomtom.com/search/2/search/shopping_center.json?language=en-US&limit=20&lat='.$location_lat.'&lon='.$location_long.'&radius=5000&categorySet=7373&key=6vdxVANLJketgjeoT3dvURPnu4ny3VWy');\n $jsondata_shopping = json_decode($shopping_url);\n\n foreach ($jsondata_shopping->results as $key => $value_shopping) {\n if(Shopping::where(['poi_id' => $value_shopping->id,'tenant_id' => auth()->user()->tenant_id,'tour_package_id' => $route_id,'location_id' => $dest_id])->doesntExist()){\n $shopping = new Shopping();\n if((array_key_exists('municipalitySubdivision', $value_shopping->address))){\n $shopping->location = $value_shopping->address->municipalitySubdivision;\n }\n\n $shopping->name = $value_shopping->poi->name;\n $shopping->latitude = $value_shopping->position->lat;\n $shopping->longitude = $value_shopping->position->lon;\n $shopping->postal_code = $value_shopping->address->postalCode;\n $shopping->country = $value_shopping->address->country;\n $shopping->address = $value_shopping->address->freeformAddress;\n $shopping->local_name = $value_shopping->address->localName;\n $shopping->location_id = $dest_id;\n $shopping->tour_package_id = $route_id;\n $shopping->tenant_id = $user->tenant_id;\n $shopping->type = $value_shopping->poi->categories[0];\n $shopping->poi_id = $value_shopping->id;\n $shopping->save();\n }\n }\n\n $transport_url = file_get_contents('https://api.tomtom.com/search/2/search/PUBLIC_TRANSPORT_STOP.json?language=en-US&limit=20&lat='.$location_lat.'&lon='.$location_long.'&radius=10000&categorySet=9942002,9942003,9942004,9942005,7380002,7380003,7380004,7380005&key=6vdxVANLJketgjeoT3dvURPnu4ny3VWy');\n $jsondata_transport = json_decode($transport_url);\n\n foreach ($jsondata_transport->results as $key => $value_transport) {\n if(TransportLocation::where(['poi_id' => $value_transport->id,'tenant_id' => auth()->user()->tenant_id,'tour_package_id' => $route_id,'location_id' => $dest_id])->doesntExist()){\n $transport = new TransportLocation();\n if((array_key_exists('municipalitySubdivision', $value_transport->address))){\n $transport->location = $value_transport->address->municipalitySubdivision;\n }\n\n $transport->name = $value_transport->poi->name;\n $transport->latitude = $value_transport->position->lat;\n $transport->longitude = $value_transport->position->lon;\n $transport->postal_code = $value_transport->address->postalCode;\n $transport->country = $value_transport->address->country;\n $transport->address = $value_transport->address->freeformAddress;\n $transport->local_name = $value_transport->address->localName;\n $transport->location_id = $dest_id;\n $transport->tour_package_id = $route_id;\n $transport->tenant_id = $user->tenant_id;\n $transport->type = $value_transport->poi->categories[1];\n $transport->poi_id = $value_transport->id;\n $transport->save();\n }\n }\n \n //$updatestatus = TourPckage::completeStatus($route_id); // Closed 19-May-2020\n $route_ids = $request->route('id'); \n $route_id = (int)$route_ids;\n $countryISO = DB::table('location_point_of_interests')\n ->join('point_of_interests','point_of_interests.id','=','location_point_of_interests.point_of_interest_id')\n ->distinct()\n ->where('location_point_of_interests.tour_package_id',$route_id)\n ->select('point_of_interests.iso_2','point_of_interests.country_name')\n ->get();\n if(count($countryISO) > 0){\n foreach ($countryISO as $iso2) {\n $inc = CountryGuide::where('iso_2',$iso2->iso_2)\n ->where('tour_package_id',$route_id)\n ->first();\n if(is_null($inc)){\n $countryguide = new CountryGuide;\n $countryguide->iso_2 = $iso2->iso_2; \n $countryguide->country_name = $iso2->country_name;\n $countryguide->tour_package_id = $route_id;\n $countryguide->status = \"1\";\n $user = auth()->user();\n $countryguide->tenant_id = $user->tenant_id;\n $countryguide->user_id = $user->id;\n $countryguide->save();\n }\n }\n }\n return response()->json(['success' => 'added successfully']); \n }", "public static function getProductLocations($productID,$cityID) {\n //echo \"product_id == \".$productID.\" , city = \".$cityID; die;\n $queryResult = DB::table('product_vendor_locations as pvl')\n ->leftJoin(DB::raw('vendor_location_address as vla'),'vla.vendor_location_id','=','pvl.vendor_location_id')\n ->leftJoin('locations as l1', 'l1.id','=','vla.area_id')\n ->leftJoin('locations as l2', 'l2.id','=','vla.city_id')\n ->leftJoin('locations as l3', 'l3.id','=','vla.state_id')\n ->select('pvl.id as vendor_location_id','l1.name as area','l2.name as city','l3.name as state_name','vla.address','vla.pin_code','vla.latitude','vla.longitude')\n ->where('pvl.product_id',$productID)\n ->where('vla.city_id',$cityID)\n ->get();\n \n //array to hold location details\n $arrLocation = array();\n if($queryResult) {\n foreach($queryResult as $row) {\n\n $arrLocation[] = array(\n \"vendor_location_id\" => $row->vendor_location_id,\n \"address_line\" => $row->address,\n \"area\" => $row->area,\n \"city\" => $row->city,\n \"pincode\" => $row->pin_code,\n \"state\" => $row->state_name, \n //\"country\" => $row->country,\n \"latitude\" => $row->latitude,\n \"longitude\" => $row->longitude \n\n );\n }\n } \n return $arrLocation;\n }", "private function get_location () {\n try {\n // MaxMind GeoIP lookup\n // See: http://maxmind.github.io/GeoIP2-php/\n $reader = new Reader('assets/GeoLite2-City.mmdb');\n $record = $reader->city($_SERVER['REMOTE_ADDR']);\n return [\n 'lat' => $record->location->latitude,\n 'lng' => $record->location->longitude\n ];\n } catch (Exception $e) {\n return false;\n }\n }", "function getAllLatLong($lat,$long,$distance=6){\n\t\t\t\t\n\t\t$sql =\"SELECT e.event_id,e.event_name,e.event_type,u.user_id,u.user_name,\n\t\t\t\tu.image as UserImage,e.event_date,e.event_time,e.description,e.latitude,\n\t\t\t\te.longitude,ef.status,\n\t\t\t\t((ACOS(SIN('\".$lat.\"' * PI() / 180) * SIN(e.latitude * PI() / 180) \n\t\t\t\t+ COS('\".$lat.\"' * PI() / 180) * COS(e.latitude * PI() / 180) \n\t\t\t\t* COS(('\".$long.\"' - e.longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) \n\t\t\t\tAS `distance` from `events` as e,event_friends as ef\n\t\t\t\t\n\t\t\t\tleft join users as u on ef.user_id=u.user_id\n\t\t\t\t\n\t\t\t\twhere e.event_id=ef.event_id and e.create_type = 'events'\n\t\t\t\tand (ef.status != 'reject')\n\t\t\t\tgroup by e.event_id \n\t\t\t\thaving distance<=$distance order by distance asc\";\n\n\n\t\t$query = $this->db->query($sql);\t\n\t\t$data = $query->result_array();\n\t\treturn $data;\n\t\t\n\t}", "public static function getProductLocations($productID,$product_vendor_location_id,$cityID) {\n //echo \"product_id == \".$productID.\" , city = \".$cityID; die;\n $queryResult = DB::table('product_vendor_locations as pvl')\n ->leftJoin(DB::raw('vendor_location_address as vla'),'vla.vendor_location_id','=','pvl.vendor_location_id')\n ->leftJoin('locations as l1', 'l1.id','=','vla.area_id')\n ->leftJoin('locations as l2', 'l2.id','=','vla.city_id')\n ->leftJoin('locations as l3', 'l3.id','=','vla.state_id')\n ->select('pvl.id as vendor_location_id','l1.name as area','l2.name as city','l3.name as state_name','vla.address','vla.pin_code','vla.latitude','vla.longitude')\n ->where('pvl.product_id',$productID)\n ->where('vla.city_id',$cityID)\n //->whereIn('pvl.status',array('Active','Hidden'))\n ->where('pvl.status','Active')\n //->orWhere('pvl.status','Hidden')\n ->get();\n \n //array to hold location details\n $arrLocation = array();\n if($queryResult) {\n foreach($queryResult as $row) {\n\n $arrLocation[] = array(\n \"vendor_location_id\" => $row->vendor_location_id,\n \"address_line\" => $row->address,\n \"area\" => $row->area,\n \"city\" => $row->city,\n \"pincode\" => $row->pin_code,\n \"state\" => $row->state_name, \n //\"country\" => $row->country,\n \"latitude\" => $row->latitude,\n \"longitude\" => $row->longitude \n\n );\n }\n } \n return $arrLocation;\n }", "public function selectnearbyRestro($lat,$long){\n // cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * \n // sin( radians( lat ) ) ) ) AS distance FROM your_table_name HAVING\n // distance < 25 ORDER BY distance LIMIT 0 , 20;\")\n\n $query = $this->db->query(\"SELECT *, ( 3959 * acos( cos( radians($lat) ) * cos( radians( latitude ) ) * \n cos( radians( longnitude ) - radians($long) ) + sin( radians($lat) ) * \n sin( radians( latitude ) ) ) ) AS distance FROM restaurant HAVING\n distance < 10 ORDER BY distance LIMIT 0 , 20\");\n // print_r($query);die;\n $res = $query->result();\n return $res;\n }", "public function getlocationbimbel(Request $request)\n {\n\n $url = 'https://api.mapbox.com/geocoding/v5/mapbox.places/'.$request->lng.','.$request->lat.'.json?access_token=pk.eyJ1Ijoic2hvcGtsaWVuIiwiYSI6ImNqcWd4MjZpcjJtaW8zeHBiM3R6a3JkaHMifQ.aOg0HE-JWjVyPySLhJC65w&types=locality';\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $response = curl_exec ($ch);\n $err = curl_error($ch); //if you need\n curl_close ($ch);\n // $as = print_r($response);\n\n $data = json_decode($response, true);\n return $data['features'][0]['place_name'];\n }", "private function executeRequest()\n {\n $response = \\GoogleMaps\\GoogleMaps::load('geocoding')\n ->setParam([\n 'address' => $this->place->complete_address\n ])\n ->get();\n\n // sometimes, Google's not entirely sure and will send multiple, but first = best\n return collect(json_decode($response)->results)->first();\n }", "function geolocate($locations){\n $json_returns_array = array();\n $lat_lng_pairs_array = array();\n\n foreach ($locations as $location) {\n $location = $location.','.$SOC_COUNTRY;\n $url = 'http://maps.googleapis.com/maps/api/geocode/json?address='.$location.'&sensor=false';\n\n $obj = getJSONResponse($url,$location);\n $latlng = ''. $obj['results'][0]['geometry']['location']['lat'].\",\".$obj['results'][0]['geometry']['location']['lng'];\n\n array_push($json_returns_array, $obj);\n array_push($lat_lng_pairs_array, $latlng);\n }\n\n return $lat_lng_pairs_array;\n/*\n // Now that we have the JSONs for all the locations, check if any non-countries exist in there. If yes, then discard the SOC_COUNTRY\n if (count($json_returns_array) > 1){\n $type = $obj['results'][0]['address_components'][0]['types'][0];\n if (strtolower($type) == 'country') {\n }\n } \n*/\n}", "abstract public function latitude();", "function getCoordination($address){\r\n $address = str_replace(\" \", \"+\", $address); // replace all the white space with \"+\" sign to match with google search pattern\r\n \r\n $url = \"http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address\";\r\n \r\n $response = file_get_contents($url);\r\n \r\n $json = json_decode($response,TRUE); //generate array object from the response from the web\r\n\r\n $latitude = ($json[\"results\"][0][\"geometry\"][\"location\"][\"lat\"]);\r\n $longitude = ($json[\"results\"][0][\"geometry\"][\"location\"][\"lng\"]);\r\n\r\n return array(\"latitude\" => $latitude, \"longitude\" => $longitude);\r\n }", "public function index()\n {\n $lat = Input::get('lat');\n $lon = Input::get('lon');\n\n $locations = Location::getNearbyLocations($lat, $lon);\n\n return response()->json($locations);\n }", "public function getLocationWithScrapingResults() { return Location::query()\n ->leftJoin('my_business_terms_scraping_results', 'locations.id', '=', 'my_business_terms_scraping_results.location_id')\n ->whereJsonDoesntContain('states', LocationState::HAS_PROBLEM)\n ->where('my_business_terms_scraping_results.fetched_at', '<=', Carbon::today()->subDays(7))\n ->oldest('my_business_terms_scraping_results.fetched_at')\n ->first();\n }", "public function __construct(){\n //Despite what Singing Science Records might tell us, the phrase \"the earth is a ball\" is not entirely accurate.\n //It's more of a round-ish potato. So lat and lon values can \"stretch\"\n //Lon: -76.673608 to -76.582241 is exactly five miles along North Avenue, sez Bing.\n // So abs(76.582241 - 76.673608)/5 = 1 mile worth of radius = this->lonmile\n $this->lonmile = abs(76.582241 - 76.673608)/5;\n //Lat (via four miles on Light Street): \n $this->latmile = abs(39.327998 - 39.271404)/4;\n //--- A couple more ... ---\n //Roughly how many feet do we want in each block?\n define('feetperblock',250);\n //How many items must be present in a sampled grid radius before our script takes notice?\n define('threshold',1);\n //WHere is our csv file full of items? And where are the lat/lon columns?\n define('csvfile','homicide_victims_2015.csv');\n define('latindex',9);\n define('lonindex',10);\n\n }", "public function distance($other_loc) {\r\n if ($this->city == false || $other_loc->city == false) {\r\n return false;\r\n }\r\n $origin = ($this->address ? str_replace(' ', '+', $this->address) : '') . '+' . $this->city . '+' . $this->state;\r\n $destination = ($other_loc->address ? str_replace(' ', '+', $other_loc->address) : '') . '+' . $other_loc->city . '+' . $other_loc->state;\r\n $url = \"https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=$origin&destinations=$destination&key={$GLOBALS['google_maps_key']}\";\r\n $curl_handle = curl_init();\r\n curl_setopt( $curl_handle, CURLOPT_URL, $url );\r\n curl_setopt( $curl_handle, CURLOPT_RETURNTRANSFER, true );\r\n $distance_info = json_decode(curl_exec( $curl_handle ), true);\r\n curl_close( $curl_handle );\r\n if (!isset($distance_info['rows'][0]['elements'][0]['distance'])) {\r\n return false;\r\n }\r\n return [\r\n 'time' => $distance_info['rows'][0]['elements'][0]['duration'],\r\n 'length' => $distance_info['rows'][0]['elements'][0]['distance']\r\n ];\r\n }", "function get_nearby_courts_by_user_id($user_id, $user_latitude, $user_longitude)\n{\n global $conn;\n $nearby_courts = array();\n $all_courts = array();\n $q['query'] = \"SELECT * FROM `courts` WHERE user_id != '$user_id'\";\n $q['run'] = $conn->query($q['query']);\n while($q['result'] = $q['run']->fetch_assoc())\n {\n array_push($all_courts,$q['result']);\n }\n\n /**\n *for each court get the distance from user and if it\n *is less than nearby distance add it to nearby courts.\n */\n foreach($all_courts as $court)\n {\n $court_latitude = $court['court_latitude'];\n $court_longitude = $court['court_longitude'];\n $distance = get_distance_from_lat_long($court_latitude, $court_longitude, $user_latitude, $user_longitude);\n if($distance <= 5)\n {\n array_push($nearby_courts,$court);\n }\n }\n return $nearby_courts;\n}", "public function getLatitude()\n {\n return $this->get('Latitude');\n }", "function get_location( $args = array() ) {\n\t$throttle_geonames = $throttle_ip2location = $location = false;\n\n\t// For a country request, no lat/long are returned.\n\tif ( isset( $args['country'] ) ) {\n\t\t$location = array(\n\t\t\t'country' => $args['country'],\n\t\t);\n\t}\n\n\t// Coordinates provided\n\tif (\n\t\t! $location && (\n\t\t\t! empty( $args['latitude'] ) && is_numeric( $args['latitude'] ) &&\n\t\t\t! empty( $args['longitude'] ) && is_numeric( $args['longitude'] )\n\t\t)\n\t) {\n\t\t$location = array(\n\t\t\t'description' => false,\n\t\t\t'latitude' => $args['latitude'],\n\t\t\t'longitude' => $args['longitude'],\n\t\t);\n\t}\n\n\t// City was provided by the user:\n\tif ( ! $location && isset( $args['location_name'] ) ) {\n\t\t$throttle_geonames = mt_rand( 1, 100 ) <= THROTTLE_GEONAMES;\n\n\t\tif ( $throttle_geonames ) {\n\t\t\treturn 'temp-request-throttled';\n\t\t}\n\n\t\t$country_code = get_country_code_from_locale( $args['locale'] ?? '' );\n\t\t$guess = guess_location_from_city( $args['location_name'], $args['timezone'] ?? '', $country_code );\n\n\t\t$country_types = array(\n\t\t\t// See http://download.geonames.org/export/dump/featureCodes_en.txt\n\n\t\t\t'A.PCL', // political entity\n\t\t\t'A.PCLD', // dependent political entity\n\t\t\t'A.PCLF', // freely associated state\n\t\t\t'A.PCLH', // historical political entity\ta former political entity\n\t\t\t'A.PCLI', // independent political entity\n\t\t\t'A.PCLIX', // section of independent political entity\n\t\t\t'A.PCLS', // semi-independent political entity\n\t\t\t'A.PRSH', // parish an ecclesiastical district\n\t\t\t'A.TERR', // territory\n\t\t\t'A.ZN', // zone\n\t\t);\n\n\t\tif ( $guess && in_array( $guess->type, $country_types, true ) ) {\n\t\t\t$location = array(\n\t\t\t\t'country' => $guess->country,\n\t\t\t\t'description' => $guess->name,\n\t\t\t);\n\t\t} elseif ( $guess ) {\n\t\t\t$location = array(\n\t\t\t\t'description' => $guess->name,\n\t\t\t\t'latitude' => $guess->latitude,\n\t\t\t\t'longitude' => $guess->longitude,\n\t\t\t\t'country' => $guess->country,\n\t\t\t);\n\t\t} else {\n\t\t\t$guess = guess_location_from_country( $args['location_name'] );\n\n\t\t\tif ( $guess ) {\n\t\t\t\t$location = array(\n\t\t\t\t\t'country' => $guess['country_short'],\n\t\t\t\t\t'description' => $guess['country_long'],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $location ) {\n\t\tif ( isset( $args['location_name'] ) || isset( $args['ip'] ) || ! empty( $args['latitude'] ) || ! empty( $args['longitude'] ) ) {\n\t\t\t// If any of these are specified, and no localitity was guessed based on the above checks, bail with no location.\n\t\t\t$location = false;\n\t\t} else {\n\t\t\t// No specific location details.\n\t\t\t$location = array();\n\t\t}\n\t}\n\n\t// IP:\n\tif ( ! $location && isset( $args['ip'] ) && ! isset( $args['location_name'] ) ) {\n\t\t$throttle_ip2location = mt_rand( 1, 100 ) <= THROTTLE_IP2LOCATION;\n\n\t\tif ( $throttle_ip2location ) {\n\t\t\treturn 'temp-request-throttled';\n\t\t}\n\n\t\t$guess = guess_location_from_ip( $args['ip'] );\n\n\t\tif ( $guess ) {\n\t\t\t$location = array(\n\t\t\t\t'description' => $guess->ip_city,\n\t\t\t\t'latitude' => $guess->ip_latitude,\n\t\t\t\t'longitude' => $guess->ip_longitude,\n\t\t\t\t'country' => $guess->country_short,\n\n\t\t\t\t/*\n\t\t\t\t * ip2location's EULA forbids exposing the derived location publicly, so flag the\n\t\t\t\t * data for internal use only.\n\t\t\t\t */\n\t\t\t\t'internal' => true,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $location;\n}", "public static function getNearbyLocations($lat1,$lon1,$max = NULL) {\n\t\t\n\t\tif ($max == NULL) {\n\t\t\t$max = 100; # 250 meters distance for the check is the default\n\t\t}\n\t\t\t\n\t\t$where = self::getSearchableCategories();\n\t\t$sql = \"SELECT * FROM Buildings WHERE type = 'Building' OR type = 'Library' GROUP BY name ORDER BY name ASC\";\n\t\t$places = self::getPlaces($sql);\n\t\t$convertedPlaces = self::convertPlaces($places);\n\t\t\n\t\t// only converting first because i want easy keys to work with\n\t\t$nearbyPlaces = array();\n\t\tforeach ($convertedPlaces as $place) {\n\t\t\t$lat2 = $place['latitude'];\n\t\t\t$lon2 = $place['longitude'];\n\t\t\t\n\t\t\t// $distance is in kilometers\n\t\t\t$distance = (3958*3.1415926*sqrt(($lat2-$lat1)*($lat2-$lat1) + cos($lat2/57.29578)*cos($lat1/57.29578)*($lon2-$lon1)*($lon2-$lon1))/180);\n\t\t\t\n\t\t\tif ($max >= ($distance*1000)) {\n\t\t\t\t$nearbyPlaces[] = $place;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $nearbyPlaces;\n\t}", "protected function getLongLat($endereco){\n\n $end = str_replace(\" \", \"+\", $endereco);\n\n $url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\".$end.\"&sensor=false\";\n\n $json = file_get_contents($url);\n $data = json_decode($json, TRUE);\n\n\n return json_encode($data['results'][0]['geometry']['location']);\n\n }", "function location($gps){\n\tglobal $api;\n\t$lat = $gps['lat'];\n\t$lon = $gps['lon'];\n\t$endpoint = \"https://us1.locationiq.com/v1/reverse.php?key=$api&lat=$lat&lon=$lon&format=json\";\n\techo \"https://www.google.com/maps/search/?q=$lat,$lon\\n\";\n\treturn file_get_contents($endpoint);\n}", "function find_carpool_match($lat1,$lon1){\n\t\tglobal $connection;\n $query = \"SELECT *, \n\t\t\t\t( 3959 * acos( cos( radians('$lat1') ) * \n\t\t\t\t cos( radians( Lat ) ) * \n\t\t\t\t cos( radians( Lng ) - \n\t\t\t\t radians('$lon1') ) + \n\t\t\t\t sin( radians('$lat1') ) * \n\t\t\t\t sin( radians( Lat ) ) ) ) \n\t\t\t\t AS distance FROM employees WHERE NeedCarpool=1 HAVING distance < 5 ORDER BY distance ASC LIMIT 0, 10\";\n\n\t\t$result = mysqli_query($connection,$query);\n confirm_query($result);\n if($result)\n return $result;\n else\n return null; \n \n }", "public function GetTicketLocationRes($restaurantID){\n return $this->object->GetTicketLocationResDB($restaurantID);\n }", "function fn_warehouses_get_location_from_order($order_info)\n{\n $location = [\n 'country' => isset($order_info['s_country']) ? $order_info['s_country'] : '',\n 'state' => isset($order_info['s_state']) ? $order_info['s_state'] : '',\n 'city' => isset($order_info['s_city']) ? $order_info['s_city'] : '',\n 'zipcode' => isset($order_info['s_zipcode']) ? $order_info['s_zipcode'] : '',\n 'address' => isset($order_info['s_address']) ? $order_info['s_address'] : '',\n ];\n\n return $location;\n}", "public function get_trouble_spots() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/trouble_spots.json\");\n }", "public function index()\r\n {\r\n\r\n $gen = 'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=';\r\n $latitude = Input::get('lat');\r\n $longitude = Input::get('lng');\r\n $radius = 1000;\r\n\r\n $gen = $gen . $latitude . ',' . $longitude . '&radius=' . $radius;\r\n\r\n //Nearest hospitals\r\n $url = $gen . '&type=hospital' . '&key=' . PLACES_KEY;\r\n\r\n $response = file_get_contents($url);\r\n $hospitals = json_decode($response, true);\r\n\r\n //Nearest police stations\r\n $url = $gen . '&type=police' . '&key=' . PLACES_KEY;\r\n\r\n $response = file_get_contents($url);\r\n $police = json_decode($response, true);\r\n\r\n //Nearest fire stations\r\n $url = $gen . '&type=fire_station' . '&key=' . PLACES_KEY;\r\n\r\n $response = file_get_contents($url);\r\n $fire_station = json_decode($response, true);\r\n\r\n //Nearest pharmacies\r\n $url = $gen . '&type=pharmacy' . '&key=' . PLACES_KEY;\r\n\r\n $response = file_get_contents($url);\r\n $pharmacy = json_decode($response, true);\r\n\r\n $contact['hospitals'] = $hospitals;\r\n $contact['police'] = $police;\r\n $contact['fire_station'] = $fire_station;\r\n $contact['pharmacy'] = $pharmacy;\r\n\r\n $contact['latitude'] = $latitude;\r\n $contact['longitude'] = $longitude;\r\n\r\n $relief_camp = DB::table('camp')->get();\r\n $contact['camps'] = $relief_camp;\r\n\r\n return view('helpme')->with('contact', $contact);\r\n }", "public function retrive_nearby_locations(Request $request){\n\n $distance=100;\n $latitude=$request->latitude;\n $longitude=$request->longitude;\n $images=array();\n $result=array();\n\n /*echo 'SELECT locations.*,schools.*,school_images.image FROM locations,schools left join school_images on schools.id = school_images.id where locations.`id` = schools.location_id AND '.$distance.' >= ( ((ACOS( SIN( ('.$latitude.' * PI( ) /180 ) ) * SIN( (locations.latitude * PI( ) /180 ) ) + COS( ('.$latitude.' * PI( ) /180 )) * COS( (locations.latitude * PI( ) /180 )) * COS( (('.$longitude.' - locations.longitude) * PI( ) /180 )))) *180 / PI( )) *60 * 1.1515)';\n die();*/\n $results=DB::select(DB::raw('SELECT locations.*,schools.school_name,schools.id as school_id FROM locations,schools left join school_images on schools.id = school_images.id where locations.`id` = schools.location_id AND '.$distance.' >= ( ((ACOS( SIN( ('.$latitude.' * PI( ) /180 ) ) * SIN( (locations.latitude * PI( ) /180 ) ) + COS( ('.$latitude.' * PI( ) /180 )) * COS( (locations.latitude * PI( ) /180 )) * COS( (('.$longitude.' - locations.longitude) * PI( ) /180 )))) *180 / PI( )) *60 * 1.1515)'));\n\n $count=count($results);\n \n if($count > 8){\n $count = 8;\n }\n\n for($i=0; $i<$count; $i++){\n $result[]=$results[$i];\n }\n\n for($i=0; $i<$count; $i++){\n $images[$i]=$result[$i]->school_id;\n\n $images[$i]=School_image::where('school_id','=',$images[$i])->first();\n if(count($images[$i])){\n $images[$i]=$images[$i]->image;\n }else{\n $images[$i]=null;\n }\n }\n // print_r($images);\n // die();\n\n return response()->json(array(\n 'results' => $result,\n 'images' => $images\n ) ); \n }", "public function venues_near_me(Request $request)\n {\n try {\n $validator = Validator::make($request->all(),\n [\n 'proximity' => 'required',\n 'latitude' => 'required',\n 'longitude' => 'required',\n ],\n [\n 'proximity.required' => 'Kindly select the proximity radius',\n 'latitude.required' => 'Kindly switch on your gps',\n 'longitude.required' => 'Kindly switch on your gps',\n ]\n );\n\n if ($validator->fails()) {\n return response()->json(\n [\n 'success' => false,\n 'message' => '' . UniversalMethods::getValidationErrorsAsString($validator->errors()->toArray()),\n 'data' => []\n ], 200\n );\n }\n\n $proximity_radius = $request->proximity;\n $user_latitude = $request->latitude;\n $user_longitude = $request->longitude;\n\n $user = $request->user();\n\n //get the venues within the given proximity using the harvesine formula\n //distance in kms, rounded to 2 dps\n $venues = Venue::select(\n DB::raw(\"venues.*,ROUND(\n 6371 * acos(\n cos( radians( ? ) ) *\n cos( radians( latitude ) ) *\n cos( radians( longitude ) - radians(?) ) +\n sin( radians( ? ) ) *\n sin( radians( latitude ))\n )\n ,2) AS distance\")\n )\n ->having(\"distance\", \"<=\", $proximity_radius)\n ->orderBy(\"distance\")\n ->where('status', '=', DB::raw(1))\n ->setBindings([$user_latitude, $user_longitude, $user_latitude])\n ->get();\n\n\n $venueTransformer = new VenueTransformer();\n $venueTransformer->setUserId($user->id);\n\n return response()->json(\n [\n \"success\" => true,\n \"message\" => \"Found \" .count($venues) .\" venues\",\n 'data' => fractal($venues, $venueTransformer)\n ],200\n );\n\n } catch ( \\Exception $exception ) {\n return response()->json(\n [\n \"success\" => false,\n \"message\" => \"venues near me failed \".$exception->getMessage(),\n 'data' => []\n ]\n );\n }\n }", "function getMQroute($point1, $point2){\n \n $apiKey = getenv(\"MQ_API\");\n //echo \"API key: \".$apiKey;\n $url = \"http://open.mapquestapi.com/directions/v2/route?key=$apiKey\";\n //$data = array('key1' => 'value1', 'key2' => 'value2');\n\n //For json format see https://developer.mapquest.com/documentation/open/directions-api/route/post/\n $jsonData = \n \"{\n 'locations' : [\n {'latLng': {\n 'lat': $point1[0],\n 'lng': $point1[1]\n }},\n {'latLng': {\n 'lat': $point2[0],\n 'lng': $point2[1]\n }}\n ],\n 'options' : {\n 'narrativeType' : 'none',\n 'shapeFormat' : 'cmp',\n 'generalize' : 0,\n 'timeType' : 1,\n 'highwayEfficiency' : 16.0\n }\n }\";\n \n $options = array(\n 'http' => array(\n 'header' => \"Content-Type: application/json\",\n 'method' => 'POST',\n 'content' => $jsonData\n )\n );\n $context = stream_context_create($options);\n //temp time limit\n set_time_limit(60);\n $result = file_get_contents($url, false, $context);\n if ($result === FALSE || empty($result)) { \n //echo \"Nothing returned from map quest\";\n $result = FALSE;\n }\n //echo $result;\n return $result;\n}", "function getInfoFromGPSCoord($long,$lat)\n{\n\t$L93_10km=10000;\n\n\tlist($longL93,$latL93)=convertWGS84ToLambert93($lat,$long);\n\n\techo \"Execution de la 1e requete...\\n\";\n\t//recuperer resultat requete SQL\n\t$rpg=$GLOBALS['external_data']['urlRPG2017']['tablename'];\n\t$cultures=$GLOBALS['CSVtables'];\n\t$sql= \"SELECT DISTINCT code_cultu, label, label_groupe\n\t\t\tFROM $rpg\n\t\t\tINNER JOIN $cultures ON rpg2017.code_cultu=cultures.code\n\t\t\tWHERE ST_DISTANCE(ST_GeomFromText('POINT($longL93 $latL93)',2154),SHAPE)<=$L93_10km\n\t\t\tORDER BY ST_DISTANCE(ST_GeomFromText('POINT($longL93 $latL93)',2154),SHAPE) ASC\";\n\techo $sql . \"\\n\";\n\t$parcels = array();\n\tif($query=$GLOBALS['db']->query($sql))\n\t{\n\t\twhile($row=$query->fetch_assoc())\n\t\t\t$parcels[$row['code_cultu']]=$row;\n\t}\n\n\t$info['parcels']=$parcels;\n\n\techo \"Execution de la 2e requete...\\n\";\n\t//Pour que le resultat sur le terminal soit plus lisible, demandez plutot stu.soil\n\t$stu=$GLOBALS['external_data']['urlSTU']['tablename'];\n\t$stuorg=$GLOBALS['external_data']['urlSTUORG']['tablename'];\n\t$soilsTable=$GLOBALS['external_data']['urlSoilsShpFile']['tablename'];\n\t$sql=\"SELECT stu.soil, stu.stu, soil.smu, stuorg.pcarea,soil_description.soil \n\t\t\tFROM $stu\n\t\t\tINNER JOIN $stuorg ON stu.stu = stuorg.stu\n\t\t\tINNER JOIN $soilsTable ON soil.smu = stuorg.smu \n\t\t\tINNER JOIN soil_description on soil_description.soil85=stu.soil\n\t\t\tWHERE ST_DISTANCE(ST_GeomFromText('POINT($longL93 $latL93)',2154),SHAPE)<=$L93_10km\";\n\t\t\t// OR soil_description.soil90=stu.soil90\n\techo $sql . \"\\n\";\n\t$soils=array();\n\tif($query=$GLOBALS['db']->query($sql))\n\t{\n\t\twhile($row=$query->fetch_assoc())\n\t\t\t$soils[$row['soil']]=$row;\n\t}\n\n\t$info['soils']=$soils;\n\n\techo \"Resultat...\\n\";\n\tvar_dump($info);\n\n\treturn $info;\n}", "public function getStartingPins()\n {\n $lng = config('app.locations.default_center.lng');\n $lat = config('app.locations.default_center.lat');\n return $this->getFoursquareLocations($lat, $lng);\n }", "public static function search() {\n global $p;\n if (check_posts(['lat', 'lng'])) {\n $pharmacies = new pharmacies();\n $pharmacies->placeLat = $p['lat'];\n $pharmacies->placeLong = $p['lng'];\n $list = $pharmacies->get_place_by_latlng($p['distance'], 10);\n $r = [];\n\n foreach ($list['result'] as $place) {\n $f = new files($place['placeImg']);\n $place['placeImg'] = $f->placeOnServer;\n $r[] = $place;\n }\n $result['status'] = TRUE;\n $result['count'] = $list['nums'];\n $result['list'] = $r;\n } else {\n\n $result['status'] = FALSE;\n $result['error'] = 'invalid lat and lng';\n }\n\n// echo json_encode($p);\n// exit;\n if (@$p['post'] == 'post')\n $result['post'] = $p;\n echo json_encode($result);\n }", "private function _getTicketsCoordinates()\n {\n /** @var Ticket[] $tickets */\n $tickets = $this->Tickets->find('all')\n ->select(['latitude', 'longitude'])\n ->where([\n 'latitude IS NOT' => null,\n 'longitude IS NOT' => null\n ])\n ->toArray();\n\n $coordinates = [];\n\n /** @var Ticket $ticket */\n foreach ($tickets as $id => $ticket) {\n $coordinates[] = [\n 'latitude' => $ticket->latitude,\n 'longitude' => $ticket->longitude,\n ];\n }\n\n return $coordinates;\n }", "public function getLnt($zip) {\n $url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\n\" . urlencode($zip) . \"&sensor=false\";\n $result_string = file_get_contents($url);\n $result = json_decode($result_string, true);\n $result1[] = $result['results'][0];\n $result2[] = $result1[0]['geometry'];\n $result3[] = $result2[0]['location'];\n return $result3[0];\n }", "public function get_nearest_driver($coordinates = array(), $category, $limit=10,$distance_unit='',$requested_drivers= array(),$global=\"\",$location = \"\",$reqType='share',$genderPref=FALSE) {\n \n\t\t$map_searching_radius = $this->config->item('map_searching_radius');\n\t\tif($map_searching_radius<1000){\n\t\t\t$map_searching_radius = 1000;\n\t\t}\n\t\tif($global==\"global\"){\n\t\t\t$map_searching_radius = 100000;\n\t\t}\n\t\t\n\t\t$distanceMultiplier = 0.001;\n\t\tif($distance_unit == 'km'){\n\t\t\t$distanceMultiplier = 0.001;\n\t\t} else if($distance_unit == 'mi'){\n\t\t\t$distanceMultiplier = 0.000621371;\n\t\t} else if($distance_unit == 'm'){\n\t\t\t$distanceMultiplier = 1;\n\t\t}\n\t\t#print_R($category);die;\n if(!is_array($requested_drivers)&& empty($requested_drivers)){\n\t\t\t$requested_drivers=array();\n\t\t}\t\t\n\t\t\n\t\t$admin_muti_vehicle_status = $this->config->item('multi_category_option');\n\t\tif($admin_muti_vehicle_status == ''){\n\t\t\t$admin_muti_vehicle_status = 'OFF';\n\t\t} \n\t\t\n $matchArr = array('availability' => array('$eq' => 'Yes'),\n\t\t\t\t\t\t\t\t\t\t'status' => array('$eq' => 'Active'),\n\t\t\t\t\t\t\t\t\t\t'verify_status' => array('$eq' => 'Yes'),\n\t\t\t\t\t\t\t\t\t\t'last_active_time' => array('$gte' => MongoDATE(time()-1800)),\n\t\t\t\t\t\t\t\t\t\t#'_id'=>array('$nin'=>$requested_drivers)\n\t\t\t\t\t\t\t\t\t);\n\t\tif($genderPref!=FALSE && $genderPref!=\"\"){\n\t\t\t$matchArr[\"gender\"] = array('$eq' =>strtolower($genderPref));\n\t\t}\n\t\t\n \n\t\tif(is_array($category) && $reqType == 'share'){ \n\t\t\tif($location!=\"\"){ \n\t\t\t\t$this->mongo_db->select(array('pool_map_search_radius'));\n\t\t\t\t$this->mongo_db->where(array('_id' => MongoID($location)));\n\t\t\t\t$res = $this->mongo_db->get(LOCATIONS);\n\t\t\t\tif($res->num_rows()>0){\n\t\t\t\t\tif(isset($res->row()->pool_map_search_radius)){\n\t\t\t\t\t\tif($res->row()->pool_map_search_radius>=1000){\n\t\t\t\t\t\t\t$map_searching_radius = $res->row()->pool_map_search_radius;\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$matchArr[\"category\"] = array('$in' =>$category);\n\t\t\t$matchArr[\"active_trips\"] = array('$lt' =>intval(2));\n\t\t\t$matchArr['$or'] = array(array('mode' => array('$eq' =>'Booked'),'ride_type'=>array('$exists' =>true,'$eq' => 'Share')),\n\t\t\t\t\t\t\t\t\t\t\t\tarray('mode' => array('$eq' =>'Available'),'ride_type' => array('$exists' =>true,'$eq' =>\"Normal\")),\n\t\t\t\t\t\t\t\t\t\t\t\tarray('mode' => array('$eq' =>'Available'),'ride_type' => array('$exists' =>true,'$eq' =>\"Share\")),\n\t\t\t\t\t\t\t\t\t\t\t\tarray('mode' => array('$eq' =>'Available'),'ride_type' => array('$exists' =>true,'$eq' =>\"\")),\n\t\t\t\t\t\t\t\t\t\t\t\tarray('mode' => array('$eq' =>'Available'),'ride_type'=>array('$exists' =>false))\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}else{\n if(is_array($category) && $reqType == 'all'){\n $matchArr[\"category\"] = array('$in' =>$category);\n } else {\n\t\t\t\tif(is_array($category)){\n\t\t\t\t\t$aCatArr = array();\n\t\t\t\t\tforeach($category as $key => $val){\n\t\t\t\t\t\t$aCatArr[] = (string) $val; \n\t\t\t\t\t} \n\t\t\t\t\t$matchArr['$or'] = array(array('category'=>array('$in' =>$category)),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('multi_car_status' => array('$eq' =>'ON'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'additional_category' => array('$eq' =>$aCatArr)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$matchArr['$or'] = array(array('category'=>array('$eq' => MongoID($category))),\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray('multi_car_status' => array('$eq' =>'ON'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'additional_category' => array('$eq' =>$category)\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t}\n }\n\t\t\t$matchArr[\"active_trips\"] = array('$lt' =>intval(1));\n\t\t\t$matchArr[\"mode\"] = array('$eq' => 'Available');\n\t\t}\n\t\t#echo '<pre>'; print_r($matchArr); die;\n\t\t\n $option = array(\n array(\n '$geoNear' => array(\"near\" => array(\"type\" => \"Point\",\n \"coordinates\" => $coordinates\n ),\n \"spherical\" => true,\n \"maxDistance\" => intval($map_searching_radius),\n \"includeLocs\" => 'loc',\n \"distanceField\" => \"distance\",\n \"distanceMultiplier\" => $distanceMultiplier,\n 'num' => (string)$limit\n ),\n ),\n array(\n '$project' => array(\n 'category' => 1,\n 'driver_name' => 1,\n 'loc' => 1,\n 'availability' => 1,\n 'status' => 1,\n 'mode' => 1,\n 'push_notification' => 1,\n 'no_of_rides' => 1,\n 'avg_review' => 1,\n 'total_review' => 1,\n 'distance' => 1,\n 'verify_status' => 1,\n 'last_active_time' => 1,\n 'active_trips' => 1,\n 'ride_type' => 1,\n\t\t\t\t\t'gender' => 1,\n\t\t\t\t\t'multi_car_status' => 1,\n\t\t\t\t\t'additional_category' => 1,\n\t\t\t\t\t'messaging_status' => 1\n )\n ),\n\t\t\tarray('$match' => $matchArr),\n array(\n '$sort' => array(\n 'distance'=>1,\n 'last_active_time' => -1\n )\n )\n );\n\t\t\n\t\t#print_r($option);\n\t\t\n $res = $this->mongo_db->aggregate(DRIVERS, $option);\n return $res;\n }" ]
[ "0.65143555", "0.6391593", "0.5560715", "0.5535994", "0.54945916", "0.54651827", "0.5382494", "0.53443116", "0.5340008", "0.53354216", "0.5199319", "0.51734483", "0.51684", "0.515701", "0.51220787", "0.51204926", "0.5112165", "0.5102098", "0.5099035", "0.5032958", "0.5014162", "0.49928957", "0.4991449", "0.49901897", "0.49786767", "0.49701115", "0.49694884", "0.49665433", "0.49665433", "0.49559984", "0.4951081", "0.4947003", "0.49318668", "0.4923366", "0.4915313", "0.49060315", "0.49054566", "0.48966762", "0.48921415", "0.48831895", "0.4874225", "0.48674256", "0.4856876", "0.48395485", "0.4831599", "0.48272517", "0.4826207", "0.48194927", "0.48189935", "0.48161724", "0.48122182", "0.48111042", "0.4810237", "0.4804975", "0.47990337", "0.47964287", "0.47779036", "0.4775681", "0.47725275", "0.47707933", "0.4767738", "0.4761664", "0.4752003", "0.47519314", "0.47487497", "0.47466317", "0.47406226", "0.4725664", "0.47191417", "0.4718113", "0.4714904", "0.47134703", "0.47060093", "0.46940508", "0.46817282", "0.46792042", "0.46756023", "0.46751994", "0.46678716", "0.46484873", "0.46469206", "0.46461016", "0.4644008", "0.46419904", "0.46329787", "0.46280265", "0.46239406", "0.46211156", "0.46184412", "0.46179953", "0.46080852", "0.4607372", "0.45960876", "0.45958915", "0.4594022", "0.4573594", "0.45731738", "0.4547758", "0.45453966", "0.45438752" ]
0.73884773
0
getFoodTruckNearestLocationDB This method returns JSON data of all foodtrucks in a partular Latitude/Longitude retrieved from MYSQL db.
public function getFoodTruckNearestLocationDB($lat, $lon ,$countOfLoc) { try{ $query = " SELECT * FROM ( SELECT *, ( ( ( acos( sin(( $lat * pi() / 180)) * sin(( `Latitude` * pi() / 180)) + cos(( $lat * pi() /180 )) * cos(( `Latitude` * pi() / 180)) * cos((( $lon - `Longitude`) * pi()/180))) ) * 180/pi() ) * 60 * 1.1515 * 1.609344 ) as distance FROM mobile_food_facility_permit ) markers order by distance asc LIMIT $countOfLoc;"; //echo $query; $result = $this->db->query($query); $foodTruck = array(); if ($result->num_rows > 0) { // output data of each row $counter = 1; while($row = $result->fetch_assoc()) { $foodTrucks[] = array( "name"=>$row["Applicant"], "address"=>$row["LocationDescription"], "facilityType"=>$row["FacilityType"]); if($counter++ >$countOfLoc) break; } } } catch (Exception $e) { return json_encode(array("error"=>"true","description"=>"Exception")); } return json_encode($foodTrucks); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFoodTruckNearestLocation($lat, $lon ,$countOfLoc) {\r\n try {\r\n $rows = array_map('str_getcsv', file('../Mobile_Food_Facility_Permit.csv'));\r\n $header = array_shift($rows);\r\n $csv = array();\r\n $counter = 1;\r\n $myJSON = array();\r\n foreach($rows as $row) {\r\n $a = $lat - $row[14];\r\n $b = $lon - $row[15];\r\n $distance = sqrt(($a**2) + ($b**2));\r\n $distances[$row[0]] = $distance;\r\n $array[$row[0]] = $row;\r\n $csv[$row[0]] = array_combine($header, $row);\r\n }\r\n asort($distances);\r\n $counter = 1;\r\n $myJSON = array();\r\n foreach($distances as $id=>$value) {\r\n \r\n $foodTruck[] = array('name'=>$csv[$id]['Applicant'], \r\n \"address\"=>$csv[$id]['LocationDescription'],\r\n \"facilityType\"=>$csv[$id]['FacilityType']);\r\n if($counter++ >$countOfLoc) break;\r\n }\r\n } catch (Exception $e) {\r\n return json_encode(array(\"error\"=>\"true\",\"description\"=>\"Exception\"));\r\n }\r\n return json_encode($foodTruck);\r\n }", "public function nearest()\n {\n $lat = Input::get('lat');\n $lon = Input::get('lon');\n\n $location = Location::getNearestLocation($lat, $lon);\n return response()->json($location);\n }", "function requestClosest($tempLoc, $curLat, $curLon) {\n global $mysqli;\n global $toiletDB;\n \n $revised = $mysqli->prepare(\"SELECT * FROM $toiletDB WHERE absLoc = $tempLoc\");\n $revised->execute();\n $res = $revised->get_result();\n \n printClosest($res, $curLat, $curLon);\n \n $res->close(); \n}", "public function find($postcode){\n $inputCoordinates =$this->getCoordinates($postcode);\n\n if(!is_array($inputCoordinates))\n return $inputCoordinates;\n //Uses updateCoordinates to check if there are any new coffeedrop locations and add their lat and lon to db\n $dbpostcodes = $this->updateCoordinates();\n $distances = [];\n foreach ($dbpostcodes as $location) {\n //calculate the distances between the input and all db locations\n $distance = $this->getDistanceBetweenTwoPoints($inputCoordinates,array('latitude' => $location->latitude,'longitude' => $location->longitude));\n $distances[$location->postcode] = $distance;\n }\n //compares distances\n $closestCoffeeDrop = min(array_keys($distances, min($distances)));\n\n $closestCoffeeDropInfo = CoffeeDrop::where('postcode', $closestCoffeeDrop)->first();\n return response()->json(['information' => $closestCoffeeDropInfo]);\n }", "function generateFullPath() {\n include_once('../common/common_functions.php');\n $jsonRouteFilePath = \"cricketTraveledPath.json\";\n $error_msg = \"\";\n $result = true;\n $travelObj = new Travel();\n $tdh_db = \"CLEARDB_URL_TDH_SCRIPTS\";\n \n //Get the points from the database sorted by tripname, then date\n try{\n if($db = connect_db($tdh_db)){\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n \n $query_sel = $db->query(\"SELECT * from gps_readings order by `tripname`, `time` ASC\");\n $previousLatLong = [];\n $previousTripName = \"\";\n $tripLeg_id = 0;\n if($query_sel->rowCount() > 0){\n foreach ($query_sel as $row){\n $currentLatLong = [ $row['lat'], $row['long'] ];\n $time = $row['time'];\n if(!empty($previousLatLong)){\n //get the mapquest info\n// echo \"getting directions with \"\n// .implode(\",\",$currentLatLong)\n// .\" and \"\n// .implode(\",\",$previousLatLong)\n// .\" <br />\";\n $mqString = getMQroute($previousLatLong, $currentLatLong);\n if($mqString){\n //echo \"Got mq result <br />\";\n $mqResult = json_decode($mqString);\n if( $row['tripname'] !== $previousTripName){\n $newTrip = new Trip();\n $newTrip->name = ($row['tripname']);\n $travelObj->add_trip($newTrip);\n $previousTripName = $row['tripname'];\n }\n //Get the latest trip object from the travelObj\n $currentTrip = end($travelObj->trips);\n\n //If the points not the same make a new leg\n $distance = $mqResult->{\"route\"}->{\"distance\"};\n if($distance > 0){\n $tripLeg_id += 10;\n $newLeg = new TripLeg();\n $newLeg->id = $tripLeg_id;\n $newLeg->distance = $distance;\n $newLeg->startLatLong = $previousLatLong;\n $newLeg->endLatLong = $currentLatLong;\n $newLeg->startTime = $time;\n $newLeg->MQencodedPath = $mqResult->{\"route\"}->{\"shape\"}->{\"shapePoints\"};\n\n //add the leg to the current trip\n $currentTrip->add_leg($newLeg);\n }\n }else{ \n //Map Quest result not returned\n $error_msg = \"Map Quest result not returned\";\n $result = false;\n }\n }\n $previousLatLong = $currentLatLong;\n }\n //If none of the leg creations failed,\n //Turn the object into a json string and update the file.\n if($result){\n if($newTripsRoute = fopen($jsonRouteFilePath,\"w\")){\n fwrite($newTripsRoute, json_encode($travelObj));\n fclose($newTripsRoute);\n $result = true;\n }else{\n //error using fopen.\n $error_msg = \"Could not open file.\";\n $result = false;\n }\n }else{\n $error_msg.=\"Failed to create all legs of trip from MQ api. <br />\";\n }\n }\n }else{ //handle error\n $error_msg = \"Could not connect to database\";\n $result = false;\n }\n }catch(PDOException $ex) {\n $error_msg = \"CODE 120: Could not connect to mySQL DB<br />\"; //user friendly message\n $error_msg .= $ex->getMessage();\n $result = false; \n }\n echo $result ? \"Success! New file created.\" : $error_msg;\n return $result;\n}", "function generateFullPathWithGoogle() {\n include_once('../common/common_functions.php');\n $jsonRouteFilePath = \"cricketTraveledPath.json\";\n $error_msg = \"\";\n $result = false;\n $travelObj = new Travel();\n $tdh_db = \"CLEARDB_URL_TDH_SCRIPTS\";\n \n //Get the points from the database sorted by tripname, then date\n try{\n if($db = connect_db($tdh_db)){\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n \n $query_sel = $db->query(\"SELECT * from gps_readings order by `tripname`, `time` ASC\");\n $previousLatLong = [];\n $previousTripName = \"\";\n $tripLeg_id = 0;\n if($query_sel->rowCount() > 0){\n foreach ($query_sel as $row){\n $currentLatLong = [ $row['lat'], $row['long'] ];\n $time = $row['time'];\n if(!empty($previousLatLong)){\n //get the mapquest info\n $mqString = getMQroute($previousLatLong, $currentLatLong);\n if($mqString){\n $mqResult = json_decode($mqString);\n if( $row['tripname'] !== $previousTripName){\n $newTrip = new Trip();\n $newTrip->name = ($row['tripname']);\n $travelObj->add_trip($newTrip);\n $previousTripName = $row['tripname'];\n }\n //Get the latest trip object from the travelObj\n $currentTrip = end($travelObj->trips);\n\n //If the points not the same make a new leg\n $distance = $mqResult->{\"route\"}->{\"distance\"};\n if($distance > 0){\n $tripLeg_id += 10;\n $newLeg = new TripLeg();\n $newLeg->id = $tripLeg_id;\n $newLeg->distance = $distance;\n $newLeg->startLatLong = $previousLatLong;\n $newLeg->endLatLong = $currentLatLong;\n $newLeg->startTime = $time;\n $newLeg->MQencodedPath = $mqResult->{\"route\"}->{\"shape\"}->{\"shapePoints\"};\n\n //add the leg to the current trip\n $currentTrip->add_leg($newLeg);\n }\n }else{ \n //Map Quest result not returned\n $error_msg = \"Map Quest result not returned\";\n $result = false;\n \n }\n }\n $previousLatLong = $currentLatLong;\n }\n //If none of the leg creations failed,\n //Turn the object into a json string and update the file.\n if($result){\n if($newTripsRoute = fopen($jsonRouteFilePath,\"w\")){\n fwrite($newTripsRoute, json_encode($travelObj));\n fclose($newTripsRoute);\n $result = true;\n }else{\n //error using fopen.\n $error_msg = \"Could not open file.\";\n $result = false;\n }\n }\n }\n }else{ //handle error\n $error_msg = \"Could not connect to database\";\n $result = false;\n }\n }catch(PDOException $ex) {\n $error_msg = \"CODE 120: Could not connect to mySQL DB<br />\"; //user friendly message\n $error_msg .= $ex->getMessage();\n $result = false; \n }\n echo $result ? \"Success! New file created.\" : $error_msg;\n return $result;\n}", "function updateFoodTruckLocation($foodTruckID, $oldLat, $oldLong, $newLat, $newLong){\n include('../db.php');\n $query = \"SELECT * FROM food_truck WHERE foodtruckid=$foodTruckID AND latitude=$oldLat AND longitude=$oldLong\";\n $results = $db->query($query);\n if ($results === false){\n // db query returns false if the call failed\n echo \"Error, test query failed.\";\n exit();\n }\n $num_query_results = $results->num_rows;\n if ($num_query_results == 0){\n printf(\"Error, No matching food trucks found. From query: id: %s oldLat: %s oldLong: %s\",\n $foodTruckID, $oldLat, $oldLong);\n exit();\n }\n // food truck info is valid, update it with the new lat and long values\n $updateQuery = \"UPDATE food_truck SET latitude=$newLat, longitude=$newLong WHERE foodtruckid=$foodTruckID\";\n $results = $db->query($updateQuery);\n if ($results === false){\n // db query returns false if the call failed\n echo \"Error, update query failed.\";\n exit();\n }\n $json[] = [\n 'message' => \"Food Truck location successfully updated.\",\n ];\n header('Content-Type: application/json');\n echo json_encode($json, JSON_PRETTY_PRINT);\n $db->close();\n}", "public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"public-disorder-weapons\");\n\t\t\n\t\treturn $rate;\n\t\t}", "public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"drugs\");\n\t\t\n\t\treturn $rate;\n\t\t}", "public function retrive_nearby_locations(Request $request){\n\n $distance=100;\n $latitude=$request->latitude;\n $longitude=$request->longitude;\n $images=array();\n $result=array();\n\n /*echo 'SELECT locations.*,schools.*,school_images.image FROM locations,schools left join school_images on schools.id = school_images.id where locations.`id` = schools.location_id AND '.$distance.' >= ( ((ACOS( SIN( ('.$latitude.' * PI( ) /180 ) ) * SIN( (locations.latitude * PI( ) /180 ) ) + COS( ('.$latitude.' * PI( ) /180 )) * COS( (locations.latitude * PI( ) /180 )) * COS( (('.$longitude.' - locations.longitude) * PI( ) /180 )))) *180 / PI( )) *60 * 1.1515)';\n die();*/\n $results=DB::select(DB::raw('SELECT locations.*,schools.school_name,schools.id as school_id FROM locations,schools left join school_images on schools.id = school_images.id where locations.`id` = schools.location_id AND '.$distance.' >= ( ((ACOS( SIN( ('.$latitude.' * PI( ) /180 ) ) * SIN( (locations.latitude * PI( ) /180 ) ) + COS( ('.$latitude.' * PI( ) /180 )) * COS( (locations.latitude * PI( ) /180 )) * COS( (('.$longitude.' - locations.longitude) * PI( ) /180 )))) *180 / PI( )) *60 * 1.1515)'));\n\n $count=count($results);\n \n if($count > 8){\n $count = 8;\n }\n\n for($i=0; $i<$count; $i++){\n $result[]=$results[$i];\n }\n\n for($i=0; $i<$count; $i++){\n $images[$i]=$result[$i]->school_id;\n\n $images[$i]=School_image::where('school_id','=',$images[$i])->first();\n if(count($images[$i])){\n $images[$i]=$images[$i]->image;\n }else{\n $images[$i]=null;\n }\n }\n // print_r($images);\n // die();\n\n return response()->json(array(\n 'results' => $result,\n 'images' => $images\n ) ); \n }", "public function getTrainDetails(){\n $day = $this->_request['day'];\n $sourceCity = $this->_request['sourceCity'];\n $destinationCity = $this->_request['destinationCity'];\n if ($day=='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train\";\n else if($day=='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity'\";\n else if($day=='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND ToStation = '$destinationCity'\";\n else if($day=='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND FromStation = '$sourceCity' AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND $day = 1\";\n else if($day!='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train where $day = 1\";\n $rows = $this->executeGenericDQLQuery($sql);\n $trainDetails= array();\n for($i=0 ; $i<sizeof($rows);$i++)\n {\n $trainDetails[$i]['TrainID'] = $rows[$i]['TrainID'];\n $trainDetails[$i]['TrainNumber'] = $rows[$i]['TrainNumber'];\n $trainDetails[$i]['TrainName'] = $rows[$i]['TrainName'];\n $trainDetails[$i]['FromStation'] = $rows[$i]['FromStation'];\n $trainDetails[$i]['ToStation'] = $rows[$i]['ToStation'];\n $trainDetails[$i]['StartAt'] = $rows[$i]['StartAt'];\n $trainDetails[$i]['ReachesAt'] = $rows[$i]['ReachesAt'];\n $trainDetails[$i]['Monday'] = $rows[$i]['Monday'];\n $trainDetails[$i]['Tuesday'] = $rows[$i]['Tuesday'];\n $trainDetails[$i]['Wednesday'] = $rows[$i]['Wednesday'];\n $trainDetails[$i]['Thursday'] = $rows[$i]['Thursday'];\n $trainDetails[$i]['Friday'] = $rows[$i]['Friday'];\n $trainDetails[$i]['Saturday'] = $rows[$i]['Saturday'];\n $trainDetails[$i]['Sunday'] = $rows[$i]['Sunday'];\n // $trainDetails[$i]['CityID'] = $rows[$i]['CityID'];\n $trainDetails[$i]['WebLink'] = $rows[$i]['WebLink'];\n }\n $this->response($this->json($trainDetails), 200);\n\n }", "function getBikeParkLoc($from_lat, $from_lon){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.1;\n $sql = \"SELECT node_id, lat, lon, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_bike_parkings\n ORDER BY x ASC LIMIT 1\";\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = array($row['lat'],$row['lon']);\n }\n return $arr[0];\n}", "function getCarParkLoc($from_lat, $from_lon){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.1;\n $sql = \"SELECT node_id, lat, lon, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_car_parkings\n ORDER BY x ASC LIMIT 1\";\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = array($row['lat'],$row['lon']);\n }\n return $arr[0];\n}", "function shopsLatLongSelect($db) {\n $query = \"SELECT id_shop, name_shop, lat_shop, long_shop, description_shop FROM shop ORDER BY lat_shop ASC;\";\n return mysqli_query($db, $query);\n}", "public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"burglary\");\n\t\t\n\t\treturn $rate;\n\t\t}", "private function getLocation() {\n $location = false;\n \t$result = new StdClass();\n \t// $result->location = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->nearest = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->location = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $this->coordinates->latitude . ',' . $this->coordinates->longitude . '&sensor=false';\n\n \t$result = json_decode($this->getUrlContents($result->location));\n \t// $result->nearest = unserialize($this->getUrlContents($result->nearest));\n\n $location = $this->validateLocation($result);\n\n if(is_array($location))\n \t $location = $this->filterLocation($location);\n }", "public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"violent-crime\");\n\t\t\n\t\treturn $rate;\n\t\t}", "public function getPlaces();", "public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"all-crime\");\n\t\t\n\t\treturn $rate;\n\t\t}", "function queryAll() {\n\t$sql = \"select postcode,place_name,latitude,longitude FROM geo ORDER BY postcode\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->query($sql); \n\t\t$geoList = $stmt->fetchAll(PDO::FETCH_OBJ);\n\t\t$db = null;\n\t\techo '{\"geo\": ' . json_encode($geoList) . '}';\n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "function queryPostCodeNear($lat,$long) {\n\t\n\t$sql = \"SELECT postcode,place_name,latitude,longitude FROM geo WHERE latitude='$lat' and longitude='$long'\";\n\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(\"id\", $id);\n\t\t$stmt->execute();\n\t\t$geoList = $stmt->fetchObject(); \n\t\t$db = null;\n\t\techo json_encode($geoList); \n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "public function StopsNearLocation($latitude = null, $longitude = null) {\r\n if ($latitude == null) {\r\n throw new Exception(\"Cannot fetch \" . __METHOD__ . \" - no latitude given\");\r\n }\r\n \r\n if ($longitude == null) {\r\n throw new Exception(\"Cannot fetch \" . __METHOD__ . \" - no longitude given\");\r\n }\r\n \r\n $parameters = array(\r\n \"latitude\" => $latitude,\r\n \"longitude\" => $longitude\r\n );\r\n \r\n $return = array();\r\n \r\n foreach ($this->fetch(\"nearme\", $parameters) as $row) {\r\n $row['result']['location_name'] = trim($row['result']['location_name']);\r\n \r\n if ($row['result']['transport_type'] == \"train\" || preg_match(\"@Railway@i\", $row['result']['location_name'])) {\r\n $placeData = array(\r\n \"stop_id\" => $row['result']['stop_id'],\r\n \"stop_name\" => $row['result']['location_name'],\r\n \"stop_lat\" => $row['result']['lat'],\r\n \"stop_lon\" => $row['result']['lon'],\r\n \"wheelchair_boarding\" => 0,\r\n \"location_type\" => 1\r\n );\r\n \r\n /**\r\n * Check if this is stored in the database, and add it if it's missing\r\n */\r\n \r\n if (!in_array($row['result']['location_name'], $this->ignore_stops) && \r\n $row['result']['stop_id'] < 10000 &&\r\n !preg_match(\"@#([0-9]{0,3})@\", $row['result']['location_name'])\r\n ) {\r\n $query = sprintf(\"SELECT stop_id FROM %s_stops WHERE stop_id = %d LIMIT 1\", self::DB_PREFIX, $row['result']['stop_id']); \r\n $result = $this->adapter->query($query, Adapter::QUERY_MODE_EXECUTE); \r\n \r\n if ($result->count() === 0) {\r\n $Insert = $this->db->insert(sprintf(\"%s_stops\", self::DB_PREFIX));\r\n $Insert->values($placeData);\r\n $selectString = $this->db->getSqlStringForSqlObject($Insert);\r\n $this->adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n }\r\n \r\n $placeData['distance'] = vincentyGreatCircleDistance($row['result']['lat'], $row['result']['lon'], $latitude, $longitude);\r\n $placeData['provider'] = $this->provider;\r\n \r\n if ($placeData['distance'] <= 10000) { // Limit results to 10km from provided lat/lon\r\n $return[] = $placeData;\r\n }\r\n }\r\n }\r\n }\r\n \r\n return $return;\r\n }", "function GetLocations(){\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare(\"SELECT location_id, name FROM location\");\n\t$query->execute();\n\t$result = $query->fetchAll(); //Fetching it\n\treturn $result;\n}", "function downloadLatLongByMlNum($ml_num,$table_name){\n $latLongExists = self::where('ml_num',$ml_num)->exists();\n if(!$latLongExists){\n $apikey = env('GOOGLE_MAP_APIKEY');\n $table_type = \"\";\n if($table_name == 'vow_residential_properties'){\n $table_type = 'residential';\n }elseif($table_name=='vow_condo_properties'){\n $table_type = 'condo';\n }\n\n $raw_query = \"Select property_table.ml_num,property_table.addr,property_table.municipality,property_table.zip,property_table.county,property_table.area from $table_name as property_table where property_table.ml_num ='$ml_num' and property_table.area in ('Toronto','York','Durham','Halton','Peel') \";\n $results = DB::select(DB::raw($raw_query));\n \n foreach($results as $property) {\n \n $add = $property->addr;\n $municipality = $property->municipality;\n $zip = $property->zip;\n $county = $property->county;\n $area = $property->area;\n $ml_num= $property->ml_num;\n \n $full_address = $add.' '.$municipality.' '.$area.' '.$county.' '.$zip;\n \n //Formatted address\n $formattedAddr = $full_address;\n \n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".urlencode($formattedAddr).\"&key=\".$apikey.\"\";\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n $responseJson = curl_exec($ch);\n curl_close($ch);\n $api_response = json_decode($responseJson);\n $latitude = '';\n $longitude = '';\n \n /** Check if api responce is exit or not ***/\n if ($api_response->status == 'OK') {\n $latitude = $api_response->results[0]->geometry->location->lat;\n $longitude = $api_response->results[0]->geometry->location->lng;\n \n } elseif($api_response->status == 'ZERO_RESULTS') {\n $latitude = '';\n $longitude = '';\n }\n \n try {\n //insert query for lat long\n $latLongObj = new LatLong();\n $latLongObj->ml_num = $ml_num;\n $latLongObj->longitude = !empty($longitude)?$longitude:0.00;\n $latLongObj->latitude = !empty($latitude)?$latitude:0.00;\n $latLongObj->table_type = $table_type;\n \\Log::info(\"Downloaded latLongs for $ml_num \");\n \\Log::info(\"Api url for $ml_num is $url\");\n \\Log::info(\"Full Address for $ml_num is $full_address and lat=$latitude and lng=$longitude\");\n return $latLongObj->save() ;\n \n } catch (Exception $e) {\n \\Log::info(\"Downloaded latLongs failed $ml_num \");\n }\n \n }\n }\n return false;\n }", "function getClosestSales($lat, $lng, $index, $size = 5) {\n // NOTE: Limit can not be dynamic and must be a number\n $db_conn = SqlManager::getInstance();\n $sql = \"SELECT *,SQRT(POWER(? - p.lat, 2) + POWER(? - p.lng,2)) AS Distance FROM places AS p\n\t JOIN garage_sales_places AS g_fk ON p.place_id = g_fk.place_fk_id\n JOIN (SELECT g.gsale_id FROM garage_sales AS g WHERE DATE(RIGHT(g.dates, 10)) >= CURRENT_DATE) g ON g.gsale_id = g_fk.garage_sale_fk_id\n WHERE p.place_id > ? ORDER BY Distance ASC LIMIT \" . $size;\n $params = array($lat, $lng, $index);\n $result = $db_conn->query($sql,$params);\n if (!$result->getError()) {\n return $result->getResult();\n }\n}", "public function get_locations() {\n $this->db->select('*');\n $this->db->from('locations');\n $query = $this->db->get();\n $query_result = $query->result();\n\n return $query_result;\n }", "public function actionLocation() {\n $term = trim($_GET['term']);\n $bGeonames = (isset($_GET['geonames'])) ? true : false;\n $results = array();\n $geonamesUrl = \"http://api.geonames.org/searchJSON?maxRows=10&lang=de&username=wkoller&style=medium\";\n\n if ($bGeonames) {\n // Construct service URL\n $geonamesUrl = $geonamesUrl . \"&q=\" . urlencode($term);\n // Fetch service response\n $service_response = file_get_contents($geonamesUrl);\n if ($service_response) {\n // Decode data\n $service_data = json_decode($service_response, true);\n\n // Save response data in location table\n foreach ($service_data['geonames'] as $geoname) {\n // Check if we already have any entry\n $model_location = null;\n $model_locationGeonames = LocationGeonames::model()->find('geonameId=:geonameId', array(':geonameId' => $geoname['geonameId']));\n if ($model_locationGeonames != null) {\n $model_location = Location::model()->findByPk($model_locationGeonames->id);\n\n // update model with new location description\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n } else {\n // Create location model & save it\n $model_location = new Location;\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n // Create according geonames model & save it as well\n $model_locationGeonames = new LocationGeonames;\n $model_locationGeonames->id = $model_location->id;\n $model_locationGeonames->service_data = serialize($geoname);\n $model_locationGeonames->geonameId = $geoname['geonameId'];\n $model_locationGeonames->countryCode = $geoname['countryCode'];\n $model_locationGeonames->save();\n }\n\n // Add response to results\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n \"countryCode\" => $model_locationGeonames->countryCode\n );\n }\n }\n } else {\n // Find all fitting entries in location table\n $models_location = Location::model()->findAll('location LIKE :location', array(':location' => $term . '%'));\n if ($models_location != NULL) {\n foreach ($models_location as $model_location) {\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n );\n }\n }\n }\n\n // Output results as service response\n $this->serviceOutput($results);\n }", "public function getHotelLocation()\n {\n return $this->select('city')->groupBy('city')->orderBy('city', 'ASC')->findAll();\n }", "function getAllLatLong($lat,$long,$distance=6){\n\t\t\t\t\n\t\t$sql =\"SELECT e.event_id,e.event_name,e.event_type,u.user_id,u.user_name,\n\t\t\t\tu.image as UserImage,e.event_date,e.event_time,e.description,e.latitude,\n\t\t\t\te.longitude,ef.status,\n\t\t\t\t((ACOS(SIN('\".$lat.\"' * PI() / 180) * SIN(e.latitude * PI() / 180) \n\t\t\t\t+ COS('\".$lat.\"' * PI() / 180) * COS(e.latitude * PI() / 180) \n\t\t\t\t* COS(('\".$long.\"' - e.longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) \n\t\t\t\tAS `distance` from `events` as e,event_friends as ef\n\t\t\t\t\n\t\t\t\tleft join users as u on ef.user_id=u.user_id\n\t\t\t\t\n\t\t\t\twhere e.event_id=ef.event_id and e.create_type = 'events'\n\t\t\t\tand (ef.status != 'reject')\n\t\t\t\tgroup by e.event_id \n\t\t\t\thaving distance<=$distance order by distance asc\";\n\n\n\t\t$query = $this->db->query($sql);\t\n\t\t$data = $query->result_array();\n\t\treturn $data;\n\t\t\n\t}", "function findClosest($res, $curLat, $curLon) {\n // REMEMBER TO CHANGE CURLAT1 to CURLAT and CURLON1 to CURLON\n // originLan, originLon, destLan, destLon\n\n $absLoc = abs($curLat) + abs($curLon);\n\n\n // name, absLoc, latitude, longitude, rating, clean, purchase, bidet, squat, tpStash, soap\n while ($row = $res->fetch_assoc()) {\n $dbAbsLoc[] =floatval($row['absLoc']);\n }\n\n // locate the nearest absLoc point\n $i = 0;\n do {\n $tempLoc = abs($absLoc - $dbAbsLoc[$i]); \n $i++;\n } while ($i < count($dbAbsLoc) && $tempLoc > (abs($absLoc - $dbAbsLoc[$i])));\n $tempLoc = $dbAbsLoc[$i-1];\n requestClosest($tempLoc, $curLat, $curLon);\n}", "public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"anti-social-behaviour\");\n\t\t\n\t\treturn $rate;\n\t\t}", "function fetch_GPS_Coordinates(){\n \n $str_query=\"SELECT gpsdevice.lat,gpsdevice.lon, bus.Bus_number FROM gpsdevice INNER JOIN bus ON gpsdevice.bus_id=bus.device_id\";\n if($this->query($str_query)){\n \n return true;\n }\n else{\n return false;\n }\n }", "private function getCurrentWind() {\n $statement = $this->db->prepare('SELECT \"speed\", \"gust\", \"direction\" FROM \"wind\" ORDER BY \"created\" DESC LIMIT 1');\n $result = $statement->execute();\n return $result->fetchArray(SQLITE3_ASSOC);\n }", "public function get_result($db, $location) {\n\t\t$lat = $location['lat'];\n\t\t$lng = $location['lng'];\n\t\t\n\t\t// Get the API-format force and neighbourhood IDs.\n\t\t$forceAndNhoodObj = getForceAndNhood($lat, $lng);\n\t\t$force = $forceAndNhoodObj->force;\n\t\t$neighbourhood = $forceAndNhoodObj->neighbourhood;\n\t\t\n\t\t// And the rate itself.\n\t\t$rate = getCrimeRate($force, $neighbourhood, \"criminal-damage-arson\");\n\t\t\n\t\treturn $rate;\n\t\t}", "function getForceAndNhood($lat, $lng) {\n\t// My unique username and password, woo! The API requires this on every query.\n\t$userpass = POLICE_API_KEY;\n\t$url = \"http://policeapi2.rkh.co.uk/api/locate-neighbourhood?q=$lat,$lng\";\n\n\t$curl = curl_init();\n\n\t// Gotta put dat password in.\n\tcurl_setopt($curl, CURLOPT_USERPWD, $userpass);\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\n\t// Without this, we just get \"1\" or similar.\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n\n\t$data = curl_exec($curl);\n\n\tcurl_close($curl);\n\n\t// The API returns JSON, and json_decode produces an interesting mix of objects and arrays.\n\t$dataObj = json_decode($data);\n\t\n\treturn $dataObj;\n\t}", "public function selectnearbyRestro($lat,$long){\n // cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * \n // sin( radians( lat ) ) ) ) AS distance FROM your_table_name HAVING\n // distance < 25 ORDER BY distance LIMIT 0 , 20;\")\n\n $query = $this->db->query(\"SELECT *, ( 3959 * acos( cos( radians($lat) ) * cos( radians( latitude ) ) * \n cos( radians( longnitude ) - radians($long) ) + sin( radians($lat) ) * \n sin( radians( latitude ) ) ) ) AS distance FROM restaurant HAVING\n distance < 10 ORDER BY distance LIMIT 0 , 20\");\n // print_r($query);die;\n $res = $query->result();\n return $res;\n }", "public function GetTicketLocationRes($restaurantID){\n return $this->object->GetTicketLocationResDB($restaurantID);\n }", "public static function getProductLocations($productID,$cityID) {\n //echo \"product_id == \".$productID.\" , city = \".$cityID; die;\n $queryResult = DB::table('product_vendor_locations as pvl')\n ->leftJoin(DB::raw('vendor_location_address as vla'),'vla.vendor_location_id','=','pvl.vendor_location_id')\n ->leftJoin('locations as l1', 'l1.id','=','vla.area_id')\n ->leftJoin('locations as l2', 'l2.id','=','vla.city_id')\n ->leftJoin('locations as l3', 'l3.id','=','vla.state_id')\n ->select('pvl.id as vendor_location_id','l1.name as area','l2.name as city','l3.name as state_name','vla.address','vla.pin_code','vla.latitude','vla.longitude')\n ->where('pvl.product_id',$productID)\n ->where('vla.city_id',$cityID)\n ->get();\n \n //array to hold location details\n $arrLocation = array();\n if($queryResult) {\n foreach($queryResult as $row) {\n\n $arrLocation[] = array(\n \"vendor_location_id\" => $row->vendor_location_id,\n \"address_line\" => $row->address,\n \"area\" => $row->area,\n \"city\" => $row->city,\n \"pincode\" => $row->pin_code,\n \"state\" => $row->state_name, \n //\"country\" => $row->country,\n \"latitude\" => $row->latitude,\n \"longitude\" => $row->longitude \n\n );\n }\n } \n return $arrLocation;\n }", "public function getLocationWithScrapingResults() { return Location::query()\n ->leftJoin('my_business_terms_scraping_results', 'locations.id', '=', 'my_business_terms_scraping_results.location_id')\n ->whereJsonDoesntContain('states', LocationState::HAS_PROBLEM)\n ->where('my_business_terms_scraping_results.fetched_at', '<=', Carbon::today()->subDays(7))\n ->oldest('my_business_terms_scraping_results.fetched_at')\n ->first();\n }", "function getAddresses()\r\n\t{\r\n\t\t// connect to the database\r\n\t\t//$this->dbsetup();\r\n\t\t\r\n\t\t$query = \"SELECT address FROM \" . $this->table . \" WHERE latitude = '0' AND longitude = '0'\";\r\n\t\t\r\n\t\t$result = mysql_query($query);\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function run()\n\t{\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '登録待ち',\n\t\t\t'latitude' => 34.352506,\n\t\t\t'longitude' => 145.173339,\n\t\t]);\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '京都コンピュータ学院京都駅前校',\n\t\t\t'latitude' => 34.985041,\n\t\t\t'longitude' => 135.752556,\n\t\t]);\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '阪神甲子園球場',\n\t\t\t'latitude' => 34.721217,\n\t\t\t'longitude' => 135.361656,\n\t\t]);\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '京都コンピュータ学院鴨川校',\n\t\t\t'latitude' => 35.027876,\n\t\t\t'longitude' => 135.772926,\n\t\t]);\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '京都コンピュータ学院洛北校',\n\t\t\t'latitude' => 35.044426,\n\t\t\t'longitude' => 135.772223,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '旭山・雪の村',\n\t\t\t'latitude' => 43.767938,\n\t\t\t'longitude' => 142.484065,\n\t\t]);\n\n\n\n\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '阿蘇山',\n\t\t\t'latitude' => 32.898506,\n\t\t\t'longitude' => 131.087475,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '桜島',\n\t\t\t'latitude' => 31.583333,\n\t\t\t'longitude' => 130.65,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '西瀬戸自動車道',\n\t\t\t'latitude' => 34.260367,\n\t\t\t'longitude' => 133.088115,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '瓶ヶ森林道',\n\t\t\t'latitude' => 33.784698,\n\t\t\t'longitude' => 133.269326,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '稲佐の浜',\n\t\t\t'latitude' => 35.401932,\n\t\t\t'longitude' => 132.670956,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '秋吉台',\n\t\t\t'latitude' => 34.234894,\n\t\t\t'longitude' => 131.305865,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '魚沼スカイライン',\n\t\t\t'latitude' => 37.038381,\n\t\t\t'longitude' => 138.797183,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '千里浜なぎさドライブウェイ',\n\t\t\t'latitude' => 36.86619,\n\t\t\t'longitude' => 136.758309,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '竜神大吊り橋',\n\t\t\t'latitude' => 36.682853,\n\t\t\t'longitude' => 140.46617,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '武生林道',\n\t\t\t'latitude' => 36.715716,\n\t\t\t'longitude' => 140.446285,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '龍泊ライン',\n\t\t\t'latitude' => 41.201133,\n\t\t\t'longitude' => 140.340338,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '津軽岩木山スカイライン',\n\t\t\t'latitude' => 40.640158,\n\t\t\t'longitude' => 140.261623,\n\t\t]);\n\n\n\n\t\tDB::table('locations')->insert([\n\t\t\t'locationName' => '六甲山',\n\t\t\t'latitude' => 34.778023,\n\t\t\t'longitude' => 135.263724,\n\t\t]);\n\t}", "public function index()\n {\n $lat = Input::get('lat');\n $lon = Input::get('lon');\n\n $locations = Location::getNearbyLocations($lat, $lon);\n\n return response()->json($locations);\n }", "function getLongLat($postcode){\n\t//This function first checks the postcodesdetailed table for the long/lat\n\t//If not found, uses the Google Geocoding API to calculate and updates the postcodesdetailed table\n\t$db = new DB;\n\t//$postcode = \"DY5 2UA\";\n\t$object = new stdClass();\n\t\n\t$postcode = trim($postcode);\n\t//Check to see if postcode exists in postcodesdetailed table\n\t$postcode_a = strtoupper(str_replace(\" \",\"\",$postcode));\n\t$postcode_a = addslashes($postcode_a);\n\t$db->query(\"SELECT pdLat, pdLong FROM postcodesdetailed WHERE pdPostcode = '$postcode_a'\");\n\t$db->next_record();\n\tlist ($pdLat, $pdLong) = $db->Record;\n\t\n\tif (($pdLat != '') && ($pdLong != '')){\n\t\t$object->long = $pdLong;\n\t\t$object->lat = $pdLat;\n\t\t$object->status = \"OK\"; //Should return 'OK' if everything fine\n\t} else {\n\t\t\n\t\t$address = str_replace(\" \", \"+\", $postcode);\n\t\t$url = \"http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&region=UK\";\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_PROXYPORT, 3128);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\t$response_a = json_decode($response);\t\n\t\t\n\t\t$object->long = $response_a->results[0]->geometry->location->lng;\n\t\t$object->lat = $response_a->results[0]->geometry->location->lat;\n\t\t$object->status = $response_a->status; //Should return 'OK' if everything fine\n\t\t\n\t\t//If Long & Lat, INSERT into postcodesdetailed table so that next time we won't need to use the Google API\n\t\tif ($response_a->status == 'OK'){\n\t\t\t$db->query(\"INSERT INTO postcodesdetailed SET pdPostcode='\".$postcode_a.\"', pdLat='\".$object->lat.\"', pdLong='\".$object->long.\"'\");\n\t\t}\n\t}\n\t\n\t/* Status codes\n\t\t- \"OK\" - No Errors.\n\t\t- \"ZERO_RESULTS\" - successful but returned no results. Invalid address or a latlng in a remote location.\n\t\t- \"OVER_QUERY_LIMIT\" - indicates that you are over your quota.\n\t\t- \"REQUEST_DENIED\" - request was denied, generally because of lack of a sensor parameter.\n\t\t- \"INVALID_REQUEST\" - indicates that the query (address or latlng) is missing.\n\t\t- UNKNOWN_ERROR - request could not be processed due to a server error. The request may succeed if you try again.\n\t*/\n\t//var_dump($response_a);\n\treturn $object;\n}", "function get_snapped_point ($lat, $lng)\n{\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/json\",\n 'method' => 'GET' \n )\n );\n \n //ATTENTION :Replace your own api_key\n $api_key=\"key\";\n $url_arr = array(\"https://roads.googleapis.com/v1/nearestRoads?points=$lat,$lng&key=\".$api_key,\n \"https://roads.googleapis.com/v1/snapToRoads?path=$lat,$lng&key=\".$api_key);\n\n $url= $url_arr[array_rand($url_arr)];\n $context = stream_context_create($options);\n\n $result = file_get_contents($url, false, $context);\n $result_arr=json_decode($result,true);\n\n \n return ($result_arr[\"snappedPoints\"][0][\"location\"]);\n}", "public static function getProductLocations($productID,$product_vendor_location_id,$cityID) {\n //echo \"product_id == \".$productID.\" , city = \".$cityID; die;\n $queryResult = DB::table('product_vendor_locations as pvl')\n ->leftJoin(DB::raw('vendor_location_address as vla'),'vla.vendor_location_id','=','pvl.vendor_location_id')\n ->leftJoin('locations as l1', 'l1.id','=','vla.area_id')\n ->leftJoin('locations as l2', 'l2.id','=','vla.city_id')\n ->leftJoin('locations as l3', 'l3.id','=','vla.state_id')\n ->select('pvl.id as vendor_location_id','l1.name as area','l2.name as city','l3.name as state_name','vla.address','vla.pin_code','vla.latitude','vla.longitude')\n ->where('pvl.product_id',$productID)\n ->where('vla.city_id',$cityID)\n //->whereIn('pvl.status',array('Active','Hidden'))\n ->where('pvl.status','Active')\n //->orWhere('pvl.status','Hidden')\n ->get();\n \n //array to hold location details\n $arrLocation = array();\n if($queryResult) {\n foreach($queryResult as $row) {\n\n $arrLocation[] = array(\n \"vendor_location_id\" => $row->vendor_location_id,\n \"address_line\" => $row->address,\n \"area\" => $row->area,\n \"city\" => $row->city,\n \"pincode\" => $row->pin_code,\n \"state\" => $row->state_name, \n //\"country\" => $row->country,\n \"latitude\" => $row->latitude,\n \"longitude\" => $row->longitude \n\n );\n }\n } \n return $arrLocation;\n }", "public function run()\n {\n DB::beginTransaction();\n DB::table('routes')->truncate();\n DB::table('routes')->insert([\n [\n 'fleet_id' => 4,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KOTA MEDAN',\n 'destination_district' => 'MEDAN KOTA',\n 'destination_island' => 'SUMATERA',\n 'price' => 4000,\n 'minimum_weight' => 100,\n ],\n [\n 'fleet_id' => 3,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KOTA MEDAN',\n 'destination_district' => 'MEDAN KOTA',\n 'destination_island' => 'SUMATERA',\n 'price' => 33500,\n 'minimum_weight' => 15,\n ],\n [\n 'fleet_id' => 4,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KOTA BATAM',\n 'destination_district' => 'BATAM KOTA',\n 'destination_island' => 'SUMATERA',\n 'price' => 5000,\n 'minimum_weight' => 100,\n ],\n [\n 'fleet_id' => 3,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KOTA BATAM',\n 'destination_district' => 'BATAM KOTA',\n 'destination_island' => 'SUMATERA',\n 'price' => 34000,\n 'minimum_weight' => 10,\n ],\n [\n 'fleet_id' => 4,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KOTA PEKANBARU',\n 'destination_district' => 'PEKANBARU KOTA',\n 'destination_island' => 'SUMATERA',\n 'price' => 4000,\n 'minimum_weight' => 100,\n ],\n [\n 'fleet_id' => 3,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KOTA PEKANBARU',\n 'destination_district' => 'PEKANBARU KOTA',\n 'destination_island' => 'SUMATERA',\n 'price' => 29500,\n 'minimum_weight' => 15,\n ],\n [\n 'fleet_id' => 4,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KOTA D U M A I',\n 'destination_district' => 'DUMAI KOTA',\n 'destination_island' => 'SUMATERA',\n 'price' => 8000,\n 'minimum_weight' => 100,\n ],\n [\n 'fleet_id' => 4,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KABUPATEN S I A K',\n 'destination_district' => 'SIAK',\n 'destination_island' => 'SUMATERA',\n 'price' => 9500,\n 'minimum_weight' => 100,\n ],\n [\n 'fleet_id' => 4,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KABUPATEN PELALAWAN',\n 'destination_district' => 'PANGKALAN KERINCI',\n 'destination_island' => 'SUMATERA',\n 'price' => 8000,\n 'minimum_weight' => 100,\n ],\n [\n 'fleet_id' => 4,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KABUPATEN INDRAGIRI HULU',\n 'destination_district' => 'RENGAT',\n 'destination_island' => 'SUMATERA',\n 'price' => 9000,\n 'minimum_weight' => 100,\n ],\n [\n 'fleet_id' => 4,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KABUPATEN INDRAGIRI HILIR',\n 'destination_district' => 'TEMBILAHAN',\n 'destination_island' => 'SUMATERA',\n 'price' => 10000,\n 'minimum_weight' => 100,\n ],\n [\n 'fleet_id' => 4,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'KABUPATEN KAMPAR',\n 'destination_district' => 'KAMPAR',\n 'destination_island' => 'SUMATERA',\n 'price' => 10000,\n 'minimum_weight' => 100,\n ],\n [\n 'fleet_id' => 4,\n 'origin' => 'KOTA SURABAYA',\n 'destination_city' => 'BUKIT BATU',\n 'destination_district' => 'SUNGAI PAKNING',\n 'destination_island' => 'SUMATERA',\n 'price' => 8000,\n 'minimum_weight' => 100,\n ],\n ]);\n DB::commit();\n }", "function get_place_JSON() {\n\n try {\n // Declare global variables;\n global $fb, $keyword, $latitude, $longitude;\n // Use Facebook SDK to code;\n // Returns a `Facebook\\FacebookResponse` object\n if(empty($latitude) || empty($longitude)) {\n $request = $fb->request('GET', '/search', ['q' => $keyword,'type' => 'place', 'fields'=>'id,name,picture.width(700).height(700)']);\n $response = $fb->getClient()->sendRequest($request);\n $arrayJSON = $response->getDecodedBody();\n $jsonObj = json_encode($arrayJSON);\n } else {\n $request = $fb->request('GET', '/search', ['q' => $keyword,'type' => 'place','center' => $latitude . \",\" . $longitude, 'fields'=>'id,name,picture.width(700).height(700)']);\n $response = $fb->getClient()->sendRequest($request);\n $arrayJSON = $response->getDecodedBody();\n $jsonObj = json_encode($arrayJSON);\n }\n\n } catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n $jsonObj = '{' . '\"error\":' . '\"'. $e . '\"' . '}';\n } catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n $jsonObj = '{' . '\"error\":' . '\"'. $e . '\"' . '}';\n } catch (Exception $e) {\n $jsonObj = '{' . '\"error\":' . '\"'. $e . '\"' . '}';\n }\n\n\n\n\n\n return $jsonObj;\n}", "public function getWKT() {\r\n $wkt = $this->db->query(\"SELECT ST_AsText(geom) AS wkt FROM {$this->table} WHERE id=?\", array($this->id) );\r\n $wkt = $wkt->row()->wkt;\r\n return $wkt;\r\n}", "public function MobidulNearMe($latitude, $longitude)\n {\n // SELECT mob.id, MIN( ( 6371 * acos( cos( radians($latitude) ) * cos( radians( st.lat ) ) * cos( radians( st.lon ) - radians($longitude) ) + sin( radians($latitude) ) * sin( radians( st.lat ) ) ) ) ) AS distance FROM mobidul as mob JOIN station as st ON st.mobidulId = mob.id GROUP BY mob.id ORDER BY distance\n\n $nearMeMobiduls = DB::select('SELECT mob.id, mob.code, mob.description, mob.name, mob.background, MIN( ( 6371 * acos( cos( radians(:lat) ) * cos( radians( st.lat ) ) * cos( radians( st.lon ) - radians(:lon) ) + sin( radians(:latx) ) * sin( radians( st.lat ) ) ) ) ) AS distance FROM mobidul as mob JOIN station as st ON st.mobidulId = mob.id GROUP BY mob.id ORDER BY distance', array('lat'=>$latitude, 'lon'=>$longitude, 'latx'=>$latitude)); //()->getPdo()->exec( $sql );\n\n $mobiuser = User::where('username', '=', 'mobiuser')\n ->select('id')\n ->first();\n\n $mobiuserMobiduls = DB::table('user2mobidul')\n ->where('userId', $mobiuser->id)\n ->select('mobidulId')\n ->get();\n\n $filteredNearMeMobiduls = [];\n foreach ($nearMeMobiduls as $mobidul) {\n $mobidulId = $mobidul->id;\n $foundMobidul = false;\n\n foreach ($mobiuserMobiduls as $muMobidul) {\n if ( $mobidulId === $muMobidul->mobidulId ) {\n $foundMobidul = true;\n break;\n }\n }\n\n $filteredNearMeMobiduls[] = $mobidul;\n }\n\n return $filteredNearMeMobiduls;\n }", "public function getHotelDetails()\n {\n\n $startPrice = intval ($this->_request['startPrice']);\n // $endPrice = $this->_request['endPrice'] != \"undefined\" ? intval ($this->_request['endPrice']) : $startPrice;\n $endPrice = $this->_request['endPrice'] != \"undefined\" ? intval ($this->_request['endPrice']) : -1; // -1 where the end orice is exceeds limit\n \n $sql=\"select distinct h.id hotelId , h.Name hotelName , h.content content ,h.Address address , h.Phone1 phone1 , h.Phone2 phone2, h.Phone3 phone3 ,\".\n \"h.Mobile mobile , h.Fax fax , h.Email email , h.Website webSite , h.reservation_authority reservationAuthority ,\".\n \"h.Category category , h.Facilities facilitites , h.CityId cityId , h.icon_image iconImg, h.home_image homeImg , c.CityName ,c.STDCode stdCode\".\n \" from hotels h\" .\n \" join city c on c.CityID = h.CityId \".\n \" join hotel_rooms hr on hr.hotel_id= h.id \";\n //echo $sql;\n if($startPrice!=\"undefined\")\n {\n\n $sql .= \" where hr.PriceStarts>=$startPrice \";\n if($endPrice >= $startPrice && $endPrice!=-1) // in case of out bound condition\n $sql .=\" and hr.PriceEnds<= $endPrice\";\n }\n \n //echo $sql;\n $hotelDetails = array();\n $rows = $this->executeGenericDQLQuery($sql);\n // print_r($rows);\n for($i=0;$i<sizeof($rows);$i++)\n {\n $hotelDetails[$i]['hotelId'] = $rows[$i]['hotelId'];\n $hotelDetails[$i]['hotelName'] =($rows[$i]['hotelName'] == null || $rows[$i]['hotelName'] == \"null\") ? \" No Data Available\" : $rows[$i]['hotelName'];\n $hotelDetails[$i]['content'] = ($rows[$i]['content'] == null || $rows[$i]['content'] == \"null\") ? \"No Data Available\" : $rows[$i]['content'] ;\n $hotelDetails[$i]['address'] = ($rows[$i]['address'] == null || $rows[$i]['address'] == \"null\") ? \"No Data Available\" : $rows[$i]['address'] ;\n $hotelDetails[$i]['phone1'] = ($rows[$i]['phone1'] == null || $rows[$i]['phone1'] == \"null\") ? \"No Data Available\" : $rows[$i]['phone1'] ;\n $hotelDetails[$i]['phone2'] = ($rows[$i]['phone2'] == null || $rows[$i]['phone2'] == \"null\") ? \"No Data Available\" : $rows[$i]['phone2'];\n $hotelDetails[$i]['phone3'] = ($rows[$i]['phone3'] == null || $rows[$i]['phone3'] == \"null\") ? \"No Data Available\" : $rows[$i]['phone3'];\n $hotelDetails[$i]['mobile'] = ($rows[$i]['mobile'] == null || $rows[$i]['mobile'] == \"null\") ? \"No Data Available\" : $rows[$i]['mobile'] ;\n $hotelDetails[$i]['fax'] = ($rows[$i]['fax'] == null || $rows[$i]['fax'] == \"null\") ? \"No Data Available\" : $rows[$i]['fax'];\n $hotelDetails[$i]['email'] = ($rows[$i]['email'] == null || $rows[$i]['email'] == \"null\") ? \"No Data Available\" :$rows[$i]['email'] ;\n $hotelDetails[$i]['webSite'] = ($rows[$i]['webSite'] == null || $rows[$i]['webSite'] == \"null\") ? \"No Data Available\" : $rows[$i]['webSite'] ;\n $hotelDetails[$i]['reservationAuthority'] = ($rows[$i]['reservationAuthority'] == null || $rows[$i]['reservationAuthority'] == \"null\") ? \"No Data Available\" : $rows[$i]['reservationAuthority'];\n $hotelDetails[$i]['category'] = ($rows[$i]['category'] == null) ? 0 : $rows[$i]['category'] ;\n $hotelDetails[$i]['iconImg'] = ($rows[$i]['iconImg'] == null || $rows[$i]['iconImg'] == \"null\") ? \"img/not_found.jpg\" : $rows[$i]['iconImg'];\n $hotelDetails[$i]['homeImg'] = ($rows[$i]['homeImg'] == null || $rows[$i]['homeImg'] == \"null\") ? \"img/not_found.jpg\" :$rows[$i]['homeImg'];\n $hotelDetails[$i]['stdCode'] = $rows[$i]['stdCode'];\n \n $hotelDetails[$i]['facilitites'] = $this->getFacilitiesByIds($rows[$i]['facilitites']);\n $hotelDetails[$i]['roomDetails'] = $this->getRoomDetailsById($rows[$i]['hotelId']);\n\n \n }\n //echo $sql;\n $this->response($this->json($hotelDetails), 200); \n\n \t\t\t\n }", "public function getNearestPark($latitude, $longitude) { \n\n $stms = $this->conn->prepare(\"SELECT * FROM `parks` ORDER BY ((? - latitude)*(? - latitude)) + ((? - longitude)*(? - longitude)) ASC\"); \n $stms->bind_param('dddd', $latitude, $latitude, $longitude, $longitude); \n if ($stms->execute()) {\n\t\t\t$result = $stms->get_result();\n\t\t\twhile ($data = $result->fetch_assoc()) {\n\t\t\t\t$nearestParks[] = $data;\n\t\t\t}\n $stms->close();\n\t\t\treturn $nearestParks;\n } \n }", "function getmappoints() {\r\n $sql = \"SELECT * FROM markers WHERE 1\";\r\n $query = $this->db->query($sql);\r\n if ($query->num_rows() > 0) {\r\n return $query;\r\n }\r\n }", "private static function getPlaces($sql) {\n\t\t$db = new db;\n\t\t$db->connection->setFetchMode(MDB2_FETCHMODE_ASSOC);\n\t\t$stmt =& $db->connection->prepare($sql);\n\t $result = $stmt->execute();\n\t $places = $result->fetchAll();\n\t\treturn $places;\n\t}", "public function getAllTruckActive()\n\t{\n\t\t/*$sql = \"SELECT id_inventories, article, brand, model, description, id_product\n\t\t\t\tFROM inventories\n\t\t\t\tWHERE id_inventories \n\t\t\t\tIN (\n\t\t\t\t\tSELECT id_truck\n\t\t\t\t\tFROM shippings\n\t\t\t\t)\";\n\t\t\n\t\t$select = $this->dbAdapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\t\t$result = $select->toArray();\n\t\treturn $result;*/\n\t\t\n\t\t$sql = new Sql($this->adapter);\n\t\t$select = $sql->select()->from(array('i' => $this->table));\n\t\t\n\t\t$subSelect = $sql->select()\n\t\t\t->from(array(\"s\" => \"shippings\"))\n\t\t\t->columns(array('id_truck'));\n\t\t\n\t\t$select\n\t\t\t->columns(array(\n\t\t\t\t\t'id_inventories', 'article', 'brand', 'model', 'id_product'\n\t\t\t))\n\t\t\t->join(array('shi' => 'shippings'), 'i.id_inventories = shi.id_truck', array('id_shipping', 'start_date'), 'LEFT')\n\t\t\t->where(array(\"shi.end_date\"=>\"0000-00-00\"))\n\t\t\t->where->in(\"id_inventories\", $subSelect);\n\t\t\t//->where->isNull(\"shi.end_date\");\n\t\t\t\n\t\t$selectString = $sql->getSqlStringForSqlObject($select);\n\t\t$execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\n\t\t$result = $execute->toArray();\n\t\treturn $result;\n\t}", "public function storeLocation(Request $request, $id)\n { \n $data = $request->all();\n $route_ids = $request->route('id'); \n $route_id = (int)$route_ids;\n $user = auth()->user();\n $poi_ids = array();\n foreach ($request->data_poi as $key => $value) {\n array_push($poi_ids, $value['poiid']);\n $dest_id = $value['did'];\n if(LocationPointOfInterest::where(['place_id' => $value['place'],'tenant_id' => auth()->user()->tenant_id,'tour_package_id' => $value['routes']])->doesntExist())\n {\n $route_ids = $request->route('id'); \n $route_id = (int)$route_ids; \n \n $locationPois = LocationPointOfInterest::create([\n 'name' => $value['dname'],\n 'place_id' => $value['place'],\n 'tour_package_id' => $value['routes'],\n 'location_id' => $value['did'],\n 'point_of_interest_id' => $value['poiid'],\n 'tenant_id' => $user->tenant_id,\n 'user_id' => $user->id\n ]); \n }\n }\n $poi_latitude = 0;\n $poi_longitude = 0; \n $poi_count = 0;\n foreach ($poi_ids as $value) {\n $latlong = PointOfInterest::where('id', $value)->first();\n $poi_latitude += $latlong->latitude;\n $poi_longitude += $latlong->longitude;\n $poi_count += 1;\n }\n $location_lat = $poi_latitude/$poi_count;\n $location_long = $poi_longitude/$poi_count;\n $shopping_url = file_get_contents('https://api.tomtom.com/search/2/search/shopping_center.json?language=en-US&limit=20&lat='.$location_lat.'&lon='.$location_long.'&radius=5000&categorySet=7373&key=6vdxVANLJketgjeoT3dvURPnu4ny3VWy');\n $jsondata_shopping = json_decode($shopping_url);\n\n foreach ($jsondata_shopping->results as $key => $value_shopping) {\n if(Shopping::where(['poi_id' => $value_shopping->id,'tenant_id' => auth()->user()->tenant_id,'tour_package_id' => $route_id,'location_id' => $dest_id])->doesntExist()){\n $shopping = new Shopping();\n if((array_key_exists('municipalitySubdivision', $value_shopping->address))){\n $shopping->location = $value_shopping->address->municipalitySubdivision;\n }\n\n $shopping->name = $value_shopping->poi->name;\n $shopping->latitude = $value_shopping->position->lat;\n $shopping->longitude = $value_shopping->position->lon;\n $shopping->postal_code = $value_shopping->address->postalCode;\n $shopping->country = $value_shopping->address->country;\n $shopping->address = $value_shopping->address->freeformAddress;\n $shopping->local_name = $value_shopping->address->localName;\n $shopping->location_id = $dest_id;\n $shopping->tour_package_id = $route_id;\n $shopping->tenant_id = $user->tenant_id;\n $shopping->type = $value_shopping->poi->categories[0];\n $shopping->poi_id = $value_shopping->id;\n $shopping->save();\n }\n }\n\n $transport_url = file_get_contents('https://api.tomtom.com/search/2/search/PUBLIC_TRANSPORT_STOP.json?language=en-US&limit=20&lat='.$location_lat.'&lon='.$location_long.'&radius=10000&categorySet=9942002,9942003,9942004,9942005,7380002,7380003,7380004,7380005&key=6vdxVANLJketgjeoT3dvURPnu4ny3VWy');\n $jsondata_transport = json_decode($transport_url);\n\n foreach ($jsondata_transport->results as $key => $value_transport) {\n if(TransportLocation::where(['poi_id' => $value_transport->id,'tenant_id' => auth()->user()->tenant_id,'tour_package_id' => $route_id,'location_id' => $dest_id])->doesntExist()){\n $transport = new TransportLocation();\n if((array_key_exists('municipalitySubdivision', $value_transport->address))){\n $transport->location = $value_transport->address->municipalitySubdivision;\n }\n\n $transport->name = $value_transport->poi->name;\n $transport->latitude = $value_transport->position->lat;\n $transport->longitude = $value_transport->position->lon;\n $transport->postal_code = $value_transport->address->postalCode;\n $transport->country = $value_transport->address->country;\n $transport->address = $value_transport->address->freeformAddress;\n $transport->local_name = $value_transport->address->localName;\n $transport->location_id = $dest_id;\n $transport->tour_package_id = $route_id;\n $transport->tenant_id = $user->tenant_id;\n $transport->type = $value_transport->poi->categories[1];\n $transport->poi_id = $value_transport->id;\n $transport->save();\n }\n }\n \n //$updatestatus = TourPckage::completeStatus($route_id); // Closed 19-May-2020\n $route_ids = $request->route('id'); \n $route_id = (int)$route_ids;\n $countryISO = DB::table('location_point_of_interests')\n ->join('point_of_interests','point_of_interests.id','=','location_point_of_interests.point_of_interest_id')\n ->distinct()\n ->where('location_point_of_interests.tour_package_id',$route_id)\n ->select('point_of_interests.iso_2','point_of_interests.country_name')\n ->get();\n if(count($countryISO) > 0){\n foreach ($countryISO as $iso2) {\n $inc = CountryGuide::where('iso_2',$iso2->iso_2)\n ->where('tour_package_id',$route_id)\n ->first();\n if(is_null($inc)){\n $countryguide = new CountryGuide;\n $countryguide->iso_2 = $iso2->iso_2; \n $countryguide->country_name = $iso2->country_name;\n $countryguide->tour_package_id = $route_id;\n $countryguide->status = \"1\";\n $user = auth()->user();\n $countryguide->tenant_id = $user->tenant_id;\n $countryguide->user_id = $user->id;\n $countryguide->save();\n }\n }\n }\n return response()->json(['success' => 'added successfully']); \n }", "function get_nearby_courts_by_user_id($user_id, $user_latitude, $user_longitude)\n{\n global $conn;\n $nearby_courts = array();\n $all_courts = array();\n $q['query'] = \"SELECT * FROM `courts` WHERE user_id != '$user_id'\";\n $q['run'] = $conn->query($q['query']);\n while($q['result'] = $q['run']->fetch_assoc())\n {\n array_push($all_courts,$q['result']);\n }\n\n /**\n *for each court get the distance from user and if it\n *is less than nearby distance add it to nearby courts.\n */\n foreach($all_courts as $court)\n {\n $court_latitude = $court['court_latitude'];\n $court_longitude = $court['court_longitude'];\n $distance = get_distance_from_lat_long($court_latitude, $court_longitude, $user_latitude, $user_longitude);\n if($distance <= 5)\n {\n array_push($nearby_courts,$court);\n }\n }\n return $nearby_courts;\n}", "function getPointsInBox($topLeftLat,$bottomRightLat,$topLeftLong,$bottomRightLong){\n\n\t//connect to database\n\t$con = mysqli_connect(\"localhost\",\"traffich_admin\",\"Admin2013\",\"traffich_main\");\n\tif (mysqli_connect_errno($con))\n {\n echo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n }\n\n\t//create query\n\t$query = \t\"SELECT Latitude, Longitude \n\t\t\t\tFROM `Traffic_Display` \n\t\t\t\tWHERE `Latitude`<'\" . $topLeftLat . \"' AND `Latitude`>'\" . $bottomRightLat . \"' AND \n\t\t\t\t`Longitude`>'\" . $bottomRightLong . \"' AND `Longitude`<'\" . $topLeftLong . \"'\";\n\t//using same syntax as first method\t\t\t\n\t$resultArray = array();\n $resultIndex = 0;\t\t\t\n\tif ($result = $con->query($query)) {\n //parse return\n while($row = $result->fetch_row()) {\n $lngLat = $row[0] . ',' . $row[1];\n //$resultArray[$resultIndex] = $lngLat;\n //$resultIndex++;\n array_push($resultArray, $lngLat);\n //array_push($resultArray, \"2\");\n }\n $result->close();\n }\n else {\n array_push($resultArray, \"0\");\n } \n\n\tmysqli_close($con);\n return $resultArray;\n}", "function location_detail($location_id, $connection, $start = 0)\n{\n\t$db_selected = mysql_select_db(Secure::DB_DATABASE, $connection);\n\t$sql = \"select organization_location.address , organization_location.city , organization_location.state , organization_location.zip , organization_location.latitude , organization_location.longitude from organization_location where location_id = {$location_id}\";\n\t$sql = $sql.\" limit {$start},\".LIMIT;\n\tif(!($resource = @ mysql_query($sql, $connection)))\n\t\tshowerror();\n\t\t//echo $sql;\n\telse\n\t\treturn $resource;\n}", "function queryPostCode($code) {\n\t\n\t$sql = \"SELECT postcode,place_name,latitude,longitude FROM geo WHERE postcode='$code'\";\n\t\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(\"id\", $id);\n\t\t$stmt->execute();\n\t\t$geoList = $stmt->fetchObject(); \n\t\t$db = null;\n\t\techo json_encode($geoList); \n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n\t\n\t\n\t\n\t\n}", "public function actionProximitycatlist($latitude, $longitude, $radius, $kind)\n {\n \n // clean term\n //$term = str_replace(',', '', $term);\n //$term = str_replace(' ', '', $term);\n //$term = str_replace(' ', '', $term);\n\t\n\t$url = \"http://ec2-54-204-2-189.compute-1.amazonaws.com/api/nearby\";\n\t$params = array('latitude' => $latitude, 'longitude' => $longitude, 'radius' => $radius, 'kind' => $kind);\n\t// Update URL to container Query String of Paramaters \n\t$url .= '?' . http_build_query($params);\n\t\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t$json = curl_exec($curl);\n\tcurl_close($curl);\n\t\t\n\t$return_array = json_decode($json);\n\t\t\n $location_service_rows = array(); \n \n\tif ($return_array) {\n $location_service_rows = $return_array->message->rows;\n\t}\n\t\t\n // Did we get some results?\n if(empty($location_service_rows)) {\n // No\n $this->_sendResponse(200, \n sprintf('No items where found.') );\n } else {\n // Prepare response\n $rows = array();\n foreach($location_service_rows as $row) {\n $id = $row->id;\n $name = $row->name;\n $address = $row->address->address;\n $address_extended = $row->address->address_extended;\n $po_box = $row->address->po_box;\n $locality = $row->address->locality;\n $region = $row->address->region;\n $post_town = $row->address->post_town;\n $admin_region = $row->address->admin_region;\n $postcode = $row->address->postcode;\n $country = $row->address->country;\n $tel = $row->address->tel;\n $fax = $row->address->fax;\n $neighbourhood = $row->address->neighbourhood;\n $website = $row->website;\n $email = $row->email;\n $category_ids = $row->category_ids;\n\t\t$category_labels = $row->category_labels;\n $status = $row->status;\n $chain_name = $row->chain_name;\n $chain_id = $row->chain_id;\n $row_longitude = $row->longitude;\n $row_latitude = $row->latitude;\n $abslongitude = $row->abslongitude;\n $abslatitude = $row->abslatitude;\n $distance = $row->distance;\n \n \n //$terms_array = explode(' ',$terms);\n //$match_count = 0;\n //foreach ($terms_array as $term) {\n //if(stripos($name, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n //if(stripos($category_labels, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n $match_count = 1;\n //}\n //$term_match_count = array('term_match_count' => $match_count);\n //array_push($row, $term_match_count);\n //$row['term_match_count'] = $match_count;\n $new_row = array(\n 'id' => $id,\n 'name' => $name,\n 'address' => $address,\n 'address_extended' => $address_extended,\n 'po_box' => $po_box,\n 'locality' => $locality,\n 'region' => $region,\n 'post_town' => $post_town,\n 'admin_region' => $admin_region,\n 'postcode' => $postcode,\n 'country' => $country,\n 'tel' => $tel,\n 'fax' => $fax,\n 'neighbourhood' => $neighbourhood,\n 'website' => $website,\n 'email' => $email,\n 'category_ids' => $category_ids,\n 'category_labels' => $category_labels,\n 'status' => $status,\n 'chain_name' => $chain_name,\n 'chain_id' => $chain_id,\n 'longitude' => $row_longitude,\n 'latitude' => $row_latitude,\n 'abslongitude' => $abslongitude,\n 'abslatitude' => $abslatitude,\n 'distance' => $distance,\n 'term_match_count' => $match_count\n );\n //if ($match_count > 0) {\n $rows[] = $new_row;\n //}\n } // end foreach location service row\n // Send the response\n $this->_sendResponse(200, CJSON::encode($rows));\n }\n }", "public function getAllDriversTopTen($lat, $long) {\n $q = \"SELECT driver_id, email, fullname, phone, driver_lat, driver_long, personalID, personalID_img,\";\n $q .= \" driver_avatar, driver_license, driver_license_img, status, busy_status, created_at, (abs(driver_lat - ?) + abs(driver_long - ?)) AS distance\";\n $q .= \" FROM driver WHERE busy_status = 1 ORDER BY distance LIMIT 10\";\n\n $stmt = $this->conn->prepare($q);\n $stmt->bind_param(\"dd\", $lat, $long);\n $stmt->execute();\n $itineraries = $stmt->get_result();\n $stmt->close();\n return $itineraries;\n }", "public function get_list()\n\t{\n\n\t\t$sel=$this->db->prepare(\"SELECT * from shop ORDER BY distance ASC\");\n\n $sel->execute();\n\n return ($sel->fetchAll(PDO::FETCH_ASSOC));\n\t\t\n\n\n\n }", "public function getFindSpotData($id) {\n \n $findspotdata = $this->getAdapter();\n $select = $findspotdata->select()\n ->from($this->_name, array(\n 'county', 'district', 'parish',\n 'easting', 'northing', 'gridref',\n 'declat', 'declong', 'fourFigure',\n 'knownas', 'smrref', 'map25k',\n 'map10k', 'landusecode', 'landusevalue',\n 'id', 'old_findspotid', 'createdBy',\n 'description', 'comments', 'address',\n 'woeid', 'elevation', 'postcode',\n 'landowner', 'fourFigureLat', 'fourFigureLon',\n 'gridlen', 'woeid', 'geonamesID',\n 'districtID', 'countyID', 'regionID',\n 'parishID'\n ))\n ->joinLeft('finds','finds.secuid = findspots.findID', \n array('discmethod'))\n ->joinLeft(array('land1' => 'landuses'),\n 'land1.id = findspots.landusecode',\n array('landuse' => 'term'))\n ->joinLeft(array('land2' =>'landuses'),\n 'land2.id = findspots.landusevalue',\n array('landvalue' => 'term'))\n ->joinLeft('maporigins','maporigins.id = findspots.gridrefsrc',\n array('source' => 'term'))\n ->joinLeft('osRegions','findspots.regionID = osRegions.osID',\n array('region' => 'label'))\n ->joinLeft('osCounties', 'findspots.countyID = osCounties.osID', \n array('countyType' => 'type'))\n ->joinLeft('osDistricts', 'findspots.districtID = osDistricts.osID', \n array('districtType' => 'type'))\n ->joinLeft('osParishes', 'findspots.parishID = osParishes.osID', \n array(\n 'parishType' => 'type', \n 'centreLat' => 'lat', \n 'centreLon' => 'lon'\n ))\n ->joinLeft('people',$this->_name . '.landowner = people.secuid', \n array('landownername' => 'fullname'))\n ->joinLeft('discmethods','finds.discmethod = discmethods.id', \n array('method'))\n ->where('finds.id = ?', (int)$id)\n ->group('finds.id')\n ->limit('1');\n return $findspotdata->fetchAll($select);\n }", "function getdistancebetweenPoints($lat=null, $lng=null, $lat1=null, $lng1=null) {\n global $token;\n global $g_key;\n global $api_googleapis;\n $file_content = ''.$api_googleapis.'origin='.$lat.'&destination='.$lng.'&alternatives=true&sensor=false&key='.$g_key.'&='.$token.'';\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $file_content);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_PROXYPORT, 3128);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $distbetween_content = curl_exec($ch);\n\n curl_close($ch);\n\n$response = json_decode($distbetween_content, true);\nif($response['status']=='OK') {\n\nforeach($response[\"routes\"] as $key => $data) {\n$route = json_encode($data[\"legs\"][0]['distance']['value'], true);\n$duration = json_encode($data[\"legs\"][0]['duration']['value'], true);\n$lat_start = json_encode($data[\"legs\"][0]['start_location']['lat'], true);\n$lng_start = json_encode($data[\"legs\"][0]['start_location']['lng'], true);\n$lat_end = json_encode($data[\"legs\"][0]['end_location']['lat'], true);\n$lng_end = json_encode($data[\"legs\"][0]['end_location']['lng'], true);\n\n $distance = array(\n 'status' => 'success',\n 'path' => array(array($lat_start, $lng_start),\n array($lat_end, $lng_end)),\n 'total_distance' => $route,\n 'total_time' => $duration);\n return $distance;\n }\n\n\n}else {\n$arr_error = array('status' => 'failure', 'error' => 'ERROR_DESCRIPTION');\necho json_encode($arr_error);\nreturn 0;\n}\n\n\n\n\n}", "public function updateCoordinates(){\n $newCoffeeDrops= CoffeeDrop::select('postcode')->whereNull('latitude')->pluck('postcode');\n foreach ($newCoffeeDrops as $postcode) {\n $coordinates = $this->getCoordinates($postcode);\n\n //adds lat and lon value based on results from http://postcodes.io/\n CoffeeDrop::where('postcode', $postcode)->update(array('latitude'=>$coordinates['latitude'],'longitude'=>$coordinates['longitude']));\n\n }\n\n return CoffeeDrop::select('postcode','latitude','longitude')->get();;\n }", "function find_carpool_match($lat1,$lon1){\n\t\tglobal $connection;\n $query = \"SELECT *, \n\t\t\t\t( 3959 * acos( cos( radians('$lat1') ) * \n\t\t\t\t cos( radians( Lat ) ) * \n\t\t\t\t cos( radians( Lng ) - \n\t\t\t\t radians('$lon1') ) + \n\t\t\t\t sin( radians('$lat1') ) * \n\t\t\t\t sin( radians( Lat ) ) ) ) \n\t\t\t\t AS distance FROM employees WHERE NeedCarpool=1 HAVING distance < 5 ORDER BY distance ASC LIMIT 0, 10\";\n\n\t\t$result = mysqli_query($connection,$query);\n confirm_query($result);\n if($result)\n return $result;\n else\n return null; \n \n }", "function getActWindSpeed() {\n $sql = \"SELECT name, node_id, wind_speed FROM nodes WHERE wind_speed = '1'\";\n try {\n $db = getConnection();\n $stmt = $db->query($sql);\n $nodes = $stmt->fetchAll(PDO::FETCH_OBJ);\n $db = null;\n echo '{\"Nodes\": ' . json_encode($nodes) . '}';\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":\"'. $e->getMessage() .'\"}}';\n }\n}", "public function GetTicketLocation($locationID){\n return $this->object->GetTicketLocationDB($locationID);\n }", "public function run()\n {\n DB::table('city')->insert([ 'name' => 'Sydney', 'latitude' => '-33.79', 'longitude' => '151.27', ]);\n DB::table('city')->insert([ 'name' => 'Melbourne', 'latitude' => '-37.81', 'longitude' => '144.97', ]);\n DB::table('city')->insert([ 'name' => 'Brisbane', 'latitude' => '-27.47', 'longitude' => '153.03', ]);\n DB::table('city')->insert([ 'name' => 'Perth', 'latitude' => '-31.92', 'longitude' => '115.91', ]);\n DB::table('city')->insert([ 'name' => 'Adelaide', 'latitude' => '-34.93', 'longitude' => '138.6', ]);\n DB::table('city')->insert([ 'name' => 'Newcastle', 'latitude' => '-32.94', 'longitude' => '151.77', ]);\n DB::table('city')->insert([ 'name' => 'Canberra', 'latitude' => '-35.31', 'longitude' => '149.14', ]);\n DB::table('city')->insert([ 'name' => 'Wollongong', 'latitude' => '-34.44', 'longitude' => '150.89', ]);\n DB::table('city')->insert([ 'name' => 'Geelong', 'latitude' => '-38.18', 'longitude' => '145.11', ]);\n DB::table('city')->insert([ 'name' => 'Townsville', 'latitude' => '-19.25', 'longitude' => '146.8', ]);\n DB::table('city')->insert([ 'name' => 'Cairns', 'latitude' => '-16.88', 'longitude' => '145.75', ]);\n DB::table('city')->insert([ 'name' => 'Toowoomba', 'latitude' => '-27.62', 'longitude' => '151.77', ]);\n DB::table('city')->insert([ 'name' => 'Darwin', 'latitude' => '-12.8', 'longitude' => '130.96', ]);\n DB::table('city')->insert([ 'name' => 'Launceston', 'latitude' => '-41.46', 'longitude' => '147.08', ]);\n DB::table('city')->insert([ 'name' => 'Ballarat', 'latitude' => '-37.56', 'longitude' => '143.82', ]);\n DB::table('city')->insert([ 'name' => 'Bendigo', 'latitude' => '-36.76', 'longitude' => '144.28', ]);\n DB::table('city')->insert([ 'name' => 'Mackay', 'latitude' => '-21.16', 'longitude' => '149.1', ]);\n DB::table('city')->insert([ 'name' => 'Mandurah', 'latitude' => '-32.55', 'longitude' => '115.75', ]);\n DB::table('city')->insert([ 'name' => 'Rockhampton', 'latitude' => '-23.39', 'longitude' => '150.5', ]);\n DB::table('city')->insert([ 'name' => 'Bundaberg', 'latitude' => '-24.84', 'longitude' => '152.02', ]);\n DB::table('city')->insert([ 'name' => 'Bunbury', 'latitude' => '-36.24', 'longitude' => '139.97', ]);\n DB::table('city')->insert([ 'name' => 'Wagga Wagga', 'latitude' => '-35.16', 'longitude' => '147.51', ]);\n DB::table('city')->insert([ 'name' => 'Hervey Bay', 'latitude' => '-25.35', 'longitude' => '152.89', ]);\n DB::table('city')->insert([ 'name' => 'Coffs Harbour', 'latitude' => '-30.34', 'longitude' => '153.07', ]);\n DB::table('city')->insert([ 'name' => 'Mildura', 'latitude' => '-34.18', 'longitude' => '142.16', ]);\n DB::table('city')->insert([ 'name' => 'Gladstone', 'latitude' => '-31.06', 'longitude' => '152.77', ]);\n DB::table('city')->insert([ 'name' => 'Shepparton', 'latitude' => '-36.36', 'longitude' => '145.4', ]);\n DB::table('city')->insert([ 'name' => 'Tamworth', 'latitude' => '-30.96', 'longitude' => '150.83', ]);\n DB::table('city')->insert([ 'name' => 'Port Macquarie', 'latitude' => '-31.4', 'longitude' => '152.85', ]);\n DB::table('city')->insert([ 'name' => 'Orange', 'latitude' => '-33.12', 'longitude' => '149.03', ]);\n DB::table('city')->insert([ 'name' => 'Dubbo', 'latitude' => '-32.2', 'longitude' => '148.9', ]);\n DB::table('city')->insert([ 'name' => 'Geraldton', 'latitude' => '-28.79', 'longitude' => '114.6', ]);\n DB::table('city')->insert([ 'name' => 'Bathurst', 'latitude' => '-33.91', 'longitude' => '149.33', ]);\n DB::table('city')->insert([ 'name' => 'Warrnambool', 'latitude' => '-38.36', 'longitude' => '142.44', ]);\n DB::table('city')->insert([ 'name' => 'Lismore', 'latitude' => '-28.61', 'longitude' => '153.04', ]);\n }", "public function find_location($longitude, $latitude,$app = 'No') {\n\t\tif($app=='No'){\n\t\t\t$option = array(\"loc\" => array('$geoIntersects' => array('$geometry' => array(\"type\"=>\"Point\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"coordinates\"=>array($longitude,$latitude)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t}else{\n\t\t\t$option = array(\"status\"=>\"Active\",\n\t\t\t\t\t\t\t\t\t\"loc\" => array('$geoIntersects' => array('$geometry' => array(\"type\"=>\"Point\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"coordinates\"=>array($longitude,$latitude)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\t\t\t\n\t\t}\n \n \n $this->mongo_db->where($option);\n $res = $this->mongo_db->get(LOCATIONS);\n \n\t\t$return['result'] = array();\n\t\tif($res->num_rows()>0){\n\t\t\t$return['result'] = $res->result_array();\n\t\t}\n return $return;\n }", "function getPlat(){\n //cration d'une connextion à la base de donnée\n $dbh = new PDO('mysql:host=localhost;dbname=resto_db_bwb', \"root\", \"\");\n //corp de la requete SQL du point de vue metier\n $request = \"SELECT * FROM plats\";\n //executon de la requete\n $statement = $dbh->query($request);\n //récupération du resultat de la requete\n $plats = $statement->fetchAll();\n return $plats;\n }", "public function findDrivers($distance)\r\n {\r\n $origin = $this->getOriginLocation();\r\n $destination = $this->getDestinationLocation();\r\n \r\n $results = Doctrine_Core::getTable('Carpools')->getNearPoints (\r\n $distance,\r\n $origin->getLatitude(),\r\n $origin->getLongitude(),\r\n $destination->getLatitude(),\r\n $destination->getLongitude(),\r\n $this->getStartDate());\r\n \r\n return $results;\r\n }", "function getSiteByDistanceApi($longitude, $latitude, $userId, $city_id = 0)\n {\n $query = $this->db->query('select no, boss_id, site_name, longitude, latitude, site_type, area \n from boss \n where site_type > -1 and (( 6371 * acos( cos( radians(' . $latitude . ') ) * cos( radians( latitude) )\n * cos( radians(longitude) - radians(' . $longitude . ')) + sin(radians(' . $latitude . '))\n * sin( radians(latitude))))<=5 or city = ' . $city_id . ') ');\n\n $response_array = array();\n foreach ($query->result() as $item) {\n $site_icon = \"map_icon.png\";\n $picture_array = array();\n $picture_array = $this->getSitePictures($item->boss_id);\n if (count($picture_array) > 0) {\n $site_icon = $picture_array[0]->picture;\n }\n\n $area_name = $this->getAreaName($item->area);\n $isFavourite = 0;\n $event_state = 0;\n $point = 0;\n $favouriteCount = 0;\n $room_state = 0;\n $bossgroup_state = 0;\n $isFavourite = $this->isFavouriteState($userId, $item->boss_id, $item->no);\n $favouriteCount = $this->getFavouriteCount($item->boss_id, $item->no);\n if ($item->boss_id != 0) {\n $event_array = $this->db->query(\"select id from event where state = 0 and organizer_id = \" . $item->boss_id)->row();\n if (count($event_array) > 0) {\n $event_state = 1;\n }\n $point = number_format((float)$this->getSiteRatingPoint($item->boss_id), 1, '.', '');\n\n $room_array = $this->db->query(\"select id from room where boss_id = \" . $item->boss_id)->row();\n if (count($room_array) > 0) {\n $room_state = 1;\n }\n $bossgroup_array = $this->db->query(\"select no from bossgroup where boss_id = \" . $item->boss_id)->row();\n if (count($bossgroup_array) > 0) {\n $bossgroup_state = 1;\n }\n }\n $distance = $this->distance($latitude, $longitude, $item->latitude, $item->longitude, \"K\");\n $show_distance_str = \"0km\";\n if ($distance > 1) {\n $show_distance_str = number_format((float)$distance, 1, '.', '') . \"km\";\n } else {\n $show_distance_str = intval($distance * 1000) . \"m\";\n }\n $picture = $this->getSitePictures($item->boss_id);\n $response_data = array('boss_no' => $item->no, 'boss_id' => $item->boss_id, 'site_name' => $item->site_name,\n 'longitude' => $item->longitude, 'latitude' => $item->latitude, 'site_type' => $item->site_type,\n 'site_icon' => $site_icon, 'point' => $point, 'event_state' => $event_state,\n 'room_state' => $room_state, 'bossgroup_state' => $bossgroup_state,\n 'areaId' => $item->area, 'areaName' => $area_name, 'isfavourite' => $isFavourite,\n 'favourite_count' => $favouriteCount, 'show_distance_str' => $show_distance_str, 'picture' => $picture,\n 'distance' => number_format((float)$distance, 1, '.', ''));\n array_push($response_array, $response_data);\n }\n return $response_array;\n }", "function buildGeoPosition($equipment)\r\n{\r\n\r\n // Try the connection to MySQL + Select the relevant database\r\n // Make the SQL connection global as soon as possible\r\n $dbc = @mysqli_connect(DB_HOST, DB_USER , DB_PASSWORD) ;\r\n if ($dbc)\r\n {\r\n if(!mysqli_select_db($dbc, DB_NAME))\r\n {\r\n trigger_error(\"Could not select the database!<br>MYSQL Error:\" . mysqli_error($dbc)) ;\r\n exit();\r\n }\r\n }\r\n else\r\n {\r\n trigger_error(\"Could not connect to MySQL!<br>MYSQL Error:\" . mysqli_error($dbc));\r\n exit();\r\n }\r\n\r\n // Get the last position of the scentinel\r\n $query = \"SELECT sample.id AS sample_id, sample.lat, sample.lon\r\n FROM sample\r\n WHERE equipement = \" . $equipment\r\n . \" ORDER BY sampledat DESC LIMIT 1\";\r\n $result = mysqli_query($dbc, $query) or trigger_error(\"Query: $query\\n<br>MySQL Error: \" . mysqli_error($dbc));\r\n $row = mysqli_fetch_array($result, MYSQLI_NUM) ;\r\n $lat = $row[1] ;\r\n $lon = $row[2] ;\r\n \r\n $final_geoposition = '{lat: ' . $lat . ', lng: ' . $lon '};';\r\n \r\n return array($final_geoposition) ;\r\n}", "public static function search() {\n global $p;\n if (check_posts(['lat', 'lng'])) {\n $pharmacies = new pharmacies();\n $pharmacies->placeLat = $p['lat'];\n $pharmacies->placeLong = $p['lng'];\n $list = $pharmacies->get_place_by_latlng($p['distance'], 10);\n $r = [];\n\n foreach ($list['result'] as $place) {\n $f = new files($place['placeImg']);\n $place['placeImg'] = $f->placeOnServer;\n $r[] = $place;\n }\n $result['status'] = TRUE;\n $result['count'] = $list['nums'];\n $result['list'] = $r;\n } else {\n\n $result['status'] = FALSE;\n $result['error'] = 'invalid lat and lng';\n }\n\n// echo json_encode($p);\n// exit;\n if (@$p['post'] == 'post')\n $result['post'] = $p;\n echo json_encode($result);\n }", "public function getListLoc()\n {\n $db = $this->dblocal;\n try\n {\n $stmt = $db->prepare(\"SELECT @rownum := @rownum + 1 AS urutan,t.* FROM m_location t, \n (SELECT @rownum := 0) r ORDER BY id_loc ASC\");\n $stmt->execute();\n $stat[0] = true;\n $stat[1] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $stat;\n }\n catch(PDOException $ex)\n {\n $stat[0] = false;\n $stat[1] = $ex->getMessage();\n return $stat;\n }\n }", "function getWines () {\n\t$sql = \"select * FROM wine ORDER BY name\";\n\ttry {\n\t\t$db = getConnection ();\n\t\t$stmt = $db->query ( $sql );\n\t\t$wines = $stmt->fetchAll ( PDO::FETCH_OBJ );\n\t\t$db = null;\n\t\techo '{\"wine\": ' . json_encode ( $wines ) . '}';\n\t} catch ( PDOException $e ) {\n\t\techo '{\"error\":{\"text\":' . $e->getMessage () . '}}';\n\t}\n}", "public function getLocation_get(){\n $user_id = $this->input->get('user_id');\n\n $data = $this->User_model->select_data('latitude,longitude','tbl_users',array('id'=>$user_id));\n\n if(empty($data))\n\n {\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"getLocation\",\n \"ResponseCode\" => false,\n \"MessageWhatHappen\" => \"Not Found\"\n\n );\n }else{\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"getLocation\",\n \"ResponseCode\" => true,\n \"getLocationResponse\" => $data\n\n );\n }\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "function backyard_getListOfPOI($poiCategory) {\n global $backyardGeo;\n if (is_int($poiCategory)) {\n $poiCategorySecured = $poiCategory;\n } else {\n $poiCategorySecured = preg_replace(\"/[^0-9,]/\", '', $poiCategory);\n }\n //$query = \"SELECT * FROM `pichacky_poi` WHERE `category` =1 AND (`typ` ='Prodejna' OR `typ` ='Admin. budova + Prodejna') \";//@TODO přidat where category==1 neboť to jsou TMCZ objekty //@TODO .. rozlišit kategorie dle použité app, tj. jiné pro skauty a jiné pro T-Check, nyní pro skauty\n $query = \"SELECT * FROM `{$backyardGeo['table_name']}` WHERE `category` IN ( \" . $poiCategorySecured . \" )\";\n $listOfPOINearby = customMySQLQuery($query);\n if (!$listOfPOINearby) {\n my_error_log('No result for query ' . $query, 2, 11);\n }\n return $listOfPOINearby;\n}", "function printClosest($res, $curLat, $curLon) {\n // name, absLoc, latitude, longitude, rating, clean, purchase, bidet, squat, tpStash, soap\n // real output inc!\n \n while ($row = $res->fetch_assoc()) { \n echo '<div>';\n echo '<p>Origin: <span id=\"originLat\">'.$curLat.'</span> , \n <span id=\"originLon\">'.$curLon.'</span> </br> >>> ';\n echo 'Destination: <span id=\"destLat\">' .$row['latitude']. '</span> , \n <span id=\"destLon\">' .$row['longitude']. '</span></br></p>';\n echo '<p id = \"name\">' .$row['name']. '</p>';\n echo '<p>Rating: ' .$row['rating']. '/5 ';\n echo 'Cleanliness: ' .$row['clean']. '/5</p>';\n echo '<p>The bathroom has: ';\n if ($row['purchase']) {\n echo 'purchase required, ';\n }\n if ($row['bidet']) {\n echo 'a bidet, ';\n }\n if ($row['squat']) {\n echo 'a squat toilet, '; \n }\n if ($row['tpStash']) {\n echo 'ample toilet paper, ';\n }\n if ($row['soap']) {\n echo 'soap';\n }\n echo '</p>';\n echo '</div>';\n }\n}", "function get_travelinfo() {\n $sql = \"SELECT * FROM travelinfo_category LIMIT 4 \";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "static function loadDBData($row, $conn, $locationobj=NULL) {\n if ( $locationobj == NULL ) {\n $locationobj = new Location();\n }\n $locationobj = POIBaseType::loadDBData($row, $conn, $locationobj);\n\n // get all points\n $sql = \"SELECT * FROM geo WHERE objname LIKE 'POINT' AND parentid = '\" . $locationobj->myid . \"' AND deleted IS NULL\";\n // echo \"$sql\\n\";\n $c = $conn->query($sql);\n if ( $c ) {\n foreach ($c as $row) {\n $g = Geom::loadDBData($row, $conn);\n $locationobj->addPointGeom($g);\n }\n }\n\n // get all lines\n $sql = \"SELECT * FROM geo WHERE objname LIKE 'LINESTRING' AND parentid = '\" . $locationobj->myid . \"' AND deleted IS NULL\";\n // echo \"$sql\\n\";\n $c = $conn->query($sql);\n if ( $c ) {\n foreach ($c as $row) {\n $g = Geom::loadDBData($row, $conn);\n $locationobj->addLineGeom($g);\n }\n }\n\n // get all polygons\n $sql = \"SELECT * FROM geo WHERE objname LIKE 'POLYGON' AND parentid = '\" . $locationobj->myid . \"' AND deleted IS NULL\";\n $c = $conn->query($sql);\n if ( $c ) {\n foreach ($c as $row) {\n $g = Geom::loadDBData($row, $conn);\n $locationobj->addPolygonGeom($g);\n }\n }\n\n // get any address\n $sql = \"SELECT * FROM POIBaseType WHERE objname LIKE 'ADDRESS' and parentid = '\" . $locationobj->myid . \"' AND deleted is NULL\";\n $c = $conn->query($sql);\n if ( $c ) {\n foreach ($c as $row) {\n $a = POIBaseType::loadDBData($row, $conn);\n $locationobj->setAddress($a);\n }\n }\n\n // get all the relationships\n $sql = \"SELECT * FROM relationship WHERE parentid = '\" . $locationobj->myid . \"' AND deleted IS NULL\";\n $c = $conn->query($sql);\n if ( $c ) {\n foreach ($c as $row) {\n $rel = Relationship::loadDBData($row, $conn);\n $locationobj->addRelationship($rel);\n }\n }\n\n // get any undetermined stuff\n if ( !empty($row['undetermined']) )\n $locationobj->undetermined = $row['undetermined'];\n \n return $locationobj;\n }", "public function getLocationByFpo($fpo_id) {\n $location_data = $this->Share_Model->getLocationByFpo( $fpo_id );\n $response = array(\"status\" => 1, \"location_data\" => $location_data);\n echo json_encode($response);\n\t}", "public function index()\n { \n\n // Set Url Path to Send Request \n $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=Bangsue&key=AIzaSyCxWJuVBao6hFOx__vGQdzLsFnGZ7jfnlw';\n\n // Use GuzzleHttp\n $client = new \\GuzzleHttp\\Client();\n\n // Send a request\n $geocodeResponse = $client->get( $url )->getBody();\n\n // Decode Json Data\n $geocodeData = json_decode( $geocodeResponse );\n\n // Get Lattitude of a location\n $lat = $geocodeData->results[0]->geometry->location->lat;\n\n // Get Longtitude of a location\n $lng = $geocodeData->results[0]->geometry->location->lng;\n\n // Set a second Path to find a restaurant around Location we have get first\n $place = 'https://maps.googleapis.com/maps/api/place/textsearch/json?query=restaurant&location='.$lat.','.$lng.'&rankby=distance&key=AIzaSyCxWJuVBao6hFOx__vGQdzLsFnGZ7jfnlw';\n\n // Call a Guzzle Http Function\n $get = new \\GuzzleHttp\\Client();\n\n // Send a request\n $geocodeResponse_2nd = $client->get( $place )->getBody();\n\n // Decode Json Data\n $geocodeData_2nd = (array) json_decode( $geocodeResponse_2nd );\n \n // Check if there is a cache\n if(Cache::has('Bangsue')) {\n // Return a Cache Data\n $cache = Cache::get('Bangsue');\n // Return a result as a json\n return response()->json($cache);\n }\n // No Cache file on this keyword\n else {\n // Store a cache file\n Cache::put('Bangsue', $geocodeData_2nd, 10);\n // Return a result as a json\n return response()->json($geocodeData_2nd);\n }\n\n }", "function getDetailAllStation($account_id_local,$station_type1,$DbConnection)\n{\n $query=\"select station_id,customer_no,station_name,distance_variable FROM station USE INDEX(stn_uaid_status) WHERE user_account_id=$account_id_local and status=1\";\n //echo \"query=\".$query.\"<br>\";\n\t//echo \"DbConnection=\".$DbConnection.\"<br>\";\n\t$result=mysql_query($query,$DbConnection); \t\t\t\t\t\t\t\n while($row=mysql_fetch_object($result))\n {\n\t\t//echo \"in while\";\n /*$station_id=$row->station_id;\n $customer_no=$row->customer_no;\t\n $station_name=$row->station_name;\n $distance_variable=$row->distance_variable;\n $type=$row->type;*/\t\t\t\t\n $data[]=array('station_id'=>$row->station_id,'customer_no'=>$row->customer_no,'station_name'=>$row->station_name,'distance_variable'=>$row->distance_variable,'type'=>$row->type);\n }\n\t//print_r($data);\n return $data;\n}", "function get_route($my_location){\n $route_start = $my_location[0];\n $route_end = $my_location[1];\n\n $loc_api_key = AIzaSyBFuL6yafR8BuhdbzupDAcorVH4sAO2YpE;\n //$route_url = \"https://maps.googleapis.com/maps/api/directions/json?origin=\".$route_start.\"&destination=\".$route_end.\"&key=\".$loc_api_key.\"&alternatives=true\"; this is for detours\n $route_url = \"https://maps.googleapis.com/maps/api/directions/json?origin=\".$route_start.\"&destination=\".$route_end.\"&key=\".$loc_api_key;\n\n if (!function_exists('curl_init')){\n die('Can\\'t find cURL module'); \n }\n\n $chRD = curl_init(); //RD = Route Directions\n\n if (!$chRD){\n die('Couldn\\'t initialize a cURL module'); \n }\n\n curl_setopt($chRD, CURLOPT_URL, $route_url);\n curl_setopt($chRD, CURLOPT_RETURNTRANSFER, TRUE);\n \n $dataRD = curl_exec($chRD);\n curl_close($chRD);\n\n $routes = json_decode($dataRD);\n\n return $routes;\n}", "public function getAllDriversTopOne($lat, $long) {\n $q = \"SELECT driver_id, email, fullname, phone, driver_lat, driver_long, personalID, personalID_img,\";\n $q .= \" driver_avatar, driver_license, driver_license_img, status, busy_status, created_at, (abs(driver_lat - ?) + abs(driver_long - ?)) AS distance\";\n $q .= \" FROM driver WHERE busy_status = 1 ORDER BY distance LIMIT 1\";\n\n $stmt = $this->conn->prepare($q);\n $stmt->bind_param(\"dd\", $lat, $long);\n $stmt->execute();\n $itineraries = $stmt->get_result();\n $stmt->close();\n return $itineraries;\n }", "private function get_location () {\n try {\n // MaxMind GeoIP lookup\n // See: http://maxmind.github.io/GeoIP2-php/\n $reader = new Reader('assets/GeoLite2-City.mmdb');\n $record = $reader->city($_SERVER['REMOTE_ADDR']);\n return [\n 'lat' => $record->location->latitude,\n 'lng' => $record->location->longitude\n ];\n } catch (Exception $e) {\n return false;\n }\n }", "public function getBeaufortWestSimilarPropertyToRent(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 101\n\t\t\t\t\t\t AND properties.property_status = 'To Rent'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\n\t\t\t}\n\t\t}", "public function selectlocalitymaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM localitymaster\") or die(mysql_error());\n\t\treturn $result;\n\t}", "function get_gps($mcc, $mnc, $lac, $cellid) {\r\n $gps_data = \"\";\r\n $key = \"f0d88cf6-3a80-4f12-830d-f4b8fd1f06b0\";\r\n\r\n ///JSON CODE\r\n //$URL = \"http://opencellid.org/cell/get?key=\".$key.\"&mcc=\".$mcc.\"&mnc=\".$mnc.\"&lac=\".$lac.\"&cellid=\".$cellid.\"&format=json\"; \r\n $URL = \"http://opencellid.org/cell/get?key=$key&mcc=$mcc&mnc=$mnc&lac=$lac&cellid=$cellid&format=json\";\r\n\r\n $raw = @file_get_contents($URL);\r\n $json_data = json_decode($raw);\r\n\r\n //var_dump($json_data);\r\n echo \"<br>\";\r\n //$json = '{\"foo-bar\": 12345}';\r\n //$obj = json_decode($json);\r\n //echo \"lon=\". $json_data->{'lon'}; // 12345\r\n\r\n $gps_data = $json_data->{'lat'} . \",\" . $json_data->{'lon'};\r\n return $gps_data;\r\n}", "function getZone()\n {\n $this->company_db = $this->load->database('company_db', TRUE);\n $this->company_db->select(\"*\");\n $this->company_db->from('tbl_pickup_zone');\n /*$this->company_db->where($where);*/\n $query = $this->company_db->get();\n\n if($query->num_rows() >= 1)\n {\n return $query->result_array();\n }\n else\n {\n return array();\n }\n }", "public static function getPlacesByWiFi() {\n\t\t$sql = \"SELECT * FROM Buildings WHERE wifi = 'Y' GROUP BY name ORDER BY name ASC\";\n\t\t$places = self::getPlaces($sql);\n\t\t$convertedPlaces = self::convertPlaces($places);\n\t\treturn $convertedPlaces;\n\t}", "public function geoboundAction()\n {\n $tailoredMap = $this->get('tailoredplacement.map');\n $parameterHandler = $this->get('search.parameters');\n\n $coordinates[0] = $_POST['top_left'];\n $coordinates[1] = $_POST['bottom_right'];\n\n $avoid_ids = isset($_POST['item_ids']) ? $_POST['item_ids'] : [];\n\n $location[0] = $coordinates[0][0];\n $location[1] = $coordinates[0][1];\n\n $where = implode(' ', $parameterHandler->getWheres());\n\n $data = $tailoredMap->searchBounds($coordinates, 'listing', $avoid_ids, $where);\n\n return new JsonResponse($data);\n }", "public function buscar_hotels() {\n $ciutat = $_POST['ci'];\n $categoria = $_POST['ca'];\n $places = $_POST['pl'];\n $preu_min = $_POST['pmi'];\n $preu_max = $_POST['pma'];\n \n $usuari = session::get('idusuari');\n \n $sql = \"SELECT DISTINCT hotels.nom AS hotelnom, hotels.ciutat AS hotelciutat, hotels.categoria AS hotelcategoria,\n serveis.id AS servei_id, reserves.idusuari AS reservesidusuari, serveis.preu AS serveipreu, serveis_reservats.idreserva AS idreserva,\n reserves.status AS status, hotels.latitud AS latitud, hotels.longitud AS longitud\n\n FROM hotels \n LEFT JOIN serveis ON hotels.id = serveis.id\n LEFT JOIN serveis_reservats ON serveis.id = serveis_reservats.idservei\n LEFT JOIN reserves ON serveis_reservats.idreserva = reserves.id\n\n WHERE hotels.ciutat = '\".utf8_decode($ciutat).\"' AND serveis.nplaces >= \".$places.\" AND serveis.preu >= \".$preu_min.\" \n AND serveis.preu <= \".$preu_max.\"\";\n if($categoria != 0)\n $sql = $sql . \" AND hotels.categoria = \".$categoria.\" \";\n \n $sql = $sql . \" GROUP BY hotelnom;\";\n \n $query=$this->db->prepare($sql);\n $query->execute();\n $res=$query->fetchAll();\n \n return $res;\n }", "public function read() {\n //Create query\n $query = 'SELECT vendor_id, latitude, longitude, time, type FROM ' . $this->table_name;\n\n //Prepare statement\n $stmt = $this->conn->prepare($query);\n\n //Execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function getLeadLatLongs($route_id){\n\t\t\n\t\t$sql = \"SELECT ll.leadlat as LeadLat,ll.leadlong as LeadLong\n\t\t\t\t\t\n\t\t\t\t\tfrom `events` as e\n\t\t\t\t\tleft join leadlatlongs as ll on ll.event_id = e.event_id \n\t\t\t\t\tand ll.user_id = e.user_id\n\t\t\t\t\twhere e.event_id = '\".$route_id.\"' and e.create_type = 'routes' \n\t\t\t\t\torder by ll.id desc\";\n\t\t$query = $this->db->query($sql);\n\t\t$data = $query->result_array();\n\t\treturn $data;\n }", "public function get_database_tax_data($location = FALSE)\r\n\t{\r\n\t\t// Check the tax table exists in the config file and is enabled.\r\n\t\tif ($this->get_enabled_status('tax'))\r\n\t\t{\r\n\t\t\t// Set aliases of tax table data.\r\n\t\t\t$tbl_tax = $this->flexi->cart_database['tax'];\r\n\t\t\t$tbl_cols_tax = $this->flexi->cart_database['tax']['columns'];\r\n\r\n\t\t\t// Check the location tables exist in the config file and are enabled.\r\n\t\t\tif ($this->get_enabled_status('location'))\r\n\t\t\t{\r\n\t\t\t\t// If no location data is set, lookup defaults.\r\n\t\t\t\tif (empty($location) || ! is_array($location))\r\n\t\t\t\t{\r\n\t\t\t\t\t$location = $this->get_database_location_data(FALSE, 'tax');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$sql_order_by = ($tbl_tax['default']) ? $tbl_tax['default'].' DESC, ' : NULL;\r\n\t\t\t$sql_order_by .= $tbl_cols_tax['location'].' ASC, '.$tbl_cols_tax['zone'].' ASC';\r\n\r\n\t\t\tif (isset($location))\r\n\t\t\t{\r\n\t\t\t\t$sql_select = array($tbl_cols_tax['name'], $tbl_cols_tax['rate']);\r\n\r\n\t\t\t\t// Loop through locations querying database for any matching tax rates.\r\n\t\t\t\tfor($i = 0; isset($location[$i]); $i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql_where = $tbl_cols_tax['status'].\" = '1'\";\r\n\t\t\t\t\tif ($location[$i]['location_id'] > 0 || $location[$i]['zone_id'] > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sql_where .= \" AND (\";\r\n\t\t\t\t\t\t$sql_where .= ($location[$i]['location_id'] > 0) ? $tbl_cols_tax['location'].\" = \".$this->db->escape($location[$i]['location_id']).\" OR \" : NULL; \r\n\t\t\t\t\t\t$sql_where .= ($location[$i]['zone_id'] > 0) ? $tbl_cols_tax['zone'].\" = \".$this->db->escape($location[$i]['zone_id']) : NULL;\r\n\t\t\t\t\t\t$sql_where = rtrim($sql_where, ' OR ').\")\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t$query = $this->db->select($sql_select)\r\n\t\t\t\t\t\t->from($tbl_tax['table'])\r\n\t\t\t\t\t\t->where($sql_where)\r\n\t\t\t\t\t\t->order_by($sql_order_by)\r\n\t\t\t\t\t\t->limit(1)\r\n\t\t\t\t\t\t->get();\r\n\r\n\t\t\t\t\tif ($query->num_rows() == 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tax_data = $query->row_array();\r\n\t\t\t\t\t\t$tax['name'] = $tax_data[$this->flexi->cart_database['tax']['columns']['name']];\r\n\t\t\t\t\t\t$tax['rate'] = $tax_data[$this->flexi->cart_database['tax']['columns']['rate']];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn $tax;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If no tax data has been returned by the database lookup, lookup the database default tax columns set via config file.\r\n\t\t\tif ($tbl_tax['default'])\r\n\t\t\t{\r\n\t\t\t\t$sql_select = array($tbl_cols_tax['name'], $tbl_cols_tax['rate']);\r\n\t\t\t\t\r\n\t\t\t\t$sql_where = array(\r\n\t\t\t\t\t$tbl_cols_tax['status'] => 1,\r\n\t\t\t\t\t$tbl_tax['default'] => 1\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$query = $this->db->select($sql_select)\r\n\t\t\t\t\t->where($sql_where)\r\n\t\t\t\t\t->from($tbl_tax['table'])\r\n\t\t\t\t\t->order_by($sql_order_by)\r\n\t\t\t\t\t->limit(1)\r\n\t\t\t\t\t->get();\r\n\t\t\t\t\t\r\n\t\t\t\tif ($query->num_rows() == 1) \r\n\t\t\t\t{\r\n\t\t\t\t\t$tax_data = $query->row_array();\r\n\t\t\t\t\t$tax['name'] = $tax_data[$this->flexi->cart_database['tax']['columns']['name']];\r\n\t\t\t\t\t$tax['rate'] = $tax_data[$this->flexi->cart_database['tax']['columns']['rate']];\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn $tax;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}", "public function getClientLocations($clid){\r\r\n\t\t\t$location = false;\r\r\n\t\t\t$dbhandle = $this->dbhandle();\r\r\n\t\t\tif ($dbhandle){\r\r\n\t\t\t\t$dbfound = $this->dbfound();\r\r\n\t\t\t\tif ($dbfound){\r\r\n\t\t\t\t\t$tablename = \"clientloc\";\r\r\n\t\t\t\t\t$tableExists = $this->tableExists($tablename);\r\r\n\t\t\t\t\tif ($tableExists){\r\r\n\t\t\t\t\t\t$active = \"active\";\r\r\n\t\t\t\t\t\t$eactive = $this->encode($active);\r\r\n\t\t\t\t\t\t$sql = \"SELECT `$tablename`.`id`, `$tablename`.`locid` FROM `$this->db`.`$tablename` WHERE `$tablename`.`clid` = '$clid' AND `$tablename`.`status` = '$eactive'\";\r\r\n\t\t\t\t\t\t$result = mysql_query($sql, $dbhandle);\r\r\n\t\t\t\t\t\tif ($result){\r\r\n\t\t\t\t\t\t\tif (mysql_num_rows($result) > 0){\r\r\n\t\t\t\t\t\t\t\t$i = 0;\r\r\n\t\t\t\t\t\t\t\twhile ($resarr = mysql_fetch_assoc($result)){\r\r\n\t\t\t\t\t\t\t\t\t$location[$i]['id'] = $resarr['id'];\r\r\n\t\t\t\t\t\t\t\t\t$location[$i]['locid'] = $this->decode($resarr['locid']);\r\r\n\t\t\t\t\t\t\t\t\t$i++;\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t\treturn $location;\r\r\n\t\t}", "public function findLocation($keyword)\n {\n $data = NULL;\n //upto level 5 code \n $location = DB::table('locations')->where('name_0', $keyword)->orWhere('name_1', $keyword)->orWhere('name_2', $keyword)->orWhere('name_3', $keyword)->orWhere('name_4', $keyword)->orWhere('name_5', $keyword)->first();\n //upto level 4 code\n //$location = DB::table('locations')->where('name_0', $keyword)->orWhere('name_1', $keyword)->orWhere('name_2', $keyword)->orWhere('name_3', $keyword)->orWhere('name_4', $keyword)->first();\n //upto level 3 code\n //$location = DB::table('locations')->where('name_0', $keyword)->orWhere('name_1', $keyword)->orWhere('name_2', $keyword)->orWhere('name_3', $keyword)->first();\n //upto level 2 code\n //$location = DB::table('locations')->where('name_0', $keyword)->orWhere('name_1', $keyword)->orWhere('name_2', $keyword)->first();\n //upto level 1 code\n //$location = DB::table('locations')->where('name_0', $keyword)->orWhere('name_1', $keyword)->first();\n if(isset($location))\n if(!is_null($location))\n {\n if(isset($location->name_0))\n if($keyword==$location->name_0)\n {$data = array($location->name_0,$location->lat,$location->lon);}\n if(isset($location->name_1))\n if($keyword==$location->name_1)\n {$data = array($location->name_1,$location->lat,$location->lon);}\n if(isset($location->name_2))\n if($keyword==$location->name_2)\n {$data = array($location->name_2,$location->lat,$location->lon);}\n if(isset($location->name_3))\n if($keyword==$location->name_3)\n {$data = array($location->name_3,$location->lat,$location->lon);}\n if(isset($location->name_4))\n if($keyword==$location->name_4)\n {$data = array($location->name_4,$location->lat,$location->lon);}\n if(isset($location->name_5))\n if($keyword==$location->name_5)\n {$data = array($location->name_5,$location->lat,$location->lon);}\n }\n return $data;\n }" ]
[ "0.62735647", "0.6116956", "0.59083396", "0.5695926", "0.55033654", "0.5340375", "0.5322224", "0.5300415", "0.52903897", "0.5273668", "0.5233395", "0.5198685", "0.51730955", "0.51668566", "0.5162884", "0.5161274", "0.5120996", "0.51192355", "0.51150507", "0.5101921", "0.50933003", "0.5083452", "0.5071404", "0.50683755", "0.5051225", "0.50358194", "0.5032002", "0.50308204", "0.50228614", "0.5018632", "0.5016098", "0.50132436", "0.50088197", "0.50036097", "0.49939063", "0.49809957", "0.49756104", "0.49606517", "0.49519044", "0.49074244", "0.48978692", "0.48960257", "0.48802826", "0.4880277", "0.48780355", "0.48704335", "0.48601985", "0.48400944", "0.48393276", "0.48348114", "0.48342308", "0.48217344", "0.4816202", "0.48084372", "0.47931182", "0.47912148", "0.4780332", "0.4772309", "0.47662732", "0.4762296", "0.47299403", "0.4726967", "0.47179806", "0.47158906", "0.4713244", "0.47096458", "0.47042164", "0.46990514", "0.46944815", "0.46930385", "0.46864504", "0.46859208", "0.46765223", "0.4673574", "0.46721742", "0.467202", "0.46707928", "0.46638668", "0.46601996", "0.46595857", "0.46584377", "0.46454838", "0.46381012", "0.4636553", "0.4634171", "0.46278375", "0.46241987", "0.46220818", "0.46170598", "0.46106353", "0.46071336", "0.4606799", "0.4600398", "0.45862693", "0.45856166", "0.4584422", "0.45839956", "0.45801166", "0.4579273", "0.45755795" ]
0.74327886
0
$sql = 'select distinct query from Reports.Reports where id in (' . $pendingReports . ')';
function fetchStoredQueries($pendingReports){ $sql = 'select distinct task from reporting.tasks'; $this->database->query($sql); $results = $this->database->resultSet(); return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_ids_for_in($sql,$col_name='id') {\n\t$rows = fetchAll($sql);\n\t$ids = array();\n\tforeach($rows AS $row) {\n\t\t$ids[] = $row[$col_name];\n\t}\n\tif (count($ids) == 0) $ids[] = '0';\n\treturn join(',',$ids);\n}", "public function getQuestionIds()\r\n{\r\n $query_string = \"SELECT questionid FROM questions \";\r\n $query_string .= \"WHERE question = :question AND questionid != :questionid\";\r\n\r\n return $query_string;\r\n}", "public function getSystemIds()\r\n{\r\n $query_string = \"SELECT systemid FROM voting_system \";\r\n $query_string .= \"WHERE systemname = :systemname AND systemid != :systemid\";\r\n\r\n return $query_string;\r\n\r\n}", "function uploadedreportlist(){\r\n $select = \"SELECT * FROM reports ORDER BY date_published DESC\";\r\n global $pdo;\r\n $res = $pdo->query($select);\r\n return $res->fetchAll(PDO::FETCH_ASSOC);\r\n }", "function checkIDList($table, $fixedQuery, &$IDList)\n{\n\tglobal $sitePosition;\n\n\t$IDs = array();\n\t$rs = query('Select `ID` from `' . $sitePosition . '.' . $table . '` where ' . ($fixedQuery != '' ? ('(' . $fixedQuery . ') and ') : '') . '`ID` in (' . $IDList . ')', false);\n\twhile(true)\n\t{\n\t\t$rsInfo = fetchRow($rs);\n\t\tif($rsInfo === null) break;\n\t\t$IDs[] = $rsInfo[0];\n\t}\n\tfreeResult($rs);\n\t$IDList = implode(',', $IDs);\n}", "public function getSystemTypeIds()\r\n{\r\n $query_string = \"SELECT systemtypeid FROM system_type \";\r\n $query_string .= \"WHERE systemtypename = :systemtypename AND systemtypeid != :systemtypeid\";\r\n\r\n return $query_string;\r\n}", "protected function getListQuery()\r\n {\r\n $trackingDate = new Date($this->getState('trackingDate', 'now'));\r\n $db = $this->getDbo();\r\n \r\n $query = $db->getQuery(true);\r\n $query->select('*');\r\n $query->from($db->qn('#__ktbtracker_tracking'));\r\n $query->where($db->qn('userid').' = '.(int) Factory::getUser()->get('id'));\r\n $query->where($db->qn('tracking_date').' = '.$db->quote($trackingDate->format('Y-m-d')));\r\n \r\n return $query;\r\n }", "function get_export_list(){\n\n\t\t$output = array();\n\n\t\t$query = \"SELECT lead_id FROM leads_pending\n\t\tWHERE sent_fes = 0\n\t\tLIMIT 60000; \";\n\n\t\tif ($result = mysql_query($query, $this->conn)){\n\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t$output[] = $row['lead_id'];\n\t\t\t}\n\t\t}else{\n\t\t\t$this->display(\"Query failed: $query\" . mysql_error($this->conn));\n\t\t}\n\n\t\treturn $output;\n\t}", "private function getDatasets($datasets) {\n $datasets_id = collect($datasets)->implode('id', ', ');\n $sql = \" AND t1.datasets_id\";\n\n return $sql .= ((count($datasets) === 1)) ? \" = $datasets_id\" : \" IN ($datasets_id)\";\n }", "function edd_pup_queue_emails() {\r\n\r\n\t$email_list = array();\r\n\tglobal $wpdb;\r\n\r\n\t$query = \"SELECT DISTINCT email_id FROM $wpdb->edd_pup_queue WHERE sent = 0\";\r\n\r\n\t$emails = $wpdb->get_results( $query , ARRAY_A );\r\n\r\n\tforeach ( $emails as $email ) {\r\n\t\t$email_list[] = $email['email_id'];\r\n\t}\r\n\r\n\treturn $email_list;\r\n}", "function get_internship_list() {\n $conn = db_connect();\n $sql = \"SELECT DISTINCT *\n FROM internship_list;\";\n $result = mysqli_query($conn, $sql);\n while ($row = $result->fetch_assoc()) {\n $output[] = $row;\n }\n //clean-up result set and connection\n mysqli_free_result($result);\n mysqli_close($conn);\n\n return $output;\n}", "function statistics_client_query($query) {\n // TODO: regexp instead of normal comparison\n $result = db_query('SELECT id, query FROM {statistics_client_query_whitelist}');\n $flag = FALSE;\n foreach ($result as $record) {\n if ($query === $record->query) {\n $flag = TRUE;\n }\n }\n if (!$flag) {\n return array();\n }\n $tmp_res = db_query($query);\n $result = array();\n foreach ($tmp_res as $record) {\n $result[] = $record;\n }\n return $result;\n}", "function getViewableReports($conn){\n\t$sql = \"SELECT PlanId, plan.Name AS PlanName, CompanyName FROM plan JOIN client ON plan.ClientId = client.ClientId WHERE plan.UserId = :userID\";\n\n\n\t$userID = getLoggedInID();\n\n\t\n\t$sth = $conn->prepare($sql);\n\t$sth->bindParam(':userID', $userID, PDO::PARAM_INT, 11);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n}", "function getPagesQuery($table=' tx_tdcalendar_events'){\n\t\t$pages = $this->pidList;\n\t\tif(!$pages)return;\n\t\treturn ' AND '.$table.'.pid IN ('.$pages.') ';\n\t}", "function getProductFromArray($itemsIds) {\r\n $strIds = implode($itemsIds, ', ');\r\n $sql = \"SELECT * FROM products WHERE id in ({$strIds})\";\r\n\r\n include '../config/db.php';\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n return createSnartyRsArray($rs);\r\n}", "function get_all_reports()\r\n {\r\n return $this->db->get('reports')->result_array();\r\n }", "function get_internship_detail($id) {\n $conn = db_connect();\n $sql = \"SELECT DISTINCT *\n FROM internship_detail\n WHERE InternshipId = $id\n LIMIT 1;\";\n $result = mysqli_query($conn, $sql);\n while ($row = $result->fetch_assoc()) {\n $output[] = $row;\n }\n //clean-up result set and connection\n mysqli_free_result($result);\n mysqli_close($conn);\n\n return $output;\n}", "function BuildQuery($ASSETS_TABLE, $assetid)\n{\n $query = \"UPDATE $ASSETS_TABLE SET Equi_Assigned_Pats_IDs = NULL, Equi_Loaned = NULL, Equi_Return_due = NULL WHERE Equi_ID=$assetid\";\n return $query;\n}", "function getViewablePausedReports($conn){\n\t$sql = \"SELECT temporaryreport.PlanId, DatePaused FROM temporaryreport JOIN plan ON temporaryreport.PlanId = plan.PlanId WHERE plan.UserId = :userID\";\n\n\n\t$userID = getLoggedInID();\n\n\t\n\t$sth = $conn->prepare($sql);\n\t$sth->bindParam(':userID', $userID, PDO::PARAM_INT, 11);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n}", "function getAllSiteList()\r\n{\r\n $sql = 'select site.id, site.company_id, company.display_name as company_name, site.name, site.phone, site.location from site inner join company on site.company_id=company.id where 1=1 order by company_id';\r\n $result = mysql_query($sql);\r\n return queryResultToArray($result);\r\n}", "public function reportListing()\n {\n\t$strsql = \"SELECT r.*,rs.* FROM \" . TBL_REPORTS . \" r inner join \" . TBL_REPORTS_SUBMISSION . \" rs on r.report_id=rs.report_id where r.site_id='\" . $_SESSION['site_id'] . \"' and r.report_id='\".$_GET['rid'].\"'\";\n\t$objRs = $this->objDatabase->dbQuery($strsql);\n\tparent:: reportListing($objRs);\n }", "function get_reports($report_id)\r\n {\r\n return $this->db->get_where('reports',array('report_id'=>$report_id))->row_array();\r\n }", "function suppr_client($bdd) {\n $reponse = $bdd->query('DELETE FROM users\n WHERE users.id \n NOT IN (\n SELECT orders.Users_id\n FROM orders\n )\n ');\n}", "function sql_query_issplaninscr ($q20_planilha, $campos = \"*\") {\n\t \t\n\t \t$sql = \"select \";\n\t \tif ( $campos != \"*\") {\n\t \t\t\n\t \t\t$campos_sql = split(\"#\",$campos);\n\t \t\t$virgula = \"\";\n\t \t\tfor($i=0;$i<sizeof($campos_sql);$i++){\n\t \t\t\t$sql .= $virgula.$campos_sql[$i];\n\t \t\t\t$virgula = \",\";\n\t \t\t}\n\t \t} else { \n\t \t\t$sql .= $campos;\n\t \t}\n\t \t\n\t \t$sql .= \" from issplan\";\n\t \t$sql .= \" \tleft join issplaninscr on q24_planilha = q20_planilha\";\n\t \t$sql .= \" left join issplannumpre on q32_planilha = q20_planilha\";\n\t \t$sql .= \" where issplan.q20_planilha = {$q20_planilha}\";\n\n\t \treturn $sql;\n\t }", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "protected function getListQuery() {\n\t\t$db = $this->_db;\n\t\t\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\n\t\t$query->select('COUNT(DISTINCT '.$db->quoteName('a.id').') count');\n\t\t$query->select($db->quoteName(array('a.category_id', 'a.type')));\n\t\t$query->from($db->quoteName('#__gtsms_messages', 'a'));\n\t\t\n\t\t$query->where($db->quoteName('a.msisdn_id').' > 0');\n\t\t$query->where($db->quoteName('a.modem').' IS NOT NULL');\n\t\t$query->where('('.$db->quoteName('a.modem').') <> \"\"');\n\t\t$query->where($db->quoteName('a.message').' IS NOT NULL');\n\t\t$query->where('('.$db->quoteName('a.message').') <> \"\"');\n\n\t\t$query->group($db->quoteName('a.category_id'));\n\t\t$query->group($db->quoteName('a.type'));\n\n\t\t//echo nl2br(str_replace('#__','eburo_',$query));\n\n\t\treturn $query;\n\t}", "function get_all_supervisors($conn, $table) {\n $stmt = \"SELECT DISTINCT(supervisor) FROM \" . $table . \" ORDER BY supervisor\";\n return exec_query($conn, $stmt);\n}", "function dbQueryStudentIdList($ids)\n {\n $where = \" WHERE id IN (\" . arrayToDBString($ids) . \")\";\n $rs = $this->_getFullList($where);\n return $rs;\n }", "function get_smsstudents_by_ids($inputarray = array()) {\n $sql = \"select * from student_records where id in(\" . implode(',', $inputarray) . \")\";\n //log_message('error', 'get_smsstudents_by_ids '.$sql);\t\t\n $res = $this->db->query($sql);\n return $res->result();\n }", "function buldSqlQuery($arr, $form) {\r\n\t$formId = getFormId($form);\r\n\r\n\t$sql = \"SELECT count(b.id) AS vote, b.description AS choice, b.id AS choice_id, c.description AS question, c.id AS questionId, d.description AS formName FROM survey_data AS a LEFT JOIN choices AS b ON a.choice_id = b.id LEFT JOIN questions AS c ON c.id = b.question_id LEFT JOIN forms AS d ON c.form_id = d.id WHERE c.form_id=$formId AND (\";\r\n\r\n\tforeach ($arr as $key => $value) {\r\n\t\t$sql .= \"(c.question=\" . $value . \" AND c.form_id=\" . $formId . ($key<(sizeof($arr)-1)?\") OR \":\")\");\r\n\t}\r\n\r\n\t$sql .= \") GROUP BY b.id\";\r\n\treturn $sql;\r\n}", "function createQuery_GetSitesByCodes($fullSiteCodeArray)\r\n{\r\n $where = 'WHERE SiteCode IN (';\r\n foreach ($fullSiteCodeArray as $fullCode) {\r\n $split = explode(\":\", $fullCode);\r\n $shortCode = $split[1];\r\n $where .= '\"' . $shortCode . '\",';\r\n }\r\n $whereStr = substr($where, 0, strlen($where) - 1);\r\n $whereStr .= \")\";\r\n\r\n //run SQL query\r\n $query_text = createQuery_GetAllSites() . $whereStr;\r\n return $query_text;\r\n}", "function find_all_department(){\nglobal $database;\n$user_id = $_SESSION['user_id'];\n$query = \"SELECT * \";\n$query .= \"FROM department \";\n$query .= \"WHERE user_id = {$user_id} \";\n$query .= \"ORDER BY department_name ASC\";\n$department_set = mysqli_query($database,$query);\nconfirm_query($department_set);\n\nreturn $department_set;\n\n}", "function dropbox_assignments()\n{\n global $class_id;\n /*/\n * SELECT *\n * FROM dropbox_assignments\n * WHERE class_id = $class_id\n /*/\n return good_query_table(\"SELECT * FROM dropbox_assignments WHERE class_id = $class_id\");\n}", "private function query_distinct($table, Array $columns, Array $records,$extraSQL=\"\",$printSQL = false) {\n\t\treturn $this->get_database_utils ()->query_distinct ( $table, $columns, $records,$extraSQL, $printSQL );\n\t}", "private function query_distinct($table, Array $columns, Array $records,$extraSQL=\"\",$printSQL = false) {\n\t\treturn $this->get_database_utils ()->query_distinct ( $table, $columns, $records,$extraSQL, $printSQL );\n\t}", "function FetchAdminIDs()\r\n{\r\n\tglobal $connect;\r\n $crud = new Crud($connect);\r\n $row = $crud->select(\"users\", \"GROUP_CONCAT(ID separator ', ') as AdminIDs\", \"AccessLevel ='1'\" );\r\n return $row[0][\"AdminIDs\"];\r\n}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM cst_hit';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function query_statements($q) {\r\n\t\textract($q);\r\n\t\tlist($resource_ids, $rule_values) = query_result($q);\r\n\t\tfor($i=0;$i<count($resource_ids);$i++) {\r\n\t\t\t$items[] = array('item_id'=>$resource_ids[$i], 'notes'=>get_notes($resource_ids[$i],$db));\r\n\t\t}\r\n\t\treturn $items;\r\n\t}", "function getSqlArrayForStats()\r\n\t{\r\n\t\tglobal $langs;\r\n\t\t$langs->load(\"users\");\r\n\r\n\t\t$statssql=array();\r\n\t\treturn $statssql;\r\n\t}", "public function getReport(){\n\t\tglobal $db;\n\t\t$sql = $db->prepare(\"SELECT * FROM project01_report ORDER BY id DESC;\");\n\t\t$sql->execute();\n\t\tif ($sql->rowCount()>0) {\n\t\t\t$report = $sql->fetchAll();\n\t\t\treturn $report;\n\t\t}\n\t}", "function get_companies_where($connection, $params=array())\n{\n try {\n $params_imploded = implode(\"','\",$params);\n $sql = \"SELECT symbol,name FROM companies WHERE symbol IN ('$params_imploded')\";\n $result = runQuery($connection, $sql, null);\n return $result;\n }\n catch (PDOException $e) {\n die( $e->getMessage() );\n }\n}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM tbl_task';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function get_all_ids() {\n\t\t$cloudprofile_list = array();\n\t\t$query = \"select pr_id from \".$this->_db_table;\n\t\t$db=htvcenter_get_db_connection();\n\t\t$rs = $db->Execute($query);\n\t\tif (!$rs)\n\t\t\t$this->_event->log(\"get_all_ids\", $_SERVER['REQUEST_TIME'], 2, \"cloudprofile.class.php\", $db->ErrorMsg(), \"\", \"\", 0, 0, 0);\n\t\telse\n\t\twhile (!$rs->EOF) {\n\t\t\t$cloudprofile_list[] = $rs->fields;\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\treturn $cloudprofile_list;\n\n\t}", "private function addInstruments () {\n//\t\t$rptid = sqlPrep($this->id);\n//\t\t$selstmt = \"SELECT INSTRUMENT_ID FROM REPORTS_INSTRUMENTS WHERE REPORT_ID = $rptid\";\n\t\t$resultSet = ORM::for_table (self::REPTS_INSTS_TABLE)->\n\t\t\tselect('instrument_id')->\n\t\t\twhere_equal('report_id', $this->id)->\n\t\t\tfind_many();\n\t\t$this->instruments = array();\n\t\tforeach ($resultSet as $result) {\n\t\t\t$instId = $result->instrument_id;\n\t\t\t$instrument = Instrument::findById($instId);\n\t\t\tif ($instrument != NULL) {\n\t\t\t\t$this->instruments[] = $instrument;\n\t\t\t}\n\t\t}\n\t}", "protected function getListQuery() {\n // Create a new query object.\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n $userid = JFactory::getUser()->id;\n\n // Select the required fields from the table.\n $query\n ->select(\n $this->getState(\n 'list.select', 'DISTINCT a.id, a.title, a.time_created, a.category_id, a.state'\n )\n );\n\n $query->from('`#__adverts79_adverts` AS a');\n\n $query->select('userApproval.link AS link');\n $query->join('INNER', '#__auto79_articles AS userApproval ON a.id = userApproval.postid');\n //$query->where('userApproval.user_approval = ' . $userid);\n \n $query->where('a.state = 0');\n \n $app = JFactory::getApplication();\n $getTemplate = $app->getTemplate('template');\n\n $province = $getTemplate->params['province'];\n if ($province) {\n $query->where('a.add_province = ' . $province);\n }\n\n // Add the list ordering clause.\n $orderCol = $this->state->get('list.ordering');\n $orderDirn = $this->state->get('list.direction');\n if ($orderCol == '') {\n $orderCol = \"a.time_updated\";\n }\n if ($orderDirn == '') {\n $orderDirn = \"DESC\";\n }\n if ($orderCol && $orderDirn) {\n $query->order($db->escape($orderCol . ' ' . $orderDirn));\n }\n// echo $query;\n// exit();\n return $query;\n }", "function getWhereDistinct($table,$col,$where){\n $array=array();\n $conn=connectDB();\n $query=\"SELECT DISTINCT $col FROM $table WHERE $where\";\n //print($query);\n foreach ($conn->query($query) as $row){\n //print_r($row);\n //print_r($col);\n\n array_push($array,$row[$col]);\n }\n return $array;\n }", "public function test(){\r\n $a=M('policy_isms')->select();\r\n $new = trim(array_reduce($a, function(&$new,$v2){\r\n return $new .\",\". $v2['id'];\r\n\r\n }),',');\r\n dump($new);die;\r\n}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM turma_disciplina';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function fetchItemsIssuedAgainstAllDepts()\r {\r $link = parent::connectToDB();\r $query=\"SELECT `item_id`,`department_id` ,department_stock.quantity, department.name, `issue_date`, `name_brand` \r FROM `department_stock` \r NATURAL JOIN `department` \r LEFT JOIN `stock` ON `department_stock`.stock_id = `stock`.stock_id\r NATURAL JOIN `item`\";\r $result=mysqli_query($link, $query);\r return $result;\r }", "public function get_default_list_query()\n {\n return \"SELECT\n\t\t\tobj_main.*,\n\t\t\tobj_main.isys_obj__id AS '__id__',\n\t\t\tjn1.isys_its_type__title,\n\t\t\tjn3.isys_purpose__title,\n\t\t\tjn5.isys_catg_global_category__title\n\n\t\t\tFROM isys_obj AS obj_main\n\t\t\tLEFT JOIN isys_cmdb_status AS obj_main_status ON obj_main_status.isys_cmdb_status__id = obj_main.isys_obj__isys_cmdb_status__id\n\t\t\tLEFT JOIN isys_catg_its_type_list AS j2 ON j2.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id\n\t\t\tLEFT JOIN isys_its_type AS jn1 ON jn1.isys_its_type__id = j2.isys_catg_its_type_list__isys_its_type__id\n\t\t\tLEFT JOIN isys_catg_global_list AS j6 ON j6.isys_catg_global_list__isys_obj__id = obj_main.isys_obj__id\n\t\t\tLEFT JOIN isys_purpose AS jn3 ON jn3.isys_purpose__id = j6.isys_catg_global_list__isys_purpose__id\n\t\t\tLEFT JOIN isys_catg_global_category AS jn5 ON jn5.isys_catg_global_category__id = j6.isys_catg_global_list__isys_catg_global_category__id\n\n\t\t\tWHERE (obj_main.isys_obj__isys_obj_type__id = \" . $this->convert_sql_id(C__OBJTYPE__IT_SERVICE) . \") \";\n }", "function get_all_portfolios($connection, $id)\n{\n try {\n $sql = \"select companies.name, portfolio.symbol, portfolio.amount from portfolio inner join companies on portfolio.symbol = companies.symbol where portfolio.userid = ?\";\n $result = runQuery($connection, $sql, array($id));\n return $result;\n }\n catch (PDOException $e) {\n die( $e->getMessage() );\n }\n}", "function good_query_list($sql, $debug=0)\n{\n $result = good_query($sql, $debug);\n\t\n if($lst = mysql_fetch_row($result))\n {\n\tmysql_free_result($result);\n\treturn $lst;\n }\n mysql_free_result($result);\n return false;\n}", "public function getAllReports(){\n $table = \"LITS_Stack_Reports\";\n\n try {\n $conn = $this->connect();\n $stmt = $conn->prepare(\"SELECT report, tag FROM $table\");\n $stmt->execute();\n $result = $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $result = $stmt->fetchAll();\n $conn = null;\n\n return $result;\n }\n catch(PDOException $e){\n echo $e;\n return null;\n }\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM auditoriacategoria';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function queryPlanPago_FULL($idCredito_){\n global $db; \n $dataQuery = array();\n \n $db->where('id_credito', $idCredito_); \n $queryTbl = $db->get (\"planes_pago_tbl\", 1, \"id_plan_pago, periocidad_plan_pago, valor_credito_plan_pago, valor_pagar_credito, utilidad_credito, numero_cuotas_plan_pago, plazocredito_plan_pago, fecha_inicio_plan_pago, fecha_fin_plan_pago, capital_cuota_plan_pago, valor_cuota_plan_pago, valor_mora_plan_pago\");\n \n $rowQueryTbl = count($queryTbl);\n if ($rowQueryTbl > 0){ \n foreach ($queryTbl as $qKey) { \n $dataQuery = $qKey;\n } \n return $dataQuery;\n }\n}", "static function publishable_ids()\r\n {\r\n $xrate = current(current(WEBPAGE::$dbh->getAll(sprintf\r\n (\r\n \"select rate from tblCurrenciesExchangeRates where date = '%s' and currency_id = %s\", \r\n date('Y-m-d'),WEBPAGE::$conf['app']['xrate_local']))));\r\n $margin = $xrate * WEBPAGE::$conf['mod_sponsorship']['min_donation'];\r\n return WEBPAGE::$dbh->getAssoc(sprintf\r\n (\r\n \"select distinct\r\n lm.id, 1 + %s - datediff(curdate(),ckd.date) time_left,\r\n coalesce(rc.donations,0.00) donations,\r\n br.borrowers borrowers,\r\n lm.amount - coalesce(rc.donations,0.00) pending\r\n from\r\n (\r\n tblLoansMaster lm,\r\n (\r\n select\r\n lmd.master_id, lsh.date\r\n from\r\n tblLoanStatusHistory lsh,\r\n tblLoansMasterDetails lmd\r\n where\r\n lmd.loan_id = lsh.loan_id and\r\n lsh.status = 'G' and\r\n lsh.date < CURDATE() and\r\n lsh.date >= DATE_ADD(CURDATE(), INTERVAL -%s DAY)\r\n ) ckd\r\n )\r\n left join\r\n (\r\n select master_id,sum(donation) donations from tblLoansMasterSponsors group by master_id\r\n ) rc on rc.master_id = lm.id\r\n left join\r\n (\r\n select master_id,count(loan_id) borrowers from tblLoansMasterDetails lmd group by master_id\r\n ) br on br.master_id = lm.id\r\n where\r\n lm.borrower_type = 'B' and\r\n lm.check_status = 'R' and\r\n ckd.master_id = lm.id and\r\n br.borrowers >= %s and\r\n br.borrowers <= %s and\r\n coalesce(rc.donations,0.00) < lm.amount - %s\r\n order by\r\n lm.id\",\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_margin'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_margin'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_min_borrowers'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_max_borrowers'],\r\n $margin)\r\n );\r\n }", "function createQuery($arr) {\n $printArray = \"\";\n for ($i = 0; $i < sizeof($arr); $i++) {\n if ($i == sizeof($arr) - 1) $printArray = $printArray .'\\'' . $arr[$i] . '\\'';\n else $printArray = $printArray . '\\'' . $arr[$i] . '\\'' . \", \";\n } \n return $printArray;\n}", "function get_AllSurveys(){\r\n $sql = $this->db->prepare(\"SELECT DISTINCT s.SurveyID, s.SurveyTitle, s.DatePosted FROM SURVEYLOOKUP L LEFT JOIN SURVEY s ON s.SurveyID = L.SurveyID\r\n WHERE :chamberid = L.ChamberID or :chamberid = L.RelatedChamber ORDER BY s.DatePosted DESC;\");\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber']\r\n ));\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "function survey_filter3($company_list)\n {\n $type_array = $this->input->post('company_type');\n\n //put the values from those arrays into strings so they can be added to the query\n $imploded_type = implode(\",\", $type_array);\n \n /*\n echo \"these are the passed company types:<br>\";\n echo $imploded_type;\n echo \"<br>\";\n \n echo \"this is the passed company list:<br>\";\n echo $company_list;\n echo \"<br>\"; \n */\n $sql = 'SELECT id,company_name FROM company WHERE type_id IN ('.$imploded_type.')\n AND id IN ('.$company_list.')';\n ////TODO: this query cannot handle the case where there is only one choice passed. \n //must be a problem with the comma?\n\n //run the query\n $query = $this->db->query($sql);\n \n if ($query->num_rows() > 0)\n {\n //build array of company ids that came from the last query...so we can use them in the upcoming query\n foreach ($query->result_array() as $row) {\n //$companyid_array[]=$row;\n $companyid_array[]=$row['id'];\n }\n $queried_comp_ids = implode(',', $companyid_array);\n /*\n echo \"queried comp ids based on TYPE: <br>\";\n print_r($queried_comp_ids);\n echo '<br>';\n */\n return $queried_comp_ids;\n \n }\n else //no companies were found\n {\n return FALSE;\n }\n }", "function department_branch_batch($department, $branch) {\n $batch = $this->db->query(\"SELECT * FROM batch WHERE FIND_IN_SET('\" . $department . \"',degree_id) AND FIND_IN_SET('\" . $branch . \"',course_id)\")->result();\n \n return $batch;\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM tbl_journal_lines';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function selectAll(){\r\n $query = \"SELECT B.branchName, S.*\r\n FROM branches AS B, userschedules AS S \r\n WHERE S.organizationId = $this->organizationId\r\n AND B.organizationId = S.organizationId\r\n AND B.branchId LIKE S.branchId\r\n AND S.locationCode LIKE '$locationCode' \r\n AND S.userName = '$this->userName'\r\n AND S.date BETWEEN '\".date('Y-m-d',strtotime($this->fromDate)).\"' AND '\".date('Y-m-d',strtotime($this->toDate)).\"'\r\n ORDER BY S.date, S.branchId, S.locationCode\";\r\n include(\"includes/dbConnection.php\");\t\t\t\r\n $executeQuery = $db->prepare($query);\r\n $executeQuery->execute() or exit(\"Error: SELECT query failed.\");\r\n $result = $executeQuery->fetchAll(PDO::FETCH_BOTH);\r\n return $result;\r\n }", "protected function getListQuery()\n {\n $db = JFactory::getDBO();\n $query = $db->getQuery(true);\n // Select some fields\n $query->select('*');\n // From the hello table\n $query->from('#__workerstatus_persons');\n return $query;\n }", "function nf_getListofUncompletedTasks(&$processlist) {\n global $_TABLES;\n\n $retval = array();\n $plist = implode(',',$processlist);\n $sql = \"SELECT distinct a.id \";\n $sql .= \"FROM {$_TABLES['nfqueue']} a inner join {$_TABLES['nfprocess']} b on a.nf_processId = b.id \";\n $sql .= \"inner join {$_TABLES['nftemplatedata']} c on a.nf_templateDataId = c.id \";\n $sql .= \"inner join {$_TABLES['nfprocess']} d on a.nf_processId = d.id \";\n $sql .= \"inner join {$_TABLES['nftemplate']} e on b.nf_templateId = e.id \";\n $sql .= \"inner join {$_TABLES['nfsteptype']} h on c.nf_steptype = h.id \";\n $sql .= \"WHERE d.complete=0 \";\n if (count($processlist) > 0) {\n $sql .= \"AND a.id not in ($plist) \";\n }\n $sql .= \" AND (a.status=0 AND a.archived is null AND h.is_interactiveStepType=0)\";\n $query = DB_query($sql);\n $retval['count'] = DB_numRows($query);\n while (list($taskid) = DB_fetchArray($query)) {\n array_push($processlist,$taskid);\n }\n $retval['list'] = $processlist;\n return $retval;\n}", "function in_query_assoc($sql){\n\t\t$q = $this->query($sql);\n\t\t$results = array();\n\t\tif($q){\n\t\t\twhile($row=$this->fetch_array($q, db::DB_ASSOC)){\n\t\t\t\t$results[] = $row;\n\t\t\t}\n\t\t}\n\t\treturn $results;\n\t}", "static public function getQueries() {\n\t\t$db = MijnSqli::instance();\n\t\t$selectQuery = \"\n\t\t\tSELECT\n\t\t\t\tID, beschrijving, permissie, categorie\n\t\t\tFROM\n\t\t\t\tsavedquery\n\t\t\tORDER BY categorie, beschrijving;\";\n\t\t$result = $db->query($selectQuery);\n\t\t$return = array();\n\t\twhile ($data = $db->next($result)) {\n\t\t\tif (self::magWeergeven($data['permissie'])) {\n\t\t\t\t$return[] = $data;\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "function getUuidArray($db, $tabledefuuid, $ids){\r\n\r\n\tif(!count($ids))\r\n\t\treturn false;\r\n\r\n\t$querystatement = \"\r\n\t\t\tSELECT\r\n\t\t\t\t\t`maintable`\r\n\t\t\tFROM\r\n\t\t\t\t\t`tabledefs`\r\n\t\t\tWHERE\r\n\t\t\t\t\t`uuid` = '\".$tabledefuuid.\"'\";\r\n\r\n\t$queryresult = $db->query($querystatement);\r\n\r\n\t$tablerecord = $db->fetchArray($queryresult);\r\n\r\n\t$whereclause = \"\";\r\n\tforeach($ids as $id)\r\n\t\t$whereclause .= \" OR `id` = '\".(int)$id.\"'\";\r\n\r\n\t$whereclause = substr($whereclause, 4);\r\n\r\n\t$querystatement = \"\r\n\t\t\tSELECT\r\n\t\t\t\t\t`uuid`\r\n\t\t\tFROM\r\n\t\t\t\t\t`\".$tablerecord[\"maintable\"].\"`\r\n\t\t\tWHERE\r\n\t\t\t\t\t\".$whereclause;\r\n\r\n\t$queryresult = $db->query($querystatement);\r\n\r\n\t$thereturn = array();\r\n\tif($db->numRows($queryresult))\r\n\t\twhile($therecord = $db->fetchArray($queryresult))\r\n\t\t\t$thereturn[] = $therecord[\"uuid\"];\r\n\r\n\treturn $thereturn;\r\n\r\n}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM tbl_coverage';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function ddl_batch()\r\n\t {\r\n\t $link = $this->connect();\r\n\t $search = \"SELECT DISTINCT pig_batch FROM pig\";\r\n\t $resultq = mysqli_query($link, $search);\r\n\t $batch = array();\r\n\t $batchArr = array();\r\n\t while ($row = mysqli_fetch_row($resultq)) {\r\n\t $batch['batch'] = $row[0];\r\n\t $batchArr[] = $batch;\r\n\t }\r\n\t return $batchArr;\r\n\t }", "function getPostIdArray($userIdarray)\n{\n global $conn;\n $postIds = array();\n\n $sql = \"SELECT post.postId FROM user JOIN post ON user.userId=post.userId WHERE \";\n\n $length = sizeof($userIdarray);\n $counter = 0;\n\n foreach ($userIdarray as $user) {\n $counter++;\n $sql .= \"user.userId='\" . $user . \"' \";\n if ($counter != $length) {\n $sql .= \"OR \";\n } else {\n $sql .= \"AND post.deleted=0 ORDER BY post.creationTime DESC;\";\n\n }\n }\n\n $result = mysqli_query($conn, $sql);\n\n if ($result == false) {\n return $postIds;\n } else {\n while ($row = mysqli_fetch_assoc($result)) {\n\n $postIds[] = $row['postId'];\n\n }\n\n return $postIds;\n }\n\n}", "private function get_sql_statement_blacklisted_ids( $blacklisted_ids, $is_only_exclude_ids = false ) {\n\n\t\tif ( empty( $blacklisted_ids ) ) {\n\n\t\t\t$result = $is_only_exclude_ids ? ' AND (1 = 2) ' : '';\n\n\t\t} else {\n\n\t\t\t$result = sprintf( $is_only_exclude_ids ? ' AND ID IN (%s) ' : ' AND ID NOT IN (%s) ', implode( ',', $blacklisted_ids ) );\n\t\t}\n\n\t\treturn $result;\n\t}", "function get_brgy(){\n $arr_brgy = array();\n \n if(in_array('all',$_SESSION[brgy])):\n $q_brgy = mysql_query(\"SELECT barangay_id FROM m_lib_barangay ORDER by barangay_id ASC\") or die(\"Cannot query 252\". mysql_error());\n while(list($brgy_id) = mysql_fetch_array($q_brgy)){ \n array_push($arr_brgy,$brgy_id);\n }\n else:\n $arr_brgy = $_SESSION[brgy];\n endif;\n \n $str_brgy = implode(',',$arr_brgy);\n \n return $str_brgy;\n \n}", "function survey_filter2($categories)\n {\n $categories = implode(',', $categories);\n /*\n $sql = 'SELECT b.*\n FROM category_map bt, company b, category t\n WHERE bt.category_id = t.id\n AND (t.id IN ('.$categories.'))\n AND b.id = bt.company_id\n GROUP BY b.id';\n */\n $sql = 'SELECT b.*\n FROM company_category bt, company b, ref_category t\n WHERE bt.category_id = t.id\n AND (t.id IN ('.$categories.'))\n AND b.id = bt.company_id\n GROUP BY b.id';\n $query = $this->db->query($sql);\n\n if ($query->num_rows() > 0)\n {\n //build array of company ids that came from the last query...so we can use them in the upcoming query\n foreach ($query->result_array() as $row) {\n //$companyid_array[]=$row;\n $companyid_array[]=$row['id'];\n }\n $queried_comp_ids = implode(',', $companyid_array);\n \n /* echo \"queried comp ids based on CATEGORY: <br>\";\n print_r($queried_comp_ids);\n echo '<br>';*/\n \n //return a comma-separated squeried comp ids: tring of the company ids that match\n return $queried_comp_ids;\n \n }\n else //no companies were found\n {\n return FALSE;\n }\n\n }", "function workspace_getStructureID($workspaces) {\n\tglobal $Auth;\n\t## multiclient\n\t$client_id = $Auth->auth[\"client_id\"];\n\n\t$db_connection = new DB_Sql();\n\t\n\t\n\t## prepare the query\n\t$query = '';\n\tforeach($workspaces as $current_workspace) {\n\t\tif($query=='') {\n\t\t\t$query .= \"workspace_id='\".$current_workspace.\"'\";\n\t\t} else {\n\t\t\t$query .= \" OR workspace_id='\".$current_workspace.\"'\";\n\t\t}\n\t}\t\n\t\n\t## now do the actually query\n\t$query = \"SELECT DISTINCT(structure_id) FROM \".DB_PREFIX.\"workspace_item AS a INNER JOIN \".STRUCTURE.\" AS b ON a.workspace_item=b.page_id WHERE a.client_id='$client_id' AND (\".$query.\")\";\n\t$result_pointer = $db_connection->query($query);\n\t\n\t$results = array();\n\twhile($db_connection->next_record()) {\t\n\t\t$results[] = $db_connection->Record[\"structure_id\"];\t\n\t}\n\treturn $results;\t\n}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM cst_tech_req';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function getMulti($table_name, $ws, $field = 'false')\n{\n\n if ($field == 'false')\n $field = '*';\n $result = mysqli_query(connect(), \"SELECT $field FROM $table_name WHERE $ws \");\n\n //$r = array();\n while ($row = mysqli_fetch_assoc($result)) {\n $r[] = $row;\n }\n return $r;\n}", "public function countAll(){\n\n $all_reporting_ids = $this->common_model->get_categories($this->session->user_id);\n\n $this->db->from($this->table);\n $this->db->join('enquiry','enquiry.enquiry_id=tbl_client_contacts.client_id','left');\n $this->db->where(\"enquiry.comp_id\",$this->session->companey_id);\n $where=\"\";\n $where .= \"( enquiry.created_by IN (\".implode(',', $all_reporting_ids).')';\n $where .= \" OR enquiry.aasign_to IN (\".implode(',', $all_reporting_ids).'))';\n // if(!empty($_POST['specific_list']))\n // {\n // $where.=\"AND tbl_visit.id IN (\".$_POST['specific_list'].\") \"; \n // }\n $this->db->where($where);\n return $this->db->count_all_results();\n }", "function getDistinct($table,$col){\n $array=array();\n $conn=connectDB();\n $query=\"SELECT DISTINCT $col FROM $table\";\n foreach ($conn->query($query)as $row){\n array_push($array,$row[$col]);\n }\n return $array;\n }", "function get_all_purchase_requests($db)\n{\n $sql = \"SELECT * FROM purchase_requests\";\n $st= $db->prepare($sql);\n $st->execute();\n $us = $st->fetchAll();\n return $us;\n}", "function find_all_commite() {\n global $db;\n\n $sql = \"SELECT * FROM commite \";\n $sql .= \"ORDER BY id ASC\";\n $result = mysqli_query($db, $sql);\n return $result;\n }", "function ArrayIntoQuery($camps,$dades,$modificador='')\n{\n\t$qstring='';\n\t$last_item = end($camps); \n\tforeach ($camps as $camp)\n\t{\n\t\t$dada_final=$dades[$camp];//anirà be pels idiomes\n\t\tif (is_array($dada_final) && $modificador!='') {$dada_final=$dada_final[$modificador];}\t\t\n\t\t$qstring.=\"$camp = '\".MQ($dada_final).\"'\".($camp!=$last_item?\", \":\" \");\n\t}\n\treturn $qstring;\n}", "public function filter()\n\t{\n\t\treturn implode( ' AND ', array_map( function( $col ) { return \"$col=?\"; }, array_keys( $this->_id ) ) );\n\t}", "function pi_list_query($table,$count=0,$addWhere='',$mm_cat='',$groupBy='',$orderBy='',$query='',$returnQueryArray=FALSE)\t{\n\n \t\t\t// Begin Query:\n\t\tif (!$query)\t{\n\t\t\t\t// Fetches the list of PIDs to select from.\n\t\t\t\t// TypoScript property .pidList is a comma list of pids. If blank, current page id is used.\n\t\t\t\t// TypoScript property .recursive is a int+ which determines how many levels down from the pids in the pid-list subpages should be included in the select.\n\t\t\t$pidList = 2;\n \n\t\t\tif (is_array($mm_cat))\t{\n\t\t\t\t$query='FROM '.$table.','.$mm_cat['table'].','.$mm_cat['mmtable'].chr(10).\n\t\t\t\t\t\t' WHERE '.$table.'.uid='.$mm_cat['mmtable'].'.uid_local AND '.$mm_cat['table'].'.uid='.$mm_cat['mmtable'].'.uid_foreign '.chr(10).\n\t\t\t\t\t\t(strcmp($mm_cat['catUidList'],'')?' AND '.$mm_cat['table'].'.uid IN ('.$mm_cat['catUidList'].')':'').chr(10).\n\t\t\t\t\t\t' AND '.$table.'.pid IN ('.$pidList.')';\n\t\t\t} else {\n\t\t\t\t$query='FROM '.$table.' WHERE pid IN ('.$pidList.')';\n\t\t\t}\n\t\t}\n\n\t\t\t// Split the \"FROM ... WHERE\" string so we get the WHERE part and TABLE names separated...:\n\t\tlist($TABLENAMES,$WHERE) = spliti('WHERE', trim($query), 2);\n\t\t$TABLENAMES = trim(substr(trim($TABLENAMES),5));\n\t\t$WHERE = trim($WHERE);\n\n\t\t\t// Add '$addWhere'\n\t\tif ($addWhere)\t{$WHERE.=' '.$addWhere.chr(10);}\n\n\t\t\t// Search word:\n\t\tif ($this->piVars['sword'] && $this->internal['searchFieldList'])\t{\n\t\t\t$WHERE.=$this->cObj->searchWhere($this->piVars['sword'],$this->internal['searchFieldList'],$table).chr(10);\n\t\t}\n\n\t\tif ($count) {\n\t\t\t$queryParts = array(\n\t\t\t\t'SELECT' => 'count(*)',\n\t\t\t\t'FROM' => $TABLENAMES,\n\t\t\t\t'WHERE' => $WHERE,\n\t\t\t\t'GROUPBY' => '',\n\t\t\t\t'ORDERBY' => '',\n\t\t\t\t'LIMIT' => ''\n\t\t\t);\n\t\t} else {\n\t\t\t\t// Order by data:\n\t\t\tif (!$orderBy && $this->internal['orderBy'])\t{\n\t\t\t\tif (t3lib_div::inList($this->internal['orderByList'],$this->internal['orderBy']))\t{\n\t\t\t\t\t$orderBy = 'ORDER BY '.$table.'.'.$this->internal['orderBy'].' '.$this->internal['descFlag'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\t// Limit data:\n\t\t\t$pointer = intval($this->ter_pointer);\n\t\t\t\n \t\t$results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'],1,1000);\n\t\t\t$LIMIT = ($pointer*$results_at_a_time).','.$results_at_a_time;\n\n\t\t\t\t// Add 'SELECT'\n\t\t\t$queryParts = array(\n\t\t\t\t'SELECT' => $this->pi_listFields,\n\t\t\t\t'FROM' => $TABLENAMES,\n\t\t\t\t'WHERE' => $WHERE,\n\t\t\t\t'GROUPBY' => $GLOBALS['TYPO3_DB']->stripGroupBy($groupBy),\n\t\t\t\t'ORDERBY' => $GLOBALS['TYPO3_DB']->stripOrderBy($orderBy),\n\t\t\t\t'LIMIT' => $LIMIT\n\t\t\t);\n\t\t}\n\n\t\t$query = $GLOBALS['TYPO3_DB']->SELECTquery (\n\t\t\t\t\t$queryParts['SELECT'],\n\t\t\t\t\t$queryParts['FROM'],\n\t\t\t\t\t$queryParts['WHERE'],\n\t\t\t\t\t$queryParts['GROUPBY'],\n\t\t\t\t\t$queryParts['ORDERBY'],\n\t\t\t\t\t$queryParts['LIMIT']\n\t\t\t\t);\n\t\treturn $returnQueryArray ? $queryParts : $query;\n\t}", "function paperselPredicate($papersel) {\n return \"ContactInfo.contactId\" . sql_in_numeric_set($papersel);\n}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM timesheet';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "static function get_all_reports($includeDeleted=false)\n {\n global $DB;\n\n static $r;\n\n if(isset($r))\n return $r;\n\n $r = array();\n\n foreach($DB->get_fieldset_select('block_ilp_report','id','1 = 1 ') as $rid)\n {\n $report=static::from_id($rid);\n if(!$report->deleted or $includeDeleted)\n $r[$rid]=$report;\n }\n\n return $r;\n }", "function getJournalIds() {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT DISTINCT journal_id FROM counter_monthly_log l'\n\t\t);\n\t\t$journalIds = array();\n\t\twhile (!$result->EOF) {\n\t\t\t$row = $result->GetRowAssoc(false);\n\t\t\t$journalIds[] = $row['journal_id'];\n\t\t\t$result->MoveNext();\n\t\t}\n\t\t$result->Close();\n\t\treturn $journalIds;\n\t}", "function get_all_internships_detail($start, $end) {\n $conn = db_connect();\n\n $sql = \"SELECT * FROM internship_detail where InternshipId between $start and $end\";\n $result = mysqli_query($conn, $sql);\n while ($row = $result->fetch_assoc()) { \n $output[] = $row;\n }\n\n //clean-up result set and connection\n mysqli_free_result($result);\n mysqli_close($conn);\n return $output;\n}", "function queryCobrador_FULL($idCobrador_){\n global $db; \n $dataQuery = array();\n \n $db->where('id_cobrador', $idCobrador_); \n $queryTbl = $db->get (\"cobrador_tbl\", 1, \"id_cobrador, nombre_cobrador, mail_cobrador, tel_uno_cobrador, tel_dos_cobrador, direccion_cobrador, ciudad_cobrador\");\n \n $rowQueryTbl = count($queryTbl);\n if ($rowQueryTbl > 0){ \n foreach ($queryTbl as $qKey) { \n $dataQuery = $qKey;\n } \n return $dataQuery;\n }\n}", "function selectAll($dsstr)\n{\n\t$args = func_get_args();\n\t$sql = $this->getSelectSql($dsstr, $args);\n\t$res = $this->query($sql);\n\treturn $this->fetchAll($res);\n}", "public function getAllObjectsQuery($objects)\n {\n return $objects->first()->query()->whereIn('id', $objects->pluck('id')->toArray());\n }", "public function getPayoutSchedules()\n {\n \t$activePayoutSchedules = array(1,8,10,11);\n \t$query = \"SELECT * FROM \" . self::getTableName() . \"\n \t\tWHERE id IN (\" . implode(',', $activePayoutSchedules) . \")\n \t\tORDER BY schedule ASC\n \t\";\n\t\t\n \t$stmt = $this->connection->prepareQuery($query);\n $stmt->execute();\n\n return $stmt;\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM recibo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function distinct_value($conn,$column_name,$table_name,$where)\r\n\t{\r\n\t$result=array();\r\n\t\t$qry=\"SELECT DISTINCT `$column_name` as dis_value FROM `$table_name` $where\";\r\n\t\t$res=mysql_query($qry);\r\n\t while($row=mysql_fetch_array($res))\r\n\t\t{\r\n\t\t$result[]=$row['dis_value'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "static function getUnpaidDepositReport() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \"SELECT guest_name, checkin_date, checkout_date, payment_total, data_href, booking_reference, \n booking_source, booked_date, notes, viewed_yn, created_date\n FROM wp_lh_rpt_unpaid_deposit\n WHERE job_id IN (SELECT CAST(value AS UNSIGNED) FROM wp_lh_job_param WHERE name = 'allocation_scraper_job_id' AND job_id = (SELECT MAX(job_id) FROM wp_lh_jobs WHERE classname = 'com.macbackpackers.jobs.UnpaidDepositReportJob' AND status = 'completed'))\n ORDER BY checkin_date\");\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n return $resultset;\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM answer';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM power_station_warning';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "protected function _buildItemsQuery() {\n\n $query=\"SELECT b.id, b.title, b.alias, b.state, b.create_date, b.public_date, u.name AS author_name, c.title AS category_title, c.alias AS category_alias\n FROM `#__blog` AS b\n LEFT JOIN `#__categories` AS c\n ON b.category_id = c.id \n LEFT JOIN `#__users` AS u\n ON b.author_id = u.id\";\n\n return $query;\n\n }", "function scheduledreporting_component_get_all_reports()\n{\n $scheduled_reports = array();\n\n // Get all the users and grab their reports\n $users = get_users();\n foreach ($users as $user) {\n $tmp = scheduledreporting_component_get_reports($user['user_id']);\n foreach ($tmp as $i => $t) {\n $tmp[$i]['user_id'] = $user['user_id'];\n }\n $scheduled_reports = array_merge($scheduled_reports, $tmp);\n }\n\n return $scheduled_reports;\n}", "protected function getListQuery()\n\t{\n\t\t$db\t= $this->getDbo();\n\t\t$query\t= $db->getQuery(true);\n\n\t\treturn $query;\n\t}" ]
[ "0.5831332", "0.58158416", "0.5757618", "0.5651377", "0.56060964", "0.560527", "0.54921037", "0.5489922", "0.5480918", "0.5472621", "0.5375201", "0.53651655", "0.5321976", "0.5299881", "0.5294847", "0.52901036", "0.52606684", "0.52389485", "0.52328706", "0.52324647", "0.5231207", "0.52151614", "0.52034545", "0.52017164", "0.5181891", "0.51728964", "0.51686734", "0.51664066", "0.51663405", "0.51427317", "0.5128894", "0.5115405", "0.51045734", "0.5089972", "0.5089972", "0.5086501", "0.5081744", "0.5066995", "0.5066326", "0.50521016", "0.50408506", "0.5031284", "0.503061", "0.5020343", "0.50199795", "0.5013375", "0.50060517", "0.50048333", "0.4998621", "0.49864507", "0.49851462", "0.49846065", "0.49818367", "0.49799344", "0.49786434", "0.49773845", "0.4973291", "0.49675277", "0.49648875", "0.49526426", "0.49513298", "0.49444535", "0.49395543", "0.49380466", "0.49376044", "0.49369124", "0.49298316", "0.49296033", "0.49290568", "0.49284753", "0.49192595", "0.4917098", "0.49130028", "0.49125153", "0.49080163", "0.4907179", "0.49046195", "0.49030256", "0.4901454", "0.49011108", "0.4895596", "0.48942438", "0.48912126", "0.48905045", "0.48893392", "0.488739", "0.4884892", "0.48817575", "0.48779088", "0.48760092", "0.48743024", "0.48733687", "0.48701042", "0.48672885", "0.4866938", "0.48664913", "0.48643124", "0.48626557", "0.48592308", "0.485754" ]
0.6589
0
will assign valid report name once tables are ready
function processData($data){ $fileName = rand(1,10).'test.csv'; $formatData = json_decode($data, true); $headers = $this->formatHeaders($formatData); $rows = $this->formatRows($formatData); $this->createFile(array_unique($headers), $rows, $fileName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function nameReportFile(){\n $name= str_replace(' ','_',$this->nombrereporte).'_'.\n $this->id.'_'.h::userId().'_'.uniqid().'.'.$this->type;\n }", "protected abstract function getReportName() : string;", "private function initReport()\n {\n $this->report = new \\stdClass();\n\n $this->searchDiffs();\n }", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(USER_RSS); \n }", "public function setReport($table) {\n $this->setSource($table);\n }", "public function autoSetTableNames()\n\t{\n\t\t$db = $this->getDatabaseInstance();\n\t\t$query = \"SHOW TABLE STATUS LIKE 'event\\_log%'\";\n\t\t\n\t\t$result = $db->prepare($query);\n\t\t$result->execute();\n\t\t\n\t\t$table_names = array();\n\t\twhile ($row = $result->fetch())\n\t\t{\n\t\t\tif (strcasecmp($row['Engine'], 'MRG_MyISAM'))\n\t\t\t{\n\t\t\t\t$table_names[] = $row['Name'];\n\t\t\t}\n\t\t}\n\t\t\n\t\trsort($table_names);\n\t\t\n\t\t$this->setTableNames($table_names);\n\t\tif (isset($table_names[0]))\n\t\t{\n\t\t\t$this->setTableName($table_names[0]);\n\t\t}\n\t}", "abstract public function getDetailedReportName();", "private function generateReportName() : string {\n\t\treturn time().\"-\".sha1($_SERVER['REMOTE_ADDR']);\n\t}", "protected function getReportName() {\n return substr(get_class($this), strlen('SiteAuditReport'));\n }", "protected function TableName() {\n\tthrow new exception('2017-01-05 Is this being called?');\n }", "private function getTableNames()\n {\n $this->tableNames = [\n 'eav_attribute' => $this->resource->getTableName('eav_attribute'),\n 'EnitureModules' => $this->resource->getTableName('EnitureModules'),\n ];\n }", "public function GetReportName(): string {\n\treturn('Zermelo Demo: Northwind Order Slow Report');\n }", "public function makeReport()\n {\n }", "public function setTableNames() {\n $caseFormat = $this->settingsAll['Model'][self::$meta_model]['tablecaseformat'];\n $aliasFormat = $this->settingsAll['Model'][self::$meta_model]['tablealiasformat'];\n foreach ($this->settingsAll as $k => $v) {\n # do not process __meta\n if (in_array($k, array(self::$meta))) {\n continue;\n }\n $tableName = $this->getRealTableName($caseFormat, $k);\n # settingsAll.k.this->meta.tablename\n # - genTable responsible for having tableName set\n $custom_set = null;\n if (isset($this->settingsAll[$k][self::$meta]['tablename'])) {\n $custom_set = $this->settingsAll[$k][self::$meta]['tablename'];\n }\n $this->log(\"setTableNames / style: {$caseFormat} / k: {$k} / tableName: {$tableName} / custom-set: \" . $custom_set);\n # set correct tablename as defined in schema, but do not override individual defaults\n if (!isset($this->settingsAll[$k][self::$meta]['tablename'])) {\n $this->settingsAll[$k][self::$meta]['tablename'] = $tableName;\n }\n # ALIAS\n $this->settingsAll[$k][self::$meta]['alias'] = $this->getTableAlias($aliasFormat, $k);\n }\n }", "protected function setTable()\n {\n $class = explode('\\\\', get_called_class());\n $this->table = lcfirst(end($class)).'s';\n }", "private function _fetch_table()\n {\n if ($this->table_name == null) {\n $this->table_name = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this)));\n }\n }", "private function _fetch_table()\n {\n if ($this->table_name == null) {\n $this->table_name = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this)));\n }\n }", "public function reportListing_default()\n {\n\t$defaultreportnames = $this->reportNames(); $rid = $defaultreportnames->fetch_object();\n\t$strsql = \"SELECT r.*,rs.* FROM \" . TBL_REPORTS . \" r inner join \" . TBL_REPORTS_SUBMISSION . \" rs on r.report_id=rs.report_id where r.site_id='\" . $_SESSION['site_id'] . \"' and r.report_id='\".$rid->report_id.\"'\";\n\t$objRs = $this->objDatabase->dbQuery($strsql);\n\treturn $objRs;\n }", "function get_report_shortname() {\n $classname = get_class($this);\n $reportname = substr($classname, 0, strlen($classname) - strlen('_report'));\n\n return $reportname;\n }", "protected function assign_report_columns() {\n\t\t$table_name = self::get_db_table_name();\n\t\t$this->report_columns = array(\n\t\t\t'amount' => 'SUM(discount_amount) as amount',\n\t\t\t'coupons_count' => 'COUNT(DISTINCT coupon_id) as coupons_count',\n\t\t\t'orders_count' => \"COUNT(DISTINCT {$table_name}.order_id) as orders_count\",\n\t\t);\n\t}", "function getReport() ;", "function InsertANewReportType($name)\n {\n $reportTypeModel = new ReportTypeModel();\n $reportTypeModel->InsertANewReportType($name);\n }", "private function setTableName()\n {\n // Get table name from name of entity if not defined\n if (!$this->tableName) {\n $path = explode('\\\\', get_class($entity));\n $this->tableName = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', array_pop($path))).'s';\n }\n\n // Set table to be used\n $this->adapter->setTable($this->tableName);\n }", "private function _set_table()\n\t{\n\t\t$dossier = $this->config->item('dossier');\n\t\tif($dossier === false)\n\t\t{\n\t\t\tlog_message('info', '\"Dossier\" params is not set');\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_dossier = $dossier;\n\t\t\t$this->_table = $this->_dossier . '.' . $this->_table;\n\t\t}\n\t}", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(COMMENT); \n }", "protected function assign_report_columns() {\n\t\t$table_name = self::get_db_table_name();\n\t\t// Avoid ambigious columns in SQL query.\n\t\t$this->report_columns = array(\n\t\t\t'order_id' => \"{$table_name}.order_id\",\n\t\t\t'parent_id' => \"{$table_name}.parent_id\",\n\t\t\t'date_created' => \"{$table_name}.date_created\",\n\t\t\t'date_created_gmt' => \"{$table_name}.date_created_gmt\",\n\t\t\t'status' => \"REPLACE({$table_name}.status, 'wc-', '') as status\",\n\t\t\t'customer_id' => \"{$table_name}.customer_id\",\n\t\t\t'net_total' => \"{$table_name}.net_total\",\n\t\t\t'total_sales' => \"{$table_name}.total_sales\",\n\t\t\t'num_items_sold' => \"{$table_name}.num_items_sold\",\n\t\t\t'customer_type' => \"(CASE WHEN {$table_name}.returning_customer = 1 THEN 'returning' WHEN {$table_name}.returning_customer = 0 THEN 'new' ELSE '' END) as customer_type\",\n\t\t);\n\t}", "function install_reporting_tables() {\n global $wpdb;\n\n $charset_collate = '';\n if ( ! empty($wpdb->charset) )\n $charset_collate = \"DEFAULT CHARACTER SET $wpdb->charset\";\n if ( ! empty($wpdb->collate) )\n $charset_collate .= \" COLLATE $wpdb->collate\";\n\n // Reporting: Queries\n //\n $table_name = $wpdb->prefix . \"slp_rep_query\";\n $sql = \"CREATE TABLE $table_name (\n slp_repq_id bigint(20) unsigned NOT NULL auto_increment,\n slp_repq_time timestamp NOT NULL default current_timestamp,\n slp_repq_query varchar(255) NOT NULL,\n slp_repq_tags varchar(255),\n slp_repq_address varchar(255),\n slp_repq_radius varchar(5),\n PRIMARY KEY (slp_repq_id),\n INDEX (slp_repq_time)\n )\n $charset_collate\t\t\t\t\t\t\n \";\n $this->dbupdater($sql,$table_name);\t\n\n\n\n // Reporting: Query Results\n //\n $table_name = $wpdb->prefix . \"slp_rep_query_results\";\n $sql = \"CREATE TABLE $table_name (\n slp_repqr_id bigint(20) unsigned NOT NULL auto_increment,\n slp_repq_id bigint(20) unsigned NOT NULL,\n sl_id mediumint(8) unsigned NOT NULL,\n PRIMARY KEY (slp_repqr_id),\n INDEX (slp_repq_id)\n )\n $charset_collate\t\t\t\t\t\t\n \";\n\n // Install or Update the slp_rep_query_results table\n //\n $this->dbupdater($sql,$table_name); \n }", "public function __construct($report_name)\n {\n $timeoff_types = \\App\\Models\\Employee\\TimeoffType::all();\n\n foreach ($timeoff_types as $timeoff_type) {\n $this->report_columns[$timeoff_type->id] = [\n 'color' => $timeoff_type->color,\n 'title' => $timeoff_type->title,\n 'is_bar' => true\n ];\n }\n\n $this->report_columns['total'] = [\n 'color' => '#3598dc',\n 'title' => trans('reports.' . $report_name . '.total'),\n 'is_bar' => false\n ];\n\n parent::__construct($report_name);\n }", "public function setReport(string $report): void\n {\n $this->report = $this->cleanReport($report);\n }", "protected function prepareDetailsTables()\n\t{\n\t}", "private function populateDummyTable() {}", "abstract public function buildReport();", "public function reloadTableNames() {\n\t\t$this->_loadTableNames();\n\t}", "private function _loadTableNames() {\n\t\tif ($this->_cache && $tableNames = $this->_cache->load('rsc_simpledb_tablenames')) {\n\t\t\t$this->_tableNames = $tableNames;\n\t\t}\n\n\t\t$this->_tableNames = $this->_db->listTables();\n\n\t\tif ($this->_cache) {\n\t\t\t$this->_saveTableNamesCache();\n\t\t}\n\t}", "private function getTableNames(){\n $exceptions = array_merge(\n self::EXCEPTION_TABLES,\n explode(\",\",str_replace(' ','',$this->params['exceptions']))\n );\n $exceptions = array_filter($exceptions);\n $this->tables = DB::table('information_schema.tables')->select([\n 'table_name'\n ])->where('table_schema','public')->whereNotIn('table_name',$exceptions)->get();\n }", "public function SetDefaultTable($strName) {\n if(!is_string($strName) || !strlen(trim($strName))) {\n $this->SetGoodToGo(false);\n $this->XaoThrow(\n \"Default database table name needs to be a valid string.\"\n , debug_backtrace()\n );\n return;\n }\n $this->_strTable = trim($strName);\n }", "protected function cleanTableNames() {}", "private function _fetch_table()\n {\n if ($this->_table == NULL)\n {\n $this->_table = plural(preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))));\n }\n }", "Function report1(){\n\n\t}", "Function report1(){\n\n\t}", "private function prepareTables() {}", "public function init()\n {\n \t$this->view->host = $_SERVER[\"HTTP_HOST\"];\n \t$this->view->pdfhost = $_SERVER[\"HTTP_HOST\"];\n \t//$this->view->pdfhost = $this->getFrontController()->getParam('pdfhost');\n \t$this->view->mode = $this->getFrontController()->getParam ('pdfmode');\n\n \tif (Content_Model_School::getReportLayout() == 0){\n\t\t\t$this->_identifier = 'ges_standard';\n \t}\n \telse{\n \t\t$this->_identifier = $this->_frontController->getInstance()->getParam('identifier');\n \t}\n }", "function getReportNameForSelf( $reporttype, $getline ) {\r\n\t\treturn $this->getReportNameForUser( $_SESSION['userid'], $reporttype, $getline );\r\n\t}", "public function setUp() {\n\t\t$this->report = new Report();\n\t}", "abstract public function setTableName();", "public function initTables(): void\n {\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.Surveys');\n $this->Surveys = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyResults');\n $this->SurveyResults = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyEntries');\n $this->SurveyEntries = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyEntryQuestions');\n $this->SurveyEntryQuestions = $table;\n }", "function checkForDefaultSettings(){\n\n if(!isset($this->settings[\"reportTitle\"]))\n $this->settings[\"reportTitle\"] = \"Packing List\";\n\n parent::checkForDefaultSettings();\n\n }", "public function override_dashboard_reports() {\n\t\t// Dummy, to prevent overrides made by ancestor\n\t}", "abstract protected function construct_assigned_table($uniqid = null);", "function printReport() {\n # You need both of these globals!!\n global $report, $page_index;\n\n # This turns the Name Field into a link to the correct contact.\n $report->setFieldRule( 'Account',\n '<a href=\"/ACCT_main_workspace_page.php?content_page='\n . urlencode(\"/py/account/view.pt\")\n . '&args=' . urlencode('account_number=') \n . '%Account\">%Account</a>');\n\n\n # This does the actual printing of the HTML\n $report->printHTML( $page_index );\n}", "private function _fetch_table()\n {\n if (!isset($this->table))\n {\n $this->table = $this->_get_table_name(get_class($this));\n }\n }", "abstract protected function construct_unassigned_table($uniqid = null);", "private function createDummyTable() {}", "protected function table () : string {\n return $this->guessName();\n }", "protected function _initsTable() {}", "public function report()\n {\n }", "function init(){\n\t\t/*\n\t\t * Redefine this object, call parent then use addField to specify which fields\n\t\t * you are going to use\n\t\t */\n\t\tparent::init();\n\t\t$this->table_name = get_class($this);\n\t}", "public function testReportsSkillv1reportsbench()\n {\n\n }", "public static function getReportFileName()\n {\n return Mage::getBaseDir('var') . DS . 'mageuc' . DS . 'codesniffer' . DS . 'report' . DS . 'checkstyle.xml';\n }", "public function reportListing()\n {\n\t$strsql = \"SELECT r.*,rs.* FROM \" . TBL_REPORTS . \" r inner join \" . TBL_REPORTS_SUBMISSION . \" rs on r.report_id=rs.report_id where r.site_id='\" . $_SESSION['site_id'] . \"' and r.report_id='\".$_GET['rid'].\"'\";\n\t$objRs = $this->objDatabase->dbQuery($strsql);\n\tparent:: reportListing($objRs);\n }", "function getAnswerTableName()\n\t{\n\t\treturn \"\";\n\t}", "public function getReport() {}", "public function getReport() {}", "protected static function init()\n\t{\n\t\tif( static::$table === null )\n\t\t{\n\t\t\t// set the table name by Model name\n\t\t\t// Ex: UserModel -> users\n\t\t\tstatic::$table = strtolower( preg_replace('/Model$/', '', get_called_class()) ) . \"s\";\n\t\t}\n\t}", "public function prepareTableName()\n {\n $this->tableName = $this->getOption('tableName');\n\n if (empty($this->tableName)) {\n $this->tableName = $this->modelNames['snake_plural'];\n }\n }", "public function test_the_fm_facade_layout_sets_the_table_name()\n {\n $builder = FM::layout('pet');\n\n $this->assertEquals('pet', $builder->from);\n }", "public function tableNoSel()\n {\n RlDebug::logger(\"SQL query can't be run, it isn't table name selected\", null, null, 'Warning');\n return 'Table not selected, see error log';\n }", "protected static function get_table_name() {\n return null;\n }", "function maybe_load_report( $report ) {\r\n if ( ! $report ) \r\n return false;\r\n\r\n $report_override = $report . '-override.txt';\r\n $report = $report . '.txt';\r\n\r\n if ( file_exists( $report_override ) ) {\r\n return file( $report_override );\r\n } else if ( file_exists( $report ) ) {\r\n return file( $report );\r\n } else {\r\n return false;\r\n }\r\n }", "public function processReports();", "static function get_report_filename($shortname) {\n global $CFG;\n\n //path to the report instance folder\n $base_path = $CFG->dirroot .'/blocks/php_report/instances/';\n\n //name of php file containing report definition\n $class_filename = $shortname . '_report.class.php';\n\n //full file path\n $full_path = $base_path . $shortname . '/' . $class_filename;\n\n return $full_path;\n }", "public function StartReport(){\n $this->AliasNbPages();\n $this->AddPage();\n $this->SetAutoPageBreak(true, 11);\n $this->SetTextColor(0);\n }", "protected function fillTable()\n {\n $names = [\n 'Anna', 'Betty', 'Clara', 'Donna', 'Fiona',\n 'Gertrude', 'Hanna', 'Ione', 'Julia', 'Kara',\n ];\n\n $stm = \"INSERT INTO {$this->table} (name) VALUES (:name)\";\n foreach ($names as $name) {\n $this->connection->perform($stm, ['name' => $name]);\n }\n }", "public static function exportGiudeReport()\n {\n /**\n * TODO\n */\n }", "public function testFailInvalidReportName(): void\n {\n $process = $this->phpbench(\n 'run --report=foobar benchmarks/set4/NothingBench.php'\n );\n $this->assertExitCode(1, $process);\n $this->assertStringContainsString('No generator configuration or service named \"foobar\" exists.', $process->getErrorOutput());\n }", "public function set_table_vars() {\n\t\tglobal $wpdb;\n\n\t\t$this->table = $wpdb->prefix . self::TABLE_NAME;\n\t\t$this->ms_table = $wpdb->base_prefix . self::MS_TABLE_NAME;\n\n\t\t/* Register the snippet table names with WordPress */\n\t\t$wpdb->snippets = $this->table;\n\t\t$wpdb->ms_snippets = $this->ms_table;\n\n\t\t$wpdb->tables[] = self::TABLE_NAME;\n\t\t$wpdb->ms_global_tables[] = self::MS_TABLE_NAME;\n\t}", "public static function getTableName()\n {\n return 'b_report_visual_report_widget';\n }", "function addReport($rptName){\n new Report($rptName, $this->_getParserInstance(), $this->_getConnInstance());\n }", "static function table($newtable = false)\n {\n static $_table;\n\n if (!empty($newtable)) $_table = $newtable;\n\t\tif (empty($_table)) $_table = 'adodb_logsql';\n return $_table;\n }", "function scheduledreporting_component_add_report($report, $userid = 0)\n{\n $reports = scheduledreporting_component_get_reports($userid);\n \n $id = random_string(12);\n $reports[$id] = $report;\n\n scheduledreporting_component_save_reports($reports, $userid);\n\n return $id;\n}", "protected function filename()\n {\n return 'Reports_' . date('YmdHis');\n }", "private function setNames(){\n\t\t\n\t\t$timeName = date('mm-dd-Y_hh-mm', strtotime('now'));\n\t\t\n\t\tswitch ( str_replace(' ','',strtolower($this-company)) ){\n\t\t\t\t\n\t\t\tcase 'customsigncenter' || 'csc':\n\t\t\t\t$this->fname = $timeName.'$csc.xml';\n\t\t\t\t$this->nodeCalId = 'Custom Sign Center';\n\t\t\t\tbreak;\n\t\t\tcase 'outdoorimages' || 'outdoor':\n\t\t\t\t$this->fname = $timeName.'$out.xml';\n\t\t\t\t$this->nodeCalId = 'Outdoor Images';\n\t\t\t\tbreak;\n\t\t\tcase 'boyer' || 'boyersigns':\n\t\t\t\t$this->fname = $timeName.'$boy.xml';\n\t\t\t\t$this->nodeCalId = 'Boyer Signs';\n\t\t\t\tbreak;\n\t\t\tcase 'marionsigns' || 'marion':\n\t\t\t\t$this->fname = $timeName.'$mar.xml';\n\t\t\t\t$this->nodeCalId = 'Marion Signs';\n\t\t\t\tbreak;\n\t\t\tcase 'jgsigns' || 'jg' || 'jgsignservices':\n\t\t\t\t$this->fname = $timeName.'jg.xml';\n\t\t\t\t$this->nodeCalId = 'JG Signs';\n\t\t\tdefault: $this->status .= 'Fatal Error: Company name must be spelled like one of the following:<br>\n\t\t\t\t\t\t\t\t custom sign center, outdoor images, boyer signs, marion signs, jg signs.<br>\n\t\t\t\t\t\t\t\t Exiting.';\n\t\t\t\texit($this->status);\n\t\t}\t\t\n\t\t\n\t}", "public function setup_table() {\n /*\n * Table has 3 columns\n *| course | final grade | rank (optional) |\n */\n\n // setting up table headers\n $tablecolumns = array('studentname', 'activityname', 'failedgrade', 'gradetopass');\n $tableheaders = array($this->get_lang_string('studentname', 'gradereport_failed'),\n $this->get_lang_string('activityname','gradereport_failed'),\n $this->get_lang_string('finalgrade', 'gradereport_failed'),\n\t\t$this->get_lang_string('gradetopass', 'gradereport_failed'));\n\t\t\n $this->table = new flexible_table('grade-report-failed-10');\n\n $this->table->define_columns($tablecolumns);\n $this->table->define_headers($tableheaders);\n $this->table->define_baseurl($this->baseurl);\n\n $this->table->set_attribute('cellspacing', '0');\n $this->table->set_attribute('id', 'failed-grade');\n $this->table->set_attribute('class', 'boxaligncenter generaltable');\n\n $this->table->setup();\n }", "function get_report_sql_groups() {\n return '';\n }", "private function setTable()\n {\n if (is_null($this->table)) {\n $this->table = $this->getTableName();\n }\n }", "public function isReport()\n {\n return $this->getName() === 'report';\n }", "protected function filename() {\n return 'Passport_report_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'verifydatatables_' . time();\n }", "public function getDefaultTableName(): string\n {\n return \\implode('_', \\array_map(function ($element) {\n return Str::plural($element);\n }, \\array_merge(\n \\is_null($this->getModelGroup()) ? [] : \\explode('_', $this->getModelGroup()),\n ['pivot'],\n \\explode('_', $this->modelName),\n )));\n }", "public function insertReport($name, $report, $userid, $affiliationid) {\n $this->sdb->query('insert into reports (name, report, user_id, affiliation_id) values\n ($1, $2, $3, $4)', array($name, $report, $userid, $affiliationid));\n }", "protected function _saveTableNamesCache() {\n\t\tif (!$this->_cache) {\n\t\t\treturn;\n\t\t}\n\n\t\t// store table list for 12 hours\n\t\t$this->_cache->save($this->_tableNames, 'rsc_simpledb_tablenames', array(), 43200);\n\t}", "public function report()\n {\n // TODO: Implement report() method.\n }", "function writeReportForAll()\t{\n\t\tGLOBAL $LANG;\n\n\t\t@ob_end_clean();\n\t\tob_start();\n\t\t$startTime = time();\n\t\techo '<h2>'.$LANG->getLL('report_translation_status').' '.t3lib_BEfunc::dateTime(time()).'</h2>';\n\n\t\t$details = $header = '';\n\n\t\t$header.= '<tr>\n\t\t<td><b>'.$LANG->getLL('report_language').'</b></td>\n\t\t<td><b>'.$LANG->getLL('report_langkey').'</b></td>\n\t\t<td><b>'.$LANG->getLL('report_label_mising').'</b></td\n\t\t<td><b>'.$LANG->getLL('report_complete').'</b></td>\n\t\t<td><b>'.$LANG->getLL('report_missing').'</b></td>\n\t\t<td><b>'.$LANG->getLL('report_download').'</b></td>\n\t\t</tr>';\n\t\t\t// Find all files:\n\t\t$files = array();\n\t\tforeach($this->extPathList as $path)\t{\n\t\t\t$files = array_merge($files, $this->getllxmlFiles(PATH_site . $path));\n\t\t}\n\n\t\tt3lib_div::loadTCA('be_users');\n\t\tforeach($GLOBALS['TCA']['be_users']['columns']['lang']['config']['items'] as $pair)\t{\n\t\t\tif ($pair[1])\t{\n\t\t\t\t\t// Re-generate status\n\t\t\t\t$this->MOD_SETTINGS['editLang'] = $pair[1];\n\t\t\t\t$statInfo = $this->loadTranslationStatus($files, true);\n\n\t\t\t\t$header.= '<tr>\n\t\t\t\t<td><a href=\"#'.$pair[1].'\">'.$pair[0].'</a></td>\n\t\t\t\t<td>'.$pair[1].'</td>\n\t\t\t\t<td>'.$statInfo['Labels missing translation'].'</td>\n\t\t\t\t<td>'.round(100-$statInfo['Labels missing translation']/($statInfo['Labels missing translation']+$statInfo['labels']['ok'])*100).'%</td>\n\t\t\t\t<td>'.($statInfo['csh']['new']+$statInfo['csh']['changed']+$statInfo['csh']['unknown']).'</td>\n\t\t\t\t<td>'.\n\t\t\t\t\t(@is_file(PATH_site.'typo3conf/l10n/'.$pair[1].'.zip') ? '<a href=\"'.$pair[1].'.zip\">'.$pair[1].'.zip</a> ' : '').\n\t\t\t\t\t(@is_file(PATH_site.'typo3conf/l10n/'.$pair[1].'.tgz') ? '<a href=\"'.$pair[1].'.tgz\">'.$pair[1].'.tgz</a> ' : '').\n\t\t\t\t\t'</td>\n\t\t\t\t</tr>';\n\n\n\t\t\t\t$details.= '<h3 id=\"'.$pair[1].'\">'.$pair[0].' ('.$pair[1].')</h3>';\n\n\t\t\t\tif (class_exists('t3lib_utility_Debug')) {\n\t\t\t\t\t$details .= t3lib_utility_Debug::viewArray($statInfo);\n\t\t\t\t} else {\n\t\t\t\t\t$details .= t3lib_div::view_array($statInfo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\t// Output:\n\t\techo '<table border=\"1\">'.$header.'</table>';\n\t\techo '<h3>'.$LANG->getLL('report_files').'</h3>';\n\t\tt3lib_utility_Debug::debug($files);\n\t\techo $details;\n\n\t\techo '<hr>'.sprintf($LANG->getLL('report_files'),floor((time()-$startTime)/60),((time()-$startTime)%60));\n\n\t\t// Output:\n\t\t$output = ob_get_contents().chr(10);\n\t\tob_end_clean();\n\n\t\treturn $output;\n\t}", "protected function filename()\n {\n return 'examensdatatable_' . time();\n }", "function quiz_report_default_report($context) {\n return reset(quiz_report_list($context));\n}", "public function initialize()\n {\n $this->belongsTo('report_id', 'HdUserAutoReport', 'id', array('alias' => 'HdUserAutoReport'));\n }", "function buildlangfileRSVTb($dbinuse){\t\t\t\t\t\t\t\t\t\t\t\t\t\n $sql_available_tables=\"show tables\"; \n $results=mysql_query( $sql_available_tables);\n\t$cntreg=mysql_num_rows($results); \n\nif ($cntreg>0){ \n \n while($count=mysql_fetch_array($results)){ \n\t\t\t$table_name=$count[0]; \n\t\t\t//echo $table_name.'<br>'; \n\t\t\t$sqltbcols=\"Show columns from $table_name\"; \n\t\t\t$results_tbc=mysql_query($sqltbcols);\n\t $cnt_cols=mysql_num_rows($results_tbc); \n\t\t\twhile($count_cls=mysql_fetch_array($results_tbc)){\n\t\t\t $table_col_Name=$count_cls['Field']; \n\t\t\t $table_col_Type=$count_cls['Type']; \n\t\t\t $table_col_Null=$count_cls['Null'];\n\t\t\t \n\n \n\t\t\t} echo '$_SESSION'.\"['\".$table_name.\"']='\".$table_name.\"'; <br>\";\n \n} //end while\n} //end if\n}", "public function setObjReport($dataReport)\n { \n $this->dataReport = $dataReport;\n $this->spreadsheet = new Spreadsheet(); \n }", "abstract protected function getTableName();", "abstract protected function getTableName();", "function runReport (){\n\t\tif(!empty($this->params['form']))\n\t\t{\n\t\t\tif($this->params['form']=='allData'){\n\t\t\t\tindex();\n\t\t\t}else {\n\t\t\t\tindex();\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t}" ]
[ "0.62320596", "0.6183658", "0.60234815", "0.5959017", "0.59370863", "0.5846803", "0.58190644", "0.58131236", "0.5735573", "0.57320434", "0.5717014", "0.5658755", "0.56480473", "0.5629274", "0.56178766", "0.550497", "0.550497", "0.550394", "0.5487549", "0.545146", "0.5447515", "0.5443711", "0.5429116", "0.5428618", "0.5425294", "0.54100657", "0.5409572", "0.53587615", "0.53384715", "0.53278935", "0.53100455", "0.52997094", "0.52854675", "0.5283561", "0.527308", "0.52712876", "0.5267406", "0.5246735", "0.5238762", "0.5238762", "0.5230169", "0.5223439", "0.52154094", "0.5214274", "0.52065516", "0.5204831", "0.5198674", "0.51974577", "0.518026", "0.516045", "0.5157315", "0.5149433", "0.51419604", "0.51307666", "0.51252496", "0.5109546", "0.51067436", "0.5091485", "0.50896126", "0.5088267", "0.5080196", "0.50755805", "0.50755805", "0.50713557", "0.50707686", "0.5066317", "0.5063856", "0.50546354", "0.50439966", "0.5037853", "0.50355023", "0.5034212", "0.5020502", "0.50135285", "0.5012942", "0.50076056", "0.5007345", "0.5001952", "0.49928012", "0.49796146", "0.49745572", "0.49709624", "0.4967265", "0.49383533", "0.4934596", "0.49328926", "0.49328095", "0.49310976", "0.4919834", "0.491845", "0.49146515", "0.49011034", "0.48998258", "0.48937044", "0.48891932", "0.4870333", "0.48680502", "0.4860913", "0.48532072", "0.48532072", "0.48528782" ]
0.0
-1
/ params format [ first_name last_name phoneNumber trakr_id user_id ]
public static function checkIfLoggedIn($conditions){ $firstname = isset($conditions['first_name']) ? $conditions['first_name'] : ""; $lastname = isset($conditions['last_name']) ? $conditions['last_name'] : ""; $phoneNumber = isset($conditions['phoneNumber']) ? $conditions['phoneNumber'] : ""; $trakr_id = isset($conditions['trakr_id']) ? $conditions['trakr_id'] : ""; $user_id = isset($conditions['user_id']) ? (int)$conditions['user_id'] : ""; $returndata = []; // DB::enableQueryLog(); $checker_query = Trakr::select('checked_in_status' , 'check_in_date','check_out_date' , 'id as visitor_id' , 'firstName') ->where('user_id' ,$user_id) ->when($firstname, function ($query , $firstname) { return $query->where('firstName' , $firstname); }) ->when($lastname , function ($query , $lastname){ return $query->where('lastName' , $lastname); }) ->when($phoneNumber , function ($query , $phoneNumber){ return $query->where('phoneNumber' , $phoneNumber); }) ->when($trakr_id , function ($query , $trakr_id){ return $query->whereRaw("BINARY trakr_id = '$trakr_id' "); })->first(); if ($checker_query) { $returndata['visitor_id'] = $checker_query->visitor_id; $returndata['is_loggedin'] = $checker_query->checked_in_status; $returndata['check_date'] = $checker_query->check_in_date; $returndata['check_out_date'] = $checker_query->check_out_date; $returndata['firstName'] = $checker_query->firstName; $returndata['has_record'] = true; return $returndata; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requestFirstname();", "public function requestSurname();", "function getPersonName($user) {\n if ($user==null || (!isset($user[\"lastname\"]) && !isset($user[\"firstname\"])) )\n return '';\n $ret =\"\";\n if (isset($user[\"title\"]))\n $ret = $user[\"title\"].' ';\n $ret .= $user[\"lastname\"].\" \".$user[\"firstname\"];\n if (isset($user[\"birthname\"]) && trim($user[\"birthname\"])!=\"\")\n $ret .= \" (\".trim($user[\"birthname\"]).\")\";\n return $ret;\n}", "function userInfo($fname, $lname, $country, $age)\n{\n $fullname = $fname + $lname; // Ovde pravimo promenljivu u kojoj cuvamo puno ime\n $details = $fullname . ' is from ' . $country . ' and is ' . $age . ' years old ';\n return $details; // I na kraju obavezno idemo return details\n}", "function showProfile ($parm1='re') {\n global $edProfPrmpt;\n $redStar = \"<font color='red'>*</font>\";\n print \"<form action='?action=\".$_GET['action'].\"' method='POST'>\\n<table>\\n\";\n if ($parm1 == \"re\") {\n print \"<tr><td> </td><td><br/>Fields marked with $redStar are required.<br/></td></tr>\\n\";\n }\n print \"<tr><td><br/><br/></td></tr>\\n\";\n print \"<tr><td>Full Name(s)\";\n if ($parm1 == \"re\") { print \" $redStar\"; }\n print \": </td><td colspan='2'><input name='fullname' size='30' maxlength='255' value='\".$_POST['fullname'].\"'></td></tr>\\n\";\n print \"<tr><td>Address: </td><td colspan='2'><input name='address' size='48' maxlength='255' value='\".$_POST['address'].\"'></td></tr>\\n\";\n print \"<tr><td>City: </td><td colspan='2'><input name='city' size='48' maxlength='255' value='\".$_POST['city'].\"'></td></tr>\\n\";\n print \"<tr><td>State, Country, Zip: </td><td colspan='2'>\n <input name='state' size='3' maxlength='255' value='\".$_POST['state'].\"'> &nbsp; \n <input name='country' size='12' maxlength='255' value='\".$_POST['country'].\"'> &nbsp;\n <input name='zip' size='9' maxlength='255' value='\".$_POST['zip'].\"'></td></tr>\\n\";\n print \"<tr><td>Phone: </td><td><input name='phone' size='12' maxlength='255' value='\";\n if (strlen($_POST['phone']) > 1) { print formatPhone($_POST['phone']); }\n print \"'></td></tr>\\n\";\n print \"<tr><td>Email Address\";\n if ($parm1 == \"re\") { print \" $redStar\"; }\n print \": </td><td colspan='2'><input name='email' size='30' maxlength='255' value='\".$_POST['email'].\"'></td></tr>\\n\";\n print \"<tr><td>Website: </td><td colspan='2'><input name='website' size='48' maxlength='255' value='\".$_POST['website'].\"'></td></tr>\\n\";\n print \"<tr><td>Boat Name: </td><td colspan='2'><input name='boatname' size='48' maxlength='255' value='\".$_POST['boatname'].\"'></td></tr>\\n\";\n print \"<tr><td>Hailing Port: </td><td colspan='2'><input name='hailingport' size='48' maxlength='255' value='\".$_POST['hailingport'].\"'></td></tr>\\n\";\n print \"<tr><td><br/><br/></td></tr>\\n\";\n if ($parm1 != \"ep\") { # Can't change uid once set in create account\n print \"<tr><td>Username\";\n if ($parm1 == \"re\") { print \" $redStar\"; }\n print \": </td><td><input name='username' size='14' value='\".$_POST['username'].\"'></td>\"; \n # gotta have this one in here... Only new accounts need a unique username - it's the record key.\n if (($_POST['submit'] == \"Create Account\") || ($_GET['action'] == \"register\")) {\n print \"<td><input type='submit' name='submit' value='check for availability'></td>\";\n }\n print \"</tr>\\n\";\n }\n print \"<tr><td>Password\";\n if ($parm1 == \"re\") { print \" $redStar\"; }\n print \": </td>\n <td><input name='password' size='14' value='\".$_POST['password'].\"' type='password'></td>\n <td>again: <input name='password2' size='14' value='\".$_POST['password2'].\"' type='password'> </td></tr>\\n\";\n if ($parm1 == \"ep\") {\n print \"<tr><td>&nbsp;</td><td><input type='submit' name='submit' value='$edProfPrmpt'></td></tr>\\n\"; }\n if ($parm1 == \"re\") {\n print \"<tr><td><br/><br/></td></tr>\\n\";\n print \"<tr><td>Enter the letters:</td><td colspan='2'><input name='captcha' size='12'>&nbsp; &nbsp;\" . showCaptchaImage(). \"</td></tr>\\n\";\n print \"<tr><td>&nbsp;</td><td><input type='submit' name='submit' value='Register'></td><td>$spc <input type='submit' name='foo' value='Click here if letters are unreadable'></td></tr>\\n\";\n }\n print \"</table>\\n</form>\\n\";\n}", "function get_profile_lname($lname){\r\n\t\r\n}", "function get_profile_fname($fname){\r\n\t\r\n}", "function add_usr($fname, $lname, $email, $pass, $usrnm, $typ){\r\n\r\n}", "function tagline(){\r\n if($_GET['url']=='tagline'){\r\n $msg=\"\";\r\n $flag=true;\r\n if(!$_GET[\"fname1\"]) {\r\n $msg.=\"First Name Can't Be Empty<br/>\";\r\n $flag=false;\r\n }\r\n if(!$_GET[\"fname1\"]) {\r\n $msg.=\"Last Name Can't Be Empty<br/>\";\r\n $flag=false;\r\n }\r\n if(!$flag) {\r\n $_SESSION['profile_error']=$msg;\r\n header(\"location:\".ROOTPATH.\"/index.php?controller=profile\");\r\n return false;\r\n }\r\n \t$arrArgs=array(\r\n\t 'about_myself'=>strip_tags(@$_GET[\"about\"]),\r\n\t 'fname'=>strip_tags(@$_GET[\"fname1\"]),\r\n\t 'lname'=>strip_tags(@$_GET[\"lname1\"]),\r\n\t );\r\n print_r($arrArgs);\r\n $arrData=loadModel(\"personalprofile\",\"insertabout\",$arrArgs);\r\n\theader(\"location:\".ROOTPATH.\"/index.php?controller=profile\");\r\n\r\n }\r\n\r\n\t}", "function convertFields($recipRow) {\n\n\t\t\t// Compensation for the fact that fe_users has the field 'telephone' instead of 'phone'\n\t\tif ($recipRow['telephone'])\t{\n\t\t\t$recipRow['phone'] = $recipRow['telephone'];\n\t\t}\n\n\t\t\t// Firstname must be more that 1 character\n\t\t$recipRow['firstname'] = trim(strtok(trim($recipRow['name']), ' '));\n\t\tif (strlen($recipRow['firstname']) < 2 || preg_match('|[^[:alnum:]]$|', $recipRow['firstname'])) {\n\t\t\t$recipRow['firstname'] = $recipRow['name'];\n\t\t}\n\t\tif (!trim($recipRow['firstname'])) {\n\t\t\t$recipRow['firstname'] = $recipRow['email'];\n\t\t}\n\t\treturn $recipRow;\n\t}", "private function formatParams($params) {\n\t\t$code = ltrim(gv($params, 'code'), '0');\n\n\t\tif (!isInteger($code)) {\n\t\t\tthrow ValidationException::withMessages(['code' => trans('validation.integer', ['attribute' => trans('employee.form.code')])]);\n\t\t}\n\n\t\t$prefix = gv($params, 'prefix');\n\n\t\tif ($this->employee->filterByCode($code)->filterByPrefix($prefix)->count()) {\n\t\t\tthrow ValidationException::withMessages(['code' => trans('employee.code_exists')]);\n\t\t}\n\t\t$marital_status = gv($params, 'marital_status');\n\t\tif ($marital_status == 'married') {\n\t\t\t$anniversary_date = gv($params, 'anniversary_date');\n\t\t\t$spouse_name = gv($params, 'spouse_name');\n\t\t} else {\n\t\t\t$anniversary_date = Null;\n\t\t\t$spouse_name = Null;\n\t\t}\n\t\t$same_as_present_address = gbv($params, 'same_as_present');\n\t\t$name = gv($params, 'name');\n\t\t$photo = gv($params, 'photo');\n\t\t$upload_photo = upload_file($photo, $name, 'employee/photo');\n\n\t\t$formatted = [\n\t\t\t'uuid' => Str::uuid(),\n\t\t\t'branch_id' => gv($params, 'branch_id'),\n\t\t\t'prefix' => gv($params, 'prefix'),\n\t\t\t'code' => gv($params, 'code'),\n\t\t\t'name' => gv($params, 'name'),\n\t\t\t'joining_date' => gv($params, 'joining_date'),\n\t\t\t'photo' => $upload_photo,\n\t\t\t'date_of_birth' => gv($params, 'date_of_birth'),\n\t\t\t'anniversary_date' => $anniversary_date,\n\t\t\t'gender' => gv($params, 'gender'),\n\t\t\t'marital_status' => $marital_status,\n\t\t\t'mobile_no' => gv($params, 'mobile_no'),\n\t\t\t'phone_no' => gv($params, 'phone_no'),\n\t\t\t'email' => gv($params, 'user_email'),\n\t\t\t'alternate_email' => gv($params, 'alternate_email'),\n\t\t\t'nationality_id' => gv($params, 'nationality_id'),\n\t\t\t'blood_group_id' => gv($params, 'blood_group_id'),\n\t\t\t'religion_id' => gv($params, 'religion_id'),\n\t\t\t'category_id' => gv($params, 'category_id'),\n\t\t\t'caste_id' => gv($params, 'caste_id'),\n\t\t\t'nid_no' => gv($params, 'nid_no'),\n\t\t\t'birth_certificate_no' => gv($params, 'birth_certificate_no'),\n\t\t\t'father_name' => gv($params, 'father_name'),\n\t\t\t'mother_name' => gv($params, 'mother_name'),\n\t\t\t'spouse_name' => $spouse_name,\n\t\t\t'emergency_contact_name' => gv($params, 'emergency_contact_name'),\n\t\t\t'emergency_contact' => gv($params, 'emergency_contact'),\n\t\t\t'present_house' => gv($params, 'present_house'),\n\t\t\t'present_road' => gv($params, 'present_road'),\n\t\t\t'present_village' => gv($params, 'present_village'),\n\t\t\t'present_post' => gv($params, 'present_post'),\n\t\t\t'present_upozila' => gv($params, 'present_upozila'),\n\t\t\t'present_district' => gv($params, 'present_district'),\n\t\t\t'present_postcode' => gv($params, 'present_postcode'),\n\t\t\t'same_as_present' => gbv($params, 'same_as_present'),\n\t\t\t'height' => gv($params, 'height'),\n\t\t\t'weight' => gv($params, 'weight'),\n\t\t\t'mark' => gv($params, 'mark'),\n\t\t\t'permanent_house' => !$same_as_present_address ? gv($params, 'permanent_house') : '',\n\t\t\t'permanent_road' => !$same_as_present_address ? gv($params, 'permanent_road') : '',\n\t\t\t'permanent_village' => !$same_as_present_address ? gv($params, 'permanent_village') : '',\n\t\t\t'permanent_post' => !$same_as_present_address ? gv($params, 'permanent_post') : '',\n\t\t\t'permanent_upozila' => !$same_as_present_address ? gv($params, 'permanent_upozila') : '',\n\t\t\t'permanent_district' => !$same_as_present_address ? gv($params, 'permanent_district') : '',\n\t\t\t'permanent_postcode' => !$same_as_present_address ? gv($params, 'permanent_postcode') : '',\n\t\t];\n\n\t\t$formatted['options'] = [];\n\n\t\treturn $formatted;\n\t}", "function kino_user_fields_logement( $user, $kino_fields ) {\n\n\t$kino_userid = $user->ID ;\n\n if ( empty( $kino_fields ) ) {\n $kino_fields = kino_test_fields();\n }\n \n $kino_user_participation = kino_user_participation( \n \t$kino_userid, \n \t$kino_fields\n );\n \n\t$kino_userdata = array(\n \"user-id\" => $kino_userid,\n \"user-name\" => $user->display_name,\n \"user-slug\" => $user->user_nicename,\n \"user-email\" => $user->user_email,\n \"user-registered\" => $user->user_registered,\n \"participation\" => $kino_user_participation,\n \"cherche-logement-remarque\" => bp_get_profile_field_data( array(\n 'field' => $kino_fields['cherche-logement-remarque'],\n 'user_id' => $kino_userid\n ) ),\n \"offre-logement-remarque\" => bp_get_profile_field_data( array(\n 'field' => $kino_fields['offre-logement-remarque'],\n 'user_id' => $kino_userid\n ) ),\n \"offre-logement-nb\" => bp_get_profile_field_data( array(\n 'field' => $kino_fields['offre-logement-nb'],\n 'user_id' => $kino_userid\n ) ),\n \"rue\" => bp_get_profile_field_data( array(\n 'field' => $kino_fields[\"rue\"],\n 'user_id' => $kino_userid\n ) ),\n \"ville\" => bp_get_profile_field_data( array(\n 'field' => $kino_fields[\"ville\"],\n 'user_id' => $kino_userid\n ) ),\n \"code-postal\" => bp_get_profile_field_data( array(\n 'field' => $kino_fields[\"code-postal\"],\n 'user_id' => $kino_userid\n ) ),\n \"pays\" => bp_get_profile_field_data( array(\n 'field' => $kino_fields[\"pays\"],\n 'user_id' => $kino_userid\n ) ),\n \"tel\" => bp_get_profile_field_data( array(\n 'field' => $kino_fields[\"tel\"],\n 'user_id' => $kino_userid\n ) ),\n \"dispo\" => bp_get_profile_field_data( array(\n 'field' => $kino_fields[\"dispo\"],\n 'user_id' => $kino_userid\n ) ),\n \"dispo-partiel\" => bp_get_profile_field_data( array(\n 'field' => $kino_fields[\"dispo-partiel\"],\n 'user_id' => $kino_userid\n ) ),\n );\n\t\n\treturn $kino_userdata;\n\n}", "public function generateUserByFullName() {\n\n\t\t$fullName = 'Alberto Rosa Asencio';\n\n $user = null;\n $temp = explode(' ', $fullName);\n if (count($temp) > 0)\n {\n $allowedVars = null;\n foreach ($temp as $value)\n {\n if (strlen($value) > 3)\n {\n $allowedVars[] = $value;\n }\n }\n }\n $vars['FN'] = $allowedVars[0];\n $vars['FI'] = substr($allowedVars[0], 0, 1);\n \n $vars['MN'] = $allowedVars[1];\n $vars['MI'] = substr($allowedVars[1], 0, 1);\n \n if (isset($allowedVars[2]))\n {\n $vars['SN'] = $allowedVars[2];\n $vars['SI'] = substr($allowedVars[2], 0, 1);\n }\n if (isset($allowedVars[3]))\n {\n $vars['LN'] = $allowedVars[3];\n $vars['LI'] = substr($allowedVars[3], 0, 1);\n }\n \n $variants = array('FN', 'MN', 'SN', 'LN', 'FI', 'MI', 'SI', 'LI');\n \t//posibles variantes a seguir, que se utilizarán de forma aleatoria o que se prefiera\n $allowedConbinations = array(\n '0.1',\n '0.2',\n '0.3',\n '0.4',\n '3.4',\n '2.3.4',\n '3.2.4',\n '0.2',\n '0.3',\n '0.2.3',\n '2.0',\n '3.0',\n '2.3.0',\n '3.2.0',\n '0.6',\n '0.7',\n '0.6.7',\n '6.7.0',\n '7.6.0',\n '1.6.7',\n '6.7.1',\n '7.6.1',\n '5.2.3',\n '2.3.5',\n '3.2.5',\n '2.3.1',\n '3.2.1',\n '1.2.3',\n '5.2',\n '5.3',\n '2.5',\n '3.5',\n '1.2',\n '1.3',\n '2.1',\n '3.1',\n '1.6',\n '1.7',\n '4.5.2',\n '2.4.5',\n '4.5.3',\n '3.4.5',\n '4.5.2.3',\n '2.3.4.5',\n '3.2.4.5',\n );\n \n $runVariants = explode('.', $allowedConbinations[rand(0, count($allowedConbinations) - 1)]);\n if (count($runVariants) > 0)\n {\n $user = '';\n foreach ($runVariants as $value)\n {\n if (isset($vars[$variants[$value]]))\n {\n if(strlen($user) <= 12)\n {\n $user.= $vars[$variants[$value]];\n }\n }\n }\n }\n echo $user;\n }", "function rfc($params) \r\n {\r\n \r\n \t$defaultParams = array(\r\n \t\t'nombre'\t\t=> '',\r\n\t\t\t\t'fecha'\t\t\t=> '',\r\n\t\t\t\t'personaFisica'\t=> true,\r\n\t\t\t\t'soloHomoclave'\t=> false,\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$params = array_merge($defaultParams,$params);\r\n\t\t\t\r\n\t\t\t$nombre\t\t\t= $params['nombre'];\r\n\t\t\t$fecha \t\t\t= $params['fecha'];\r\n\t\t\t$personaFisica \t= $params['personaFisica'];\r\n\t\t\t$soloHomoclave \t= $params['soloHomoclave'];\r\n\t\t\t\r\n if ($personaFisica) \r\n {\r\n \t//Procesamos el nombre completo para obtener los apellidos\r\n \t$this->nombre = $this->QuitarArticulos(strtoupper(trim($nombre)));\r\n \t$arr_nombres = explode(\" \", $this->nombre);\r\n \t$num_nombres = count($arr_nombres);\r\n \t//Si hay menos de 2 elementos devolvemos un RFC INVALIDO\r\n \tif ($num_nombres < 2)\r\n \t{\r\n\t \t$this->rfc = \"DATOS INVALIDOS\";\r\n\t \treturn;\r\n \t}\t\r\n \t//Si hay 3 elementos el primero es el nombre\r\n \tif ($num_nombres == 3)\r\n \t{\r\n\t \t$this->nombre = $arr_nombres[0] ;\r\n\t \t$this->apellidoPaterno = $arr_nombres[1];\r\n\t \t$this->apellidoMaterno = $arr_nombres[2];\r\n \t}\r\n \telse \r\n \t{\r\n \t\t//Si hay mas 3 elementos asumimos que los primeros dos son los nombres\r\n \t\t//el tercero el apellido paterno y los demas el apellido materno\r\n\t \t$this->nombre = array_shift($arr_nombres) . \" \" . array_shift($arr_nombres);\r\n\t \t$this->apellidoPaterno = array_shift($arr_nombres);\r\n\t \t$this->apellidoMaterno = implode(\" \", $arr_nombres);\r\n \t}\r\n\t //Quitamos los artículos de los apellidos \r\n\t\t\t\t$this->nombreProcesado = $this->apellidoPaterno . \" \" . $this->apellidoMaterno . \" \" . $this->QuitaNombreComun($this->nombre);\r\n\t\t\t\t//Agregamos el primer caracter del apellido paterno \r\n\t\t\t\t$this->rfc = substr($this->apellidoPaterno, 0, 1); \r\n\t\t\t\t//Buscamos y agregamos al rfc la primera vocal del primer apellido \r\n\t\t\t\tfor($i = 1; $i < strlen($this->apellidoPaterno); $i++) \r\n\t\t\t\t{ \r\n \t\t$c = $this->apellidoPaterno[$i]; \r\n\t\t\t \t\tif ($this->EsVocal($c)) \r\n\t\t\t \t\t{ \r\n \t$this->rfc .= $c; \r\n\t\t\t\t\t\tbreak; \r\n\t\t\t\t\t} \r\n\t\t\t\t} \r\n\t\t\t\t//Agregamos el primer caracter del apellido materno \r\n\t\t\t\t$this->rfc .= substr($this->apellidoMaterno, 0, 1);\r\n\t\t\t\t//Agregamos el primer caracter del primer nombre, o los 2 primeros en caso de no haber apellido materno \r\n\t\t\t\t$this->rfc .= substr($this->QuitaNombreComun($this->nombre), 0, $this->apellidoMaterno ? 1 : 2); \r\n\t\t\t\t//Revisamos es una \"palabra mala\" \r\n\t\t\t\t$this->rfc = $this->QuitaPalabraMala($this->rfc); \r\n }\r\n\t\t\telse //Persona Moral\r\n\t\t\t{\r\n\t\t\t\t$this->nombre = strtoupper(trim($nombre));\r\n\t\t\t\t//Quitamos el S.A., A.C., etc.\r\n\t\t\t\t$pos = strpos($this->nombre, '.') - 1;\r\n\t\t\t\t$this->nombreProcesado = rtrim(substr($this->nombre, 0, $pos));\r\n\t\t\t\t//Agregamos los primeros tres caracteres de la razon social \r\n\t\t\t\t$this->rfc = substr($this->nombreProcesado, 0, 3); \r\n\t\t\t}\r\n \r\n \r\n /* Agregamos la fecha dd-mm-yyyy (por ejemplo: 25-08-1968 = 25 de agosto de 1968); \r\n por si las dudas, ponemos un cero a la izquierda de los meses y dias < 10 */ \r\n $efecha = explode(\"-\", $fecha);\r\n $ano = $efecha[2];\r\n $mes = $efecha[1];\r\n $dia = $efecha[0];\r\n $efecha[0] = substr($ano, 2, 2); \r\n $efecha[1] = str_pad($mes, 2, '0', STR_PAD_LEFT); \r\n $efecha[2] = str_pad($dia, 2, '0', STR_PAD_LEFT); \r\n $fecha = implode(\"\", $efecha); \r\n $this->rfc .= $fecha; \r\n \r\n $homoclave = '';\r\n //Le agregamos la homoclave al rfc \r\n if ($personaFisica) \r\n\t\t\t\t$homoclave = $this->CalcularHomoclave($this->apellidoPaterno . \" \" . $this->apellidoMaterno . \" \" . $this->nombre); \r\n\t\t\telse\r\n\t\t\t\t$homoclave = $this->CalcularHomoclave($this->nombreProcesado);\r\n\t\t\tif(!$soloHomoclave) \r\n $this->rfc .= $homoclave; \r\n\t\t\telse \r\n $this->rfc = $homoclave;\r\n }", "function get_user_details($username)\n {\n }", "function kino_user_fields_kabaret( $user, $kino_fields ) {\n\n\t$kino_userid = $user->ID ;\n\n if ( empty( $kino_fields ) ) {\n $kino_fields = kino_test_fields();\n }\n \n $kino_user_participation_role = kino_user_participation( \n \t$kino_userid, \n \t$kino_fields\n );\n \n\t$kino_userdata = array(\n \"user-id\" => $kino_userid,\n \"user-name\" => $user->display_name,\n \"user-slug\" => $user->user_nicename,\n \"user-email\" => $user->user_email,\n \"user-registered\" => $user->user_registered,\n \"participation\" => $kino_user_participation_role\n );\n\t\n\treturn $kino_userdata;\n\n}", "public function add_user_get(){\r\n if (!$this->pronet_model->add_user('Fname Lname', '7711223344553', '[email protected]', '31111225', '1990-01-01','134091830-2')) {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "function printUserInput($userInput)\n{\n\techo \"Ihr Vorname lautet: \" . $userInput['firstName'] . \"<br>\";\n\techo \"Ihr Nachname lautet: \" . $userInput['lastName'] . \"<br>\";\n\techo \"Ihr Username lautet: \" . $userInput['userName'] . \"<br>\";\n\techo \"Ihre Email lautet: \" . $userInput['email'] . \"<br>\";\n\techo \"Ihr Passwort lautet: Hm, hoffentlich haben Sie es sich gemerkt <br>\";\n\techo \"Ihr liebstes Reiseziel ist: \" . $userInput['travelDestination']. \"<br>\";\n\techo \"Sie haben folgendes Haustier angegeben: \" . $userInput['pet'] . \"<br>\";\n\tif(!empty ($userInput['isStupid'])) echo \"Sie finden diese Fragen ganz schön doof! <br>\";\n\telse echo \"Sie finden diese Fragen offensichtlich ganz normal <br> \";\t\t\n\techo \"Sie haben sich registriert am \" . $userInput['dateOfRegistration'] . \" um \" . $userInput['timeOfRegistration'] . \"<br>\";\n\techo \"Ihre Registrierung ist 30 Tage gültig, also bis zum \" . $userInput['dateRegistrationExpires'] . \n\t\" um \" . $userInput['timeRegistrationExpires'] . \"<br>\";\n}", "function _process_user_info()\n\t{\n\t\t$user_info = null;\n\t\t$code = $this->input->get('code');\n\n\t\t//Google redirects with code insead of post\n\t\tif( $code )\n\t\t{\n\t\t\t$user_info = get_user_info( $this->input->get('code') );\n\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$user_info['email'] = trim($this->input->post('email'));\n\t\t\t$user_info['username'] = trim($this->input->post('username'));\n\t\t}\n\n\t\treturn $user_info;\n\t}", "public function getUserByPhone($phone);", "public function validateUserParam($p){\n\t\t\treturn (preg_match(\"/^user_id=[0-9]+$/\", $p) || preg_match(\"/^screen_name=[0-9a-zA-Z_]+$/\", $p));\n\t\t}", "public function __construct($firstname, $lastname, $userpass)\n {\n $this->firstname = $firstname;\n $this->lasttname = $lastname;\n $this->userpass = $userpass;\n }", "function validate_phone($phone=null,$email_used_user_id=null,$first_name=null,$last_name=null){\r\n\t\tif($phone==null)return false;\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('telephone_no'=>$phone));\r\n\t\tif(isset($email_used_user_id) && $email_used_user_id!=null && $email_used_user_id!=''){ \r\n\t\t\t$array = array('id!'=>$email_used_user_id);\r\n\t\t\t$this->db->where($array); \r\n\t\t}\t\r\n\t\tif(isset($first_name) && $first_name!=null && $first_name!=''){ \r\n\t\t\t$array = array('first_name' =>$first_name);\r\n\t\t\t$this->db->where($array); \r\n\t\t}\t\r\n\t\tif(isset($last_name) && $last_name!=null && $last_name!='' ){ \r\n\t\t\t$array = array('last_name' =>$last_name);\r\n\t\t\t$this->db->where($array); \r\n\t\t}\t\r\n\t\t$recordSet = $this->db->get(TBL_MST_USERS_Information);\t\r\n\t\t$data=$recordSet->result() ;\r\n\t\tif(count($data)>0){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "abstract public function parseRequestParameters();", "function FindUser($User) {\n $User = str_replace('ZZ ', '', $User);\n\n //separa o primeiro nome do sobrenome\n $name_complete = explode(' ', $User);\n $user_name = array_shift($name_complete);\n $user_lastname = implode(' ', $name_complete);\n\n $Read = new WsUsers();\n\n $Read->setUser_name($user_name);\n $Read->setUser_lastname($user_lastname);\n $Result = $Read->Execute()->Query(\"user_name like '%{$user_name}%' AND user_lastname like '%{$user_lastname}%'\");\n\n if (!empty($Result)):\n return $Result[0]->user_id;\n endif;\n}", "public function setUser_fname($user_fname)\n {\n if(strlen($user_fname) <= 50 && strlen($user_fname) > 0 && preg_match('#^[a-zA-Z-]*$#', $user_fname)) {\n $this->user_fname = $user_fname;\n }\n }", "public function create()\n {\n \n echo \"Syntax: POST: /api?telefon=*telefon*&id_agencija=*id*<br>/api?email=*email*&id_agencija=*id*\";\n \n }", "function get_number_info() {\n\n $CallSid = $_POST['fieldname'];\n $AccountSid=$_POST['fieldname'];\n $CallFrom=$_POST['fieldname'];\n $CallTo=$_POST['fieldname'];\n $CallStatus=$_POST['fieldname'];\n $ApiVersion=$_POST['fieldname'];\n $Direction=$_POST['fieldname'];\n\n if (isset($_POST['fieldname'])) {\n $FromCity=$_POST['fieldname'];\n $FromState=$_POST['fieldname'];\n $FromZip=$_POST['fieldname'];\n $FromCountry=$_POST['fieldname'];\n } else {\n $FromCity=\"\";\n $FromState=\"\";\n $FromZip=\"\";\n $FromCountry=\"\";\n }\n $ToCity=$_POST['fieldname'];\n $ToState=$_POST['fieldname'];\n $ToZip=$_POST['fieldname'];\n $ToCountry=$_POST['fieldname'];\n\n $vars = array($CallSid,$AccountSid,$CallFrom,$CallTo,$CallStatus,$ApiVersion,$Direction,$FromCity,$FromState,$FromZip,$FromCountry,$ToCity,$ToState,$ToZip,$ToCountry);\n return $vars;\n }", "public function search_user($username,$surname,$email,$phone){\n if(!empty($username)){$this->db->like('username', $username);}\n if(!empty($surname)){$this->db->where('surname', $surname);}\n\t if(!empty($email)){$this->db->where('email', $email);}\n\t if(!empty($phone)){$this->db->where('phone', $phone);}\n\t // if(!empty($acc_company_name)){$this->db->where('acc_company_name', $acc_company_name);}\n\t \n\t //two not empty with username\n \n if(!empty($username) && !empty($surname)){$this->db->where(array('username' => $username, 'surname' => $surname));}\n if(!empty($username) && !empty($email)){$this->db->where('username',$username); $this->db->where('email', $email);}\n\t if(!empty($username) && !empty($phone)){$this->db->where(array('username' => $username, 'phone' => $phone));}\n\t // if(!empty($username) && !empty($acc_company_name)){$this->db->where(array('username' => $username, 'acc_company_name' => $acc_company_name));}\n\t \n\t //two not empty with surname\n if(!empty($surname) && !empty($username) ){$this->db->where('surname', $surname);$this->db->where('username', $username);}\n\t if(!empty($surname) && !empty($email) ){$this->db->where('surname', $surname);$this->db->where('email', $email);}\n\t if(!empty($surname) && !empty($phone) ){$this->db->where('surname', $surname);$this->db->where('phone', $phone);}\n\t// if(!empty($surname) && !empty($acc_company_name) ){$this->db->where('surname', $surname);$this->db->where('acc_company_name', $acc_company_name;}\n\t \n\t //two not empty with phone\n if(!empty($phone) && !empty($username) ){$this->db->where('phone', $phone);$this->db->where('username', $username);}\n\t if(!empty($phone) && !empty($email) ){$this->db->where('phone', $phone);$this->db->where('email', $email);}\n\t if(!empty($phone) && !empty($surname) ){$this->db->where('phone', $phone);$this->db->where('surname', $surname);}\n//\t if(!empty($phone) && !empty($acc_company_name) ){$this->db->where('phone', $phone);$this->db->where('acc_company_name', $acc_company_name;}\n\t \n\t //two not empty with email\n if(!empty($surname) && !empty($email)){$this->db->where('email' , $email);$this->db->where('surname', $surname);}\n\t if(!empty($username) && !empty($email)){$this->db->where('email' , $email);$this->db->where('username', $username);}\n\t if(!empty($phone) && !empty($email)){$this->db->where('email' , $email);$this->db->where('phone', $phone);}\n\t // if(!empty($acc_company_name) && !empty($email)){$this->db->where('email' , $email);$this->db->where('acc_company_name', $acc_company_name);}\n\t \n\t \n\t //three not empty with username\n if(!empty($username) && !empty($surname) && !empty($email) ){$this->db->like('username', $username);$this->db->where(array('surname' => $surname, 'email' => $email));}\n\t \n\t if(!empty($username) && !empty($surname) && !empty($phone) ){$this->db->like('username', $username);$this->db->where(array('surname' => $surname, 'phone' => $phone));}\n\t \n\t //three not empty with email\n\t if(!empty($username) && !empty($phone) && !empty($email) ){$this->db->like('username', $username); $this->db->or_like('email', $email); $this->db->where('phone', $phone); }\n\t \n\t if(!empty($username) && !empty($surname) && !empty($email) ){$this->db->like('username', $username); $this->db->or_like('email', $email); $this->db->where('surname', $surname); }\n\t \n\t if(!empty($surname) && !empty($phone) && !empty($email) ){$this->db->where('surname', $surname); $this->db->or_like('email', $email); $this->db->where('phone', $phone); }\n\t \n\t \n\t //All Not Empty\n\t \n if(!empty($username)){$this->db->like('username', $username);}\n if(!empty($surname) && empty($username) ){$this->db->like('surname', $surname);}\n if(!empty($username) && !empty($surname) ){$this->db->or_like('surname', $surname);} \n if(empty($surname) && empty($username) && !empty($email)){$this->db->like('email', $email);}\n if(!empty($username) || !empty($surname) ){ if(!empty($email)){$this->db->or_like('email', $email);}}\n if(empty($surname) && empty($username) && empty($email) && !empty($phone) ){$this->db->like('phone', $phone);}\n if(!empty($username) || !empty($surname) || !empty($email) ){ if(!empty($phone)){$this->db->or_like('phone', $phone);}}\n $query = $this->db->get('user');\n return $query->result_array();\n }", "function itstar_extra_user_profile_fields( $user ) {\n?>\n <h3><?php _e(\"Extra profile information\", \"itstar\"); ?></h3>\n <table class=\"form-table\">\n <tr>\n <th><label for=\"birthday\"><?php echo __(\"birthday\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthday\" id=\"Birth Day\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthday' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birthday.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"birthmonth\"><?php echo __(\"Birth Month\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthmonth\" id=\"birthmonth\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthmonth' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birth Month.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"birthyear\"><?php echo __(\"Birth Year\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthyear\" id=\"birthyear\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthyear' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birth Year.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"phone\"><?php echo __(\"Phone\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"phone\" id=\"phone\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID ,'phone',true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your phone.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"job\"><?php echo __(\"Job\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"job\" id=\"job\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID ,'job',true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Job.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"viraclub\"><?php __(\"Vira club ID\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" disabled name=\"viraclub\" id=\"viraclub\" class=\"regular-text\" \n value=\"<?php echo 'V'.esc_attr( get_user_meta( $user->ID,'viraclub' ,true) ); ?>\" /><br />\n \n </td>\n </tr>\n </table>\n<?php\n}", "static function getUserDisplayName($params, $short = false) {\n $full_name = isset($params['full_name']) && $params['full_name'] ? $params['full_name'] : null;\n $first_name = isset($params['first_name']) && $params['first_name'] ? $params['first_name'] : null;\n $last_name = isset($params['last_name']) && $params['last_name'] ? $params['last_name'] : null;\n $email = isset($params['email']) && $params['email'] ? $params['email'] : null;\n \n if ($short) {\n if($full_name) {\n $parts = explode(' ', $full_name);\n \n if(count($params) > 1) {\n $first_name = array_shift($parts);\n $last_name = implode(' ', $parts);\n } else {\n $first_name = $full_name;\n } // if\n } // if\n \n if($first_name && $last_name) {\n return $first_name . ' ' . substr_utf($last_name, 0, 1) . '.';\n } elseif($first_name) {\n return $first_name;\n } elseif($last_name) {\n return $last_name;\n } else {\n return substr($email, 0, strpos($email, '@'));\n } // if\n } else {\n if($full_name) {\n return $full_name;\n } elseif($first_name && $last_name) {\n return $first_name . ' ' . $last_name;\n } elseif($first_name) {\n return $first_name;\n } elseif($last_name) {\n return $last_name;\n } else {\n return substr($email, 0, strpos($email, '@'));\n } // if\n } // if\n }", "function formatName($user) {\n return ucfirst($user->nombre) . \" \" .\n ucfirst($user->apellido_paterno) . \" \" .\n ucfirst($user->apellido_materno);\n}", "function kino_user_fields( $kino_userid, $kino_fields ) {\n\t\n\tif ( empty( $kino_userid ) ) {\n\t\t$kino_userid = bp_loggedin_user_id();\n\t}\n\t\n\tif ( empty( $kino_fields ) ) {\n\t\t$kino_fields = kino_test_fields();\n\t}\n\t\n\t$kino_userdata = array();\n\t\n\t$kino_userdata['participation'] = kino_user_participation( \n\t\t$kino_userid, \n\t\t$kino_fields\n\t);\n\t\n\t// Define our fields\n\t// Ville, Pays\n\t\n\t$kino_userdata[\"ville\"] = bp_get_profile_field_data( array(\n\t\t\t'field' => $kino_fields[\"ville\"],\n\t\t\t'user_id' => $kino_userid\n\t) );\n\t$kino_userdata[\"pays\"] = bp_get_profile_field_data( array(\n\t\t\t'field' => $kino_fields[\"pays\"],\n\t\t\t'user_id' => $kino_userid\n\t) );\n\t$kino_userdata[\"birthday\"] = bp_get_profile_field_data( array(\n\t\t\t'field' => $kino_fields[\"birthday\"],\n\t\t\t'user_id' => $kino_userid\n\t) );\n\t$kino_userdata[\"tel\"] = bp_get_profile_field_data( array(\n\t\t\t'field' => $kino_fields[\"tel\"],\n\t\t\t'user_id' => $kino_userid\n\t) );\n\t\n\t// Method to find age in years...\n\t // Simple method:\n\t $kino_birthyear = substr($kino_userdata[\"birthday\"], -4);\n\t $kino_userdata[\"userage\"] = 2015 - $kino_birthyear;\n\t\n\t// Sessions\n\t\n\t$kino_userdata[\"sessions\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['session-attribuee'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t // Disponibilité\n\t \n\t $kino_userdata[\"dispo\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['dispo'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t $kino_userdata[\"dispo-partiel\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['dispo-partiel'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t // Présentation\n\t \n\t $kino_userdata[\"presentation\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['id-presentation'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t $kino_userdata[\"photo\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['id-photo'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t // Role Technicien ??\n\t if ( in_array( \"technicien-kab\", $kino_userdata[\"participation\"] )) {\n\t \n\t\t\t\t\t\t $kino_userdata[\"role-tech\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['role-kabaret-tech'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t \n\t\t\t\t\t\t $kino_userdata[\"comp-production\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-production'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-scenario\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-scenario'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-realisation\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-realisation'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-image\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-image'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-postprod-image\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-postprod-image'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-son\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-son'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-postprod-son\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-postprod-son'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-direction-artistique\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-direction-artistique'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-hmc\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-hmc'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-autres-liste\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-autres-liste'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-autres-champ\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-autres-champ'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"equipement\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['equipement'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"equipement-spec\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['equipement-spec'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t }\n\t \n\t // Role Comédien ??\n\t if ( in_array( \"comedien-kab\", $kino_userdata[\"participation\"] )) {\n\t \n\t\t\t\t $kino_userdata[\"role-comed\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['role-kabaret-comed'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"age-camera-min\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['age-camera-min'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"age-camera-max\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['age-camera-max'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langue-mat\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langue-mat'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langue-mat-autre\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langue-mat-autre'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langues-parlees\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langues-parlees'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langues-parlees-autre\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langues-parlees-autre'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langues-jouees\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langues-jouees'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langues-jouees-autre\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langues-jouees-autre'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"talents\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['talents'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"talents-autre\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['talents-autre'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t \n\t\t}\n\t \n\t // Role Réalisateur ??\n\t \n\t $kino_userdata[\"role-real\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['role-kabaret-real'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t // Is Staff ?? \n\t $kino_userdata[\"fonctions-staff\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['fonctions-staff'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t // Véhicule\n\t \n\t $kino_userdata[\"vehicule\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['vehicule'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t $kino_userdata[\"vehicule-remarque\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['vehicule-remarque'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\treturn $kino_userdata;\n\t\n}", "public function saveUserFirstSecondLastNames($user_id,$firstname, $secondname, $lastname) {\n try {\n $stm=$this->uFunc->pdo('uAuth')->prepare('UPDATE \n u235_users\n SET\n firstname=:firstname,\n secondname=:secondname,\n lastname=:lastname\n WHERE\n user_id=:user_id\n ');\n $stm->bindParam(':firstname', $firstname,PDO::PARAM_STR);\n $stm->bindParam(':secondname', $secondname,PDO::PARAM_STR);\n $stm->bindParam(':lastname', $lastname,PDO::PARAM_STR);\n $stm->bindParam(':user_id', $user_id,PDO::PARAM_INT);\n $stm->execute();\n }\n catch(PDOException $e) {$this->uFunc->error('1587216107'/*.$e->getMessage()*/,1);}\n }", "function extraFields($data, $insert_id, $fname, $lname, $update = '')\n{\n\t$str = '';\n\tif (!empty($data['country']))\n\t{\n\t\t$country = $data['country'];\n\t\t$id = pSQL(getIdByCountryISO($country));\n\t\tif (!empty($id))\n\t\t\t$str .= \"id_country='$id',\";\n\t}\n\tif (!empty($data['country']) && empty($id))\n\t{\n\t\t$country = $data['country'];\n\t\t$id = pSQL(getIdByCountryName($country));\n\t\tif (!empty($id))\n\t\t\t$str .= \"id_country='$id',\";\n\t}\n\telseif (empty($id))\n\t{\n\t\t$id = (int)Configuration::get('PS_COUNTRY_DEFAULT');\n\t\tif (!empty($id))\n\t\t\t$str .= \"id_country='$id',\";\n\t}\n\tif (isset($data['state']) && $data['state'] != 'empty' && !empty($data['state']))\n\t{\n\t\t$state = $data['state'];\n\t\t$iso = pSQL(getIsoByState($state));\n\t\tif (!empty($iso))\n\t\t\t$str .= \"id_state='$iso',\";\n\t}\n\tif (isset($data['city']) && !empty($data['city']))\n\t{\n\t\t$city = pSQL($data['city']);\n\t\t$str .= \"city='$city',\";\n\t}\n\tif (isset($data['zipcode']) && !empty($data['zipcode']))\n\t{\n\t\t$zip = trim(pSQL($data['zipcode']));\n\t\t$str .= \"postcode='$zip',\";\n\t}\n\tif (isset($data['address']) && !empty($data['address']))\n\t{\n\t\t$address = pSQL($data['address']);\n\t\t$str .= \"address1='$address',\";\n\t}\n\tif (isset($data['phonenumber']) && !empty($data['phonenumber']))\n\t{\n\t\t$phone = pSQL($data['phonenumber']);\n\t\t$str .= \"phone_mobile='$phone',\";\n\t}\n\tif (isset($data['addressalias']) && !empty($data['addressalias']))\n\t{\n\t\t$add_alias = pSQL($data['addressalias']);\n\t\t$str .= \"alias='$add_alias',\";\n\t}\n\t$tbl = _DB_PREFIX_.'address';\n\t$date = date('y-m-d h:i:s');\n\tif ($update == 'yes')\n\t{\n\t\tif (!empty($fname))\n\t\t\t$str .= \"firstname='$fname',\";\n\t\tif (!empty($lname))\n\t\t\t$str .= \"lastname='$lname',\";\n\t\t$q = \"UPDATE $tbl SET \".$str.\" date_upd='$date' WHERE id_customer='$insert_id'\";\n\t\t$q = Db::getInstance()->Execute($q);\n\t}\n\telse\n\t{\n\t\t$str .= \"date_add='$date',date_upd='$date',\";\n\t\t$fname = pSQL($fname);\n\t\t$lname = pSQL($lname);\n\t\t$q = \"INSERT into $tbl SET \".$str.\" id_customer='$insert_id', lastname='$lname',firstname='$fname' \";\n\t\t$q = Db::getInstance()->Execute($q);\n\t}\n}", "public function getUsersName(){\n //Get the Id\n $userId = $_GET[\"userId\"];\n //Gets the users name \n $usersName = $this->individualGroupModel->getTheUsersName($userId); \n //echos out a created users name given the first and last name\n echo $usersName->User_First_Name . \" \" . $usersName->User_Last_Name;\n }", "function get_profile_usrid($usrid){\r\n\t\r\n}", "public function setFirstName($u_fname) {\n\n $this->u_fname = $u_fname;\n\n }", "function SM_prettyName($name) {\n\n // firstName = First Name\n if (preg_match(\"/[a-z][A-Z]/\",$name)) {\n $name = preg_replace(\"/([a-z])([A-Z])/\",\"\\\\1%\\\\2\",$name);\n $wordList = explode('%',$name);\n $name = '';\n foreach ($wordList as $word) {\n $name .= ucfirst($word).' ';\n }\n chop($name);\n }\n // FirstName = First Name\n elseif (preg_match(\"/[A-Z][a-z]/\",$name)) { \n $name = preg_replace(\"/([A-Z])([a-z])/\",\"\\\\1%\\\\2\",$name);\n \n $wordList = explode('%',$name);\n $name = '';\n foreach ($wordList as $word) {\n $name .= ucfirst($word).' ';\n }\n }\n // address1 = Address 1\n // address2 = Address 2\n elseif (preg_match(\"/^(\\w+)(\\d)\\$/\",$name,$m)) {\n $name = ucfirst($m[1]).' '.$m[2];\n }\n // sometext = Sometext\n else {\n $name = ucfirst($name);\n }\n \n // strip a trailing _idxNum\n if (preg_match(\"/^(.+)_idx\\s*Num\\s*\\$/\",$name,$m)) {\n $name = $m[1];\n } \n \n return trim($name);\n\n}", "public static function create_user_parameters() {\n return new external_function_parameters(array(\n 'model' => new external_single_structure(array(\n 'username' => new external_value(\n PARAM_TEXT,\n 'User account name'),\n 'firstname' => new external_value(\n PARAM_TEXT,\n 'User first (given) name'),\n 'lastname' => new external_value(\n PARAM_TEXT,\n 'User last (family) name'),\n 'email' => new external_value(\n PARAM_TEXT,\n 'User E-Mail address'),\n )),\n ));\n }", "public function __construct($_salutation = NULL,$_firstName = NULL,$_middleName = NULL,$_lastName = NULL,$_suffix = NULL)\r\n\t{\r\n\t\tparent::__construct(array('Salutation'=>$_salutation,'FirstName'=>$_firstName,'MiddleName'=>$_middleName,'LastName'=>$_lastName,'Suffix'=>$_suffix));\r\n\t}", "function __construct(int $idNum, String $firstName, String $lastName, String $email, String $phoneNumber, \n int $userRole, int $active, UserCredential $userCredentials, UserInformation $userInforamtion)\n {\n $this->idNum = $idNum;\n $this->firstName = $firstName;\n $this->lastName = $lastName;\n $this->email = $email;\n $this->phoneNumber = $phoneNumber;\n $this->userRole = $userRole;\n $this->active = $active;\n $this->userCredentials = $userCredentials;\n $this->userInformation = $userInforamtion;\n }", "public function getClientByNameOrSurnameOrDni() {\n $term = Request::input('term', '');\n $results = array();\n $queries = User::where('role_id', 6)\n ->where(function($query) use ($term){\n $query->where('name', 'LIKE', '%'.$term.'%');\n $query->orWhere('surname', 'LIKE', '%'.$term.'%');\n $query->orWhere('dni', 'LIKE', '%'.$term.'%');\n })\n ->take(10)->get();\n foreach ($queries as $query)\n $results[] = ['id' => $query->id,\n 'value' => $query->fullname().' ['.$query->dni.']'];\n return response()->json($results);\n }", "public function __construct($args=[]) {\n $this->fName = $args['fName'] ?? '';\n $this->lName = $args['lName'] ?? '';\n $this->email = $args['email'] ?? '';\n $this->address = $args['address'] ?? '';\n $this->phoneNum = $args['phoneNum'] ?? '';\n $this->gender = $args['gender'] ?? '';\n $this->dob = $args['dob'] ?? '';\n $this->rating = $args['rating'] ?? '1000';\n $this->role = $args['role'] ?? 'MEMBER';\n $this->password = $args['password'] ?? '';\n $this->password = $args['password'] ?? '';\n $this->confirm_password = $args['confirm_password'] ?? '';\n }", "public function users_create() {\n\t\t$response = '';\n\t\t$status = 200;\n\t\t$email = $first_name = $last_name = $pub = null;\n\t\t$source = 'api';\n\t\t$errors = array();\n\n\t\t// either accept POST, PUT, or GET\n\t\tif ($this->request->is(array('put', 'post'))) {\n\t\t\t$response = 'received';\n\t\t\tif (!empty($this->request->data['email'])) {\n\t\t\t\t$email = $this->request->data['email'];\n\t\t\t}\n\t\t\tif (!empty($this->request->data['first_name'])) {\n\t\t\t\t$first_name = $this->request->data['first_name'];\n\t\t\t}\n\t\t\tif (!empty($this->request->data['last_name'])) {\n\t\t\t\t$last_name = $this->request->data['last_name'];\n\t\t\t}\n\t\t\tif (!empty($this->request->data['utm_source']) || !empty($this->request->data['source'])) {\n\t\t\t\tif (empty($this->request->data['utm_source']) && !empty($this->request->data['source'])) {\n\t\t\t\t\t$this->request->data['utm_source'] = $this->request->data['source']; \n\t\t\t\t}\n\t\t\t\t$source = $source.':'.$this->request->data['utm_source'];\n\t\t\t}\n\t\t\tif (!empty($this->request->data['pub'])) {\n\t\t\t\t$pub = $this->request->data['pub'];\n\t\t\t}\n\t\t}\n\t\telseif (isset($this->request->query['email'])) {\n\t\t\t$response = 'received';\n\t\t\tif (!empty($this->request->query['email'])) {\n\t\t\t\t$email = $this->request->query['email'];\n\t\t\t}\n\t\t\tif (!empty($this->request->query['first_name'])) {\n\t\t\t\t$first_name = $this->request->query['first_name'];\n\t\t\t}\n\t\t\tif (!empty($this->request->query['last_name'])) {\n\t\t\t\t$last_name = $this->request->query['last_name'];\n\t\t\t}\n\t\t\tif (!empty($this->request->data['utm_source']) || !empty($this->request->data['source'])) {\n\t\t\t\tif (empty($this->request->data['utm_source']) && !empty($this->request->data['source'])) {\n\t\t\t\t\t$this->request->data['utm_source'] = $this->request->data['source']; \n\t\t\t\t}\n\t\t\t\t$source = $source.':'.$this->request->data['utm_source'];\n\t\t\t}\n\t\t\tif (!empty($this->request->query['pub'])) {\n\t\t\t\t$pub = $this->request->query['pub'];\n\t\t\t}\n\t\t}\n\n\t\t$source = strtolower($source);\n\t\tif ($this->User->save(array('User' => array(\n\t\t\t'email' => $email,\n\t\t\t'firstname' => $first_name,\n\t\t\t'lastname' => $last_name,\n\t\t\t'origin' => $source, // always will be set to at least api\n\t\t\t'pub_id' => !empty($pub) ? $pub: null\n\t\t)))) {\n\t\t\t$user = $this->User->findById($this->User->id);\n\t\t\t$this->UserActions->afterCreate($user, 'registration');\n\t\t\t\n\t\t\t$this->UserLog->create();\n\t\t\t$this->UserLog->save(array('UserLog' => array(\n\t\t\t\t'user_id' => $user['User']['id'],\n\t\t\t\t'type' => 'user.created',\n\t\t\t\t'description' => 'User created from API'\n\t\t\t)));\n\n\t\t\t$this->UserAcquisition->create();\n\t\t\t$this->UserAcquisition->save(array('UserAcquisition' => array(\n\t\t\t\t'user_id' => $user['User']['id'],\n\t\t\t\t'ip' => null, // it's a server-to-server post, so this is largely irrelevant\n\t\t\t\t'source' => $source,\n\t\t\t\t'params' => isset($this->request->query) ? serialize($this->request->query): null,\n\t\t\t)));\n\t\t\t$this->UserLog->create();\n\t\t\t$this->UserLog->save(array('UserLog' => array(\n\t\t\t\t'user_id' => $user['User']['id'],\n\t\t\t\t'type' => 'user_acquisition.created',\n\t\t\t)));\n\n\t\t\t$response = 'created';\n\t\t\t$status = 201;\n\t\t}\n\t\telse {\n\t\t\t$status = 400;\n\t\t\t$response = 'error';\n\t\t\tif (!empty($this->User->validationErrors)) {\n\t\t\t\tforeach ($this->User->validationErrors as $error_type => $error_message) {\n\t\t\t\t\tif ($error_type == 'email') {\n\t\t\t\t\t\t$error_type = 'Email';\n\t\t\t\t\t}\n\t\t\t\t\telseif ($error_type == 'firstname') {\n\t\t\t\t\t\t$error_type = 'First name';\n\t\t\t\t\t}\n\t\t\t\t\telseif ($error_type == 'lastname') {\n\t\t\t\t\t\t$error_type = 'Last name';\n\t\t\t\t\t}\n\t\t\t\t\t$errors[] = $error_type.': '.implode(' ', $error_message);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$body = array();\n\t\tif (!empty($response)) {\n\t\t\t$body['response'] = $response;\n\t\t}\n\t\tif (!empty($errors)) {\n\t\t\t$body['errors'] = $errors;\n\t\t}\n\n\t\treturn new CakeResponse(array(\n\t\t\t'body' => json_encode($body),\n\t\t\t'type' => 'json',\n\t\t\t'status' => $status\n\t\t));\n\t}", "function fullNameById($userId, $format=0) {\r\n\r\n\t$query = db_query(\"SELECT firstName,lastName FROM user WHERE id=\".escapeValue($userId));\r\n\r\n\tif (db_numrows($query) == 1) {\r\n\t\r\n\t\t$result = db_fetch($query);\r\n\t\tif ($format == 0)\r\n\t\t\t$name = $result[\"firstName\"].\" \".$result[\"lastName\"];\r\n\t\telse\r\n\t\t\t$name = $result[\"lastName\"].\", \".$result[\"firstName\"];\r\n\t\t\r\n\t} else $name = \"\";\r\n\t\r\n\treturn $name;\r\n\t\r\n}", "public function getSurname ();", "function getFirstName($f)\n {\n $array = $this->load( array( \"username=?\", $f->get('POST.login_username') ));\n return $array['firstname'].\" \".$array['lastname'];\n }", "function addProfileFields($user) {\n\t\tif($this->checkPermissions()) {\n\t\t\techo '<h3>LePress Teacher</h3>';\n\t\t\techo '<table class=\"form-table\">';\n\t\t\techo '<tr>';\n\t\t\techo\t'<th><label for=\"lepress-organization\">'.__('Organization', lepress_textdomain).'</label></th>';\n\t\t\techo '<td><input type=\"text\" name=\"lepress-organization\" id=\"lepress-organization\" value=\"'.esc_attr( get_the_author_meta( 'lepress-organization', $user->ID)).'\" class=\"regular-text\"/><br />';\n\t\t\techo '<span class=\"description\">'.__('Your organization - university, college, high school, primary school etc..', lepress_textdomain).'</span></td>';\n\t\t\techo '</tr></table>';\n\t\t}\n\t}", "function user_edit($user_info)\n {\n }", "public function getHonoreeFirstName();", "public function getShipToFirstName();", "public function insertUser($params) {\n\n\t}", "function savePerson($formvalues, $prefix){\n\tif($formvalues[$prefix.'firstname'] != \"\"){\n\t\tif(isset($formvalues[$prefix.'personupdateid'])){\n\t\t\t$query = \"UPDATE persons SET firstname = '\".ucfirst($formvalues[$prefix.'firstname']).\"', lastname = '\".ucfirst($formvalues[$prefix.'lastname']).\"', othernames = '\".ucfirst($formvalues[$prefix.'othernames']).\"', birthlastname = '\".$formvalues[$prefix.'birthlastname'].\"', nationality = '\".$formvalues[$prefix.'nationality'].\"', tribe = '\".$formvalues[$prefix.'tribe'].\"', occupation = '\".$formvalues[$prefix.'occupation'].\"', employer = '\".$formvalues[$prefix.'employer'].\"', dateofbirth = \".changeDateFromPageCombosToMySQLFormat($formvalues[$prefix.'bday'], $formvalues[$prefix.'bmonth'], $formvalues[$prefix.'byear']).\", birthplaceid = '\".$formvalues[$prefix.'bplaceid'].\"', isalive = '\".$formvalues[$prefix.'alive'].\"', addressid = '\".$formvalues[$prefix.'addressid'].\"', homeid = '\".$formvalues[$prefix.'homeaddressid'].\"', workplaceid = '\".$formvalues[$prefix.'workaddressid'].\"', lastupdatedby = \".$_SESSION['userid'].\", lastupdatedate = now() WHERE id = '\".$formvalues[$prefix.'personupdateid'].\"'\";\n\t\t\n\t\t} else {\n\t\t\t$query = \"INSERT INTO persons (firstname, lastname, othernames, birthlastname, nationality, tribe, occupation, employer, dateofbirth, birthplaceid, isalive, addressid, homeid, workplaceid, createdby, datecreated) VALUES ('\".$formvalues[$prefix.'firstname'].\"', '\".$formvalues[$prefix.'lastname'].\"', '\".$formvalues[$prefix.'othernames'].\"', '\".$formvalues[$prefix.'birthlastname'].\"', '\".$formvalues[$prefix.'nationality'].\"', '\".$formvalues[$prefix.'tribe'].\"', '\".$formvalues[$prefix.'occupation'].\"', '\".$formvalues[$prefix.'employer'].\"', \".changeDateFromPageCombosToMySQLFormat($formvalues[$prefix.'bday'], $formvalues[$prefix.'bmonth'], $formvalues[$prefix.'byear']).\", '\".$formvalues[$prefix.'bplaceid'].\"', '\".$formvalues[$prefix.'alive'].\"', '\".$formvalues[$prefix.'addressid'].\"', '\".$formvalues[$prefix.'homeaddressid'].\"', '\".$formvalues[$prefix.'workaddressid'].\"', \".$_SESSION['userid'].\", NOW())\";\n\t\t\n\t\t}\n\t\t\n\t\t$result = mysql_query($query);\n\t\t$addressid = \"\";\n\t\t# check if any errors have occured during the saving the activities to the database\n\t\tif (mysql_error() == \"\") {\n\t\t\t# no errors occured, so return the last inserted id\n\t\t\t$addressid = mysql_insert_id();\n\t\t\t\n\t\t\tif(isset($formvalues[$prefix.'personupdateid'])){\n\t\t\t\t$addressid = $formvalues[$prefix.'personupdateid'];\n\t\t\t}\n\t\t} else {\n\t\t\t# add the error message to the string\n\t\t\t$_SESSION['error'] = \"ERROR: Couldnot insert person named \".$formvalues[$prefix.'firstname'].\" \".$formvalues[$prefix.'lastname'].\". Please try again. DETAILS: \".mysql_error();\n\t\t}\n\t\treturn $addressid;\n\t}\n}", "function build_us_profile_by_zip_range($zip1, $zip2, $gender='*', $first_name='*', $last_name='*')\r\n{\r\n\t$this->set_identity($gender, $first_name, $last_name);\r\n\t$this->set_street_address();\r\n\t$this->set_random_zipcode_by_range($zip1, $zip2);\r\n\t$this->set_random_us_phone($this->state);\r\n}", "function scorm_get_user_data($userid) {\n/// for report.php\n\n return get_record('user','id',$userid,'','','','','firstname, lastname, picture');\n}", "public function addUser()\n {\n\n foreach ($this->employeeStorage->getEmployeeScheme() as $key => $singleUser) {\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key); // Each input is sent for validation using validateInput method\n\n while (!$validate) // loop that forces user to enter valid input\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', ''); // formats income input so it always has 2 decimal points\n }\n\n $data[$key] = $userInput;\n\n }\n\n $this->employeeStorage->setEmployee( $data ); // After every input is validated data is stored using setEmployee method\n\n echo \"\\033[32m\". \"## Novi zaposlenik \". $data['name'].\" \". $data['lastname'].\" je dodan! \\n\\n\".\"\\033[0m\";\n\n\n }", "function build_us_profile($state='*', $gender='*', $first_name='*', $last_name='*')\r\n{\r\n\t$this->set_identity($gender, $first_name, $last_name);\r\n\t$this->set_street_address();\r\n\t$this->set_random_zipcode_by_state($state);\r\n\t$this->set_random_us_phone($this->state);\r\n}", "function openmeetings_setUserObjectAndGenerateRecordingHashByURL($username, $firstname, $lastname, \n\t\t\t\t\t\t$userId, $systemType, $recording_id) {\n\t $restService = new openmeetings_rest_service();\n\t \t$result = $restService->call($this->getUrl().'/services/UserService/setUserObjectAndGenerateRecordingHashByURL?'.\n\t\t\t'SID='.$this->session_id .\n\t\t\t'&username='.urlencode($username) .\n\t\t\t'&firstname='.urlencode($firstname) .\n\t\t\t'&lastname='.urlencode($lastname) .\n\t\t\t'&externalUserId='.$userId .\n\t\t\t'&externalUserType='.urlencode($systemType) .\n\t\t\t'&recording_id='.$recording_id,\n\t\t\t'return'\n\t\t\t);\n\t\t\n\t\tif ($client_roomService->fault) {\n\t\t\techo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>';\n\t\t} else {\n\t\t\t$err = $restService->getError();\n\t\t\tif ($err) {\n\t\t\t\techo '<h2>Error</h2><pre>' . $err . '</pre>';\n\t\t\t} else {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t} \n\t\treturn -1;\n\t}", "public function testRegisterLongFirstName() {\n\t\t$data = $this->getUserData(\n\t\t\t'othrus',\n\t\t\tstr_repeat('abcde', 6)+ 'a', // 31 chars\n\t\t\t$this->surname,\n\t\t\t'[email protected]'\n\t\t);\n\t\t\n\t\t$response = $this->call('POST','v1/users', $data);\n\t\t$resp_data = $response->getData();\n\t\t\n\t\t$this->assertResponseStatus(400);\n\t\t$this->assertTrue($resp_data->error);\n\t}", "function create_user ( $ID, $first_name, $last_name, $email ) {\n\tglobal $access_token, $canvas_base_url;\n\t\n\t$pass=md5(uniqid($first_name.$last_name, true));\n\t$url=$canvas_base_url.\"/api/v1/accounts/1/users.json\";\n\tsystem(\"curl $url -F 'user[name]=$first_name $last_name' -F 'user[short_name]=$first_name' -F 'pseudonym[unique_id]=$email' -F 'pseudonym[password]=$pass' -F 'pseudonym[sis_user_id]=$ID' -H 'Authorization: Bearer $access_token'\");\n\t\n}", "function setFirstName($firstName);", "function getAllPerson($sw,$usePre=true) {\n if ($usePre) $Pre=$_SESSION[\"pre\"];\n $rechte=berechtigung(\"cp_\");\n if (!$sw[0]) { $where=\"cp_phone1 like '$Pre\".$sw[1].\"%' or cp_mobile1 like '$Pre\".$sw[1].\"%' \"; }\n else { $where=\"cp_name ilike '$Pre\".$sw[1].\"%' or cp_givenname ilike '$Pre\".$sw[1].\"%' or cp_stichwort1 ilike '$Pre\".$sw[1].\"%'\"; }\n $sql=\"select *,'P' as tab,cp_id as id,cp_name as name from contacts where ($where) and $rechte\";\n $rs=$GLOBALS['dbh']->getAll($sql);\n if($rs) return $rs;\n //Was geschieht wenn nach einer Person mit Vor- und Zuname gesucht wird??\n //Fall 1: Nachname wird zuerst eingeben \"Byron Augusta Ada\"\n $sw_array=explode(\" \",$sw[1],9);\n if (!isset($sw_array[1])) return false;\n $name=array_shift($sw_array);\n $givenname=implode(\" \",$sw_array);\n $where=\"cp_name ilike '$Pre\".$name.\"%' and cp_givenname ilike '$Pre\".$givenname.\"%'\";\n $sql=\"select *,'P' as tab,cp_id as id,cp_name as name from contacts where ($where) and $rechte\";\n $rs=$GLOBALS['dbh']->getAll($sql);\n if ($rs) return $rs;\n //Fall 2: Vorname wird zuerst eingegeben \"Augusta Ada Byron\"\n $sw_array=explode(\" \",$sw[1],9);\n $name=array_pop($sw_array);\n $givenname=implode(\" \", $sw_array);\n $where=\"cp_name ilike '$Pre\".$name.\"%' and cp_givenname ilike '$Pre\".$givenname.\"%'\";\n $sql=\"select *,'P' as tab,cp_id as id,cp_name as name from contacts where ($where) and $rechte\";\n $rs=$GLOBALS['dbh']->getAll($sql);\n if ($rs) return $rs;\n return false;\n}", "function editUserName($data){\n\t\t\t$conn = $this->connect();\n\t\t\t$fname = $this->modify(mysqli_real_escape_string($conn, $data['fname']));\n\t\t\t$lname = $this->modify(mysqli_real_escape_string($conn, $data['lname']));\n\t\t\tif(empty($fname) || empty($lname)) {\n\t\t\t\t$this->re_direct(\"profile\", \"input=empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z]+(\\.)?( )?[a-z]*$/i\", $fname) && preg_match(\"/^[a-z]+$/i\", $lname)) {\n\t\t\t\t\tif($this->length($fname, 25, 4) && $this->length($lname, 25, 4)) {\n\t\t\t\t\t\t$result = $this->change(\"user_login\", \"user_fname\", $fname , $_SESSION['userid']);\n\t\t\t\t\t\t$result1 = $this->change(\"user_login\", \"user_lname\", $lname , $_SESSION['userid']);\n\t\t\t\t\t\tif($result == false || $result1 == false) {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Failed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Successfull\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"profile\", \"Error=toobigOrtooSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=name\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function fillParamsWithProfileData(Profile $profileData) {\n $profileDataCond = \"\";\n\n\n $city = $profileData->getCity();\n $country = $profileData->getCountry();\n $toBeformettedDate = $profileData->getDateOfBirth();\n $dateOfBirth = date(\"Y-m-d\\TG:i:s\", strtotime($toBeformettedDate));\n $firstName = $profileData->getFirstName();\n $lastName = $profileData->getLastName();\n $homeLandLine = $profileData->getHomeLandLine();\n $line1 = $profileData->getLine1();\n $line2 = $profileData->getLine2();\n $mobile = $profileData->getMobile();\n $officeLandLine = $profileData->getOfficeLandLine();\n $pincode = $profileData->getPincode();\n $sex = $profileData->getSex();\n $state = $profileData->getState();\n\n if ($city != null && $city != \"\") {\n $profileDataCond .= \"city:$city!\";\n }\n if ($country != null && $country != \"\") {\n $profileDataCond .= \"country:$country!\";\n }\n if ($dateOfBirth != null && $dateOfBirth != \"\") {\n $profileDataCond .= \"date_of_birth:$dateOfBirth!\";\n }\n\n if ($firstName != null && $firstName != \"\") {\n\n $profileDataCond.= \"first_name:$firstName!\";\n }\n if ($lastName != null && $lastName != \"\") {\n $profileDataCond .= \"last_name:$lastName!\";\n }\n if ($homeLandLine != null && $homeLandLine != \"\") {\n $profileDataCond .= \"home_land_line:$homeLandLine!\";\n }\n if ($line1 != null && $line1 != \"\") {\n $profileDataCond .= \"line1:$line1!\";\n }\n if ($line2 != null && $line2 != \"\") {\n $profileDataCond .= \"line2:$line2!\";\n }\n if ($mobile != null && $mobile != \"\") {\n $profileDataCond .= \"mobile:$mobile!\";\n }\n if ($officeLandLine != null && $officeLandLine != \"\") {\n $profileDataCond .= \"office_land_line:$officeLandLine!\";\n }\n if ($pincode != null && $pincode != \"\") {\n $profileDataCond .= \"pincode:$pincode!\";\n }\n if ($sex != null && $sex != \"\") {\n $profileDataCond .= \"sex:$sex!\";\n }\n if ($state != null && $state != \"\") {\n $profileDataCond .= \"state:$state!\";\n }\n return $profileDataCond;\n }", "function buildLinkWithQueryString($userName, $firstName, $lastName, $email) {\t\n\t$linkWithQueryString = 'index.php?userName=' . $userName . '&firstName=' . $firstName . '&lastName=' . $lastName . \n\t'&email=' . $email;\t\n\treturn $linkWithQueryString;\t\t\n}", "private function url_params()\n {\n return \"?user={$this->login}&password={$this->password}&answer=json\";\n }", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "private function prepareParams(\\UserWrapper $user)\r\n {\r\n $param = array(\r\n 'User_Role' => $user->user_Role,\r\n 'User_FirstName' => $user->user_FirstName,\r\n 'User_LastName' => $user->user_LastName,\r\n 'User_Pesel' => $user->user_Pesel,\r\n 'User_Address' => $user->user_Address,\r\n 'User_PostalCode' => $user->user_PostalCode,\r\n 'User_Phone' => $user->user_Phone,\r\n 'User_Email' => $user->user_Email\r\n );\r\n \r\n return $param;\r\n }", "public function user($user);", "public static function search_users_parameters() {\n $query = new external_value(\n PARAM_RAW,\n 'Query string'\n );\n $capability = new external_value(\n PARAM_RAW,\n 'Required capability'\n );\n $limitfrom = new external_value(\n PARAM_INT,\n 'Number of records to skip',\n VALUE_DEFAULT,\n 0\n );\n $limitnum = new external_value(\n PARAM_RAW,\n 'Number of records to fetch',\n VALUE_DEFAULT,\n 100\n );\n return new external_function_parameters(array(\n 'query' => $query,\n 'capability' => $capability,\n 'limitfrom' => $limitfrom,\n 'limitnum' => $limitnum\n ));\n }", "public function createStudent($firstName, $lastName, $userName, $password, $emailAddress, $studentId, $major, $address);", "function returnUser($firstName, $lastName, $id){\n $ret = '{\"u_firstName\": \"'.$firstName.'\",\"u_lastName\":\"'.$lastName.'\",\"u_id\":\"'.$id.'\"}';\n toJSON($ret);\n }", "function registerUser($uName,$pass,$_POST) {\n \t$first = $_POST['first'];\n $last = $_POST['last'];\n $dob = $_POST['dob'];\n $gender = $_POST['gender'];\n $email = $_POST['email'];\n $address = $_POST['address']; \n $membership = $_POST['membership'];\n $ccn = $_POST['ccn'];\n $cce = $_POST['cce'];\n $duration = $_POST['duration'];\n \n // Validate credit card, return error if not valid\n if(cc_validate_checksum($ccn) == false) {\n \treturn \"<p class=\\\"errorMessage\\\">Invalid Credit Card number check and try again</p>\";\n }\n \n $text = $uName.\":\".$pass.\":\".$first.\":\".$last.\":\".$dob.\":\".$gender.\":\".$email.\":\".$address.\":\".\n \t$membership.\":\".$ccn.\":\".$cce.\":\".$duration.\"\\n\";\n $file = \"data/registeredUsers.txt\";\n $handle = fopen($file,\"a+\");\n if (!$handle) {\n \treturn \"<p> Internal Error </p>\";\n }\n while (($line = fgets($handle)) !== false) {\n \t$current = explode(\":\",$line);\n \tif ($current[0] == $uName) {\n \t\treturn \"<p class=\\\"errorMessage\\\">Username already taken</p>\";\n \t}\n }\n fwrite($handle, $text);\n fclose($handle);\n return;\n }", "function add_person($params)\n {\n $this->db->insert('person',$params);\n $this->db->insert('company_person',array_slice($params, 13)); \n \n return $this->db->insert_id();\n //$this->db->query('select company_id, company_name from company');\n \n }", "public function getBillingFirstName();", "function Name ($cid, $format = \"%F %M %L %D\", $row_name = NULL)\r{\r\tif ($GLOBALS['feedback']) echo \"Name($cid,$format)\\n\";\r\r\t// correct any lingering occurrences of mal-formatted names\r\tif (strpos ($format, \"%M \\\"%N\\\"\"))\r\t{\r\t\t$format = str_replace (\"%M \\\"%N\\\"\", \"\\\"%N\\\" %M\", $format);\r\t}\r\r\t// a hack to match format codes at the start of the string\r\t$format = ' ' . $format;\r\r\tif (! $row_name)\r\t{\r\t\t$sql = \"SELECT * FROM contacts AS c LEFT JOIN titles AS t ON c.title_id = t.title_id LEFT JOIN degrees AS d ON c.degree_id = d.degree_id WHERE contact_id = $cid\";\r\t\t$name = mysql_query ($sql) or exit_mysql_error($sql);\r\t\t$row_name = mysql_fetch_assoc ($name);\r\t\tmysql_free_result ($name);\r\r\t\t// if the nickname is the same as the middle name, and both are\r\t\t// requested, ignore the nickname\r\t\tif ($row_name[\"nickname\"] == $row_name[\"middle_name\"])\r\t\t{\r\t\t\t$format = str_replace (\"\\\"%N\\\" %M\", \"%M\", $format);\r\t\t}\r\t}\r\r\t$formats = array('%F' => 'first_name',\r\t\t\t\t\t '%M' => 'middle_name',\r\t\t\t\t\t '%m' => 'middle_name', // only middle initial\r\t\t\t\t\t '%L' => 'primary_name',\r\t\t\t\t\t '%N' => 'nickname',\r\t\t\t\t\t '%T' => 'title',\r\t\t\t\t\t '%D' => 'degree',\r\r\t\t\t\t\t // choose the nickname if it exists, otherwise first name\r\t\t\t\t\t '%n' => ($row_name['nickname'] != '' ? 'nickname' : 'first_name'));\r\r\t// loop through the format string and construct the name\r\twhile (list ($code, $field) = each ($formats))\r\t{\r\t\t// use an easy-to-type local variable\r\t\t$data = $row_name[$field];\r\r\t\t// make initials pretty;\r\t\tif (($code == \"%m\") && (strlen ($data) > 0))\r\t\t{\r\t\t\t$data = $data[0];\r\t\t}\r\t\tif (strlen ($data) == 1)\r\t\t{\r\t\t\t$data .= '.';\r\t\t}\r\r\t\t// replace all instances of this formatting code with the data\r\t\twhile ($pos = strpos ($format, $code))\r\t\t{\r\t\t\t$format = substr_replace ($format, $data, $pos, strlen($code));\r\t\t}\r\t}\r\r\t// remove extraneous quotes\r\t$format = str_replace (\"\\\"\\\" \", \"\", $format);\r\r\t// remove extra spaces\r\t$format = str_replace (\" \", \" \", $format);\r\t$format = str_replace (\" ,\", \",\", $format);\r\r\treturn trim($format);\r}", "function parse_user($value){\n\t\t$value = preg_replace_callback('/\\[user=([\\w-_]+)\\]/iU','preg_replace_user',$value);\n\t\t$CI =& get_instance();\n\t\t$user = $CI->user->is_logged() ? $CI->user->get('name') : t('user guest');\n\t\t$value = str_replace('%username%', $user, $value);\n\t\treturn $value;\n\t}", "public function mtii_utilities_show_extra_profile_fields($user) {\n $gender = get_the_author_meta('gender', $user->ID);\n $gender_label = $gender=='' ? 'Pick a Gender' : $gender;\n $phone_number = get_the_author_meta('phone_number', $user->ID);\n $state_city = get_the_author_meta('state_city', $user->ID);\n ?>\n <h3><?php esc_html_e('Personal Information (for Mtii Utilities User)', 'mtii-utilities-josbiz'); ?></h3>\n\n <table class=\"form-table\">\n <tr>\n <th>\n <label for=\"gender\"><?php _e( 'Gender', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <select name=\"gender\" id=\"gender\" class=\"input\">\n <option disabled value=\"<?php _e($gender, 'mtii-utilities-josbiz'); ?>\"><?php echo $gender_label; ?></option>\n <option value=\"<?php _e('Male', 'mtii-utilities-josbiz'); ?>\">Male</option>\n <option value=\"<?php _e('Female', 'mtii-utilities-josbiz'); ?>\">Female</option>\n </select>\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"phone_number\"><?php _e( 'Phone Number', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <input\n type=\"number\" name=\"phone_number\" id=\"phone_number\" class=\"input\"\n value=\"<?php echo esc_attr(wp_unslash($phone_number)); ?>\" size=\"25\" />\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"state_city\"><?php _e( 'State/City', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <input\n type=\"text\" name=\"state_city\" id=\"state_city\" class=\"input\"\n value=\"<?php echo esc_attr(wp_unslash($state_city)); ?>\" size=\"25\" />\n </td>\n </tr>\n </table>\n <?php\n }", "function changeUserDetail($userEmail, $firstname, $lastname, $phone){\n\n\t\tglobal $conn;\n\n\t\t$query = \"UPDATE User \n\t\tSET firstname='$firstname', lastname='$lastname', phone='$phone' \n\t\tWHERE email='\" . $userEmail . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result != TRUE){\n\t\t\techo \"Error updating \" . $userEmail . \" details\";\n\t\t}\n\n\t}", "function CreateUser() {\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USER_TYPE] = $this->reseller->getUserType();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USERNAME] = $this->reseller->getUserLoginName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_EMAIL_ID] = $this->reseller->getEmailId();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_CONTACT_NO] = $this->reseller->getMobileNo();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_FULL_NAME] = $this->reseller->getFullName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_ADDRESS] = $this->reseller->getAddress();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_CITY] = $this->reseller->getCity();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_REGION] = $this->reseller->getRegion();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_COUNTRY] = $this->reseller->getCountry();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_DOMAIN_NAME] = $this->reseller->getDomainName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_EXPIRY_DATE] = $this->reseller->getExpiryDate();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_ENABLE_CMS] = $this->reseller->getEnableCMS();\n $this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_DLT_ENTITY_ID] = $this->reseller->getDltEntityId();\n\t\t\t$response = new sgc_callapi(sgc_constant::SGC_API, sgc_constant::SGC_ENDPOINT_RESELLER_CREATE_USER, $this->data, $this->header, sgc_common_api_params::API_COMMON_METHOD_POST, $this->useRestApi);\n\t\t\treturn $response->getResponse();\n\t\t}", "function insertPersonalInfo($user_id,$userData)\n\t\t{\n\t\t\t//setting user full name\n\t\t\t$name = $userData['f_name'].\" \".$userData['l_name'];\n\t\t\t//profile creation date\n\t\t\t$profile_creation_date = $this->getCurrentDate();\n\t\t\t//last updation date\n\t\t\t$last_updation_date = $this->getCurrentDate();\n\t\t\t//column name for insertion\n\t\t\t$column_name = array(\"user_id\",\"name\",\"gender\",\"dob\",\"contact_no\",\"addr_line1\",\"addr_line2\",\"pincode\",\"city\",\"state\",\"country\",\"profile_creation_date\",\"last_upgradation_date\");\n\t\t\t//column value for insertion\n\t\t\t$column_value = array($user_id,$name,$userData['gender'],$userData['dob'],$userData['contact'],$userData['add1'],$userData['add2'],$userData['pin'],$userData['city'],$userData['state'],$userData['country'],$profile_creation_date,$last_updation_date);\n\t\t\t//insert the values to user info table\n\t\t\t$insert = $this->manageContent->insertValue(\"user_info\",$column_name,$column_value);\n\t\t\treturn $insert;\n\t\t}", "function __construct($nameU,$tlf) {\r\n\t\t\t$this->nombreUnidad = $nameU;\r\n\t\t\t$this->telefono = $tlf;\r\n }", "public function userDetail()\n {\n inputs([\n 'userName'=>[\n 'type'=>\"array\",\n 'value'=>$this->input->post('username'), \n 'validation'=>\"required|notEmpty\"]\n ], $this);\n\n $userDetails = $this->UserDetails->where([\"roleId\"=>$this->getUserRoleId()]);\n if(!in_array(\"ALL\", $this->inputs['userName'])) {\n $this->UserDetails->where_in( \"userName\",$this->inputs['userName']);\n } else {\n $this->UserDetails->where_not_in( \"userName\",$this->inputs['userName']);\n }\n $userDetails = $this->UserDetails->read();\n \n foreach($userDetails as $key=>$userDetail) {\n $contactDetails = $this->getContactDetails([$userDetail['_id']]); \n\n if(!empty($contactDetails)) {\n $userDetails[$key]['contact'] = $contactDetails;\n }\n $documentDetails = $this->getDocumentDetails([$userDetail['_id']]);\n\n if(!empty($documentDetails)) {\n $userDetails[$key]['document'] = $documentDetails; \n }\n }\n return output($userDetails,'success','SM001','api call success',\"\");\n }", "function generate_search_data_fields($name, $dexnum, $type1, $type2, $region, $specialform, $tier) {\n $specialform = $specialform ? 'true' : 'false';\n\n if ($type1 === 'No Secondary') {\n $type1 = 'notype';\n }\n\n if ($type2 === 'No Secondary') {\n $type2 = 'notype';\n }\n \n $fields = [\n $name,\n \"num=$dexnum\",\n \"dexnum=$dexnum\",\n \"type=$type1\",\n \"type=$type2\",\n \"type1=$type1\",\n \"type2=$type2\",\n \"region=$region\",\n \"specialform=$specialform\",\n \"tier=$tier\"\n ];\n\n return strtolower(implode(' ', $fields));\n}", "function tidyInputs(){\n\tglobal $nric,$firstName,$lastName,$dob,$address1,$address2,$poCode,\n$homeNum,$handphoneNum,$email,$description;\n\tglobal $faID;\n\t\n\t$nric = preg_replace('/[^a-zA-Z0-9]/','',$nric);\n\t$firstName = preg_replace('/[^a-zA-Z0-9 ]/','',$firstName);\n\t$lastName = preg_replace('/[^a-zA-Z0-9 ]/','',$lastName);\n\t$dob = preg_replace('/[^0-9-]/','',$dob);\n\t$address1 = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$address1);\n\t$address2 = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$address2);\n\t$poCode = preg_replace('/[^0-9]/','',$poCode);\n\t$homeNum = preg_replace('/[^0-9]/','',$homeNum);\n\t$handphoneNum = preg_replace('/[^0-9]/','',$handphoneNum);\n\t$email = preg_replace('/[^a-zA-Z0-9@._-]/','',$email);\n\t$description = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$description);\n\t\n\t$faID = preg_replace('/[^0-9]/','',$faID);\n}", "private function account(){\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\t\t\t\n\t\t\t$first_name = $this->_request['first_name'];\t\t\n\t\t\t$last_name = $this->_request['last_name'];\n\t\t\t$address = $this->_request['address'];\t\t\n\t\t\t$member_number = $this->_request['member_number'];\t\n\t\t\t$email = $this->_request['email'];\n\t\t\t$phone_number = $this->_request['phone_number'];\n\t\t\t$mobile = $this->_request['mobile'];\t\n\t\t\t$signature = $this->_request['signature'];\n\t\t\t$current_datetime = new DateTime(); \n\t\t\t$birth_date = $this->_request['birth_date'];\t\n\t\t\t$birth_date_format = substr($birth_date, 6, 4).'-'.substr($birth_date, 3, 2).'-'.substr($birth_date, 0, 2);\n\t\t\t$name_of_fund_1 = $this->_request['name_of_fund_1'];\n\t\t\t$name_of_fund_2 = $this->_request['name_of_fund_2'];\n\t\t\t$name_of_fund_3 = $this->_request['name_of_fund_3'];\n\t\t\t$name_of_fund_4 = $this->_request['name_of_fund_4'];\n\t\t\t$name_of_fund_5 = $this->_request['name_of_fund_5'];\n\t\t\t$previous_name = $this->_request['previous_name'];\n\t\t\t$name_of_fund = $name_of_fund_1;\n\t\t\tif(trim($name_of_fund_2)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_2;\n\t\t\t}\t\n\t\t\tif(trim($name_of_fund_3)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_3;\n\t\t\t}\n\t\t\tif(trim($name_of_fund_4)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_4;\n\t\t\t}\n\t\t\tif(trim($name_of_fund_5)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_5;\n\t\t\t}\t\t\t\n\t\t\t$previous_address = $this->_request['previous_address'];\n\t\t\t$result = mysql_query(\"INSERT INTO accounts (member_number, first_name, last_name, address, email, phone_number, mobile, birth_date, signature, date_created, date_modified ) \n\t\t\tVALUES ('\".$member_number.\"', '\".mysql_real_escape_string($first_name).\"', '\".mysql_real_escape_string($last_name).\"', '\".$address.\"', '\".$email.\"', '\".$phone_number.\"', '\".$mobile.\"', '\".$birth_date_format.\"', '\".$signature.\"', NOW(), NOW())\", $this->db);\n\t\t\tif($result) {\n\t\t\t\t$account_id = mysql_insert_id();\n\t\t\t\tif(trim($name_of_fund_1)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_1).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_2)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_2).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_3)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_3).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(trim($name_of_fund_4)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_4).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_5)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_5).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t\tif($result){\n\t\t\t\t$to = \tEMAIL_TO;\n\t\t\t\t$subject = \t'\"Snap4m New Account';\n\t\t\t\t$mime_boundary=\"==Multipart_Boundary_x\".md5(mt_rand()).\"x\";\n\t\t\t\t \t \t\t\t /*\t*/\n\t\t\t\t$headers = \t\"From:\".EMAIL_FROM.\"\\r\\n\";\n\t\t\t\t$headers .= \t\"MIME-Version: 1.0\\r\\n\"\n\t\t\t\t \t.\"Content-Type: multipart/mixed; boundary=\\\"{$mime_boundary}\\\"\";\t\t\t\t\t \t \n\t $message = \"This is a multi-part message in MIME format.\\n\\n\".\n\t \"--{$mime_boundary}\\n\" .\n\t \"Content-Type: text/plain; charset=\\\"iso-8859-1\\\"\\n\" .\n\t \"Content-Transfer-Encoding: 7bit\\n\\n\";\n\t $message .= \"Name: \".htmlspecialchars($first_name).' '.htmlspecialchars($last_name).\"\\r\\n\"\n\t\t\t\t\t.\"Member No: \".$member_number.\"\\r\\n\"\n\t\t\t\t\t.\"Birthdate: \".$birth_date.\"\\r\\n\"\n\t\t\t\t\t.\"Address: \".$address.\"\\r\\n\"\n\t\t\t\t\t.\"Email: \".$email.\"\\r\\n\"\n\t\t\t\t\t.\"Phone No: \".$phone_number.\"\\r\\n\"\n\t\t\t\t\t.\"Mobile: \".$mobile.\"\\r\\n\"\n\t\t\t\t\t.\"Name of Fund: \".htmlspecialchars($name_of_fund).\"\\r\\n\"\n\t\t\t\t\t.\"Previous Name: \".htmlspecialchars($previous_name).\"\\r\\n\"\n\t\t\t\t\t.\"Previous Address: \".$previous_address.\"\\r\\n\\r\\n\".\"Signature:\\n\\n\";\n\t // attachment with mime babble\n\t $message .= \"--{$mime_boundary}\\n\";\t\t\t\t\t\t\t \t \n\t\t\t\t$file = \tfile_get_contents(\"http://snap4m.com/signatures/\".$signature);\t\t\t\t\t\t \t \n\t\t\t\t$message .= \t\"Content-Type: image/png; name=\\\"\".$signature.\"\\\"\\r\\n\"\n\t\t\t\t \t.\"Content-Transfer-Encoding: base64\\r\\n\"\n\t\t\t\t \t.\"Content-disposition: attachment; file=\\\"\".$signature.\"\\\"\\r\\n\"\n\t\t\t\t \t.\"\\r\\n\"\n\t\t\t\t \t.chunk_split(base64_encode($file))\n\t\t\t\t \t.\"--{$mime_boundary}--\\n\";\n\t\t\t\t\n\t\t\t\tif(mail($to, $subject, $message, $headers))\n\t\t\t\t{\n\t\t\t\t $this->response('success', 200);\n\t\t\t\t} else {\n\t\t\t\t $this->response('success', 200);\n\t\t\t\t} \t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t//$this->response('success', 200);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Add Failed\");\n\t\t\t\t$this->response($this->json($error), 400);\t\t\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}", "function userRegister($userDetails){\n\ttry {\n\t\t$user = new MangoPay\\UserNatural();\n\t\t$user->FirstName \t\t\t= $userDetails['FirstName'];\n\t\t$user->LastName \t\t\t= $userDetails['LastName'];\n\t\t$user->Email \t\t\t\t= $userDetails['Email'];\n\t\t$user->Address \t\t\t\t= $userDetails['Address'];\n\t\t$user->Birthday \t\t\t= strtotime($userDetails['Birthday']);\n\t\t$user->Nationality \t\t\t= $userDetails['Nationality'];\n\t\t$user->CountryOfResidence \t= $userDetails['CountryOfResidence'];\n\t\t$user->Occupation \t\t\t= $userDetails['Occupation'];\n\t\t$user->IncomeRange \t\t\t= $userDetails['IncomeRange'];\n\t\t//call create function\n\t\t$createdUser \t\t\t\t= $mangoPayApi->Users->Create($user);\n\t\tif(isset($createdUser->Id)) {\n\t\t\treturn $createdUser->Id;\n\t\t}\n\t\telse {\n\t\t\treturn 0;\n\t\t}\n\t}\n\tcatch(Exception $e) {\n\t\treturn $e;//error in field values\n\t\t\n\t}\n}", "public function get_trainee() {\n $matches = array();\n $paid = $this->input->post('paid');\n $query_string = htmlspecialchars($_POST['q'], ENT_QUOTES, 'UTF-8');\n $result = $this->classtraineemodel->get_user($this->tenant_id, '', $query_string, $paid);\n if ($result) {\n foreach ($result as $row) {\n $matches[] = array(\n 'key' => $row->user_id,\n 'label' => $row->first_name . ' ' . $row->last_name . ' (Tax Code: ' . $row->tax_code . ')',\n 'value' => $row->first_name . ' ' . $row->last_name,\n );\n }\n }\n echo json_encode($matches);\n exit();\n }", "public function getUserIDandEmail()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE username = :username OR email = :email\";\r\n\r\n return $query_string;\r\n}", "public function __construct($id, $fname, $lname){\r\n\t\t$this->uid = id;\r\n\t\t$this->first_name = $fname;\r\n\t\t$this->last_name = $lname;\r\n\t}", "function user_register($user_info)\n {\n }", "public function getFirstName();", "public function createUser($data,$fname,$lname,$username){\n\t\t\t$this->db->from('tbl_employees')->where(array('fname'=>$fname,'lname'=>$lname));\n\t\t\t$query = $this->db->get();\n\t\t\tif($query->num_rows() == 0){\n\t\t\t\t$this->db->from('tbl_employees')->where('username',$username);\n\t\t\t\t$query = $this->db->get();\n\t\t\t\tif($query->num_rows() == 0){\n\t\t\t\t\t$this->db->insert('tbl_employees',$data);\n\t\t\t\t\treturn \"created\";\n\t\t\t\t}else{\n\t\t\t\t\treturn \"username\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn \"person\";\n\t\t\t}\n\t\t}", "public function getName($format = 'F L')\n\t{\n\t\t$name = str_replace('F', '{first}', $format);\n\t\t$name = str_replace('L', '{last}', $name);\n\t\t$name = str_replace('U', '{user}', $name);\n\n\t\t$name = str_replace('{first}', $this->first_name, $name);\n\t\t$name = str_replace('{last}', $this->last_name, $name);\n\t\t$name = str_replace('{user}', $this->{config('auth.username.field')}, $name);\n\n\t\treturn trim($name);\n\t}", "function lendingform_search_user($search = NULL) {\r\n \r\n $users = array();\r\n if (empty($search)) {\r\n $users = entity_load('user');\r\n } else {\r\n // Search users\r\n $users = entity_get_controller(PROJECT_ENTITY)->search_users($search);\r\n }\r\n \r\n $users_name_and_id = array();\r\n foreach ($users as $user) {\r\n $users_name_and_id[] = array(\r\n 'uid' => $user->uid,\r\n 'name' => lendingform_siemens_format_username($user),\r\n );\r\n }\r\n\r\n echo json_encode($users_name_and_id);\r\n \r\n exit();\r\n}", "function test13($user) {\n\n}", "function get_profile_usrnm($usrname){\r\n\t\r\n}", "public function crea_user(){\n\t\tif ($this->input->post('tipo_persona')==\"Natural\") {\n\t\t\t$nombres = 'Nombres del titular';\n\t\t\t$apellid = 'Apellidos del titular';\n\t\t\t$cedulas = 'Cédula de identidad';\n\t\t\t$numerif = 'RIF del titular';\n\t\t} else {\n\t\t\t$nombres = 'Razón social';\n\t\t\t$apellid = 'Representante legal';\n\t\t\t$cedulas = 'C.I. Representante legal';\n\t\t\t$numerif = 'RIF de la empresa';\n\t\t}\n\t\tif ($this->input->post('nacionalidad')==\"Local\") {\n\t\t\t$condced = 'required|min_length[6]|max_length[8]|callback_validanumero';\n\t\t\t$condrif = 'required|min_length[9]|max_length[10]|callback_validarif';\n\t\t} else {\n\t\t\t$condced = 'required|min_length[6]|max_length[9]|callback_validanumero';\n\t\t\t$condrif = 'required|min_length[9]|max_length[11]|callback_validarif';\n\t\t}\n\t\t$this->form_validation->set_rules('tit_nombres', $nombres, 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('tit_apellidos', $apellid, 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('tit_cedula', $cedulas, $condced);\n\t\t$this->form_validation->set_rules('tit_rif', $numerif, $condrif);\n\t\tif ($this->input->post('tipo_persona')==\"Natural\") {\n\t\t\t$this->form_validation->set_rules('tit_fecha_nac', 'Fecha de nacimiento', 'required');\n\t\t\t$this->form_validation->set_rules('tit_edo_civil', 'Estado Civil', 'required');\n\t\t\t$this->form_validation->set_rules('tit_sexo', 'Sexo', 'required');\n\t\t\t$this->form_validation->set_rules('tit_profesion', 'Profesión', 'required|max_length[150]');\n\n\t\t\t$this->form_validation->set_rules('cot_nombres', 'Nombres del cotitular', 'max_length[150]');\n\t\t\t$this->form_validation->set_rules('cot_apellidos', 'Apellidos del cotitular', 'max_length[150]');\n\t\t\t$this->form_validation->set_rules('cot_cedula', 'Cédula de identidad', 'min_length[6]|max_length[9]|callback_validanumero');\n\t\t\t$this->form_validation->set_rules('cot_rif', 'RIF del cotitular', 'min_length[8]|max_length[11]|callback_validarif');\n\t\t}\n\t\t$this->form_validation->set_rules('calle', 'Calle/Avenida/Vereda', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('cruce', 'Cruce con/Entre calles', 'max_length[150]');\n\t\t$this->form_validation->set_rules('casa', 'Casa/Edificio', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('sector', 'Urbanización/Sector', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('piso', 'Piso Nro.', 'max_length[50]');\n\t\t$this->form_validation->set_rules('apto', 'Apto.', 'max_length[50]');\n\t\t$this->form_validation->set_rules('referencia', 'Punto de referencia', 'max_length[150]');\n\t\t$this->form_validation->set_rules('ciudad', 'Ciudad', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('municipio', 'Municipio', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('estado', 'Estado', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('parroquia', 'Parroquia', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('cod_postal', 'Código Postal', 'required|max_length[10]');\n\t\t$this->form_validation->set_rules('pais', 'País', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('tel_local', 'Teléfono Local', 'required|min_length[11]|max_length[50]|callback_validanumero');\n\t\t$this->form_validation->set_rules('tel_celular', 'Teléfono Celular', 'required|min_length[11]|max_length[50]|callback_validanumero');\n\t\t$this->form_validation->set_rules('email', 'Dirección de Correo Electrónico', 'required|max_length[150]|valid_email');\n/*\n\t\t$this->form_validation->set_rules('enrol_codigo', 'Código del enrolador', 'required|exact_length[5]|callback_validacodigo|callback_existecodigo');\n\t\t$this->form_validation->set_rules('enrol_nombre_completo', 'Nombres y Apellidos del enrolador', 'required|max_length[200]');\n\n\t\t$this->form_validation->set_rules('patroc_codigo', 'Código del patrocinador', 'required|exact_length[5]|callback_validacodigo|callback_existecodigo');\n\t\t$this->form_validation->set_rules('patroc_nombre_completo', 'Nombres y Apellidos del patrocinador', 'required|max_length[200]');\n*/\n\t\t$this->form_validation->set_rules('banco_nombre_cta', 'Nombre del titula de la cuenta', 'required|max_length[200]');\n\t\t$this->form_validation->set_rules('banco_numero_cta', 'Número de cuenta bancaria', 'required|min_length[13]|max_length[20]|callback_validanumero');\n\t\t$this->form_validation->set_rules('banco_nombre_bco', 'Nombre del Banco', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('banco_sucursal', 'Sucursal bancaria', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('banco_estado', 'Estado de ubicación del banco', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('banco_tipo_cta', 'Tipo de cuenta', 'required');\n\n\t\t$this->form_validation->set_message('required', 'El campo {field} es obligatorio, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('valid_email', 'Debe incluir un correo electrónico válido, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('max_length', 'El campo {field} no debe exceder de {param} caracteres, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('min_length', 'El campo {field} debe tener al menos {param} caracteres, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('exact_length', 'El campo {field} debe tener {param} caracteres, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('validanumero', 'El campo {field} sólo debe contener números, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('validarif', 'El campo {field} debe contener el formato válido para RIF (1 letra: V, J ó E) y hasta 10 números sin guiones ni puntos, pulse atrás para corregir');\n\n\t\tif ($this->form_validation->run() == FALSE){\n $this->registro();\n } else {\n\t\t\t$data = new stdClass();\n\t\t\t$data->title = \"MANNA - La Provisión que cambiará tu vida\";\n\t\t\t$data->contenido = \"apl/auth/contrato\"; //aqui es la dirección física del controlador\n\t\t\t$data->panel_title = \"Afiliación de aliados comerciales - Página 3 de 3\";\n\n\t\t\t$data->tit_nombres = $this->input->post('tit_nombres');\n \t$data->tit_apellidos = $this->input->post('tit_apellidos');\n \t$data->tit_cedula = $this->input->post('tit_cedula');\n \t$data->tit_rif = $this->input->post('tit_rif');\n \t$data->tit_fecha_nac = $this->input->post('tit_fecha_nac');\n \t$data->tit_edo_civil = $this->input->post('tit_edo_civil');\n \t$data->tit_sexo = $this->input->post('tit_sexo');\n \t$data->tit_profesion = $this->input->post('tit_profesion');\n \t$data->cot_nombres = $this->input->post('cot_nombres');\n \t$data->cot_apellidos = $this->input->post('cot_apellidos');\n \t$data->cot_cedula = $this->input->post('cot_cedula');\n \t$data->cot_rif = $this->input->post('cot_rif');\n \t$data->cot_fecha_nac = $this->input->post('cot_fecha_nac');\n \t$data->cot_edo_civil = $this->input->post('cot_edo_civil');\n \t$data->cot_sexo = $this->input->post('cot_sexo');\n \t$data->calle = $this->input->post('calle');\n \t$data->cruce = $this->input->post('cruce');\n \t$data->casa = $this->input->post('casa');\n \t$data->sector = $this->input->post('sector');\n \t$data->piso = $this->input->post('piso');\n \t$data->apto = $this->input->post('apto');\n \t$data->referencia = $this->input->post('referencia');\n \t$data->ciudad = $this->input->post('ciudad');\n \t$data->municipio = $this->input->post('municipio');\n \t$data->estado = $this->input->post('estado');\n \t$data->parroquia = $this->input->post('parroquia');\n \t$data->cod_postal = $this->input->post('cod_postal');\n \t$data->pais = $this->input->post('pais');\n \t$data->tel_local = $this->input->post('tel_local');\n \t$data->tel_celular = $this->input->post('tel_celular');\n \t$data->email = $this->input->post('email');\n \t$data->enrol_codigo = $this->input->post('enrol_codigo');\n \t$data->enrol_nombre_completo = $this->input->post('enrol_nombre_completo');\n \t$data->patroc_codigo = $this->input->post('patroc_codigo');\n \t$data->patroc_nombre_completo = $this->input->post('patroc_nombre_completo');\n \t$data->banco_nombre_cta = $this->input->post('banco_nombre_cta');\n \t$data->banco_numero_cta = $this->input->post('banco_numero_cta');\n \t$data->banco_nombre_bco = $this->input->post('banco_nombre_bco');\n \t$data->banco_sucursal = $this->input->post('banco_sucursal');\n \t$data->banco_estado = $this->input->post('banco_estado');\n \t$data->banco_tipo_cta = $this->input->post('banco_tipo_cta');\n \t$data->tipo_persona = $this->input->post('tipo_persona');\n \t$data->nacionalidad = $this->input->post('nacionalidad');\n \t$data->tipo_afiliado = $this->input->post('tipo_afiliado');\n \t$data->tipo_kit = $this->input->post('tipo_kit');\n \t$data->fechapago = $this->input->post('fechapago');\n// \t$data->fechapago = substr($this->input->post('fechapago'),6,4).\"-\".substr($this->input->post('fechapago'),3,2).\"-\".substr($this->input->post('fechapago'),0,2);\n \t$data->numcomprobante = $this->input->post('numcomprobante');\n \t$data->bancoorigen = $this->input->post('bancoorigen');\n \t$data->envio = $this->input->post('envio'); \t\n \t$data->direccion_envio = $this->input->post('direccion_envio');\n\n\t\t\t$data->active = \"registro\";\n\t\t\t$this->load->view('menu',$data);\n\t\t}\n\t}", "public static function show_user_extra_field( $user ) {\n\t\t$phone = get_user_meta( $user->ID, 'phone', true );\n\t\tif ( empty( $phone ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<h3><?php echo esc_html__( 'Extra profile information', 'uael' ); ?></h3>\n\t\t<table class=\"form-table\">\n\t\t\t<tr>\n\t\t\t\t<th><label for=\"phone\"><?php echo esc_html__( 'Phone Number', 'uael' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" name=\"phone\" id=\"phone\" value=\"<?php echo esc_attr( $phone ); ?>\" class=\"regular-text\" placeholder=\"<?php echo esc_attr( 'Enter your phone number' ); ?>\" /><br />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<?php\n\t}", "private function handleKeyLastname(UserInterface $user, Request $request) {\n $data = $request->request->all();\n\n if (array_key_exists('lastname', $data)) {\n $user->setLastname($data['lastname']);\n }\n }" ]
[ "0.5785363", "0.5715713", "0.539201", "0.53585434", "0.53443265", "0.5260504", "0.52086633", "0.5207948", "0.5175861", "0.51687634", "0.51679206", "0.5163125", "0.5141774", "0.51208144", "0.5105209", "0.51007736", "0.5098209", "0.507301", "0.50632715", "0.5055364", "0.50151825", "0.5009266", "0.4989947", "0.4989571", "0.49863306", "0.49761367", "0.4961526", "0.4951535", "0.4948088", "0.49437222", "0.49138278", "0.49031383", "0.48602542", "0.4857318", "0.48526374", "0.48453847", "0.4836778", "0.4830208", "0.4820101", "0.48153317", "0.48008478", "0.47997957", "0.4799704", "0.47970578", "0.4794841", "0.47934666", "0.47927076", "0.4791546", "0.47877666", "0.4778374", "0.47696194", "0.4768304", "0.47618094", "0.4760597", "0.47460184", "0.47369614", "0.4727243", "0.4718662", "0.47115582", "0.47113383", "0.4709812", "0.47087568", "0.4702662", "0.470076", "0.46935216", "0.46892434", "0.46871793", "0.46828133", "0.46807197", "0.46755037", "0.4665316", "0.46629417", "0.46609214", "0.46585286", "0.46576133", "0.46559554", "0.46556813", "0.46550503", "0.46508405", "0.4649607", "0.46485582", "0.4645696", "0.4644131", "0.46407405", "0.46385545", "0.46366635", "0.46355525", "0.46317267", "0.46309033", "0.4622307", "0.46204543", "0.46171367", "0.4613885", "0.46132255", "0.46065763", "0.46048734", "0.46004117", "0.459757", "0.45964205", "0.45940274", "0.45939815" ]
0.0
-1
Add vat to site
public function up() { Schema::table('sites', function (Blueprint $table) { $table->float('vat')->default(21)->after('country_id'); }); // Add vat to sites_payments Schema::table('sites_payments', function (Blueprint $table) { $table->float('payment_vat')->default(21)->after('payment_rate'); }); // Recalculate commissions \App\Models\Site\Payment::whereNotNull('reseller_id')->chunk(10, function ($payments) { foreach ($payments as $payment) { $payment_net_amount = $payment->payment_amount / ( ( 100 + $payment->payment_vat ) / 100 ); $reseller_amount = $payment->reseller_fixed + ( $payment_net_amount * $payment->reseller_variable / 100 ); $payment->update([ 'reseller_amount' => $reseller_amount, ]); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cao_vip_page() {\r\n}", "public function vitimas() {\n $this->validaAutenticacao();\n $vitimas = Container::getModel('Vitimas');\n $this->view->vitimas = $vitimas->getAllDashboard();\n $vitimas->__set('id', '1');\n $this->view->vtm = $vitimas->getVitima();\n $this->menu();\n $this->render('vitimas', 'layout-dashboard');\n }", "public function show(Vat $vat)\n {\n //\n }", "public function onTwigSiteVariables()\n {\n $this->grav['assets']->addJs('plugin://shoppingcart-shipping-payment-method/service/script.js');\n }", "public function add_video_glance() {\n\t\t/* How many videos are published. */\n\t\t$video_count = wp_count_posts( 'video' )->publish;\n\t\t\n\t\t/* Get the correct label (video, videos) depending on the count. */\n\t\t$video_type = get_post_type_object( 'video' );\n\t\t$video_text = _n( $video_type->labels->singular_name, $video_type->labels->name, intval( $video_count ), 'makigas-videoman' );\n\t\t\n\t\t/* Render HTML code. */\n\t\techo '<li class=\"page-count video-count\">';\n\t\techo '<a href=\"edit.php?post_type=video\">' . $video_count . ' ' . strtolower( $video_text ) . '</a>';\n\t\techo '</li>';\n\t\t\n\t\t/* TODO: content: \"\\f236\"; in CSS: */\n\t}", "public function avancer($vitesse) {\n $this->vitesse = $vitesse;\n\n return \"la voiture roule à \" .$this->vitesse.\"km/h\";\n}", "public static function addVat($priceWithoutVat, $vat)\n {\n if ($vat) {\n return $priceWithoutVat * (1 + ($vat / 100));\n }\n\n return $priceWithoutVat;\n }", "public static function afficherVue() {\r\n $filevue = \"application/views/\" . Page::getInstance()->vue . \".view.php\";\r\n if (!empty($filevue)) {\r\n Page::getInstance()->insererVue();\r\n } else {\r\n die(\"vue non renseigne\");\r\n }\r\n }", "public static function include_vat_check() {\n ?>\n <p id=\"edd-vat-reg-check-wrap\">\n <label for=\"edd-vatreg\" class=\"edd-label\">\n <?php _e( 'I am registered for VAT in the EU', 'taxamoedd' ); ?>\n <input class=\"edd-vatreg\" type=\"checkbox\" name=\"edd_vatreg\" id=\"edd-vatreg\" value=\"true\" />\n </label>\n </p>\n\n <p id=\"edd-vat-reg-number-wrap\">\n <label for=\"vat_number\" class=\"edd-label\">\n <?php _e( 'VAT Number', 'taxamoedd' ); ?>\n </label>\n <span class=\"edd-description\"><?php _e( 'If you are registered for VAT, place your VAT number here (no spaces).', 'taxamoedd' ); ?></span>\n <input type=\"text\" id=\"vat_number\" name=\"vat_number\" class=\"vat-number edd-input\" placeholder=\"<?php _e( 'VAT Number', 'taxamoedd' ); ?>\" value=\"\"/>\n </p>\n\n\n <?php\n }", "private function insererVue() {\r\n $filevue = \"application/views/\" . $this->vue . \".view.php\";\r\n require_once $filevue;\r\n }", "public function onTwigSiteVariables()\n\t{\n\t\trequire_once __DIR__ . '/classes/datetools.php';\n\n\t\t$args = [];\n\t\t$args['config'] = $this->grav['config'];\n\n\t\t$twig = $this->grav['twig'];\n\t\t$twig->twig_vars['datetools'] = new DateTools($args);\n\t\t//$twig->twig->addGlobal('datetools', new DateTools($args));\n\t}", "public function add_version() {\n $installed = get_option( 'wd_academy_installed' );\n if ( $installed ) {\n update_option( 'wd_academy_installed', time() );\n }\n update_option( 'wd_academy_version', WD_ACADEMY_VERSION );\n }", "public function uxstockIntegratewithVC(){\n\t\tif(!defined(WPB_VC_VERSION)){\n\n\t\t\tadd_action('admin_notices',array($this,'uxstockshowVersionnotices'));\n\t\t}\n\n\t\t//Visual Composer Addons\n\t\t\n\t\tinclude UXSTOCK_ACC_PATH.'/vc-addons/vc-slide.php';\n\t\tinclude UXSTOCK_ACC_PATH.'/vc-addons/vc-logo-carosel.php';\n\t\tinclude UXSTOCK_ACC_PATH.'/vc-addons/vc-service.php';\n\t\t\n\t}", "static function add_voting(): void {\r\n\t\tself::add_acf_inner_field(self::roles, self::voting, [\r\n\t\t\t'label' => 'Automatic voting rights?',\r\n\t\t\t'type' => 'true_false',\r\n\t\t\t'instructions' => 'As opposed to earned.',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '25',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'message' => '',\r\n\t\t\t'default_value' => 0,\r\n\t\t\t'ui' => 1,\r\n\t\t]);\r\n\t}", "function vatIncluded($value = 0, $vat_percent = 20)\n{\n return $value * (1 + $vat_percent / 100);\n}", "public function vpup_init() \n {\n // Build our shortcode.\n add_shortcode( 'vpup', [ $this, 'vpup_shortcode' ] );\n\n // Register our vue scripts.\n wp_register_script( 'vpup-dist', VPUP_URL . 'wp-vue/dist/js/app.js', [ 'jquery' ] );\n wp_register_script( 'vpup-dist-chunks', VPUP_URL . 'wp-vue/dist/js/chunk-vendors.js' );\n \n // Enqueues our styles. \n add_action( 'wp_enqueue_scripts', [ $this, 'vpup_load_styles' ], 10 );\n }", "public function set_customer_vat( $post_data ) {\n\n\t\tif ( ! empty( $post_data ) ) {\n\n\t\t\t$post_data = explode( '&', $post_data );\n\n\t\t\tforeach ( $post_data as $pair ) {\n\t\t\t\t$pair = explode( '=', $pair );\n\t\t\t\t$post_data[ $pair[0] ] = urldecode( $pair[1] );\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $post_data['billing_wc_avatax_vat_id'] ) ) {\n\t\t\tWC()->customer->vat_id = $post_data['billing_wc_avatax_vat_id'];\n\t\t}\n\t}", "public function render_my_vat_number_content() {\n\t\t$vars = array(\n\t\t\t'vat_number' => get_user_meta( get_current_user_id(), 'vat_number', true ),\n\t\t\t'show_title' => version_compare( WC()->version, '2.6', '<' ),\n\t\t\t'messages' => $this->messages,\n\t\t);\n\n\t\twc_get_template(\n\t\t\t'my-account/my-vat-number.php',\n\t\t\t$vars,\n\t\t\t'woocommerce-eu-vat-number',\n\t\t\tuntrailingslashit( plugin_dir_path( WC_EU_VAT_FILE ) ) . '/templates/'\n\t\t);\n\t}", "public function stockIntegrateWithVC() {\n\t\tif ( !defined('WPB_VC_VERSION')){\n\t\t\tadd_action('admin_notices', array($this, 'stockShowVcVersionNotice'));\n\t\t}\n\t\t\n\t//visual composer addons\n\tinclude STOCK_ACC_PATH .'/vc-addons/vc-slides.php';\n\t\n\t}", "public function index()\n {\t\n $this->variation();\n }", "function vida_scripts_init() {\n\t\n}", "static function install() {\n\t\t\tVWvideoShare::setupOptions();\n\t\t\tflush_rewrite_rules();\n\t\t}", "public function addVariable($tv);", "function vmt_head()\n\t\t{\n\t\t\tif (! empty($this->options['google'])) {\n\t\t\t\techo '<meta name=\"google-site-verification\" content=\"' . esc_attr($this->options['google']) . '\" />';\n\t\t\t}\n\t\t\tif (! empty($this->options['pinterest'])) {\n\t\t\t\techo '<meta name=\"p:domain_verify\" content=\"' . esc_attr($this->options['pinterest']) . '\" />';\n\t\t\t}\n\t\t\tif (! empty($this->options['analytics'])) {\n\t\t\t\techo $this->options['analytics'];\n\t\t\t}\n\t\t}", "public function extra_voor_verp()\n\t{\n\t}", "function ventures() {\n\n\t\t$labels = array(\n\t\t\t'name' => 'Ventures',\n\t\t\t'singular_name' => 'Venture',\n\t\t\t'menu_name' => 'Ventures',\n\t\t\t'name_admin_bar' => 'Venture',\n\t\t);\n\t\t$args = array(\n\t\t\t'label' => 'Venture',\n\t\t\t'description' => 'Polymath ventures',\n\t\t\t'labels' => $labels,\n\t\t\t'supports' => array( 'title', 'thumbnail', ),\n\t\t\t'taxonomies' => array(),\n\t\t\t'hierarchical' => false,\n\t\t\t'public' => true,\n\t\t\t'menu_position' => 5,\n\t\t\t'capability_type' => 'post',\n\t\t);\n\t\tregister_post_type( 'ventures', $args );\n\n\t}", "function free_vietnam_visa($data) {\r\n $data['page_meta'] = get_page_meta(ADVERTISING_PROMOTION_ADS_PAGE, null);\r\n \r\n $data = get_page_navigation($data, $data['is_mobile'], ADVERTISING_PROMOTION_ADS_PAGE);\r\n \r\n $data['countries'] = $this->Visa_Model->get_nationalities(true);\r\n \r\n $data['main_view'] = load_view('advertising/free_visa', $data, $data['is_mobile']);\r\n \r\n return $data;\r\n }", "function activate() {\r\n add_option(\"bvd_post_version\", '31');\t\r\n add_option(\"bvd_post_type\", 'fav');\r\n add_option(\"bvd_connection\", 'fopen');\r\n add_option(\"bvd_show_version\", '1');\r\n add_option(\"bvd_favorites\", 'Psalm 8:3-5|Psalm 4:8|Psalm 27:1|Psalm 27:14|Psalm 11:7|1 Samuel 15:22|Psalm 30:4-5|Psalm 27:7-9a|Psalm 38:9|Psalm 50:10-11|Psalm 50:23|Psalm 71:19|Psalm 73:21-24|Hebrews 13:17|Hebrews 12:3|James 4:3|James 4:7-8|Psalm 4:4|Jeremiah 17:5|Hebrews 13:5-6|Hebrews 13:8|Psalm 56:3-4|Psalm 43:5|Psalm 146:7');\r\n }", "public function index() {\r\n $this->genererVue();\r\n }", "public function vpup_shortcode( $atts )\n {\n // enqueue our vue scripts.\n wp_enqueue_script( 'vpup-dist' );\n wp_enqueue_script( 'vpup-dist-chunks' );\n\n // Check our cart.\n $should_redirect = $this->vpup_set_cart();\n\n // Redirect to cart if needed. \n $this->vpup_redirect_to_cart( $should_redirect );\n\n // Localize data to vue.\n $vue_atts = esc_attr( json_encode( [\n 'siteURL' => VPUP_URL,\n 'url' => get_site_url()\n ] ) );\n\n // Output our mountable div and pass in our $vue_atts\n return \"<div id='vpup-app' data-vpup-atts='{$vue_atts}'></div>\";\n }", "function xmldb_local_vlacsguardiansurvey_install() {\r\n}", "function addVako($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedVakoIdOnMarketplace_'.rand(1000, 9999); \n}", "function havp_update_AV() {\n\tfile_put_contents(HVDEF_AVUPD_SCRIPT, havp_AVupdate_script());\n\thavp_set_file_access(HVDEF_AVUPD_SCRIPT, HVDEF_AVUSER, '0755');\n\t// Run update in background\n\tmwexec_bg(HVDEF_AVUPD_SCRIPT);\n}", "function add_site_option($option, $value)\n {\n }", "private function setRutasVista() {\n /* variable relacionadas a un controlador especifico */\n $this->_rutas = [\n 'vista' => RUTA_MODULOS . 'vista' . DS . $this->_controlador . DS,\n 'img' => URL_MODULOS . \"vista/\" . $this->_controlador . \"/img/\",\n 'js' => URL_MODULOS . \"vista/\" . $this->_controlador . \"/js/\",\n 'css' => URL_MODULOS . \"vista/\" . $this->_controlador . \"/css/\",\n ];\n }", "public function update(Request $request, Vat $vat)\n {\n //\n }", "public function edit(Vat $vat)\n {\n //\n }", "public function vcenter() {\n\t}", "function add($v)\n\t{\n\t\t$this->liste[] = $v;\n\t}", "public function index()\n {\n $this->permission->check_label('add_variant')->create()->redirect();\n\n $content = $this->lvariant->variant_add_form();\n $this->template_lib->full_admin_html_view($content);\n }", "public function setVatIdNo($vatin);", "function totalVAT()\n {\n return false;\n }", "function vmt_init()\n\t\t{\n\t\t\t// Register admin style sheet\n\t\t\twp_register_style('vmt-style-admin', plugins_url('verify-meta-tags') . '/admin.css');\n\t\n\t\t\t// Register the settings name and sanitization function\n\t\t\tregister_setting( 'vmt-options-page', 'verify-meta-tags', array (&$this, 'sanitize_settings') );\n\t\t}", "public function setVip($vip)\n {\n $this->_vip = $vip;\n }", "function VM_setVisualURL($VMguest,$url)\n{\n\t//Get information about the VM guest and its host\n\t$info = VM_getSWandHost($VMguest);\n\n\t//e.g. $url = \"m23vmclient:1\" => $hostScreen[0] = \"m23vmclient\", $hostScreen[1] = \"1\"\n\t$hostScreen = explode(\":\",$url);\n\t$data['vmVisualURL'] = \"$info[vmHostIP]:$hostScreen[1]\";\n\treturn(CLIENT_setAllParams($VMguest,$data));\n}", "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 }", "protected function _addIsVirtual()\n {\n if ($this->_order->getIsVirtual() == '1') {\n $array = array('isVirtual' => 1);\n \n if (is_array($this->_vars)) {\n $this->_vars = array_merge($this->_vars, $array);\n } else {\n $this->_vars = $array;\n }\n } \n }", "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 tsuiseki_tracking_install() {\n add_option('tsuiseki_tracking_key', NULL, NULL, 'no');\n $css = TSUISEKI_TRACKER_CSS_CLASS;\n if (empty($css)) {\n $css = 'a.tsuiseki-link';\n }\n add_option('tsuiseki_tracking_css_class', $css, NULL, 'no');\n add_option('tsuiseki_tracking_excluded_uris', 'wp-admin/*', NULL, 'no');\n}", "function publisher_inject_location_before_uva() {\n\n\t\t\tglobal $wp_query, $publisher_inject_location_uva_compatibility;\n\n\t\t\t$publisher_inject_location_uva_compatibility['is_404'] = is_404();\n\t\t\t$publisher_inject_location_uva_compatibility['is_search'] = is_search();\n\n\t\t\t$wp_query->is_404 = false;\n\t\t\t$wp_query->is_search = false;\n\t\t}", "function inject_js() {\nglobal $wp;\n$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );\nif($current_url == 'url zeljene stranice stranice'){\n\techo '<script src=\"'. esc_url( plugins_url( __FILE__ ) ).'/imeJSfajlaGdeSeNalazi.js\"></script>';\n \t }\n}", "private function formVipCode() {\n\t\t\t\n\t\t\t//The vipcode is formed by y - Year 2 digits, z - day of the year, Hi - Hour and minutes, s - seconds\n\t\t\t$this->vipCodeUniqueId = date('yz-Hi-s');\n\t\t\t//$this->vipCodeUniqueId = explode('.', microtime(true))[0] . explode('.', microtime(true))[1];\n\t\t\t$this->vipCode = \"voltoAo\" . ucfirst($this->enterprise->getName()) . \"#\". $this->vipCodeUniqueId;\n\t\t\treturn $this->vipCode;\n\t\t\t\n\t\t}", "public function showVcVersionNotice() {\n $plugin_data = get_plugin_data(__FILE__);\n echo '\n <div class=\"updated\">\n <p>'.sprintf(__('<strong>%s</strong> requires <strong><a href=\"http://bit.ly/vcomposer\" target=\"_blank\">Visual Composer</a></strong> plugin to be installed and activated on your site.', 'vc_extend'), $plugin_data['Name']).'</p>\n </div>';\n }", "private function set_category_version($site_id, $version){\n\n $data = $this->get_category_version();\n $data[$site_id] = $version;\n// var_dump(json_encode($data));\n $this->ebay_model->set_storage_data('ebay_category_version', json_encode($data));\n\n }", "function addVakoImage($object) {\n /* you can itentify the vako with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedVakoImageIdOnMarketplace_'.rand(1000, 9999); \n}", "function vatAmount($value = 0, $vat_percent = 20)\n{\n return ($vat_percent / 100) * $value;\n}", "public function processVat()\n {\n $query = preg_replace('/[^\\\\d.]+/', '', self::$_query);\n $vatCalculator = new Vat($query);\n $data = $vatCalculator->getVatOf($query);\n return $vatCalculator->output($data);\n }", "public function addRevision()\n {\n $this->check_sess($this->session->user_logged);\n\t\t$this->load->view('head');\n\t\t$this->load->view('sclerk_sidebar');\n\n\t\t$this->load->view('search_officer', $this->response);\n\t\t$this->load->view('footer');\n }", "public function show_my_account() {\n\t\tif ( version_compare( WC()->version, '2.6', '<' ) ) {\n\t\t\t$this->render_my_vat_number_content();\n\t\t}\n\t}", "public function vitrassa()\n { \n $table = 'vitrassa';\n $all = $this->Master->test2($table);\n $data['product'] = $all;\n $this->load->view('designer_collection/vitrassa', $data);\n }", "public function addVideo($title, $vID, $sID=\"vimSID\", $hdID=\"hdID\", $sdID=\"sdID\", $mobileID=\"mobileID\", $type=\"Generic\", $thumb=\"tn\", $frame=\"fr-img\", $ro_dir=\"Director\", $ro_dp=\"DP\", $ro_cam=\"Camera\", $ro_ed=\"Editor\", $desc=\"Long description\"){\n $this->videoList[] = new cShowcaseVideo($title, $vID, $sID, $hdID, $sdID, $mobileID, $type, $thumb, $frame, $ro_dir, $ro_dp, $ro_cam, $ro_ed, $desc);\n }", "function grab_video_vine($url) {\n $vId = explode('/', $url);\n $vTitle = get_vine_title($url);\n $video = array();\n $video[0]['index'] = 1;\n $video[0]['video_id'] = $vId[4];\n $video[0]['title'] = (string) $vTitle;\n $video[0]['duration'] = 'Unknown';\n $video[0]['video_source'] = 'Vine';\n\n return $video;\n}", "public function addAt() {\n\t\t$at = json_decode(Flight::request()->query['at'],true);\n\t\t$date = date('H:i Y-m-d', $at['d']);\n\t\tswitch ($at['t']) {\n\t\t\tcase 'on': exec('at '.$date.' -q A -f /srv/www/home.fr/public/conf/aton.txt'); break;\n\t\t\tcase 'off': exec('at '.$date.' -q B -f /srv/www/home.fr/public/conf/atoff.txt'); break;\n\t\t\tcase 'tts': exec('at '.$date.' -q C -f /srv/www/home.fr/public/conf/attts.txt'); break;\n\t\t}\n\t\tFlight::json(array('Status' => 'OK','At' => $date, 'Type' => $at['t']));\n\t}", "static function add_bod_vacant(): void {\r\n\t\tself::add_acf_inner_field(self::bods, self::bod_vacant, [\r\n\t\t\t'label' => 'Vacant seats',\r\n\t\t\t'type' => 'number',\r\n\t\t\t'instructions' => '',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::bod_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'min' => 1,\r\n\t\t\t'max' => 5,\r\n\t\t\t'step' => 1,\r\n\t\t]);\r\n\t}", "function cc_set_in_vetrina(){\n\t\n\t$path = ABSPATH . \"import/\";\n\t$file = FILE_XML_IMMOBILI; // nome del file\n\t$cometa = cc_get_unique_post_meta_values(\"_id_cometa\");\n\n\t$xml = @simplexml_load_file($path.$file);\t\n\n\tif($xml){\t\t\n\t\t\n\t\t$offerte = $xml->Offerte;\n\n\t\tif($offerte){\n\t\t\t\n\t\t\tforeach($offerte as $offerta){\n\t\t\t\t\n\t\t\t\t$idunique = (int) $offerta->Idimmobile; // campo univoco Cometa\n\t\t\t\t$post_id = array_search($idunique, $cometa);\n\t\t\t\t\n\t\t\t\tif(empty($post_id)) continue;\n\t\t\t\t\n\t\t\t\t$vetrina = (int) $offerta->Vetrina;\n\t\t\t\t\n\t\t\t\tupdate_post_meta( $post_id, \"fave_featured\", $vetrina );\n\n\t\t\t}\n\t\t\t\n\t\t\t$dbg = var_export($results, true);\n\t\n\t\t\tcc_import_immobili_error_log($dbg);\n\n\t\t\t\n\t\t}else{\n\t\t\tcc_import_immobili_error_log(\"no offerte!\");\n\t\t}\n\t\t\n\t}else{\n\t\tcc_import_immobili_error_log(\"no xml!\");\n\t}\n\t\n}", "function devindavid_add_site_info() {\n\t\t\n\t\t$site_info = sprintf(\n\t\t\t\n\t\t\t'<div id=\"copyrights\" class=\"noselect\">\n\t\t\t<span>©%1$s </span>\n\t\t\t<span class=\"footerLogo\" style=\"margin: 0 0 0 6px; display:inline-block; color:transparent;\">%2$s</span>\n\t\t\t</div>',\n\t\t\t\n\t\t\tsprintf( esc_html__( '%s', 'devindavid' ),\n\t\t\t\t'2021'\n\t\t\t),\n\t\t\tsprintf( esc_html__( '%s', 'devindavid' ),\n\t\t\t\t'Devin David'\n\t\t\t)\n\t\t);\n\n\t\techo apply_filters( 'devindavid_site_info_content', $site_info ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t}", "function site($url) {\n\t\t$this->url = $url;\n\t}", "function am2_vanity_add_meta_box() {\n\t\n\t$vanity_available_post_types = get_option('vanity_available_post_types');\n\t$screens = $vanity_available_post_types;\n\n\tforeach ( $screens as $screen ) {\n\n\t\tadd_meta_box(\n\t\t\t'am2_vanity_sectionid',\n\t\t\t__( 'Vanity URL setup', 'am2_vanity_textdomain' ),\n\t\t\t'am2_vanity_meta_box_callback',\n\t\t\t$screen,\n\t\t\t'side',\n\t\t\t'high'\n\t\t);\n\t}\n}", "function setHasVAT( $value )\n {\n if ( $value )\n $this->HasTax = 1;\n else\n $this->HasTax = 0;\n }", "public function onTwigSiteVariables()\n {\n }", "public function onTwigSiteVariables() {\n if ($this->grav['page']->template() == 'proposal') {\n $this->grav['twig']->twig_vars['proposal'] = $this->fetchProposal();\n $this->grav['twig']->twig_vars['currency_symbol'] = $this->getSymbolOfCurrencyCode($this->config->get('plugins.proposal.stripe_currency'));\n }\n }", "function ajouter_vue(){\n $fichier = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'cli' . DIRECTORY_SEPARATOR . 'compteur';\n $fichier_journalier = $fichier . '_' . date('Y-m-d');\n incrementer_compteur($fichier);\n incrementer_compteur($fichier_journalier);\n }", "function crea_vetrina()\n {\n $peer = new VetrinaPeer();\n\n $do = $peer->new_do();\n $peer->setupByParams($do);\n $peer->save($do);\n\n if (is_html())\n return Redirect::success();\n else\n return Result::ok();\n }", "public function pagina(){\r\n include\"vies/template.php\";\r\n }", "public function add_meta_keyword() {\n\t\t// Get global settings\n\t\t$vfb_settings \t= get_option( 'vfb-settings' );\n\n\t\t// Settings - Disable meta tag version\n\t\t$settings_meta\t= isset( $vfb_settings['show-version'] ) ? '' : '<!-- <meta name=\"vfbPro\" version=\"'. VFB_PRO_VERSION . '\" /> -->' . \"\\n\";\n\n\t\techo apply_filters( 'vfb_show_version', $settings_meta );\n\t}", "function intromvc()\n {\n $data['$option'] = \"doc/intromvc\";\n $this->loadContent('doc/home', $data);\n }", "function havp_install() {\n\tupdate_status(\"HAVP check system ...\\n\");\n\thavp_check_system();\n\t// Remove stale scripts\n\tunlink_if_exists(HVDEF_SCRIPT_DIR . \"/havp\");\n\tunlink_if_exists(HVDEF_SCRIPT_DIR . \"/clamd.sh\");\n\n\thavp_avset_resync();\n\thavp_update_AV();\n\n\tupdate_status(\"Starting update of AV databases. Wait 5-20 min before use ...\");\n}", "function fantacalcio_load_voti($round) {\n drupal_set_title(filter_xss('Risultati ' . $round . '&ordf; giornata'));\n\n $providers = get_vote_providers();\n $votes = get_votes_html_data($round, $providers);\n\n foreach($providers as $p_id => $provider) {\n insert_votes($votes[$p_id], $round, $p_id);\n } \n return \"\";\n}", "private function setTraffic() {\n $this->getTraffic();\n if (!$this->Traffic):\n $ArrSiteViews = ['siteviews_date' => $this->Date, 'siteviews_users' => 1, 'siteviews_views' => 1, 'siteviews_pages' => 1];\n $CreateSiteViews = new Create;\n $CreateSiteViews->ExeCreate('ws_siteviews', $ArrSiteViews);\n else:\n\n endif;\n }", "public function shareVisualsVars(View $view)\n {\n // Forward to layouts\n $view->with('visualLogo', $this->_getCacheEntry(AppCacheManager::EXTRANET_VISUAL_LOGO));\n $view->with('visualLogoLarge', $this->_getCacheEntry(AppCacheManager::EXTRANET_VISUAL_LOGO_LARGE));\n $view->with('visualLoginBackground', $this->_getCacheEntry(AppCacheManager::EXTRANET_VISUAL_AUTH_BACKGROUND));\n $view->with('visualFavicon', $this->_getCacheEntry(AppCacheManager::EXTRANET_VISUAL_FAVICON));\n\n }", "function vip_contrib_add_upload_cap() {\n\tadd_action( 'init', '_vip_contrib_add_upload_cap');\n\tadd_action( 'xmlrpc_call', '_vip_contrib_add_upload_cap' ); // User is logged in after 'init' for XMLRPC\n}", "public function getVat()\n {\n return $this->_dVat;\n }", "public function externalAction() {\n\n //GET SUBJECT\n $this->view->video = $video = Engine_Api::_()->core()->getSubject('sitereview_video');\n\n //CHECK THAT EMBEDDING IS ALLOWED OR NOT\n if (!Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview_video.embeds', 1)) {\n $this->view->error = 1;\n return;\n } else if (isset($video->allow_embed) && !$video->allow_embed) {\n $this->view->error = 2;\n return;\n }\n\n //GET EMBED CODE\n $this->view->videoEmbedded = \"\";\n if ($video->status == 1) {\n $video->view_count++;\n $video->save();\n $this->view->videoEmbedded = $video->getRichContent(true);\n }\n\n //TRACK VIEWS FROM EXTERNAL SOURCES\n Engine_Api::_()->getDbtable('statistics', 'core')\n ->increment('video.embedviews');\n\n //GET FILE LOCATION\n if ($video->type == 3 && $video->status == 1) {\n if (!empty($video->file_id)) {\n $storage_file = Engine_Api::_()->getItem('storage_file', $video->file_id);\n if ($storage_file) {\n $this->view->video_location = $storage_file->map();\n }\n }\n }\n\n //GET RATING DATA\n $this->view->rating_count = Engine_Api::_()->getDbTable('videoratings', 'sitereview')->ratingCount($video->getIdentity());\n }", "public static function stockAttribu() {\n $results = ModelStockAttribu::getAllIdcentre();\n $results1= ModelStockAttribu::getAllIdvaccin();\n // ----- Construction chemin de la vue\n include 'config.php';\n $vue = $root . '/app/view/stock/viewAttribution.php';\n require ($vue);\n }", "public function vUpdatevirtualAction(){\n\t\t$this->secondaryMenu($this->controller,$this->action);\n\t\t$this->tools($this->controller,$this->action);\n\t\t\t\n\t\t$stypes = Stype::find();\n\t\t$servers = Server::find();\n\t\t\n\t\t$itemservers = array();\n\t\tforeach($servers as $server) {\n\t\t\t$itemservers[] = $server->getName();\n\t\t}\n\t\t\n\t\t\n\t\t$semantic=$this->semantic;\n\t\t\n\t\t$btnCancel = $semantic->htmlButton(\"btnCancel\",\"Annuler\",\"red\");\n\t\t$btnCancel->getOnClick(\"Serveur/index\",\"#index\");\n\t\t\n\t\t\n\t\t$btnCancel = $semantic->htmlButton(\"btnCancel\",\"Annuler\",\"red\");\n\t\t$btnCancel->getOnClick(\"Servers\",\"#divAction\");\n\t\t\n\t\t\n\t\t$form=$semantic->htmlForm(\"frmUpdate\");\n\t\t$form->addInput(\"name\")->getField()->labeledToCorner(\"asterisk\",\"right\");\n\t\t\n\t\t\n\t\t$input2=$semantic->htmlInput(\"Configuration...\");\n\t\t$form->addInput(\"config\")->getField()->labeledToCorner(\"asterisk\",\"right\");\n\t\t\t\n\t\t\n\t\t\n\t\t$form->addDropdown(\"server\",$itemservers,\"Nom du Serveurs : * \",\"Selectionner un nom de serveur ...\",false);\n\t\t\n\t\t$form->addButton(\"submit\", \"Valider\",\"ui green button\")->postFormOnClick(\"Serveur/vAddSubmitvirtual\", \"frmUpdate\",\"#divAction\");\n\t\t\n\t\t\n\n\t\t$form->addButton(\"cancel\", \"Annuler\",\"ui red button\")->postFormOnClick(\"Serveur/hosts\", \"frmDelete\",\"#tab\");\n\t\t\n\t\t\t\n\t\t$this->jquery->compile($this->view);\n\t\t\n\t\t\n\t}", "function vip_powered_wpcom_url() {\n\treturn 'https://vip.wordpress.com/';\n}", "public function actionVegetables()\n {\n getSearchTags();\n\n // set category so the correct products will be displayed\n $product = \"vegetable\";\n $this->setParam('product', $product);\n\n // get search-tags if they are set and push them to the view so only products\n // that fit the tags are displayed\n $tags = $_GET['t'] ?? \"\";\n $this->setParam('tags', $tags);\n }", "function simple_visitor_counter_shortcode( $atts_total_view_counter )\n{\n\t$total_count_key = 'site_visit_counter';\n\t$totalvisitcount = get_option( $total_count_key );\n\t\n\n\t$atts_total_view_counter = shortcode_atts( array(\n\t\t\t\t\t\t\t\t\t'start' => add_option( $total_count_key, 0 ),\n\t\t\t\t\t\t\t\t), $atts_total_view_counter, 'svc' );\n\tif($atts_total_view_counter['start'] !='')\n\t{\n\t\t$totalvisitcount = $atts_total_view_counter['start'] + $totalvisitcount ;\n\t}\n\t\n\n\treturn \"Total Site Visit = {$totalvisitcount}\";\n}", "function video() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from videos where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $query = \"update videos set views = views + 1 where id =$id;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "function havp_AVupdate_script() {\n\t$hvdef_freshclam_path = HVDEF_FRESHCLAM_PATH;\n\t$hvdef_sigtool_path = HVDEF_SIGTOOL_PATH;\n\t$f = HVDEF_UPD_STATUS_FILE;\n\t$u = HVDEF_FRESHCLAM_STATUS_FILE;\n\treturn <<< EOD\n#!/bin/sh\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus update started.\" > $f\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus database already is updated.\" > $u\n{$hvdef_freshclam_path}\nwait\n/bin/cat $u >> $f\n{$hvdef_sigtool_path} --unpack-current daily.cvd\n{$hvdef_sigtool_path} --unpack-current main.cvd\nwait\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus update end.\" >> $f\nEOD;\n\n}", "function getV($url){\n\tif(preg_match(\"~/watch\\?v=(.+)~\", $url, $match)){\n\t\treturn $match[1];\n\t}\n\n\treturn false;\n}", "function mars_video_meta() {}", "public function initVenueratings()\n\t{\n\t\t$this->collVenueratings = new PropelObjectCollection();\n\t\t$this->collVenueratings->setModel('Venuerating');\n\t}", "public function init(){\n $this->vvars['menu'] = 'paid';\n $this->vvars['nav'] = 'paid';\n }", "public function add($vector)\n {\n }", "public function add_scripts() {\n\n\t\t\t\tFusion_Dynamic_JS::enqueue_script( 'fusion-video' );\n\t\t\t}", "public function getsvinfoAction()\n {\n $uid = $this->uid;\n $fid = $this->_request->getParam('fid', null);\n\n $result1 = Hapyfish2_Island_Bll_SuperVisitor::getSuperVisitor($uid, $fid);\n\n // update by hdf add compound visitor\n $result2 = Hapyfish2_Island_Bll_CompoundSuperVisitor::getSuperVisitor($uid, $fid);\n $result['spVisitors'] = array_merge($result1['spVisitors'], $result2['spVisitors']); \n\n $this->echoResult($result);\n }", "protected function mostraPaginaRegistrazione($vd) {\n $vd->setTitolo(\"AutoShop -> Registrazione\");\n $vd->setLogoFile(basename(__DIR__) . '/../View/Login/Logo.php');\n $vd->setMenuFile(basename(__DIR__) . '/../View/Login/Menu.php');\n $vd->setLeftBarInfoFile(basename(__DIR__) . '/../View/Login/LeftBarInfo.php');\n $vd->setContentFile(basename(__DIR__) . '/../View/Login/Registrazione.php');\n }", "public function hasVat()\r\n {\r\n return $this->item->getParentObject()->getOrder()->getProxy()->hasVat();\r\n }", "function wpbs_advertisment_option()\n {\n include wpbs_advs_plugin_dir . 'admin/view/adminLayoutOption.php';\n }", "function hasVAT( )\n {\n if ( $this->HasTax == 1 )\n return true;\n else\n return false;\n }" ]
[ "0.5725555", "0.55576676", "0.55553806", "0.550532", "0.5476012", "0.5457993", "0.5447146", "0.5428132", "0.5308347", "0.5270654", "0.5225805", "0.522406", "0.5214832", "0.52024126", "0.5192554", "0.5185213", "0.5179061", "0.5163304", "0.5144589", "0.51444674", "0.51410246", "0.51380384", "0.51288265", "0.5123802", "0.5116499", "0.508354", "0.50435764", "0.50395864", "0.5017613", "0.5012311", "0.49880457", "0.49732915", "0.49694857", "0.49567947", "0.49290833", "0.49123168", "0.49022466", "0.48918352", "0.4876982", "0.48564637", "0.48344478", "0.4831767", "0.48219818", "0.48167384", "0.48041946", "0.47990298", "0.47970957", "0.47790575", "0.4775368", "0.47750276", "0.4769472", "0.47687536", "0.47678456", "0.47673544", "0.4762776", "0.47508374", "0.4745348", "0.4744612", "0.47440085", "0.47431633", "0.4735704", "0.4731969", "0.47318834", "0.47272193", "0.47190073", "0.47136933", "0.47060663", "0.46938443", "0.46810606", "0.4680052", "0.46786174", "0.4675532", "0.46746194", "0.46725327", "0.46692398", "0.46664625", "0.46629974", "0.4658155", "0.46482897", "0.4642948", "0.4631056", "0.4616761", "0.46156722", "0.4614083", "0.46050924", "0.45955372", "0.45907485", "0.4590141", "0.4589916", "0.45872974", "0.45867962", "0.458238", "0.45814958", "0.4575239", "0.45744997", "0.4574218", "0.4573103", "0.45713657", "0.45695978", "0.4567189", "0.45590883" ]
0.0
-1
Transform the resource into an array.
public function toArray($request) { return [ 'id' => $this->id, 'problem_id' => $this->problem_id, 'option_text' => $this->option_text, 'is_true' => $this->is_true, 'sort' => $this->sort, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }", "public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }", "public function asArray() {\n return $this->resource;\n }", "public function transform($resource)\n {\n return [];\n }", "public function toArray()\n {\n if ($this->resource instanceof ArrayableInterface) {\n\n return $this->resource->toArray();\n } else {\n\n return null;\n }\n }", "public function parse($resource)\n {\n return $resource->toArray();\n }", "public function transform($resource)\n {\n return [\n 'id' => $resource['id'],\n 'item' => $resource['item'],\n 'qty' => $resource['qty'],\n\n ];\n }", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "abstract protected function toArray();", "public function getAsArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function getAsArray()\n\t{\n\t\t\n\t\t$path = $this->get();\n\t\t\n\t\treturn self::toArray($path);\n\t\t\n\t}", "public function transform($resource)\n {\n return [\n\n 'id' => (int) $resource->id,\n\t\t\t'name' => $resource->name,\n\t\t\t'description' => $resource->description,\n 'seat_count' => $resource->seat_count,\n\t\t\t'is_active' => $resource->is_active,\n\t\t\t'status' => $resource->status,\n\t\t\t'created_at' => $resource->created_at->toDateTimeString(),\n\t\t\t'updated_at' => $resource->updated_at->toDateTimeString(),\n\t\t\t\n ];\n }", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray(): array\n {\n return [\n 'users' => HiUserResource::collection($this->resource),\n ];\n }", "public function toArray()\n {\n return $this->transform();\n }", "function toArray() ;", "function toArray() ;", "public function convertItemArray() {}", "public function toArray(): array\n {\n $content = $this->getContent();\n\n if (\\is_array($content)) {\n return $this instanceof Filterable\n ? (array) $this->filterResponse($content)\n : $content;\n }\n\n return [];\n }", "protected function asArray()\n\t{\n\t\treturn \\json_decode($this->response, true);\n\t}", "public function arr() {\n\t\t\treturn \\uri\\generate::to_array($this->object);\n\t\t}", "public function toArray()\n {\n return $this->getContent();\n }", "public function toArray()\n {\n\n }", "public function asArray(): array\n {\n return json_decode($this->result, true);\n }", "public function toArray()\n {\n return $this->cast('array');\n }", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "private function arrayify(): array\n {\n return $this->toArray();\n }", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "public function toArray() // untested\n {\n return $this->data;\n }", "public function toArray(){\n $this->buildArray();\n return $this->array;\n }", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;" ]
[ "0.7750928", "0.7750928", "0.7715773", "0.75906307", "0.7310379", "0.7138024", "0.7134791", "0.7096877", "0.7096877", "0.70968604", "0.70968604", "0.70968604", "0.70968604", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.6959165", "0.69560915", "0.68910366", "0.68910366", "0.68910366", "0.68910366", "0.68910366", "0.68910366", "0.6881386", "0.6868011", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6851924", "0.6790647", "0.674651", "0.674651", "0.67363435", "0.6720337", "0.6712338", "0.67115825", "0.6710179", "0.666141", "0.66587526", "0.6656767", "0.6655622", "0.66545117", "0.6648871", "0.6648871", "0.6648871", "0.6648871", "0.6648871", "0.66377884", "0.6637001", "0.6629", "0.6629", "0.6629", "0.6629", "0.6629", "0.6629", "0.6629" ]
0.0
-1
Checks if the query entry is valid
public function isValid(QueryCacheKey $key, QueryCacheEntry $entry);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function valid()\n\t{\n\t\treturn $this->query->valid();\n\t}", "protected function validateQuery(): bool {\n\t\t$columnsCount = count($this->columns);\n\t\t$valuesCount = count($this->values);\n\t\tif ($columnsCount === 0 || $valuesCount === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($this->values as $valueRow) {\n\t\t\tif (count($valueRow) !== $columnsCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn parent::validateQuery();\n\t}", "private function validate_query_key()\n {\n if (!isset($this->arrSearch['query'])) {\n throw new DocumentSearchMissingSearch('Missing request \"query\" key!');\n }\n }", "private function isValid($what) {\n\t\t\t$params = array($this->id_);\n\n\t\t\ttry { \n\t\t\t\t$this->dbHandler_->executeQuery(\"SELECT * FROM \" . $what . \" WHERE id_\". $what . \"=%d\", $params, true);\n\t\t\t}\n\t\t\tcatch(DeltaException $e) {\n\t\t\t\tif($e->isCode(603)) //empty result, throw id not valid\n\t\t\t\t\tthrow new DeltaException(100);\n\t\t\t\telse\n\t\t\t\t\tthrow $e;\n\t\t\t}\n\t\t\t$this->dbHandler_->releaseResult();\t\t\t\n\t\t}", "static private function validateQuery($query)\n {\n $query = trim($query);\n // the query ain't to be more than 30 characters (alphanumeric) in length.\n if(!preg_match('#^[-a-zа-яё0-9 ]*$#iu', $query)\n ||mb_strlen($query)>30||mb_strlen($query)<3)\n return false;\n return true;\n }", "public function valid()\n\t{\n\t\treturn $this->databaseResult->valid();\n\t}", "public function valid() {\n\t\t$this->checkResultSet();\n\n\t\tif ($this->index >= 0 && $this->index < $this->indexMax) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function validateEntries() \n {\n //verify if first entry is a START entry\n $this->firstItemIsStartEntry();\n\n //Detect the right order of entries\n $this->detectRightEntryOrder();\n\n //check if last entry is pause or end when the record is not current\n $this->obligePauseWhenNotCurrent();\n }", "public function validateQuery(array $input)\n {\n\n }", "public function entryIsValid(){\r\n $this->emailEntryIsValid();\r\n $this->usernameEntryIsValid();\r\n $this->passwordEntryIsValid();\r\n \r\n return ( count($this->errors) ? false : true );\r\n }", "public function valid()\n {\n return isset($this->resultSet[$this->key()]);\n }", "public function isValid(){\n\t\treturn !count($this->_rows) && empty($this->_settings);\n\t}", "private function check_sanity()\n {\n if (!is_object($this->qb))\n {\n return false;\n }\n \n if (empty($this->pager_id))\n {\n\n return false;\n }\n return true;\n }", "public function validate()\r\n {\r\n foreach ($this->_data as $data) {\r\n if (!in_array($data, $this->_validateAgainst)) $this->addError('Value is not a valid selection.');\r\n }\r\n \r\n return !sizeof($this->_errors);\r\n }", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "abstract public function valid();", "public function valid() : bool\n {\n return !($this->key() >= count($this->currentRecordSet) && count($this->currentRecordSet) != $this->pageSize);\n }", "function isValid() {\n\t\treturn( $this->verifyId( $this->mPostId ) && is_numeric( $this->mPostId ) && $this->mPostId > 0 );\n\t}", "public function valid() {\n return ( ! is_null($this->key()));\n }", "public function checkResult() {\n\t\treturn ($this->_query_result !== false);\n\t}", "public function valid ()\n\t{\n\t\tif (is_a($this->rs,'iterator'))\n\t\t{\n\t\t\treturn $this->rs->valid();\n\t\t}\n\t\treturn false;\n\t}", "public function valid()\n {\n return !is_null($this->key());\n }", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {\n // TODO: Check numProcessed against itemlimit\n return !is_null($this->currentRow);\n }", "public function check_validity() {\r\n\t\t$value = $this->get_posted_value();\r\n\r\n\t\t// required field check\r\n\t\t// 0, '0', and 0.0 need special handling since they're valid, but PHP considers them falsy values.\r\n\t\tif ( $this->props['required'] && ( empty( $value ) && ! in_array( $value, [ 0, '0', 0.0 ], true ) ) ) {\r\n\t\t\t// translators: Placeholder %s is the label for the required field.\r\n\t\t\tthrow new \\Exception( sprintf( _x( '%s is a required field.', 'Add listing form', 'my-listing' ), $this->props['label'] ) );\r\n\t\t}\r\n\r\n\t\t// if field isn't required, then no validation is needed for empty values\r\n\t\tif ( empty( $value ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// otherwise, run validations\r\n\t\t$this->validate();\r\n\t}", "public function valid()\n {\n return $this->key() !== null;\n }", "protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}", "public function validateEntry($entry)\n {\n $arrayKeys = array(\n 'unlockDate',\n 'positionTop',\n 'positionLeft',\n 'url'\n );\n\n foreach ($arrayKeys as $arrayKey) {\n if (!array_key_exists($arrayKey, $entry)) {\n return false;\n }\n }\n\n if (!array_key_exists('doorImageLeft', $entry) && !array_key_exists('doorImageRight', $entry)) {\n return false;\n }\n\n return true;\n }", "private function query_arg_check() {\n\t\t//Set some variables\n\t\t$query_arg_count = 0;\n\t\t$arg_count = 0;\n\t\t$arg_match = False;\t\n\n\t\t//Check number of arguments in the query\n\t\tif ($this->QUERY) {\n\t\t\t$query_arg_count = substr_count($this->QUERY, '?');\n\t\t}\n\t\t\n\t\t//Check number of arguments passes to the class\n\t\tif ($this->QUERY_ARGS) {\n\t\t\tforeach($this->QUERY_ARGS as $arg_count_value) {\n\t\t\t\tif ($arg_count_value) {\n\t\t\t\t\t$arg_count += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Match up argument counts\n\t\tif ( $query_arg_count == $arg_count ) {\n\t\t\t$arg_match = True;\n\t\t} else {\n\t\t\t$arg_match = False;\n\t\t}\n\t\treturn $arg_match;\n\t}", "function validate() {\n\t\t// execute the column validation \n\t\tparent::validate();\n\t\t\n\t\t// connection\t\t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM company WHERE name = '\".$this->getName().\"' AND id <> '\".$this->getID().\"'\";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage(\"result is \".$result);\n\t\tif(!isEmptyString($result)){ \n\t\t\t$this->getErrorStack()->add(\"unique.name\", \"The name \".$this->getName().\" already exists. Please specify another.\");\n\t\t}\n\t}", "public function hasValidResult()\n {\n return ( $this->result !== null );\n }", "public function valid()\n {\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n $allowed_values = array(\"text\", \"range\", \"category\");\n if (!in_array($this->container['type'], $allowed_values)) {\n return false;\n }\n if ($this->container['sort_type'] === null) {\n return false;\n }\n $allowed_values = array(\"alphabetical\", \"count\", \"value\", \"size\");\n if (!in_array($this->container['sort_type'], $allowed_values)) {\n return false;\n }\n if ($this->container['values'] === null) {\n return false;\n }\n return true;\n }", "public function validateQuery($data)\n {\n $validator = Validator::make($data, [\n 'transactionId' => 'required|integer'\n ]);\n\n if ($validator->fails()) {\n throw new \\Exception($validator->errors()->first());\n }\n }", "public function valid()\n {\n\n if (strlen($this->container['virtual_operator']) > 60) {\n return false;\n }\n if (strlen($this->container['event_type']) > 100) {\n return false;\n }\n if (strlen($this->container['result_status']) > 100) {\n return false;\n }\n if (strlen($this->container['username']) > 100) {\n return false;\n }\n if (strlen($this->container['property_value']) > 450) {\n return false;\n }\n return true;\n }", "public function valid() {\n\t\treturn $this->can_fetch() && (false !== $this->fetch());\n\t}", "public function valid()\n {\n return $this->datasource->valid();\n }", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "public function valid() {\n return ($this->key() !== null);\n }", "public function valid() {\n return ($this->key() !== null);\n }", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "public function check_queries() {\r\n\t\tQueryManager::check_queries();\r\n\t}", "public function valid()\n\t{\n\t\treturn $this->row !== NULL;\n\t}", "function isDataValid() \n {\n return true;\n }", "private function assertValidQuery($query, $expected)\n {\n }", "private function assertValidQuery($query, $expected)\n {\n }", "private function assertValidQuery($query, $expected)\n {\n }", "private function assertValidQuery($query, $expected)\n {\n }", "public function valid()\n {\n return $this->offsetExists($this->key());\n }", "public function valid()\n {\n return $this->_key + 1 <= $this->_limit;\n }", "public function isValid(): bool\n {\n\n return null !== $this->_col && null !== $this->_op && null !== $this->_val &&\n null !== $this->_colType && null !== $this->_valType;\n\n }", "public function isDataValid(): bool;", "function valid()\n {\n if (isset($this->aid))\n return true;\n else\n return false;\n }", "public function valid()\n {\n return ($this->key() !== null);\n }", "public function valid()\n {\n return ($this->key() !== null);\n }", "public function valid()\n {\n return ($this->key() !== null);\n }", "public function valid()\n {\n return $this->key === 0;\n }", "public function valid() {\n\t\t// Init the recordset if needed.\n\t\t$this->initRecordSet();\n\t\t// Is current position valid?\n\t\treturn ((!$this->recordSet->EOF) and $this->currentIndex < $this->recordSet->RecordCount() );\n\t}", "public function valid()\n {\n return $this->dataSource->valid();\n }", "protected function _isResultValid()\n {\n if (!$this->getRequest()->getParam('result') ||\n !in_array($this->getRequest()->getParam('result'), $this->_validResults)) {\n $this->_logger->error(__(\"Invalid Result\"));\n return false;\n }\n return true;\n }", "public function isValid() {\n\t\treturn !is_array($this->data) && count($this->data->getRawData()) > 0;\n\t}", "public function check () {\n $modelName = $this->field->model->name;\n $fieldName = $this->field->name;\n $bean = $this->field->model->bean;\n $ctx = @$this->field->constraints['context'];\n $update = $ctx ? strpos(\",,{$ctx->value},\", ',update,') : true;\n return $this->dispatch(\n (!$this->value) || ($this->field && $this->field->value) || ($bean->id && !$update),\n \"{$this->field->title} is required\"\n );\n }", "public function valid()\n {\n\n if ($this->container['amount'] === null) {\n return false;\n }\n if ($this->container['unit_relation'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n if ($this->container['name'] === null) {\n return false;\n }\n if (strlen($this->container['name']) > 50) {\n return false;\n }\n if ($this->container['location_id'] === null) {\n return false;\n }\n if ($this->container['business_unit_id'] === null) {\n return false;\n }\n return true;\n }", "public function isValid() {\n\t\treturn !( empty( $this->fk_NMC ) || empty( $this->titre ) || empty( $this->contenu ) );\n\t}", "public function isValid() {\n return !empty($id);\n }", "public function valid()\n {\n return ( current( $this->data ) !== false );\n }", "public function valid()\n {\n if ($this->list === null)\n $this->rewind(); // loads from the table\n if ($this->list === null)\n return false;\n $key = key($this->list);\n $valid = ($key !== NULL && $key !== FALSE);\n return $valid;\n }", "public function is_valid_field() {\n\t\tglobal $wpdb, $bp;\n\n\t\t$retval = $wpdb->get_row( $wpdb->prepare( \"SELECT id FROM {$bp->profile->table_name_fields} WHERE id = %d\", $this->field_id ) );\n\n\t\treturn apply_filters_ref_array( 'xprofile_data_is_valid_field', array( (bool)$retval, $this ) );\n\t}", "public function valid()\n {\n $key = $this->key();\n return ($key !== false && $key !== null);\n }", "public function valid()\n {\n return count($this->result_queue) !== 0;\n }", "public function valid () {\n return isset($this->__fields[key($this->__fields)]);\n }", "protected function checkQuery($query=null)\n {\n if ($query) {\n $this->getQuery()->set($query);\n unset($query);\n }\n \n $query = $this->getQuery();\n \n // if no table then set table\n if (!isset($query['table'])) {\n $query['table'] = $this->getTableName();\n }\n \n // use model database.table_prefix\n if (!isset($query['database']) && isset($this['database'])) {\n $query['database'] = $this['database'];\n }\n \n if (!isset($query['table_prefix']) && isset($this['table_prefix'])) {\n $query['table_prefix'] = $this['table_prefix'];\n }\n \n return static::formatQuery($query);\n }", "public function valid()\n {\n return key($this->entities) !== null;\n }", "public function valid() {\n\t\treturn (current($this->_data) !== false);\n\t}", "function checkStateSQL($getPara) {\r\n if ($getPara == '') {\r\n return false;\r\n } else\r\n if ($getPara == null) {\r\n return false;\r\n } else\r\n if ($getPara == '0') {\r\n return false;\r\n }\r\n if (EMPTY($getPara)) {\r\n return false;\r\n }\r\n return true;\r\n}", "public function validEntry($data) {\n\t\t$values = array_values($data);\n\t\tif (!isset($values)) {\n\t\t\treturn false;\n\t\t}\n\t\t$value = $values[0];\n\n\t\t/* Load the Entrytype model */\n\t\tApp::import(\"Webzash.Model\", \"Entry\");\n\t\t$Entry = new Entry();\n\n\t\tif ($Entry->exists($value)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function valid() {\n return array_key_exists($this->_key, $this->_data);\n }", "protected function assertValidQuery($query, $expected)\n {\n }", "protected function assertValidQuery($query, $expected)\n {\n }", "protected function assertValidQuery($query, $expected)\n {\n }", "public function is_valid()\n {\n }", "public function testValidateFails()\n\t{\n\t\t$this->assertFalse(ArrayQuery::validate('testInvalid'));\n\t}", "public function is_valid()\n {\n }", "public function valid() {\n\t\t\treturn (isset($this->data[$this->index]));\n\t\t}", "public function valid()\n {\n\n if ($this->container['warehouse_id'] === null) {\n return false;\n }\n if ($this->container['lob_id'] === null) {\n return false;\n }\n if ($this->container['sku'] === null) {\n return false;\n }\n if ($this->container['location_id'] === null) {\n return false;\n }\n if ($this->container['quantity'] === null) {\n return false;\n }\n if ($this->container['weight_per_wrap'] === null) {\n return false;\n }\n return true;\n }", "public function valid ()\n {\n return isset($this->offset) && isset($this->cache[ $this->offset ]);\n }", "function isValidFormat($format){\n $qh = new QueryHelper();\n\n $columnName = \"FormatVal\";\n $selectFormat = \"SELECT * FROM Format;\";\n if($qh -> verifyDropDownInput($format, $selectFormat, $columnName)){\n return true;\n }\n else{\n echo \"invalid format\";\n return false;\n }\n }", "public function valid(): bool\n {\n return count($this->data) != 0;\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }" ]
[ "0.71912116", "0.69873416", "0.63246804", "0.6310956", "0.62544566", "0.6224069", "0.62219656", "0.6192554", "0.6191364", "0.61497045", "0.61253554", "0.60465384", "0.60192657", "0.5981679", "0.59414047", "0.5902053", "0.5895677", "0.5889359", "0.5888374", "0.58738303", "0.5870715", "0.58692086", "0.5858853", "0.5858853", "0.5858853", "0.5858853", "0.5858853", "0.5858853", "0.5858853", "0.5858853", "0.58562183", "0.5846342", "0.58455133", "0.58354163", "0.5828701", "0.580991", "0.5794191", "0.5790434", "0.57717043", "0.5770066", "0.57650965", "0.57644266", "0.57608825", "0.5758106", "0.57576096", "0.57576096", "0.5756285", "0.5756285", "0.5756285", "0.5756285", "0.5755678", "0.5754611", "0.5747396", "0.5731137", "0.5731137", "0.5731137", "0.5731137", "0.5728753", "0.5726913", "0.5726045", "0.57142895", "0.5713026", "0.57083994", "0.57083994", "0.57083994", "0.5706162", "0.5692454", "0.5687152", "0.56782395", "0.5670463", "0.56701624", "0.56642073", "0.5654285", "0.5653389", "0.5651188", "0.5649473", "0.563228", "0.5625854", "0.5613169", "0.56123066", "0.5608651", "0.56056803", "0.5604858", "0.5600633", "0.5595797", "0.55878365", "0.558706", "0.55834365", "0.55834365", "0.55834365", "0.5583241", "0.5582942", "0.55823827", "0.55806327", "0.5574067", "0.55725664", "0.5568843", "0.5567504", "0.55472267", "0.55472267" ]
0.6562595
2
function __construct Constructor of the class, will be called in PHP5
public function __construct() { //$objCore = new Core(); //default constructor for this class }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _construct(){ }", "private final function __construct() {}", "function _construct() {\n \t\n\t\t\n\t}", "protected abstract function __construct();", "final private function __construct() {}", "final private function __construct() {}", "function __constructor(){}", "final private function __construct()\n\t{\n\t}", "private function __construct( )\n {\n\t}", "final private function __construct(){\r\r\n\t}", "function __construct(){\n\t\t// nowt much...\n\t}", "private function __construct()\t{}", "public function fn_construct_class() {\n\t}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "final private function __construct() {\n\t\t\t}", "public function _construct()\n\t{\n\n\t}", "function __construct() ;", "private function __construct() { \n\t\t\n\n\t}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}" ]
[ "0.85815763", "0.8564649", "0.85088104", "0.84991115", "0.8468479", "0.8468479", "0.84665865", "0.8461628", "0.8457269", "0.8437333", "0.842158", "0.84191144", "0.841896", "0.84170556", "0.84170556", "0.84170556", "0.84170556", "0.84170556", "0.84170556", "0.84114534", "0.8388458", "0.8384513", "0.8380568", "0.8380387", "0.8380387", "0.8380387", "0.83701915", "0.83701915", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369801", "0.8369535", "0.8367306", "0.83670855", "0.83670855", "0.83670855", "0.83670855", "0.83670855", "0.83670855", "0.83670855", "0.83670855", "0.83670855", "0.83670855", "0.83670855", "0.83670855", "0.83670855", "0.83670855", "0.83670855" ]
0.0
-1
function invoiceList This function is used to display the invoice List. Database Tables used in this function are : tbl_invoice
function invoiceList($argWhere = '', $argLimit = '') { $varWhere = " 1 " . $argWhere; $varWhere = str_replace('fkWholesalerID','tbl_logisticinvoice.fkWholesalerID',$varWhere); //echo $varWhere = '1 AND tbl_logisticinvoice.fkWholesalerID IN (5,120,36,154,85,119,122,125,132,143,133,126,131,148)'; if ($argLimit) { $varLimit = " LIMIT " . $argLimit; } $varQuery = "SELECT * FROM " . TABLE_LOGISTICINVOICE . " " . " LEFT JOIN tbl_order_items ON fkOrderitemID = pkOrderItemID " . " LEFT JOIN tbl_admin ON AdminCountry = AdminPortalID WHERE " . $varWhere . " GROUP BY tbl_logisticinvoice.fkSubOrderID ORDER BY pkInvoiceID DESC " . $varLimit; $arrRes = $this->getArrayResult($varQuery); //pre($arrRes); return $arrRes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function invoice_list()\n {\n if (!get_permission('invoice', 'is_view')) {\n access_denied();\n }\n\n $branchID = $this->application_model->get_branch_id();\n if ($this->input->post('search')) {\n $this->data['class_id'] = $this->input->post('class_id');\n $this->data['section_id'] = $this->input->post('section_id');\n $this->data['invoicelist'] = $this->fees_model->getInvoiceList($this->data['class_id'], $this->data['section_id'], $branchID);\n }\n $this->data['branch_id'] = $branchID;\n $this->data['title'] = translate('payments_history');\n $this->data['sub_page'] = 'fees/invoice_list';\n $this->data['main_menu'] = 'fees';\n $this->load->view('layout/index', $this->data);\n }", "function m_displayInvoiceList()\n\t{\n\t\t#QUERY ORDER TABLE\n\t\t$this->obDb->query = \"SELECT iOrderid_PK,iInvoice,tmOrderDate,iOrderStatus FROM \".ORDERS.\" WHERE\t iCustomerid_FK= '\".$_SESSION['userid'].\"' ORDER BY tmOrderDate DESC\";\n\t\t$rsOrders = $this->obDb->fetchQuery();\n\t\tif($this->obDb->record_count>0)\n\t\t{\n\t\t\tfor($i=0;$i<$this->obDb->record_count;$i++)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATUS\",\"Incomplete\");\n\t\t\t\tif($rsOrders[$i]->iOrderStatus==1){\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATUS\",\"Complete\");\n\t\t\t\t}\n\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ORDERDATE\", $this->libFunc->dateFormat2($rsOrders[$i]->tmOrderDate));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_INVOICE\", $this->libFunc->m_displayContent($rsOrders[$i]->iInvoice));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_DETAILS_LINK\", $this->libFunc->m_safeUrl(SITE_SAFEURL.\"ecom/index.php?action=checkout.receipt&mode=\".$rsOrders[$i]->iOrderid_PK));\n\n\t\t\t\t$this->ObTpl->parse(\"orderlist_blk\",\"TPL_ORDERLIST_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->parse(\"orderlistmain_blk\",\"TPL_ORDERLISTMAIN_BLK\");\n\t\t}\n\t}", "public function get_invoice_list()\n {\n return $this->db->select('sr_no, invoice_no, round_off_total, invoice_date, bakery_name,bakery_address, bakery_area, bakery_city')->order_by('sr_no','desc')\n ->from('insider_bill')->join('customers', 'customers.id = insider_bill.customer_id')->get();\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function invoice()\n\t{\n\t\t$tableName = 'master_invoice';\n\t\t$condition = array('send_status' => SENT);\n\t\t$result['invoice'] = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t$result['count'] = ($result['invoice'] != 0) ? count($result['invoice']) : 0;\n\n\t\t$this->load->view('london/layout/header');\n\t\t$this->load->view('london/layout/sidenavbar', $result);\n\t\t$this->load->view('london/pages/invoice', $result);\n\t\t$this->load->view('london/layout/footer');\n\t}", "function item_list_data($invoice_id = 0) {\n\n $list_data = $this->Sales_InvoicesItems_model->get_details(array(\"fid_invoices\" => $invoice_id))->result();\n $result = array();\n foreach ($list_data as $data) {\n $result[] = $this->_make_item_row($data);\n }\n echo json_encode(array(\"data\" => $result));\n // $this->output->enable_profiler(TRUE);\n // print_r($list_data);\n\n }", "function listProductView() {\n\n\n\n\t$query = \"SELECT * FROM invoice_item\";\n\t$result = mysql_query($query);\n\t$rows = array();\n\twhile($row = mysql_fetch_assoc($result)) {\n\t\t$rows[] = array(\n\t\t\t'invoice_id' => htmlspecialchars($row['invoice_id']), \n\t\t\t'invoice_item_id' => htmlspecialchars($row['invoice_item_id']),\n\t\t\t'service_type' => htmlspecialchars($row['service_type']),\n\t\t\t'service_range' => htmlspecialchars($row['service_range']),\n\t\t\t'price' => htmlspecialchars($row['price']),\n\t\t\t'value' => htmlspecialchars($row['value']),\n\t\t\t'vat' => htmlspecialchars($row['vat']),\n // 'product_pdv_percent' => htmlspecialchars($row['product_pdv_percent']),\n\t\t\t'vat_value' => htmlspecialchars($row['vat_value']),\n\t\t\t'rebate' => htmlspecialchars($row['rebate']),\n\t\t\t'total_value' => htmlspecialchars($row['total_value']),\n\n\n\t\t\t);\n\t}\n\n\n\t\t//akcije i forma\n\t$customer_id = $_GET['customer_id'];\n\t$invoice_id = $_GET['invoice_id'];\n\t$action = \"invoice_item.php?view=list&action=add&customer_id=$customer_id&invoice_id=$invoice_id\";\n\tinclude(\"invoice_item_form.php\");\n\n}", "public function index()\n\t{\t\n\t\t$this->db->join('tbl_invoice_products', 'tbl_invoice_products.invoice_number = tbl_invoice.invoice_number');\n\t\t$this->db->join('tbl_customer', 'tbl_customer.serial = tbl_invoice.customer_id');\n\t\t$this->db->group_by('tbl_invoice.invoice_number');\n\t\t$this->db->order_by('tbl_invoice.invoice_number','desc');\n\t\t$data['invoices'] = $this->db->get('tbl_invoice')->result_object();\n\t\n\t\t$this->load->view('lib/header',$data);\n\t\t$this->load->view('sale/index');\n\t\t$this->load->view('lib/footer');\n\t}", "public function get_invoices( ) {\n\n $invoiceArray = $this->mockinvoice_model->get_invoices( $this->input->post( 'jobId' ) );\n\n if ( !empty( $invoiceArray ) ) {\n $invoiceHTML = create_invoice_html( $invoiceArray );\n // Push the HTML for the invoice tables onto the array being returned\n $invoiceArray[] = array( 'mockInvoiceId' => '', 'readyToInvoice' => '', 'archived' => '', 'invoiceHTML' => $invoiceHTML );\n }\n\n // Send back the timesheet settings as JSON.\n $this->json_library->print_array_json( $invoiceArray );\n }", "public function getInvoicesDataTable($codigoInvoices='')\n {//var_dump($_POST);exit;\n echo ($this->invm->ShowInvoicesTable($codigoInvoices));\n }", "public function index()\n { \n return view('admin.invoice.list');\n }", "public function invoice_list() {\n //$this->output->enable_profiler(TRUE);\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $payment_status = $this->input->get('payment_status');\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 if (!empty($_GET)) {\n $totalrows = $this->reportsModel->get_all_invoice_count($tenant_id, $payment_status, $start_date, $end_date, $company_id);\n $records_per_page = RECORDS_PER_PAGE;\n $baseurl = base_url() . 'reports_finance/invoice_list/';\n $pageno = ($this->uri->segment(3)) ? $this->uri->segment(3) : 1;\n $offset = ($pageno * $records_per_page);\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.inv_date';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_all_invoice($tenant_id, $records_per_page, $offset, $field, $order_by, $payment_status, $start_date, $end_date, $company_id);\n $tabledata_count = count($tabledata);\n for ($i = 0; $i < $tabledata_count; $i++) {\n if ($tabledata[$i]->enrolment_mode === 'COMPSPON') {\n $tabledata[$i]->payment_status = $this->reportsModel->check_not_part_paid($tabledata[$i]->pymnt_due_id);\n }\n }\n $data['tabledata'] = $tabledata;\n $data['sort_order'] = $order_by;\n }\n $data['controllerurl'] = 'reports_finance/invoice_list/';\n $this->load->helper('pagination');\n $data['sort_link'] = $sort_link = \"payment_status=\" . $this->input->get('payment_status') . \"&start_date=\" . $this->input->get('start_date') . \"&end_date=\" . $this->input->get('end_date') . \"&company_id=\" . $this->input->get('company_id') . \"&company_name=\" . $this->input->get('company_name');\n $data['pagination'] = get_pagination($records_per_page, $pageno, $baseurl, $totalrows, $field, $order_by . '&' . $sort_link);\n $data['page_title'] = 'Accounting Reports - List and Search Invoice';\n $data['main_content'] = 'reports/invoice_list';\n $this->load->view('layout', $data);\n }", "public function list_invoices($id = false, $clientid = false)\r\n {\r\n\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n access_denied('invoices');\r\n }\r\n $this->load->model('payment_modes_model');\r\n $data['payment_modes'] = $this->payment_modes_model->get('', array(), true);\r\n if ($this->input->is_ajax_request()) {\r\n $this->perfex_base->get_table_data('invoices', array(\r\n 'id' => $id,\r\n 'clientid' => $clientid,\r\n 'data' => $data\r\n ));\r\n }\r\n $data['invoiceid'] = '';\r\n if (is_numeric($id)) {\r\n $data['invoiceid'] = $id;\r\n }\r\n $data['title'] = _l('invoices');\r\n $data['invoices_years'] = $this->invoices_model->get_invoices_years();\r\n $data['invoices_sale_agents'] = $this->invoices_model->get_sale_agents();\r\n $data['invoices_statuses'] = $this->invoices_model->get_statuses();\r\n $data['bodyclass'] = 'invoices_total_manual';\r\n $this->load->view('admin/invoices/manage', $data);\r\n }", "function jx_getinvoiceorditems()\r\n\t{\r\n\t\t$this->erpm->auth(PNH_INVOICE_RETURNS|PNH_ADD_INVOICE_RETURN);\r\n\t\t$output = array();\r\n\t\t$invno = $this->input->post('scaninp');\r\n\t\t\r\n\t\t$fr_det = $this->db->query(\"select a.franchise_id,franchise_name from pnh_m_franchise_info a join king_transactions b on a.franchise_id = b.franchise_id join king_invoice c on c.transid = b.transid where c.invoice_no = ? \",$invno)->row();\r\n\t\t\r\n\t\t$output['franchise_name'] = $fr_det->franchise_name;\r\n\t\t$output['franchise_id'] = $fr_det->franchise_id;\r\n\t\t$output['invdet'] = $this->erpm->get_invoicedet_forreturn($invno);\r\n\t\t$output['return_cond'] = $this->config->item('return_cond');\r\n\t\t$output['return_reason'] = $this->config->item('return_reason');\r\n\t\techo json_encode($output);\r\n\t}", "public function index($id = false)\r\n {\r\n $this->list_invoices($id);\r\n }", "function index()\n {\n //$data['invoice'] = $this->Invoice_model->get_all_invoice();\n\t\t$data['invoice']=$this->GenricModel->query('select distinct i.InvoiceId,i.BillNo,i.SupplierName,i.SupplierNumber,i.PurchaseDate,id.TAmount from invoice i join invoicedetail id on id.InvoiceId=i.InvoiceId');\n\t\t$userid = $this->session->userdata('userid');\n $data['users'] = $this->User_model->get_user($userid);\n $data['title']= 'e-Invoice';\n\t\t$data['_view'] = 'invoice/index';\n $this->load->view('layouts/main1',$data);\n }", "public function index()\n {\n return view('admin::sales.invoices.list', ['invoices' => Invoice::getAllByBusiness() ]);\n }", "public function manage_invoice_invoice_id()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('linvoice');\n $invoice_no = $this->input->post('invoice_no');\n $data =$this->linvoice->invoice_list_invoice_no($invoice_no);\n\t\t$data['content'] = $this->load->view('dashboard_pharmacist/invoice/invoice',$data,true);\n\t\t$this->load->view('dashboard_pharmacist/main_wrapper',$data);\n\t}", "function displayInvoices($custId) {\n $sql = \"SELECT * FROM invoices \n WHERE customer_id = $custId\n \";\n \n $result = mysqli_query($GLOBALS[\"con\"], $sql);\n if ($result) {\n $rows = array();\n while ($row = mysqli_fetch_assoc($result)) {\n $rows[] = $row;\n }\n echo json_encode($rows);\n } \n \n }", "function invoices_view_all(){\n\t\t$user_transactions=array();\n\t\t$user_transactions=$this->UserModel->get_user_transactions(array('user_id'=>$this->session->userdata('member_id'),'gateway !='=>'ADMIN','t.is_deleted'=>0),0,0,'like');\n\t\tif($_SERVER['HTTP_REFERER']!=base_url().\"account/invoices_view_all\"){\n\t\t\t$this->session->set_userdata('HTTP_REFERER', $_SERVER['HTTP_REFERER']);\n\t\t\t$previous_page_url=$_SERVER['HTTP_REFERER'];\n\t\t}else{\n\t\t\t$previous_page_url=$this->session->userdata('HTTP_REFERER');\n\t\t}\n\t\t//Loads header, Invoices list and footer view.\n\t\t$this->load->view('header',array('title'=>'My Invoices','previous_page_url'=>$previous_page_url));\n\t\t$this->load->view('user/invoices_list',array('user_transactions'=>$user_transactions));\n\t\t$this->load->view('footer-inner-red');\n\t}", "public function invoice_list( $customer_id = NULL, $count = 10, $offset = 0 ) {\r\n\t\t$params['count'] = $count;\r\n\t\t$params['offset'] = $offset;\r\n\t\tif( $customer_id )\r\n\t\t\t$params['customer'] = $customer_id;\r\n\t\t$vars = http_build_query( $params, NULL, '&' );\r\n\t\t\r\n\t\treturn $this->_send_request( 'invoices?'.$vars );\r\n\t}", "function enhanced_invoice($order_id, $end = 0){\n $order = $this->order_model->get($order_id);\n $order_type = $this->order_model->get_order_type($order->order_type);\n $od = $this->order_details_model->get_order_details($order_id, true);\n\n $inv = array();\n $total = 0;\n foreach ($od as $key) {\n $inv[$key->id]['name'] = $key->arabic;\n $inv[$key->id]['eng'] = $key->eng;\n $inv[$key->id]['price'] = $key->price;\n $inv[$key->id]['qty'] = $key->quantity;\n $inv[$key->id]['total_line'] = $key->quantity*$key->price;\n $total += $inv[$key->id]['total_line'];\n }\n //$items_table = to_table($inv);\n\n $this->load->helper('orders');\n $s = get_service($order->order_type);\n\n $service = get_service_value($total, $s);\n $grand_total = $total+$service;\n \n $this->data['grand_total'] = $grand_total;\n $this->data['service_value'] = ($service)? $service : 0;\n $this->data['ratio'] = $s;\n $this->data['total'] = $total;\n $this->data['table'] = $this->order_model->get_table($order->customer_id);\n $this->data['order'] = $order;\n $this->data['order_type'] = $order_type;\n $this->data['items_table'] = $inv ;\n\n $this->check_order($order_type, $this->data);\n\n\n $invID = str_pad($order->id, 5, '0', STR_PAD_LEFT); \n\n$header = $this->load->view('app/orders/invoice/header',$this->data, true);\n$items = $this->load->view('app/orders/invoice/items', $this->data, true);\n$footer = $this->load->view('app/orders/invoice/footer',$this->data, true);\n\n $od = $this->order_details_model->get_count($order_id);\n\n\n $format = $this->get_pdf_format($od);\n\n $this->load->library('pdf', array(\n 'format'=>$format, \n 'title'=>'Club21 Cafe & Restaurant', \n 'string'=>'Invoice Details', \n 'footer'=>false\n ));\n //$this->pdf->lib_setTitle('Invoice Details');\n $this->pdf->lib_Cell(0, 10, \"$od lines [ $format ] $order_type->name\", 1, 1, 'C');\n\n $y_head = $this->pdf->lib_getY();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_head, $header, 1, 0, false, true, '', true);\n $y_items = $y_head + $this->pdf->lib_getLastH();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_items, $items, 0, 0, false, true, '', true);\n $y_foot = $y_items + $this->pdf->lib_getLastH();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_foot, $footer, 0, 0, false, true, '', true);\n\n\n $this->pdf->lib_output(APPPATH .\"invoice/inv_$invID.pdf\");\n $this->pdf_image(APPPATH .\"invoice/inv_$invID.pdf\"); \n $this->load->library('ReceiptPrint'); \n $this->receiptprint->connect('192.168.0.110', 9100);//any ip and port \n $this->receiptprint->print_image(APPPATH .\"invoice/inv_$invID.pdf.$this->ext\"); \n//unlink(APPPATH .\"invoice/inv_$invID.pdf.$this->ext\");\n if($end == 1 )\n $this->end($order_id, $grand_total);\n $this->edit_order($order->id);\n\n }", "public function actionIndex()\n {\n $searchModel = new InvoiceSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t$dataProvider->pagination->pageSize=15;\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function getDetailAllInvoice($account_id_local,$DbConnection)\n{\n $query = \"SELECT * FROM invoice USE INDEX(inve_aid_status) WHERE account_id='$account_id_local' AND status=1\";\t\n $result = mysql_query($query,$DbConnection);\n while($row = mysql_fetch_object($result))\n {\n /*$sno = $row->sno;\n $vehicle_no = $row->vehicle_no;\n $customer_code = $row->customer_code;\n $customer_name = $row->customer_name;\n $invoice_no = $row->invoice_no;\n $invoice_amount = $row->invoice_amount;\n $email_id = $row->email_id;\n $remarks = $row->remarks;\n $driver_name = $row->driver_name;\n $driver_phone_no = $row->driver_phone_no;\n $target_time = $row->target_time;\t\t\n $tracking_no = $row->tracking_no;\t\t\n $status = $row->status;*/\t\t\n $data[]=array('sno'=>$row->sno,'vehicle_no'=>$row->vehicle_no,'customer_code'=>$row->customer_code,'customer_name'=>$row->customer_name,'invoice_no'=>$row->invoice_no,'invoice_amount'=>$row->invoice_amount,'email_id'=>$row->email_id,'remarks'=>$row->remarks,'driver_name'=>$row->driver_name,'driver_phone_no'=>$row->driver_phone_no,'target_time'=>$row->target_time,'tracking_no'=>$row->tracking_no,'status'=>$row->status);\n }\t\t\t\t\n}", "public function print_invoice_details_table() {\n\n // Language variables to be used in heredoc syntax\n $tableHeaderCategory = lang( 'report_th_category' );\n $tableHeaderDescription = lang( 'report_th_description' );\n $tableHeaderAmount = lang( 'report_th_amount' );\n\n // Get the invoice row details\n $invoiceRows = $this->mockinvoice_row_model->get_by( 'mockInvoiceId = ' . @$_POST['mockInvoiceId'] );\n\n $tableRows = '';\n\n foreach ( $invoiceRows as $row ) {\n\n // Add currency symbol Eg. '$' to the amount if we have one\n ( $row->amount != null ? $amount = lang( 'system_currency_symbol' ) . $row->amount : $amount = '' );\n // Replace new lines with HTML <br> tags\n $description = nl2br( $row->description );\n\n // Check if a row has some content and add it to the table if it does\n if ( ( $row->category != null ) or ( $row->description != null ) or ( $row->amount != null ) ) {\n $tableRows .= <<< HTML\n <tr id=\"invoice-details-row-{$row->mockInvoiceRowId}\">\n <td>{$row->category}</td>\n <td>{$description}</td>\n <td>{$amount}</td>\n </tr>\n\nHTML;\n }\n }\n\n // Output the HTML\n if ( $tableRows == '' ) {\n\n // Show that we have no details yet to display\n echo '<div class=\"alert alert-warning\">' . lang( 'report_minv_empty' ) . '</div>';\n } else {\n\n // Display the table with invoice details\n echo <<< HTML\n <table class=\"table table-striped table-bordered table-hover table-report\">\n <thead>\n <tr class=\"report-heading-row\">\n <th>{$tableHeaderCategory}</th>\n <th>{$tableHeaderDescription}</th>\n <th>{$tableHeaderAmount}</th>\n </tr>\n </thead>\n <tbody>\n\n{$tableRows}\n\n </tbody>\n </table>\n\nHTML;\n }\n }", "function InfGetInvoices($inf_contact_id, $pay_status = 0) {\n\t$object_type = \"Invoice\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t$objects = Infusionsoft_DataService::query(new $class_name(), array('ContactId' => $inf_contact_id, 'PayStatus' => $pay_status));\n\n $invoices_array = array();\n foreach ($objects as $i => $object) {\n\t\t// Give it a userful index, ie, inf_invoice_id\n\t\t$array = $object->toArray();\n $invoices_array[$array['Id']] = $array;\n }\n\treturn $invoices_array; \n}", "function invoices ($user_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT * FROM `invoice` WHERE user_id = '{$user_id}' ORDER BY invoice_date DESC\");\n }", "public function index() {\n $this->load->model(\"Invoice_model\");\n $data['global'] = $this->common_model->getGlobalSettings();\n $data = $this->common_model->commonFunction();\n $data['user_session'] = $this->session->userdata('user_account');\n\n// $orders = $this->common_model->getRecords(TABLES::$ORDER_SUMMARY,\"*\", array('ord_user_fk' => $data['user_session']['user_id'] ));\n// $invices = $this->Invoice_model->getAllInvoices($data['user_session']['user_id']);\n $invices = $this->common_model->getRecords(TABLES::$MST_SERVICE_INVOICE, \"\", array(\"user_id\" => $data['user_session']['user_id']));\n $this->template->set('page', 'bloglist');\n $this->template->set('invices', $invices);\n $this->template->set('global', $data['global']);\n $this->template->set('user_session', $data['user_session']);\n $this->template->set_theme('default_theme');\n $this->template->set_layout('backend')\n ->title('Razorclean | Orders')\n ->set_partial('header', 'partials/header')\n ->set_partial('sidebar', $this->sidebar)\n ->set_partial('footer', 'partials/footer');\n $this->template->build('invoice/invoice_list');\n }", "public function index(){\r\n $invoices=DB::table('invoices')\r\n ->join('users','invoices.user_id','=','users.id')\r\n ->select('invoices.created_at as created_at','invoices.numfac as numfac','users.name as name','invoices.mode as mode','invoices.total_amount as total_amount','invoices.id as id')\r\n ->get();\r\n //dd($invoices);\r\n return view('intranet.invoice.list', compact('invoices'));\r\n }", "public function view_invoice($invoice_number)\n\t{\n\t\t$this->db->join('tbl_invoice_products', 'tbl_invoice_products.invoice_number = tbl_invoice.invoice_number');\n\t\t$this->db->join('tbl_customer', 'tbl_customer.serial = tbl_invoice.customer_id');\n\t\t$this->db->group_by('tbl_invoice.invoice_number');\n\t\t$this->db->where('tbl_invoice.invoice_number',$invoice_number);\n\t\t$data['invoice'] = $this->db->get('tbl_invoice')->row();\n\n\n\t\t$this->db->join('tbl_product', 'tbl_product.product_id = tbl_invoice_products.product_id');\n\t\t$this->db->where('tbl_invoice_products.invoice_number',$invoice_number);\n\t\t$data['invoice_products'] = $this->db->get('tbl_invoice_products')->result_object();\n\n\t\t//echo \"<pre>\";\n\t\t//print_r($data['invoice_products']);\n\n\t\t$data['invoice_number'] = $invoice_number;\n\n\n\n\t\t$this->load->view('sale/print',$data);\n\t}", "public function actionIndex()\n {\n $searchModel = new InvoiceSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function show(Invoices $invoice)\n {\n return $invoice;\n }", "public function index(Request $request)\n {\n $search_command = $request->get('search');\n $page_title = 'Invoice';\n $page_description = 'Invoice listing';\n $customers = Customer::all();\n $cust = $request->has('search_by_customer') ? $request->input('search_by_customer') : null;\n $status = $request->has('search_by_status') ? $request->input('search_by_status') : null;\n $date_s = $request->has('search_by_start_date') ? $request->input('search_by_start_date') : null;\n $date_e = $request->has('search_by_end_date') ? $request->input('search_by_end_date') : null;\n $lookupcustomers = array();\n foreach ($customers as $k => $v) {\n $lookupcustomers[$v->customer_number] = $v->customer_name;\n }\n\n $invoice_number = Invoice::max('invoice_number');\n $custom_invoice_number = CustomInvoice::max('custom_invoice_number');\n if($invoice_number == null){\n $invoice_number = \"INV101\";\n \n }else{\n $invoice_number = (int)(substr($invoice_number,3));\n $invoice_number = $invoice_number + 1;\n $invoice_number = \"INV\".$invoice_number;\n }\n if($custom_invoice_number == null){\n $custom_invoice_number = \"CINV1001\";\n \n }else{\n $custom_invoice_number = (int)(substr($custom_invoice_number, 4));\n $custom_invoice_number = $custom_invoice_number + 1;\n $custom_invoice_number = \"CINV\".$custom_invoice_number;\n }\n if($search_command == 'command_search') {\n $prepareSearch = new SearchParamInvoice;\n $prepareSearch->fill($request->all());\n\n $qry = $this->invoiceManager::getBaseQuery();\n $preparedSearch = SearchParamInvoice::prepareSearch($qry, $prepareSearch->toArray());\n $invoices = $preparedSearch->get();\n } else {\n $invoices = DB::table('invoices')\n ->leftJoin('customers', 'customers.customer_number', '=', 'invoices.customer_id')\n ->leftJoin('projects', 'projects.project_number', '=', 'invoices.project_id')\n ->where('invoice_status', '=', 'Open')\n ->get();\n }\n\n return view('invoice.index', compact('invoices', 'page_title', 'page_description', 'invoice_number', 'custom_invoice_number', 'lookupcustomers','cust','date_s','date_e','status'));\n }", "public function index()\n {\n $returnData = Invoice::orderBy('id','DESC')->get();\n return $returnData;\n }", "public function show(Invoices $invoices)\n {\n //\n }", "public function index()\n {\n if (! Gate::allows('invoice_access')) {\n return abort(401);\n }\n\n\n if (request('show_deleted') == 1) {\n if (! Gate::allows('invoice_delete')) {\n return abort(401);\n }\n $invoices = Invoice::onlyTrashed()->get();\n } else {\n $invoices = Invoice::all();\n }\n\n return view('admin.invoices.index', compact('invoices'));\n }", "public function show(invoices_details $invoices_details)\n {\n //\n }", "public function purchase_list_invoice_id($invoice_no) {\n $this->db->select('a.*,b.supplier_name');\n $this->db->from('product_purchase a');\n $this->db->join('supplier_information b', 'b.supplier_id = a.supplier_id');\n $this->db->where('a.chalan_no', $invoice_no);\n $this->db->order_by('a.purchase_date', 'desc');\n $this->db->order_by('purchase_id', 'desc');\n $query = $this->db->get();\n\n $last_query = $this->db->last_query();\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return false;\n }", "public function purchase_list_invoice_id($invoice_no)\n\t{\n\t\t$this->db->select('a.*,b.manufacturer_name');\n\t\t$this->db->from('product_purchase a');\n\t\t$this->db->join('manufacturer_information b','b.manufacturer_id = a.manufacturer_id');\n\t\t$this->db->where('a.chalan_no',$invoice_no);\n\t\t$this->db->order_by('a.purchase_date','desc');\n\t\t$this->db->order_by('purchase_id','desc');\n\t\t$query = $this->db->get();\n\t\t\n\t\t$last_query = $this->db->last_query();\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\treturn false;\n\t}", "public function select_installment_invoices()\r\n {\r\n /*\r\n $this->db->select(\"invoice.*,cost.*\");\r\n $this->db->from(\"invoice\");\r\n $this->db->join('cost','invoice.installment_id=cost.id');\r\n $this->db->where(\"invoice.invoice_of\",\"1\"); //2 means installment\r\n $this->db->order_by(\"invoice.id\",\"desc\");\r\n $result = $this->db->get();\r\n */\r\n\r\n $this->db->select(\"*\");\r\n $this->db->select(\"user.name as user_name\");\r\n $this->db->select(\"invoice.id as invoice_id\");\r\n $this->db->select(\"user.family_name as user_surname\");\r\n $this->db->from(\"invoice\");\r\n $this->db->join('user', \"invoice.user_id = user.id\",\"left\");\r\n $this->db->order_by(\"invoice.id\",\"desc\");\r\n $result = $this->db->get();\r\n\r\n\r\n\r\n if ($result->num_rows()) {\r\n \r\n return $result->result_array();\r\n } else {\r\n return array();\r\n }\r\n }", "public function invoice($param1 = \"\", $param2 = \"\") {\n // For creating new invoice\n if ($param1 == 'single') {\n $response = $this->crud_model->create_single_invoice();\n echo $response;\n }\n\n // For creating new mass invoice\n if ($param1 == 'mass') {\n $response = $this->crud_model->create_mass_invoice();\n echo $response;\n }\n\n // For editing invoice\n if ($param1 == 'update') {\n $response = $this->crud_model->update_invoice($param2);\n echo $response;\n }\n\n // For deleting invoice\n if ($param1 == 'delete') {\n $response = $this->crud_model->delete_invoice($param2);\n echo $response;\n }\n\n // Get the list of student. Here param2 defines classId\n if ($param1 == 'student') {\n $page_data['enrolments'] = $this->user_model->get_student_details_by_id('class', $param2);\n $this->load->view('backend/admin/student/dropdown', $page_data);\n }\n\n // showing the list of invoices\n if ($param1 == 'invoice') {\n $page_data['invoice_id'] = $param2;\n $page_data['folder_name'] = 'invoice';\n $page_data['page_name'] = 'invoice';\n $page_data['page_title'] = 'invoice';\n $this->load->view('backend/index', $page_data);\n }\n\n // showing the list of invoices\n if ($param1 == 'list') {\n $date = explode('-', $this->input->get('date'));\n $page_data['date_from'] = strtotime($date[0].' 00:00:00');\n $page_data['date_to'] = strtotime($date[1].' 23:59:59');\n $page_data['selected_class'] = htmlspecialchars($this->input->get('selectedClass'));\n $page_data['selected_status'] = htmlspecialchars($this->input->get('selectedStatus'));\n $this->load->view('backend/admin/invoice/list', $page_data);\n }\n // showing the index file\n if(empty($param1)){\n $page_data['folder_name'] = 'invoice';\n $page_data['page_title'] = 'invoice';\n $first_day_of_month = \"1 \".date(\"M\").\" \".date(\"Y\").' 00:00:00';\n $last_day_of_month = date(\"t\").\" \".date(\"M\").\" \".date(\"Y\").' 23:59:59';\n $page_data['date_from'] = strtotime($first_day_of_month);\n $page_data['date_to'] = strtotime($last_day_of_month);\n $page_data['selected_class'] = 'all';\n $page_data['selected_status'] = 'all';\n $this->load->view('backend/index', $page_data);\n }\n }", "public function listAction($invoice_id)\n {\n $request = $this->get('request');\n $manager = $this->get(\"gfire_invoice.manager.invoice_account_entry\");\n $invoice = $this->getInvoice($invoice_id);\n\n $pager = $manager->findAllByInvoicePager($invoice_id,$request->get('page'));\n\n return $this->render('GFireInvoiceBundle:InvoiceAccountEntry/Renderer:accountEntries.html.twig', array(\n 'pager' => $pager,\n 'total' => $invoice->getTotalAccountDebitCredit(),\n 'invoice' => $invoice,\n ));\n }", "public function invoices() {\t\t\r\n\t\t\r\n $user = $this->session->userdata('user');\r\n if ($user['UserType'] == 'TYPE_CLI' && empty($user['AccountantAccess'])) {\r\n //setRedirect(site_url());\r\n } else {\r\n if (isset($_GET['clientID'])) {\r\n checkUserAccess(array('TYPE_ACC', 'TYPE_CLI'));\r\n } else {\r\n checkUserAccess(array('TYPE_CLI'));\r\n }\r\n }\r\n\t\t\r\n\t\t$page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;\r\n $user = $this->session->userdata('user');\t\r\n\t\t$VATYear = $this->session->userdata('VATYear');\r\n\t\t$quaters = vatQuaters($user['Params']['VATQuaters']);\r\n\t\t\t\t\r\n /* \tGet the customer list of the company. */\r\n $data['users'] = $this->clients->getUserList();\r\n\r\n $items = $this->clients->getInvoiceList(INVOICE_PAGINATION_LIMIT, $page);\r\n $data['Invoices'] = $items;\r\n //pr($data['Invoices']);\r\n $PaidVatQuarters = $this->clients->getPaidVatQuarters();\r\n\t\t$VATitems = $this->clients->getAllInvoices();\r\n $vat_listing = $this->clients->getVatType();\r\n\t\t\r\n $data['EXPitems'] = false;\r\n if($vat_listing->Type != 'flat') {\r\n $this->load->model('clients/expense');\r\n $EXPitems = $this->expense->getAllExpenses();\r\n $data['EXPitems'] = $EXPitems;\r\n }\r\n //echo '<pre>';print_r($PaidVatQuarters);echo '</pre>';die();\r\n\t\t//echo '<pre>';print_r($VATitems);echo '</pre>';//die();\r\n $data['VATitems'] = $VATitems;\r\n $data['PaidVatQuarters'] = $PaidVatQuarters;\r\n\r\n $total = $this->clients->totalInvoices();\t\t\r\n $data['pagination'] = $this->getPagination('invoices', INVOICE_PAGINATION_LIMIT, $total);\r\n if ($data['users'] == FALSE) {\r\n $data['users'] = array('0' => 'No users');\r\n }\r\n\r\n $data['vat_listing'] = $vat_listing;\r\n $data['page'] = 'invoices';\r\n $data['title'] = 'Cashman | Invoices';\r\n $this->load->view('client/invoices/default', $data);\r\n }", "public function lists()\t{\n\t\tCheckAdminLoginSession();\n\t\t$per_page = 20;\n if($this->uri->segment(4)){\n \t$page = ($this->uri->segment(4)) ;\n }\n else {\n \t$page = 1;\n }\n $start = ($page-1)*$per_page;\n $limit = $per_page;\n $totalCount = $this->admin_model->totalRecord($this->optional_warranty);\n\t\t$data[\"dataCollection\"] = $this->admin_model->getDataCollection($this->optional_warranty,$limit,$start);\n $totalResult = count($data['dataCollection']);\n\t\t$data[\"pagination\"] = Jpagination($totalCount,$limit,$start);\n\t\t$this->load->view('admin/include/head');\n\t\t$this->load->view('admin/include/header');\n\t\t$this->load->view('admin/include/sidebar');\n\t\t$this->load->view('admin/optional_warranty/list',$data);\n\t\t$this->load->view('admin/include/footer');\n\t\t$this->load->view('admin/include/foot');\n\t}", "public function show(ImportInvoice $importInvoice)\n {\n //\n }", "function InfGetInvoice($inf_contact_id, $inf_invoice_id) {\n\t$object_type = \"Invoice\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t$objects = Infusionsoft_DataService::query(new $class_name(), array('ContactId' => $inf_contact_id, 'Id' => $inf_invoice_id));\n\n $invoice_details = false;\n foreach ($objects as $i => $object) {\n\t\t$array = $object->toArray();\n $invoice_details = $array;\n }\n\treturn $invoice_details;\n}", "public function getAllInvoices($stardate,$enddate,$firm_id){\n\t \t $this->db->select(\"OSC.*, OC.invoice_no, OC.order_id, CO.order_number, C.comp_name, U.first_name, U.last_name\");\n\t\t\t$this->db->from(\"order_challan_shipping AS OSC\");\n\t\t\t$this->db->join('order_challan AS OC', 'OC.challan_no = OSC.challan_no');\t\n\t\t\t$this->db->join('client_orders AS CO', 'CO.order_id = OC.order_id');\n\t\t\t$this->db->join('clients AS C', 'CO.comp_id = C.comp_id');\n\t\t\t$this->db->join('users AS U', 'CO.uid = U.uid');\n\t\t\t\n\t\t\tif($firm_id > 0){\n\t\t\t\t$this->db->where(\"CO.invoice_firm \",$firm_id);\n\t\t\t}\n\t\t\tif($enddate != '' && $stardate !=''){\n\t\t\t\t$this->db->where(\"OC.chalan_date >=\",$stardate); \n\t\t\t\t$this->db->where(\"OC.chalan_date <=\",$enddate);\n\t\t\t}\n\t\t\t\n\t\t\t//$this->db->where(\"OC.invoice_no <>\",\"0\");\n\t\t\t$this->db->group_by('OC.challan_no');\t\t\t\n\t\t\t$this->db->order_by('OSC.account_confirmed ASC');\n\t\t\t$query_all_invoices = $this->db->get();\n\t\t\t/// echo $this->db->last_query();die;\n\t\t\tif($query_all_invoices->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_all_invoices->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t }", "public function index()\n\t{\n\t\t$invoices = Invoice::orderBy('id', 'desc')->paginate(10);\n\n\t\treturn view('invoices.index', compact('invoices'));\n\t}", "public function invoices()\n {\n //\n $invoices = Invoice::orderBy('updated_at','DESC')->get();\n return view('reports.invoice',['invoices'=>$invoices]);\n }", "function getListOfRecords(){\n // the orders will be display and the receipts from there \n \n $element = new Order();\n \n $receipts_filter_orders = cisess(\"receipts_filter_orders\");\n \n if ($receipts_filter_orders===FALSE){\n $receipts_filter_orders = \"Abierta\"; // default to abiertas\n }\n \n if (!empty($receipts_filter_orders))\n {\n $element->where(\"status\",$receipts_filter_orders);\n }\n \n \n $element->order_by(\"id\",\"desc\");\n \n $all = $element->get()->all;\n //echo $element->check_last_query();\n ///die();\n $table = $this->entable($all);\n \n return $table;\n \n \n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function indexAction() {\n\t\t$this->_helper->redirector ( 'list', 'invoices', 'admin' );\n\t}", "public function index()\n {\n\t$impinv=ImportInvoice::all();\n\treturn view('importinvoice.index',compact('impinv'));\n }", "public function getInvoiceModel(){}", "function invoice(){ \n\t$order_id=$this->uri->segment(3); \n\t$order = base64_decode(urldecode($order_id));\n\tif(empty($order)){$order=4;}\n\t\t$company_id = $this->session->userdata('id');\n\t\t$role = $this->session->userdata('role');\n\t\tif(!empty($company_id) &&($role=='admin') || ($role == 'super_admin')){\t\n\t\t\tif(!empty($order)){ \n\t\t\t$response = $this->InteractModal->get_order( $order);\n\t\t\t$where = array( 'company_id' =>$company_id);\n\t\t\t$user_data=$this->InteractModal->single_field_value('subscription',$where);\n\t\t\t$user_email= $user_data[0]['customer_email'];\n\t\t\t$pagedata['response'] = $response;\t\t\t\n\t\t\t$pagedata['user_email'] = $user_email;\t\t\t\n\t\t\t}\n\t\t\t\t$this->load->view('dashboard/header');\n\t\t\t\t$this->load->view('dashboard/invoice',$pagedata);\n\t\t\t\t$this->load->view('dashboard/footer');\n\t\t}else{\n\t\t\tredirect(base_url()); \n\t\t}\n\t}", "public function list(InvoiceDataTable $datatable)\n {\n return $datatable->ajax();\n }", "public function indexAction()\n {\n\t\ttry{\n\t\t\t// Write your code here\n\t\t\t\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t$config = $sm->get('Config');\n\t\t\t\n\t\t\t$invoice_id = $this->params('invoice_id');\n\t\t\t\n\t\t\t$newOrderForm = $sm->get('Order\\Form\\OrderForm');\n\t\t\t\n\t\t\tif($invoice_id){\n\t\t\t\t$invoiceTable = $sm->get('Invoice\\Model\\InvoiceTable');\n\t\t\t\t$invoice = $invoiceTable->getInvoiceDetailsById($invoice_id);\n\t\t\t\t\n\t\t\t\t$newOrderForm->get('cust_id')->setValue($invoice['cust_id']);\n\t\t\t\t$newOrderForm->get('opp_id')->setValue($invoice['opp_id']);\n\t\t\t\t$newOrderForm->get('opp_name')->setValue($invoice['opp_name']);\n\t\t\t\t$newOrderForm->get('invoice_number')->setValue($invoice['invoice_number']);\n\t\t\t}\n\t\t\t\n\t\t\treturn array('recordsPerPage' => $config['recordsPerPage'], 'newOrderForm' => $newOrderForm, 'identity' => $identity, 'config' => $config, 'invoice' => $invoice);\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n }", "function invoice_list_user()\n{\n $caf_id=$this->input->get('caf_id');\n $invoiceParam=array(\n 'caf_id'=>$caf_id\n \n\n );\n\n $invoice_list= modules::run('api_call/api_call/call_api',''.api_url().'account/invoiceList',$invoiceParam,'POST');\n var_dump($invoice_list);\n if($invoice_list['status']=='success')\n {\n $data['invoice']=$invoice_list['data'];\n }\n else \n {\n $data['invoice']=[];\n }\n $data['_view'] = 'invoice_list';\n\n $this->load->view('../index.php',$data);\n\n\n\n}", "public function index()\n {\n\n $invoices = Invoice::orderBy('id', 'desc')->get();\n\n return view('admin.invoices.index', compact('invoices'));\n }", "public function accountingRecordList()\n {\n\n if (isset($_POST[\"post\"])) {\n\n $data = json_decode($_POST[\"post\"],true);\n\n /* limit, offset and sql*/\n $limit = 100;\n $offset = 0;\n $sql = \"\";\n $params = array();\n /* limit, offset and sql*/\n\n\n /* adding filter */\n if ($data[\"filters\"][\"txtAccountingRecordCustomerId\"] != \"\") {\n $sql .= \" AND tbl_customers.customer_name LIKE :customer_name\";\n $params[\"customer_name\"] = \"%\".$data[\"filters\"][\"txtAccountingRecordCustomerId\"].\"%\";\n }\n /* adding filter */\n\n\n\n $model = new Model();\n\n $accountingRecords = array();\n\n\n /*purchase invoice records */\n $stmt = $model->dbh->prepare(\n \"SELECT\n tbl_purchase_invoices.purchase_invoice_id,\n tbl_purchase_invoices.purchase_invoice_total,\n tbl_purchase_invoices.purchase_invoice_maturity_date,\n tbl_suppliers.supplier_name\n FROM tbl_purchase_invoices\n INNER JOIN tbl_suppliers ON tbl_suppliers.supplier_id=tbl_purchase_invoices.purchase_invoice_supplier_id\n $sql\n LIMIT $limit OFFSET $offset\"\n );\n $stmt->execute($params);\n $purchaseInvoiceRecords = $stmt->fetchAll(PDO::FETCH_ASSOC);\n for ($i=0; $i < count($purchaseInvoiceRecords); $i++) {\n $accountingRecords[] = array(\n \"record_account\"=>$purchaseInvoiceRecords[$i][\"supplier_name\"],\n \"record_amount\"=>$purchaseInvoiceRecords[$i][\"purchase_invoice_total\"],\n \"record_title\"=>\"Alış Faturası\",\n \"record_date\"=>$purchaseInvoiceRecords[$i][\"purchase_invoice_maturity_date\"],\n );\n }\n /*purchase invoice records */\n\n\n /*sale invoice records */\n $stmt = $model->dbh->prepare(\n \"SELECT\n tbl_sale_invoices.sale_invoice_id,\n tbl_sale_invoices.sale_invoice_total,\n tbl_sale_invoices.sale_invoice_maturity_date,\n tbl_customers.customer_name\n FROM tbl_sale_invoices\n INNER JOIN tbl_customers ON tbl_customers.customer_id=tbl_sale_invoices.sale_invoice_customer_id\n $sql\n LIMIT $limit OFFSET $offset\"\n );\n $stmt->execute($params);\n $saleInvoiceRecords = $stmt->fetchAll(PDO::FETCH_ASSOC);\n for ($i=0; $i < count($saleInvoiceRecords); $i++) {\n $accountingRecords[] = array(\n \"record_account\"=>$saleInvoiceRecords[$i][\"customer_name\"],\n \"record_amount\"=>$saleInvoiceRecords[$i][\"sale_invoice_total\"],\n \"record_title\"=>\"Satış Faturası\",\n \"record_date\"=>$saleInvoiceRecords[$i][\"sale_invoice_maturity_date\"],\n );\n }\n /*sale invoice records */\n\n\n /*tbl_payments records */\n $stmt = $model->dbh->prepare(\n \"SELECT\n tbl_payments.payment_id,\n tbl_payments.payment_amount,\n tbl_payments.payment_date,\n tbl_suppliers.supplier_name\n FROM tbl_payments\n INNER JOIN tbl_suppliers ON tbl_suppliers.supplier_id=tbl_payments.payment_supplier_id\n $sql\n LIMIT $limit OFFSET $offset\"\n );\n $stmt->execute($params);\n $paymentRecords = $stmt->fetchAll(PDO::FETCH_ASSOC);\n for ($i=0; $i < count($paymentRecords); $i++) {\n $accountingRecords[] = array(\n \"record_account\"=>$paymentRecords[$i][\"supplier_name\"],\n \"record_amount\"=>$paymentRecords[$i][\"payment_amount\"],\n \"record_title\"=>\"Ödemeler\",\n \"record_date\"=>$paymentRecords[$i][\"payment_date\"],\n );\n }\n /*tbl_payments records */\n\n\n /*tbl_collections records */\n $stmt = $model->dbh->prepare(\n \"SELECT\n tbl_collections.collection_id,\n tbl_collections.collection_amount,\n tbl_collections.collection_date,\n tbl_customers.customer_name\n FROM tbl_collections\n INNER JOIN tbl_customers ON tbl_customers.customer_id=tbl_collections.collection_customer_id\n $sql\n LIMIT $limit OFFSET $offset\"\n );\n $stmt->execute($params);\n $collectionRecords = $stmt->fetchAll(PDO::FETCH_ASSOC);\n for ($i=0; $i < count($collectionRecords); $i++) {\n $accountingRecords[] = array(\n \"record_account\"=>$collectionRecords[$i][\"customer_name\"],\n \"record_amount\"=>$collectionRecords[$i][\"collection_amount\"],\n \"record_title\"=>\"Tahsilatlar\",\n \"record_date\"=>$collectionRecords[$i][\"collection_date\"],\n );\n }\n /*tbl_collections records */\n\n\n /*tbl_received_checks records */\n $stmt = $model->dbh->prepare(\n \"SELECT\n tbl_received_checks.received_check_id,\n tbl_received_checks.received_check_amount,\n tbl_received_checks.received_check_maturity_date,\n tbl_customers.customer_name\n FROM tbl_received_checks\n INNER JOIN tbl_customers ON tbl_customers.customer_id=tbl_received_checks.received_check_customer_id\n $sql\n LIMIT $limit OFFSET $offset\"\n );\n $stmt->execute($params);\n $receivedCheckRecords = $stmt->fetchAll(PDO::FETCH_ASSOC);\n for ($i=0; $i < count($receivedCheckRecords); $i++) {\n $accountingRecords[] = array(\n \"record_account\"=>$receivedCheckRecords[$i][\"customer_name\"],\n \"record_amount\"=>$receivedCheckRecords[$i][\"received_check_amount\"],\n \"record_title\"=>\"Alınan Çekler\",\n \"record_date\"=>$receivedCheckRecords[$i][\"received_check_maturity_date\"],\n );\n }\n /*tbl_received_checks records */\n\n\n /*tbl_given_checks records */\n $stmt = $model->dbh->prepare(\n \"SELECT\n tbl_given_checks.given_check_id,\n tbl_given_checks.given_check_amount,\n tbl_given_checks.given_check_date,\n tbl_suppliers.supplier_name\n FROM tbl_given_checks\n INNER JOIN tbl_suppliers ON tbl_suppliers.supplier_id=tbl_given_checks.given_check_supplier_id\n $sql\n LIMIT $limit OFFSET $offset\"\n );\n $stmt->execute($params);\n $givenCheckRecords = $stmt->fetchAll(PDO::FETCH_ASSOC);\n for ($i=0; $i < count($givenCheckRecords); $i++) {\n $accountingRecords[] = array(\n \"record_account\"=>$receivedCheckRecords[$i][\"supplier_name\"],\n \"record_amount\"=>$givenCheckRecords[$i][\"given_check_amount\"],\n \"record_title\"=>\"Verilen Çekler\",\n \"record_date\"=>$givenCheckRecords[$i][\"given_check_maturity_date\"],\n );\n }\n /*tbl_given_checks records */\n\n\n /*credit installment records */\n $stmt = $model->dbh->prepare(\n \"SELECT\n tbl_credits.credit_id,\n tbl_credits.credit_bank_id,\n tbl_banks.bank_name\n FROM tbl_credits\n LEFT JOIN tbl_banks ON tbl_banks.bank_id=tbl_credits.credit_bank_id\n $sql\n LIMIT $limit OFFSET $offset\"\n );\n $stmt->execute($params);\n $creditInformations = $stmt->fetchAll(PDO::FETCH_ASSOC);\n for ($i=0; $i < count($creditInformations); $i++) {\n $stmt = $model->dbh->prepare(\"SELECT credit_payment_installment_amount,credit_payment_date FROM tbl_credit_payments WHERE credit_payment_credit_id=:credit_id\");\n $stmt->execute([\"credit_id\"=>$creditInformations[$i][\"credit_id\"]]);\n $creditInstallments = $stmt->fetchAll(PDO::FETCH_ASSOC);\n for ($a=0; $a < count($creditInstallments); $a++) {\n $creditInstallments[$a][\"bank_name\"] = $creditInformations[$i][\"bank_name\"];\n }\n for ($i=0; $i < count($creditInstallments); $i++) {\n $accountingRecords[] = array(\n \"record_account\"=>$creditInstallments[$i][\"bank_name\"],\n \"record_amount\"=>$creditInstallments[$i][\"credit_payment_installment_amount\"],\n \"record_title\"=>\"Kredi Taksiti\",\n \"record_date\"=>$creditInstallments[$i][\"credit_payment_date\"],\n );\n }\n }\n /*credit installment records */\n\n\n $price = array();\n foreach ($accountingRecords as $key => $row)\n {\n $price[$key] = $row['record_date'];\n }\n array_multisort($price, SORT_DESC, $accountingRecords);\n\n\n\n $model = null;\n\n echo json_encode(array(\n \"data\"=>$accountingRecords,\n \"totalPageNumber\"=>0,\n \"doesHaveProfile\"=>false\n ));\n\n }else {\n $this->view->render('apps/accounting/accounting-record/accounting-record-list');\n }\n\n }", "public function index()\n { \n $invoices = $this->invoiceRepository->get();\n\n return view('chuckcms-module-booker::backend.invoices.index', compact('invoices'));\n }", "public function index()\n {\n $invoices=InvoiceItem::with(\"item\")->paginate(15);\n\n return view(\"invoiceitem.index\",compact(\"invoices\"));\n }", "public function invoice_reg_list() {\n// $this->output->enable_profiler(TRUE);\n $data['sideMenuData'] = fetch_non_main_page_content();\n\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $payment_status = $this->input->get('payment_status');\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 $invoice_id = $this->input->get('invoice_id'); //skm\n $prev_invoice_id = $this->input->get('prev_invoice_id'); //skm\n if (!empty($_GET)) {\n $totalrows = $this->reportsModel->get_reg_invoice_count($tenant_id, $payment_status, $start_date, $end_date, $company_id, $invoice_id, $prev_invoice_id);\n $records_per_page = RECORDS_PER_PAGE;\n $baseurl = base_url() . 'reports_finance/invoice_reg_list/';\n $pageno = ($this->uri->segment(3)) ? $this->uri->segment(3) : 1;\n $offset = ($pageno * $records_per_page);\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'inv_date';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_reg_invoice($tenant_id, $records_per_page, $offset, $field, $order_by, $payment_status, $start_date, $end_date, $company_id, $invoice_id, $prev_invoice_id);\n\n $tabledata_count = count($tabledata);\n\n $data['tabledata'] = $tabledata;\n $data['sort_order'] = $order_by;\n }\n $data['controllerurl'] = 'reports_finance/invoice_reg_list/';\n $this->load->helper('pagination');\n //$data['sort_link'] = $sort_link = \"payment_status=\" . $this->input->get('payment_status') . \"&start_date=\" . $this->input->get('start_date') . \"&end_date=\" . $this->input->get('end_date') . \"&company_id=\" . $this->input->get('company_id') . \"&company_name=\" . $this->input->get('company_name');\n $data['pagination'] = get_pagination($records_per_page, $pageno, $baseurl, $totalrows, $field, $order_by . '&' . $sort_link);\n $data['page_title'] = 'Accounting Reports - Regenerated and Deleted Invoice';\n $data['main_content'] = 'reports/invoice_reg_list';\n $this->load->view('layout', $data);\n }", "public function view_invoice(){\n $search = $_POST['search']['value'];\n // $limit = $_POST['length'];\n // $start = $_POST['start'];\n $status = $this->input->post('status_bayar');\n $order_index = $_POST['order'][0]['column'];\n $order_field = $_POST['columns'][$order_index]['data'];\n $order_ascdesc = $_POST['order'][0]['dir'];\n $sql_total = $this->model_home->count_all_invoice($status);\n $sql_data = $this->model_home->filter_invoice($search,$order_field, $order_ascdesc,$status);\n $sql_filter = $this->model_home->count_filter_invoice($search,$status);\n $callback = array(\n 'draw' => $_POST['draw'],\n 'recordsTotal' => $sql_total,\n 'recordsFiltered' => $sql_filter,\n 'data' => $sql_data\n );\n\n header('Content-Type: application/json');\n echo json_encode($callback);\n }", "public function index()\n {\n $productinvoices = ProductInvoice::orderBy('created_at', 'desc')->paginate(10);\n $invoices = Invoice::orderBy('created_at', 'desc')->paginate(10);\n return view('invoices.index', compact(['invoices','productinvoices']));\n }", "public function get_invoices( $page ) {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n\n // Check if data was submitted\n if ($this->input->post()) {\n \n // Add form validation\n $this->form_validation->set_rules('user', 'User', 'trim');\n $this->form_validation->set_rules('from_date', 'From Date', 'trim');\n $this->form_validation->set_rules('to_date', 'To Date', 'trim');\n \n // Get data\n $user = $this->input->post('user');\n $from_date = $this->input->post('from_date');\n $to_date = $this->input->post('to_date');\n \n // Check form validation\n if ( $this->form_validation->run() != false ) {\n \n $page --;\n $limit = 10;\n \n // Set default user_id\n $user_id = 0;\n \n // Verify if user exists\n if ( $user ) {\n \n // Get user by search\n $response = $this->invoice->get_user_by_username_or_email( $user );\n \n if ( $response ) {\n \n $user_id = $response[0]->user_id;\n \n } else {\n \n // Stop running the script\n exit();\n \n }\n \n }\n \n // Set date from\n $date_from = 0;\n \n // Verify if $from_date is not empty\n if ( $from_date ) {\n \n $date_from = $from_date;\n \n }\n \n // Set date to\n $date_to = 0;\n \n // Verify if $to_date is not empty\n if ( $to_date ) {\n \n $date_to = $to_date;\n \n } \n \n // Now get total number of invoices\n $total = $this->invoice->get_invoices( $page * $limit, $limit, $user_id, $date_from, $date_to, false );\n \n // Now get all invoices\n $invoices = $this->invoice->get_invoices( $page * $limit, $limit, $user_id, $date_from, $date_to, true );\n \n if ( $invoices ) {\n \n echo json_encode(['invoices' => $invoices, 'total' => $total]);\n \n }\n \n }\n \n }\n \n }", "public function index()\n {\n return View::make('crm.invoices.index')->with($this->getDataAndPagination());\n }", "public function invoice($param1 = \"\", $param2 = \"\") {\n\t\t// showing the list of invoices\n\t\tif ($param1 == 'invoice') {\n\t\t\t$page_data['invoice_id'] = $param2;\n\t\t\t$page_data['folder_name'] = 'invoice';\n\t\t\t$page_data['page_name'] = 'invoice';\n\t\t\t$page_data['page_title'] = 'invoice';\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}\n\n\t\t// showing the index file\n\t\tif(empty($param1)){\n\t\t\t$page_data['folder_name'] = 'invoice';\n\t\t\t$page_data['page_title'] = 'invoice';\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}\n\t}", "public function index()\n {\n $invoice=Invoice::all()->toArray();\n\t\treturn view('invoice.index',compact('invoice'));\n }", "public function get_invoice_items($invoice_id)\n\t{\n\t\t$this->db->select('invoice_item.*');\n\t\t$this->db->where('invoice_item.invoice_id = '.$invoice_id);\n\t\t$query = $this->db->get('invoice_item');\n\t\t\n\t\treturn $query;\n\t}", "public function getAllInwordInvoices($purc_order_id){\n\t\t\t$this->db->select(\"PBD.material_inward_no\");\n\t\t\t$this->db->from(\"product_batch_details AS PBD\");\n\t\t\t$this->db->where(\"PBD.purc_order_id\", $purc_order_id);\n\t\t\t\n\t\t\t$query_inword_invoices = $this->db->get();\n\t\t\t\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_inword_invoices->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_inword_invoices->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t}", "public function show(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function index() {\n\n\t\t$invoices = \\Auth::user()\n\t\t\t->invoices()\n\t\t\t->get();\n\n\t\t$transactions = \\Auth::user()\n\t\t\t->transactions()\n\t\t\t->get();\n\n\t\tforeach ($invoices as $invoice) {\n\n\t\t\t$invoice->name_date = date('Y-m', strtotime($invoice->name));\n\t\t\t$invoice->sum_of_transactions = count($invoice->transactions);\n\n\t\t\t$income = $transactions\n\t\t\t\t->where('invoice_id', $invoice->id)\n\t\t\t\t->where('type', 'income')\n\t\t\t\t->sum('amount');\n\t\t\t$expense = $transactions\n\t\t\t\t->where('invoice_id', $invoice->id)\n\t\t\t\t->where('type', 'expense')\n\t\t\t\t->sum('amount');\n\n\t\t\t$invoice->change = $income - $expense;\n\t\t}\n\n\t\t$invoices = $invoices->sortBy('name_date');\n\t\t$return['invoices'] = $invoices;\n\n\t\treturn view('/invoices/invoicesOverview', $return);\n\t}", "public function getCollections($idInvoice = 0){\n\t\t#variable de respuesta\n\t\t$response = array('status' => 'Succes');\n\t\tif($this->uri->segment(3)){\n\t\t\t$this->Query_ = 'SELECT * FROM \tcobro WHERE id_factura = ' . $idInvoice;\n\t\t}else{\n\t\t\t$this->Query_ = 'SELECT \n\t\t\t\t\tcob.id_cobro,\n\t\t\t\t\tcob.fecha,\n\t\t\t\t\tcob.id_factura,\n\t\t\t\t\tfac.id_factura,\n\t\t\t\t\ttrt.id_tratamiento,\n\t\t\t\t\tcli.nombres,\n\t\t\t\t\tcob.tipo,\n\t\t\t\t\tcob.nro_deposito,\n\t\t\t\t\tcob.valor\n\t\t\t\t\tFROM cobro AS cob\n\t\t\t\t\tLEFT JOIN factura as fac USING(id_factura)\n\t\t\t\t\tLEFT JOIN tratamiento as trt USING(id_tratamiento)\n\t\t\t\t\tLEFT JOIN cliente as cli using(id_cliente)';\n\t\t}\n\t\t#ejecutamos la consulta\n\t\t$this->Result_ = $this->db->query($this->Query_);\n\t\tif($this->Result_->num_rows() > 0){\n\t\t\t$response['msg'] = '3002';\n\t\t\t$response['data'] = $this->Result_->resul_array();\n\t\t}else{\n\t\t\tif($idInvoice != 0){\n\t\t\t\t$response['msg'] = '2001';\n\t\t\t}else{\n\t\t\t\t$response['msg'] = '2002';\n\t\t\t}\n\t\t}\n\t\t#envio de respuesta\n\t\t$this->rest->_responseHttp($response, $this->CodeHttp_);\n\t}", "public static function LoadIncoming_InventoryForBilling($code_PartNo,$incomingInvTyp)\r\n\t{ \r\n //$Query = \"SELECT ici.*,ince.principal_inv_no from incominginventory as ici left join incominginvoice_excise as ince on ici.incomingInvNo=ince.entryId left join incominginvoice_excise_detail as ined on ined.entryDId = ici.entryDId WHERE ici.code_PartNo = $code_PartNo AND ici.qty > 0\"; \r\n\t\t\r\n\t\t//$Query = \"SELECT ici.incoming_inventory_id, ici.entryDId, ici.code_PartNo, ici.\tincomingInvNo, ici.incomingInvDt, ici.incomingInvTyp, ici.principalId, ici.supplrId, ici.qty, if(ince.principal_inv_no is NULL, ici.principal_inv_no, ince.principal_inv_no) AS PRINCIPAL_INVOICE_NUMBER from incominginventory as ici left join incominginvoice_excise as ince on ici.incomingInvNo=ince.entryId left join incominginvoice_excise_detail as ined on ined.entryDId = ici.entryDId WHERE ici.code_PartNo = $code_PartNo AND ici.qty > 0\";\r\n\t\t\r\n\t\t$Query = \"SELECT ici.incoming_inventory_id, ici.entryDId, ici.code_PartNo, ici.\tincomingInvNo, ici.incomingInvDt, ici.incomingInvTyp, ici.principalId, ici.supplrId, ici.qty, if(ici.principal_inv_no is NULL, ince.principal_inv_no, ici.principal_inv_no) AS PRINCIPAL_INVOICE_NUMBER from incominginventory as ici left join incominginvoice_excise as ince on ici.incomingInvNo=ince.entryId left join incominginvoice_excise_detail as ined on ined.entryDId = ici.entryDId WHERE ici.code_PartNo = $code_PartNo AND ici.qty > 0\";\r\n\t\t/* EOF to show Invoice Number in Outgoing Invoice by Ayush Giri on 20-07-2017 */ \r\n \r\n //~ if($incomingInvTyp==\"E\")\r\n //~ {\r\n //~ $Query = \"SELECT ici.*,ince.principal_inv_no from incominginventory as ici inner join incominginvoice_excise as ince on ici.incomingInvNo=ince.entryId inner join incominginvoice_excise_detail as ined on ined.entryDId = ici.entryDId WHERE ici.code_PartNo = $code_PartNo AND ici.incomingInvTyp = '$incomingInvTyp' AND ici.ExciseQty > 0\";\r\n //~ }\r\n //~ else if($incomingInvTyp==\"I\")\r\n //~ {\r\n //~ $Query = \"SELECT ici.*,ince.principal_inv_no from incominginventory as ici inner join incominginvoice_excise as ince on ici.incomingInvNo=ince.entryId inner join incominginvoice_without_excise_detail as iwed on iwed.entryDId = ici.entryDId WHERE ici.code_PartNo = $code_PartNo AND ici.incomingInvTyp = '$incomingInvTyp' AND ici.NonExciseQty > 0\";\r\n //~ }\r\n \r\n //echo $Query; exit;\r\n\t\t$Result = DBConnection::SelectQuery($Query);\r\n\t\t$objArray = array();\r\n\t\t$i = 0;\r\n\t\twhile ($Row = mysql_fetch_array($Result, MYSQL_ASSOC)) {\r\n\t\t\t//print_r($Row);exit;\r\n //$_entryDId = $Row['entryDId'];\r\n //$_entryDId = $Row['incomingInvNo'];\r\n\t\t\t$_entryDId = $Row['incoming_inventory_id'];\r\n $code_PartNo = $Row['code_PartNo'];\r\n $incomingInvNo = $Row['incomingInvNo'];\r\n $incomingInvDt = $Row['incomingInvDt'];\r\n $incomingInvTyp = $Row['incomingInvTyp'];\r\n $principalId = $Row['principalId'];\r\n $supplrId = $Row['supplrId'];\r\n $ExciseQty = $Row['qty'];\r\n $NonExciseQty = $Row['qty'];\r\n $principal_inv_no=$Row['PRINCIPAL_INVOICE_NUMBER'];\r\n $newObj = new Incoming_Inventory_Model($_entryDId,$code_PartNo, $incomingInvNo, $incomingInvDt, $incomingInvTyp, $principalId,$supplrId, $ExciseQty, $NonExciseQty,$principal_inv_no);\r\n $objArray[$i] = $newObj;\r\n $i++;\r\n\t\t}\r\n\t\treturn $objArray;\r\n\t}", "public function invoices()\n {\n $user = auth()->user();\n $facturas = DB::table('quotes')\n ->select('quotes.account_id', 'quotes.created_by_id', 'quotes.id as quoteId', 'quotes.quote_date',\n DB::raw(\"upper(quotes.quote_number) AS quote_number\"),\n 'quotes.invoice_date','quotes.stage_id',\n 'accounts.name as accountName','users.name as userName','stages.name as stageName',\n 'accounts.document_number','document_types.name as documenttype')\n ->join('accounts', 'accounts.id', '=', 'quotes.account_id')\n ->join('document_types', 'document_types.id', '=', 'accounts.document_type_id')\n ->join('stages', 'stages.id', '=', 'quotes.stage_id')\n ->join('users', 'users.id', '=', 'quotes.created_by_id')\n ->whereIn('quotes.stage_id', array(3,4))\n ->where('users.organization_id', $user->organization_id)\n ->orderByRaw('quotes.updated_at DESC')\n ->paginate(10);\n return view('quote.invoices',compact('facturas'));\n }", "public function index()\n\t{\n\t\t// Database Queries\n\t\t$invoices = Invoice::with(['contract', 'contract.tenant', 'contract.asset'])->get();\n\t\treturn view('invoices.index', compact('invoices'));\n\t}", "public function getAllInvoicesList(InvoiceListingFilter $filter): Builder;", "public function invoice($id = '')\n {\n if (!get_permission('invoice', 'is_view')) {\n access_denied();\n }\n\n $this->data['student_id'] = $id;\n $this->data['invoice'] = $this->fees_model->getInvoiceStatus($id);\n $this->data['basic'] = $this->fees_model->getInvoiceBasic($id);\n $this->data['title'] = translate('invoice_history');\n $this->data['main_menu'] = 'fees';\n $this->data['sub_page'] = 'fees/collect';\n $this->load->view('layout/index', $this->data);\n }", "public function index()\r\n {\r\n if (!has_permission('items', '', 'view')) {\r\n access_denied('Invoice Items');\r\n }\r\n if ($this->input->is_ajax_request()) {\r\n $this->perfex_base->get_table_data('invoice_items');\r\n }\r\n $this->load->model('taxes_model');\r\n $data['taxes'] = $this->taxes_model->get();\r\n $data['items_groups'] = $this->invoice_items_model->get_groups();\r\n\r\n $data['title'] = _l('invoice_items');\r\n $this->load->view('admin/invoice_items/manage', $data);\r\n }", "function invoices_count()\n {\n $this->company_db->from('tbl_invoice_header');\n return $this->company_db->count_all_results();\n }", "function get_invoicedet_forreturn($invno)\r\n\t{\r\n\t\t$invdet = array();\r\n\t\t\r\n\t\t$sql = \"select a.invoice_no,b.id as order_id,b.itemid,c.name,b.quantity,d.packed,d.shipped,d.shipped_on,\r\n\t\t\t\t\t\ta.invoice_status \r\n\t\t\t\t\tfrom king_invoice a\r\n\t\t\t\t\tjoin king_orders b on a.order_id = b.id \r\n\t\t\t\t\tjoin king_dealitems c on c.id = b.itemid \r\n\t\t\t\t\tjoin shipment_batch_process_invoice_link d on d.invoice_no = a.invoice_no\r\n\t\t\t\t\tjoin king_transactions t on t.transid = b.transid\r\n\t\t\t\t\tleft join pnh_invoice_returns_product_link e on e.order_id = b.id \r\n\t\t\t\t\twhere a.invoice_no = ? and b.status in (1,2) \r\n\t\t\t\t\tgroup by a.order_id \r\n\t\t\t\t\";\r\n\t\t$res = $this->db->query($sql,$invno);\r\n\t\t//echo $this->db->last_query();\r\n\t\tif($res->num_rows())\r\n\t\t{\r\n\t\t\t$invord_list = $res->result_array();\r\n\t\t\tif(!$invord_list[0]['shipped'])\r\n\t\t\t{\r\n\t\t\t\t$invdet['error'] = 'Invoice is not shipped';\r\n\t\t\t}else \r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$invdet['itemlist'] = array();\r\n\t\t\r\n\t\t\t\tforeach ($invord_list as $ord)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$sql = \"(select e.is_shipped,e.shipped_on,e.is_refunded,is_stocked,is_serial_required,a.id as order_id,b.product_id,product_name,b.qty from king_orders a join m_product_deal_link b on a.itemid = b.itemid join m_product_info c on c.product_id = b.product_id left join pnh_invoice_returns_product_link e on e.product_id = b.product_id and e.order_id = a.id where a.id = ? group by e.id )\r\n\t\t\t\t\t\t\t\tunion\r\n\t\t\t\t\t\t\t(select e.is_shipped,e.shipped_on,e.is_refunded,is_stocked,is_serial_required,a.order_id,b.product_id,product_name,d.qty from products_group_orders a join m_product_info b on b.product_id = a.product_id join king_orders c on c.id = a.order_id join m_product_group_deal_link d on d.itemid = c.itemid left join pnh_invoice_returns_product_link e on e.product_id = a.product_id and e.order_id = a.order_id where a.order_id = ? group by e.id )\r\n\t\t\t\t\t\t\t\";\r\n\t\t\t\t\t$prod_list_res = $this->db->query($sql,array($ord['order_id'],$ord['order_id']));\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!isset($invdet['itemlist'][$ord['order_id']]))\r\n\t\t\t\t\t\t$invdet['itemlist'][$ord['order_id']] = array();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$invdet['itemlist'][$ord['order_id']] = $ord;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!isset($invdet['itemlist'][$ord['order_id']]['product_list']))\r\n\t\t\t\t\t\t$invdet['itemlist'][$ord['order_id']]['product_list'] = array();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$prod_list = array();\t\r\n\t\t\t\t\tforeach($prod_list_res->result_array() as $prod_det)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$ttl_pending_inreturn_qty = $this->db->query(\"select ifnull(sum(qty),0) as t from pnh_invoice_returns_product_link where order_id = ? and product_id = ? and status != 3 \",array($ord['order_id'],$prod_det['product_id']))->row()->t;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$prod_det['pen_return_qty'] = $ttl_pending_inreturn_qty; \r\n\t\t\t\t\t\t$prod_det['has_barcode'] = $this->db->query(\"select count(*) as t from t_stock_info where product_id = ? and product_barcode != '' \", $prod_det['product_id'] )->row()->t;\r\n\t\t\t\t\t\t$prod_list[] = $prod_det;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t$invdet['itemlist'][$ord['order_id']]['product_list'][] = $prod_list;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$ord_imei_list_res = $this->db->query(\"select * from t_imei_no where order_id = ? and status = 1 and is_returned = 0 and return_prod_id = 0 \",$ord['order_id']);\r\n\t\t\t\t\tif($ord_imei_list_res->num_rows())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tforeach($ord_imei_list_res->result_array() as $p_imei_det)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(!isset($invdet['itemlist'][$ord['order_id']]['imei_list'][$p_imei_det['product_id']]))\r\n\t\t\t\t\t\t\t\t$invdet['itemlist'][$ord['order_id']]['imei_list'][$p_imei_det['product_id']] = array();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$invdet['itemlist'][$ord['order_id']]['imei_list'][$p_imei_det['product_id']][] = $p_imei_det['imei_no']; \r\n\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// check if the order qty already processedIn \r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else\r\n\t\t{\r\n\t\t\t$invdet['error'] = 'Invoice not found';\r\n\t\t}\r\n\t\treturn $invdet;\r\n\t}", "public function invoicesList(RouteMatchInterface $route_match) {\n $entity_type_id = $this->config('recurly.settings')->get('recurly_entity_type');\n $entity = $route_match->getParameter($entity_type_id);\n\n $entity_type = $entity->getEntityType()->getLowercaseLabel();\n $account = recurly_account_load(['entity_type' => $entity_type, 'entity_id' => $entity->id()]);\n\n $per_page = 20;\n $invoice_list = \\Recurly_InvoiceList::getForAccount($account->account_code, ['per_page' => $per_page]);\n $invoices = $this->recurlyPageManager->pagerResults($invoice_list, $per_page);\n\n return [\n '#theme' => 'recurly_invoice_list',\n '#attached' => [\n 'library' => [\n 'recurly/recurly.invoice',\n ],\n ],\n '#invoices' => $invoices,\n '#entity_type' => $entity_type,\n '#entity' => $entity,\n '#per_page' => $per_page,\n '#total' => $invoice_list->count(),\n ];\n }", "public function testList()\n {\n //Tests all invoices\n $this->clientAuthenticated->request('GET', '/invoice/list');\n $response = $this->clientAuthenticated->getResponse();\n $content = $this->assertJsonResponse($response, 200);\n $this->assertInternalType('array', $content);\n $first = $content[0];\n $this->assertArrayHasKey('invoiceId', $first);\n }", "public function index()\n {\n $invoice = Invoice::all();\n $data['invoice'] = $invoice;\n return view('invoice.index', $data);\n }", "function detail($InvoiceId)\n { \n // check if the invoice exists before trying to edit it\n $data['invoice'] = $this->Invoice_model->get_invoice($InvoiceId);\n $data['invoicedetail']=$this->GenricModel->singlequery('select distinct i.InvoiceId,i.BillNo,i.SupplierName,i.SupplierNumber,i.SupplierAddress,i.PurchaseDate,i.PurchaseDateBS,i.Description,id.TAmount,id.Item,id.Quantity,id.Price,id.Amount from invoice i join invoicedetail id on id.InvoiceId=i.InvoiceId where i.InvoiceId='.$InvoiceId);\n\t\t$data['item']=$this->GenricModel->query('select * from invoicedetail where InvoiceId='.$InvoiceId);\n\t\t\n\t\t//var_dump($data['item']);die;\n if(isset($data['invoice']['InvoiceId']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'BillNo' => $this->input->post('BillNo'),\n\t\t\t\t'PurchaseDate' => $this->input->post('PurchaseDate'),\n\t\t\t\t'PurchaseDateBS' => $this->input->post('PurchaseDateBS'),\n\t\t\t\t'SupplierName' => $this->input->post('SupplierName'),\n\t\t\t\t'SupplierNumber' => $this->input->post('SupplierNumber'),\n\t\t\t\t'SupplierAddress' => $this->input->post('SupplierAddress'),\n\t\t\t\t'Description' => $this->input->post('Description'),\n\t\t\t\t\n );\n $this->Invoice_model->update_invoice($InvoiceId,$params); \n redirect('invoice/index');\n }\n else\n {\n\t\t\t\t $userid = $this->session->userdata('userid');\n\t\t\t\t$data['users'] = $this->User_model->get_user($userid);\n $data['_view'] = 'invoice/detail';\n $this->load->view('layouts/main1',$data);\n }\n }\n else\n show_error('The invoice you are trying to edit does not exist.');\n }", "function loadInvoice($invoiceId) {\n\t\t\n\t\t\t$invoiceId = (int) $invoiceId;\n\t\t\t\n\t\t\t$myQuery = \"\n\t\t\t\tSELECT *\n\t\t\t\tFROM fh_invoice\n\t\t\t\tWHERE invoice_id = $invoiceId\n\t\t\t\";\n\t\t\t\n\t\t\t$myInvoice = DMDatabase::loadObject($myQuery);\n\t\t\t\n\t\t\t$myQuery = \"\n\t\t\t\tSELECT ir.*, s.name AS stock_name\n\t\t\t\tFROM fh_invoice_row AS ir\n\t\t\t\tLEFT JOIN fh_stock AS s ON (ir.stock_id = s.stock_id)\n\t\t\t\tWHERE ir.invoice_id = $invoiceId\n\t\t\t\";\n\t\t\t\n\t\t\t$myInvoice->rows = DMDatabase::loadObjectList($myQuery);\n\t\t\t\n\t\t\treturn $myInvoice;\n\t\t\t\n\t\t}", "function get_datatables_invoice()\n {\n $this->company_db = $this->load->database('company_db', TRUE);\n $offset = ($_REQUEST['datatable']['pagination']['page'] - 1)*$_REQUEST['datatable']['pagination']['perpage'];\n $this->_get_datatables_query_invoice();\n if($_REQUEST['datatable']['pagination']['perpage'] != -1)\n $this->company_db->limit($_REQUEST['datatable']['pagination']['perpage'], $offset);\n $query = $this->company_db->get();\n /*$this->_get_datatables_query();\n $query2 = $this->company_db->get();*/\n /* echo \"<pre>\";\n var_dump($query);exit;\n echo \"</pre>\";*/\n\n $this->session->set_userdata('last_pickup_report_query',$this->company_db->last_query());\n\n\n if($query->num_rows() > 0)\n {\n foreach ($query->result() as $row)\n {\n //var_dump($row);exit;\n //$balance = $row->balance;\n\n //var_dump($balance);exit;\n\n\n\n // $now = strtotime(str_replace('/', '-', $_REQUEST['datatable']['pickup_date'])); // or your date as well\n\n $row->invoice_number = \"<span class='invoice'>$row->invoice_number</span>\n <span></span>\";\n $row->name = \"<div style='display:none' class='customer'>$row->customer_id</div><span>$row->name</span>\";\n\n $row->nameShipto = \"<div style='display:none' class='nameShipto'>$row->ShiptoId</div><span>$row->nameShipto</span>\";\n\n $row->total_packages = \"<span class='total_packages'>$row->total_packages</span><span></span>\";\n\n $row->balance = \"<span class='balance'>$row->balance</span><span></span>\";\n\n $row->invoice_date = \"<span class='invoice_date'>$row->invoice_date</span><span></span>\n \";\n // var_dump($row);exit;\n\n /*$your_date = strtotime($row->pickup_date);\n $datediff = $now - $your_date;\n\n $days = round($datediff / (60 * 60 * 24));\n if($days > 2)\n $row->pickup_date = \"<label class='text-danger'>\".date(\"m/d/Y\", strtotime($row->pickup_date)).\"</label>\";\n else if($days > 1)\n $row->pickup_date = \"<label class='text-warning'>\".date(\"m/d/Y\", strtotime($row->pickup_date)).\"</label>\";\n else\n $row->pickup_date = date(\"m/d/Y\", strtotime($row->pickup_date));*/\n\n $row->chk_status = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' id='chk_status_$row->id' value = '$row->id' class = 'chk_status' name='chk_status[]' data-id ='$row->id'>\n <span></span></label>\n \";\n /*if($row->status != \"Done\"){\n } else {\n $row->chk_status = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' id='chk_status_$row->id' value = '$row->id' class = 'chk_status' name='chk_status[]' data-id ='$row->id' checked>\n <span></span></label>\";\n }*/\n\n $row->chk_print = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'>\n <input type='checkbox' class = 'chk_print' name='chk_print[]' data-id ='$row->id' checked>\n <span></span>\n </label>\";\n\n /* if($row->driver_id != '0'){\n\n $row->chk_driver = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' class = 'chk_driver' name='chk_driver[]' data-id ='$row->id' checked>\n <span></span></label>\";\n\n }else{\n\n $row->chk_driver = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' class = 'chk_driver' name='chk_driver[]' data-id ='$row->id'>\n <span></span></label>\n \";\n }*/\n\n\n }\n\n return $query->result();\n }\n else\n {\n return false;\n }\n }", "public function index()\n {\n //\n $request = request();\n $inputs = $request->all();\n $invoices = $this->searchrequest($request)->paginate(15);\n\n return view('finance.invoice.index', compact('invoices', 'inputs'));\n }", "public function getPendingInvoices(){\n\t \t $this->db->select(\"OSC.*, OC.invoice_no, OC.order_id, CO.order_number\");\n\t\t\t$this->db->from(\"order_challan_shipping AS OSC\");\n\t\t\t$this->db->join('order_challan AS OC', 'OC.challan_no = OSC.challan_no');\t\n\t\t\t$this->db->join('client_orders AS CO', 'CO.order_id = OC.order_id');\t\n\t\t\t$this->db->where(\"OSC.account_confirmed\",\"0\");\n\t\t\t$this->db->where(\"OC.invoice_no <>\",\"0\");\n\t\t\t$this->db->group_by('OC.challan_no');\t\t\t\n\t\t\t$this->db->order_by('OSC.id DESC');\n\t\t\t$query_pending_invoices = $this->db->get();\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_pending_invoices->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_pending_invoices->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t }", "public function print_invoice($id='')\n\t{\n\t\tif(isset($this->session->isactive)){\n\n\t\t\tif($id){\n\t\t\t\t$this->load->model('invoice_model');\n\t\t\t\t$invoice = $this->invoice_model->get_invoice($id);\n\t\t\t\t$this->load->model('student_model');\n\t\t\t\t$student = $this->student_model->get_every_student_full($invoice[0]['gr_number']);\n\n\t\t\t\t$id = $id;\n\t\t\t\t$grnumber = $invoice[0]['gr_number'];\n\t\t\t\t$name = $student[0]['name'];\n\t\t\t\t$class = $student[0]['class'];\n\t\t\t\t$division = $student[0]['division'];\n\t\t\t\t$date = explode('-',$invoice[0]['date']);\n\t\t\t\t$date = $date[2].'-'.$date[1].'-'.$date[0];\n\t\t\t\t$grand_total = $invoice[0]['grand_total'];\n\t\t\t\t$particulars = explode(' ',$invoice[0]['particulars']);\n\t\t\t\t$amount = explode(' ',$invoice[0]['amount']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$id = $this->input->post('invoice_id');\n\t\t\t\t$grnumber = $this->input->post('grnumber');\n\t\t\t\t$name = $this->input->post('name');\n\t\t\t\t$class = $this->input->post('class');\n\t\t\t\t$division = $this->input->post('division');\n\t\t\t\t$date = $this->input->post('date');\n\t\t\t\t$grand_total = $this->input->post('grand_total');\n\t\t\t\t$particulars = explode(' ',$this->input->post('particulars'));\n\t\t\t\t$amount = explode(' ',$this->input->post('amount'));\n\t\t\t}\n\n\t\t\t$dhtml = '';\n\t\t\tfor ($i=0; $i<count($particulars); $i++) {\n\t\t\t\t$dhtml = $dhtml .\n\t\t\t\t\t\t\t\t \"<tr style='width:700px;text-align:center'>\n\t\t\t\t\t\t\t\t <td><br></td>\n\t\t\t\t\t\t\t\t <td style='width:250px;text-align:left;'>\".$particulars[$i].\"</td>\n\t\t\t\t\t\t\t\t <td style='width:250px;text-align:right;font:bold;border-left:1px solid black;'>\".$amount[$i].\"</td>\n\t\t\t\t\t\t\t\t </tr>\";\n\t\t\t}\n\n\t\t\tif(count($particulars)<15){\n\t\t\t\tfor ($i=count($particulars); $i<=15; $i++) {\n\t\t\t\t\t$dhtml = $dhtml .\n\t\t\t\t\t\t\t\t\t \"<tr style='width:700px;text-align:center'>\n\t\t\t\t\t\t\t\t\t <td><br></td>\n\t\t\t\t\t\t\t\t\t <td><br></td>\n\t\t\t\t\t\t\t\t\t <td style='border-left:1px solid black;'><br></td>\n\t\t\t\t\t\t\t\t\t </tr>\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$html = \"\n\t\t\t<html>\n\t\t\t\t<body style='margin-left:25px;'>\n\t\t\t\t\t<table style='width:700px;'>\n\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font:bold;font-size:25px;'>IQRA English Medium School</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font-size:18px;'>Mirjole, Majgaon Road,</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font-size:18px;'>Near Coast Guard Airport,</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font-size:18px;'>Ratnagiri</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font-size:15px;'>Email : [email protected]</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td><br></td></tr>\n\t\t\t\t\t\t<tr><td><br></td></tr>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font:bold;font-size:20px;'>Fees Receipt</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td><br></td></tr>\n\n\t\t\t\t\t</table>\n\n\t\t\t\t\t<table style='width:700px;font-size:17px;'>\n\t\t\t\t\t\t<tr style='width:700px;'>\n\t\t\t\t\t\t\t<td style='width:80px;'>Gr No.</td>\n\t\t\t\t\t\t\t<td style='width:400px;text-align:left;font:bold;'>: \".$grnumber.\"</td>\n\n\t\t\t\t\t\t\t<td style='width:80px;'>Invoice No.</td>\n\t\t\t\t\t\t\t<td style='width:100px;text-align:left;font:bold;'>: \".$id.\"</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;'>\n\t\t\t\t\t\t\t<td style='width:80px;'>Name</td>\n\t\t\t\t\t\t\t<td style='width:400px;text-align:left;font:bold;'>: \".$name.\"</td>\n\n\t\t\t\t\t\t\t<td style='width:80px;'>Date</td>\n\t\t\t\t\t\t\t<td style='width:100px;text-align:left;font:bold;'>: \".$date.\"</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;'>\n\t\t\t\t\t\t\t<td style='width:80px;'>Class</td>\n\t\t\t\t\t\t\t<td style='width:400px;text-align:left;font:bold;'>: \".$class.\"</td>\n\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;'>\n\t\t\t\t\t\t\t<td style='width:80px;'>Division</td>\n\t\t\t\t\t\t\t<td style='width:400px;text-align:left;font:bold;'>: \".$division.\"</td>\n\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t</table>\n\n\t\t\t\t\t<br>\n\n\t\t\t\t\t<table style='width:700px;border-collapse:collapse;font-size:17px;'>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center'>\n\t\t\t\t\t\t\t<td style='width:200px;border-top:1px solid black;border-bottom:1px solid black;'><br></td>\n\t\t\t\t\t\t\t<td style='width:250px;text-align:left;border-top:1px solid black;border-bottom:1px solid black;'>Particulars</td>\n\t\t\t\t\t\t\t<td style='width:250px;text-align:right;border-left:1px solid black;border-top:1px solid black;border-bottom:1px solid black;'>Amount</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><br></td>\n\t\t\t\t\t\t\t<td><br></td>\n\t\t\t\t\t\t\t<td style='border-left:1px solid black;'><br></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\".$dhtml.\"\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center'>\n\t\t\t\t\t\t\t<td style='width:200px;border-top:1px solid black;border-bottom:1px solid black;'><br></td>\n\t\t\t\t\t\t\t<td style='width:250px;text-align:center;border-top:1px solid black;border-bottom:1px solid black;'>Total</td>\n\t\t\t\t\t\t\t<td style='width:250px;text-align:right;font:bold;border-left:1px solid black;border-top:1px solid black;border-bottom:1px solid black;'>\".$grand_total.\"</td>\n\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t</table>\n\n\t\t\t\t\t<br><br><br><br><br><br>\n\t\t\t\t\t<div style='text-align:right;font-size:16px;margin-right:55px;'>Authorised Signatory</div>\n\n\t\t\t\t\t<footer>Developed by theShaibaz</footer>\n\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t\t\";\n\n\t\t\t// instantiate and use the dompdf class\n\t\t\t$dompdf = new Dompdf();\n\t\t\t$dompdf->loadHtml($html);\n\n\t\t\t// (Optional) Setup the paper size and orientation\n\t\t\t$dompdf->setPaper('A4', 'portrait');\n\n\t\t\t// Render the HTML as PDF\n\t\t\t$dompdf->render();\n\n\t\t\t// Output the generated PDF to Browser\n\t\t\t$dompdf->stream(\"invoice.pdf\", array(\"Attachment\" => false));\n\n\t\t}\n\t\telse {\n\t\t\tredirect('login');\n\t\t}\n\t}", "function invoiceDetail($invoiceId)\n {\n $this->company_db->select(\"*\");\n $this->company_db->from('invoice_header_payment');\n $this->company_db->where('invoice_id',$invoiceId);\n $query = $this->company_db->get();\n if($query->num_rows() >= 1){\n return $query->result_array();\n }else{\n return array();\n }\n }", "public function invoice_inserted_data($invoice_id)\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('linvoice');\n\t\t$data = $CI->linvoice->invoice_html_data($invoice_id);\t\t\n\t\t$data['content'] = $this->load->view('dashboard_pharmacist/invoice/invoice_html',$data,true);\n\t\t$this->load->view('dashboard_pharmacist/main_wrapper',$data);\n\t}", "public function browse()\n {\n require_code('templates_donext');\n return do_next_manager(get_screen_title('INVOICES'), comcode_lang_string('DOC_ECOMMERCE'),\n array(\n array('menu/_generic_admin/add_one', array('_SELF', array('type' => 'add'), '_SELF'), do_lang('CREATE_INVOICE')),\n array('menu/adminzone/audit/ecommerce/outstanding_invoices', array('_SELF', array('type' => 'outstanding'), '_SELF'), do_lang('OUTSTANDING_INVOICES')),\n array('menu/adminzone/audit/ecommerce/undelivered_invoices', array('_SELF', array('type' => 'undelivered'), '_SELF'), do_lang('UNDELIVERED_INVOICES')),\n ),\n do_lang('INVOICES')\n );\n }", "public function index()\n {\n $all_new_invoice=Sale::all();\n return view('pos.new_invoices.index',compact('all_new_invoice'));\n }", "public function readAllInvoices() {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n\r\n $sql = \"SELECT * FROM invoice WHERE traderid = '{$this->getTraderID($auth)}'\";\r\n $invoices = Invoice::find_by_sql($sql);\r\n if (!$invoices) {\r\n throw new RestException(400, \"no invoices\");\r\n }\r\n return $invoices;\r\n }", "public function obtenerInvoices($SQLOptions = [])\n {\n $count = false;\n $sort = false;\n $limit = false;\n $joins = false;\n $conditions = false;\n\n if (true === is_array($SQLOptions)) {\n $count = true === isset($SQLOptions['count']) && true === $SQLOptions['count'];\n if (true === isset($SQLOptions['sort'])) {\n $sort = $SQLOptions['sort'];\n }\n if (true === isset($SQLOptions['limit'])) {\n $limit = $SQLOptions['limit'];\n }\n if (true === isset($SQLOptions['unpaid'])) {\n $joins = \" LEFT OUTER JOIN \" . TABLE_TRANSACTION . \" paypal using(custom)\"\n . \" INNER JOIN agd_data.empresa empresa using (uid_empresa)\";\n $conditions = \" AND ((empresa.is_enterprise = 0\"\n . \" AND empresa.activo_corporacion = 0\"\n . \" AND empresa.corporation IS NULL\"\n . \" AND paypal.uid_paypal IS NULL AND sent_date > '\" . invoice::DATE_CREDIT_MEMO . \"'\"\n . \") OR empresa.is_enterprise = 1\"\n . \" OR empresa.activo_corporacion = 1\"\n . \" OR empresa.corporation IS NOT NULL\"\n . \" OR paypal.uid_paypal IS NOT NULL\"\n . \")\";\n }\n }\n\n $field = $count ? \"count(uid_invoice)\" : \"uid_invoice\";\n\n $sql = \"SELECT {$field} FROM \" . TABLE_INVOICE;\n\n if (true === is_string($joins)) {\n $sql .= \" {$joins}\";\n }\n\n $sql .= \" WHERE uid_empresa = {$this->getUID()}\n AND sent_date IS NOT NULL\";\n\n if (true === is_string($conditions)) {\n $sql .= \" {$conditions}\";\n }\n\n if ($sort) {\n $sql .= \" ORDER BY {$sort}\";\n }\n\n if ($limit) {\n $sql .= \" LIMIT {$limit[0]}, {$limit[1]}\";\n }\n\n if ($count) {\n return $this->db->query($sql, 0, 0);\n }\n\n $invoices = $this->db->query($sql, \"*\", 0, \"invoice\");\n if ($invoices) return new ArrayObjectList($invoices);\n\n return new ArrayObjectList();\n }", "public function listar()\n {\n $sql = \"SELECT I.idingreso, DATE(I.fecha_hora) AS fecha, I.idproveedor, I.tipo_comprobante, I.serie_comprobante, I.num_comprobante, I.total_compra, I.estado,\"\n . \" U.idusuario, U.nombre AS usuario, P.nombre as proveedor\"\n . \" FROM ingreso I INNER JOIN persona P ON I.idproveedor=P.idpersona INNER JOIN usuario U ON I.idusuario=U.idusuario\"\n . \" ORDER BY I.idingreso desc;\";\n return ejecutarConsulta($sql);\n }" ]
[ "0.8318088", "0.83149314", "0.8101448", "0.7480902", "0.7218415", "0.71213675", "0.7023881", "0.70137495", "0.69743556", "0.69713706", "0.6951249", "0.69324535", "0.6884702", "0.68712956", "0.6813935", "0.67969304", "0.67772776", "0.67339534", "0.67298234", "0.6721195", "0.67123955", "0.66565347", "0.66334295", "0.6616771", "0.6609493", "0.6583526", "0.65822834", "0.6577079", "0.6568707", "0.65528727", "0.655161", "0.65380776", "0.6531278", "0.6524493", "0.6517596", "0.65152997", "0.65073806", "0.6501227", "0.6492143", "0.64916193", "0.64778316", "0.6461821", "0.64413965", "0.6438964", "0.64351946", "0.6424953", "0.64060456", "0.63959193", "0.639181", "0.63902205", "0.6384438", "0.6384438", "0.6384438", "0.6373224", "0.63701093", "0.6357344", "0.6350274", "0.633492", "0.6332294", "0.6325506", "0.6316585", "0.6311958", "0.62952906", "0.62931037", "0.62925833", "0.62874585", "0.628488", "0.62751544", "0.62609524", "0.6257763", "0.6243839", "0.6243468", "0.6235364", "0.6227288", "0.6225006", "0.62116194", "0.6203559", "0.6202549", "0.6195741", "0.6192422", "0.6182377", "0.61742294", "0.6171416", "0.6157901", "0.6152774", "0.61427814", "0.61388683", "0.61299944", "0.61257005", "0.61219317", "0.6118795", "0.6116366", "0.61158895", "0.6107267", "0.6096376", "0.6085405", "0.60849005", "0.6057759", "0.60558677", "0.6055849" ]
0.720182
5
function viewInvoice This function is used to view the invoice . Database Tables used in this function are : tbl_invoice
function viewInvoice($argID, $varPortalFilter) { $varID = " FromUserType in('super-admin','user-admin') AND ToUserType = 'customer' AND pkInvoiceID ='" . $argID . "' " . $varPortalFilter; $arrClms = array( 'pkInvoiceID', 'fkOrderID', 'CustomerName', 'CustomerEmail', 'Amount', 'InvoiceDetails', 'OrderDateAdded', 'InvoiceDateAdded' ); $varTable = TABLE_INVOICE; $arrData = $this->select($varTable, $arrClms, $varID); // pre($arrData); return $arrData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function invoice()\n\t{\n\t\t$tableName = 'master_invoice';\n\t\t$condition = array('send_status' => SENT);\n\t\t$result['invoice'] = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t$result['count'] = ($result['invoice'] != 0) ? count($result['invoice']) : 0;\n\n\t\t$this->load->view('london/layout/header');\n\t\t$this->load->view('london/layout/sidenavbar', $result);\n\t\t$this->load->view('london/pages/invoice', $result);\n\t\t$this->load->view('london/layout/footer');\n\t}", "public function view_invoice($invoice_number)\n\t{\n\t\t$this->db->join('tbl_invoice_products', 'tbl_invoice_products.invoice_number = tbl_invoice.invoice_number');\n\t\t$this->db->join('tbl_customer', 'tbl_customer.serial = tbl_invoice.customer_id');\n\t\t$this->db->group_by('tbl_invoice.invoice_number');\n\t\t$this->db->where('tbl_invoice.invoice_number',$invoice_number);\n\t\t$data['invoice'] = $this->db->get('tbl_invoice')->row();\n\n\n\t\t$this->db->join('tbl_product', 'tbl_product.product_id = tbl_invoice_products.product_id');\n\t\t$this->db->where('tbl_invoice_products.invoice_number',$invoice_number);\n\t\t$data['invoice_products'] = $this->db->get('tbl_invoice_products')->result_object();\n\n\t\t//echo \"<pre>\";\n\t\t//print_r($data['invoice_products']);\n\n\t\t$data['invoice_number'] = $invoice_number;\n\n\n\n\t\t$this->load->view('sale/print',$data);\n\t}", "function index()\n {\n //$data['invoice'] = $this->Invoice_model->get_all_invoice();\n\t\t$data['invoice']=$this->GenricModel->query('select distinct i.InvoiceId,i.BillNo,i.SupplierName,i.SupplierNumber,i.PurchaseDate,id.TAmount from invoice i join invoicedetail id on id.InvoiceId=i.InvoiceId');\n\t\t$userid = $this->session->userdata('userid');\n $data['users'] = $this->User_model->get_user($userid);\n $data['title']= 'e-Invoice';\n\t\t$data['_view'] = 'invoice/index';\n $this->load->view('layouts/main1',$data);\n }", "function invoice(){ \n\t$order_id=$this->uri->segment(3); \n\t$order = base64_decode(urldecode($order_id));\n\tif(empty($order)){$order=4;}\n\t\t$company_id = $this->session->userdata('id');\n\t\t$role = $this->session->userdata('role');\n\t\tif(!empty($company_id) &&($role=='admin') || ($role == 'super_admin')){\t\n\t\t\tif(!empty($order)){ \n\t\t\t$response = $this->InteractModal->get_order( $order);\n\t\t\t$where = array( 'company_id' =>$company_id);\n\t\t\t$user_data=$this->InteractModal->single_field_value('subscription',$where);\n\t\t\t$user_email= $user_data[0]['customer_email'];\n\t\t\t$pagedata['response'] = $response;\t\t\t\n\t\t\t$pagedata['user_email'] = $user_email;\t\t\t\n\t\t\t}\n\t\t\t\t$this->load->view('dashboard/header');\n\t\t\t\t$this->load->view('dashboard/invoice',$pagedata);\n\t\t\t\t$this->load->view('dashboard/footer');\n\t\t}else{\n\t\t\tredirect(base_url()); \n\t\t}\n\t}", "public function index()\n\t{\t\n\t\t$this->db->join('tbl_invoice_products', 'tbl_invoice_products.invoice_number = tbl_invoice.invoice_number');\n\t\t$this->db->join('tbl_customer', 'tbl_customer.serial = tbl_invoice.customer_id');\n\t\t$this->db->group_by('tbl_invoice.invoice_number');\n\t\t$this->db->order_by('tbl_invoice.invoice_number','desc');\n\t\t$data['invoices'] = $this->db->get('tbl_invoice')->result_object();\n\t\n\t\t$this->load->view('lib/header',$data);\n\t\t$this->load->view('sale/index');\n\t\t$this->load->view('lib/footer');\n\t}", "public function print_invoice() {\n $userid = $this->input->post('userId');\n $data = $this->get_pdf_data($userid);\n $data['user_org'] = $this->payments_model->get_user_org_details($userid);\n $data['invoice'] = $this->payments_model->get_invoice_details($data['clsid'], $data['crsid'], $userid);\n $data['meta_data'] = $this->meta_data;\n return generate_invoice($data);\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function manage_invoice_invoice_id()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('linvoice');\n $invoice_no = $this->input->post('invoice_no');\n $data =$this->linvoice->invoice_list_invoice_no($invoice_no);\n\t\t$data['content'] = $this->load->view('dashboard_pharmacist/invoice/invoice',$data,true);\n\t\t$this->load->view('dashboard_pharmacist/main_wrapper',$data);\n\t}", "function enhanced_invoice($order_id, $end = 0){\n $order = $this->order_model->get($order_id);\n $order_type = $this->order_model->get_order_type($order->order_type);\n $od = $this->order_details_model->get_order_details($order_id, true);\n\n $inv = array();\n $total = 0;\n foreach ($od as $key) {\n $inv[$key->id]['name'] = $key->arabic;\n $inv[$key->id]['eng'] = $key->eng;\n $inv[$key->id]['price'] = $key->price;\n $inv[$key->id]['qty'] = $key->quantity;\n $inv[$key->id]['total_line'] = $key->quantity*$key->price;\n $total += $inv[$key->id]['total_line'];\n }\n //$items_table = to_table($inv);\n\n $this->load->helper('orders');\n $s = get_service($order->order_type);\n\n $service = get_service_value($total, $s);\n $grand_total = $total+$service;\n \n $this->data['grand_total'] = $grand_total;\n $this->data['service_value'] = ($service)? $service : 0;\n $this->data['ratio'] = $s;\n $this->data['total'] = $total;\n $this->data['table'] = $this->order_model->get_table($order->customer_id);\n $this->data['order'] = $order;\n $this->data['order_type'] = $order_type;\n $this->data['items_table'] = $inv ;\n\n $this->check_order($order_type, $this->data);\n\n\n $invID = str_pad($order->id, 5, '0', STR_PAD_LEFT); \n\n$header = $this->load->view('app/orders/invoice/header',$this->data, true);\n$items = $this->load->view('app/orders/invoice/items', $this->data, true);\n$footer = $this->load->view('app/orders/invoice/footer',$this->data, true);\n\n $od = $this->order_details_model->get_count($order_id);\n\n\n $format = $this->get_pdf_format($od);\n\n $this->load->library('pdf', array(\n 'format'=>$format, \n 'title'=>'Club21 Cafe & Restaurant', \n 'string'=>'Invoice Details', \n 'footer'=>false\n ));\n //$this->pdf->lib_setTitle('Invoice Details');\n $this->pdf->lib_Cell(0, 10, \"$od lines [ $format ] $order_type->name\", 1, 1, 'C');\n\n $y_head = $this->pdf->lib_getY();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_head, $header, 1, 0, false, true, '', true);\n $y_items = $y_head + $this->pdf->lib_getLastH();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_items, $items, 0, 0, false, true, '', true);\n $y_foot = $y_items + $this->pdf->lib_getLastH();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_foot, $footer, 0, 0, false, true, '', true);\n\n\n $this->pdf->lib_output(APPPATH .\"invoice/inv_$invID.pdf\");\n $this->pdf_image(APPPATH .\"invoice/inv_$invID.pdf\"); \n $this->load->library('ReceiptPrint'); \n $this->receiptprint->connect('192.168.0.110', 9100);//any ip and port \n $this->receiptprint->print_image(APPPATH .\"invoice/inv_$invID.pdf.$this->ext\"); \n//unlink(APPPATH .\"invoice/inv_$invID.pdf.$this->ext\");\n if($end == 1 )\n $this->end($order_id, $grand_total);\n $this->edit_order($order->id);\n\n }", "public function invoice_list()\n {\n if (!get_permission('invoice', 'is_view')) {\n access_denied();\n }\n\n $branchID = $this->application_model->get_branch_id();\n if ($this->input->post('search')) {\n $this->data['class_id'] = $this->input->post('class_id');\n $this->data['section_id'] = $this->input->post('section_id');\n $this->data['invoicelist'] = $this->fees_model->getInvoiceList($this->data['class_id'], $this->data['section_id'], $branchID);\n }\n $this->data['branch_id'] = $branchID;\n $this->data['title'] = translate('payments_history');\n $this->data['sub_page'] = 'fees/invoice_list';\n $this->data['main_menu'] = 'fees';\n $this->load->view('layout/index', $this->data);\n }", "public function index(){\r\n $invoices=DB::table('invoices')\r\n ->join('users','invoices.user_id','=','users.id')\r\n ->select('invoices.created_at as created_at','invoices.numfac as numfac','users.name as name','invoices.mode as mode','invoices.total_amount as total_amount','invoices.id as id')\r\n ->get();\r\n //dd($invoices);\r\n return view('intranet.invoice.list', compact('invoices'));\r\n }", "public function invoice($id = '')\n {\n if (!get_permission('invoice', 'is_view')) {\n access_denied();\n }\n\n $this->data['student_id'] = $id;\n $this->data['invoice'] = $this->fees_model->getInvoiceStatus($id);\n $this->data['basic'] = $this->fees_model->getInvoiceBasic($id);\n $this->data['title'] = translate('invoice_history');\n $this->data['main_menu'] = 'fees';\n $this->data['sub_page'] = 'fees/collect';\n $this->load->view('layout/index', $this->data);\n }", "function invoices_view_all(){\n\t\t$user_transactions=array();\n\t\t$user_transactions=$this->UserModel->get_user_transactions(array('user_id'=>$this->session->userdata('member_id'),'gateway !='=>'ADMIN','t.is_deleted'=>0),0,0,'like');\n\t\tif($_SERVER['HTTP_REFERER']!=base_url().\"account/invoices_view_all\"){\n\t\t\t$this->session->set_userdata('HTTP_REFERER', $_SERVER['HTTP_REFERER']);\n\t\t\t$previous_page_url=$_SERVER['HTTP_REFERER'];\n\t\t}else{\n\t\t\t$previous_page_url=$this->session->userdata('HTTP_REFERER');\n\t\t}\n\t\t//Loads header, Invoices list and footer view.\n\t\t$this->load->view('header',array('title'=>'My Invoices','previous_page_url'=>$previous_page_url));\n\t\t$this->load->view('user/invoices_list',array('user_transactions'=>$user_transactions));\n\t\t$this->load->view('footer-inner-red');\n\t}", "public function get_invoice_list()\n {\n return $this->db->select('sr_no, invoice_no, round_off_total, invoice_date, bakery_name,bakery_address, bakery_area, bakery_city')->order_by('sr_no','desc')\n ->from('insider_bill')->join('customers', 'customers.id = insider_bill.customer_id')->get();\n }", "public function actionPreviewInvoice() {\n // Get assets path\n $assetsPath = $this->getAssetsPath();\n // Attach script files\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/billing_dashboard.js');\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/event_handlers.js');\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/checkbox_column_helper.js');\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/invoice.js');\n // Set javascript data\n $this->setJavascriptData();\n \n // Page size modifier\n if(isset($_GET['pageSize'])) {\n Yii::app()->user->setState('pageSize', (int)$_GET['pageSize']);\n unset($_GET['pageSize']);\n }\n \n // Get data provider\n $data = $this->getData();\n if($data === false || empty($data)) {\n // Redirect back to dashboard page with flag of no selection\n $this->redirect($this->createUrl('billingDashboard/index', array('no-selection' => 1,)));\n }\n \n // Make data provider\n $dataProvider = new CArrayDataProvider($data, array(\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']),\n ),\n ));\n \n // Render preview page\n $this->render('invoice_grid', array(\n // Send general data\n 'pageTitle' => 'Invoice Preview',\n 'clientName' => $data[0]->project->getClientName(),\n // Data providers\n 'dataProvider' => $dataProvider,\n ));\n }", "function listProductView() {\n\n\n\n\t$query = \"SELECT * FROM invoice_item\";\n\t$result = mysql_query($query);\n\t$rows = array();\n\twhile($row = mysql_fetch_assoc($result)) {\n\t\t$rows[] = array(\n\t\t\t'invoice_id' => htmlspecialchars($row['invoice_id']), \n\t\t\t'invoice_item_id' => htmlspecialchars($row['invoice_item_id']),\n\t\t\t'service_type' => htmlspecialchars($row['service_type']),\n\t\t\t'service_range' => htmlspecialchars($row['service_range']),\n\t\t\t'price' => htmlspecialchars($row['price']),\n\t\t\t'value' => htmlspecialchars($row['value']),\n\t\t\t'vat' => htmlspecialchars($row['vat']),\n // 'product_pdv_percent' => htmlspecialchars($row['product_pdv_percent']),\n\t\t\t'vat_value' => htmlspecialchars($row['vat_value']),\n\t\t\t'rebate' => htmlspecialchars($row['rebate']),\n\t\t\t'total_value' => htmlspecialchars($row['total_value']),\n\n\n\t\t\t);\n\t}\n\n\n\t\t//akcije i forma\n\t$customer_id = $_GET['customer_id'];\n\t$invoice_id = $_GET['invoice_id'];\n\t$action = \"invoice_item.php?view=list&action=add&customer_id=$customer_id&invoice_id=$invoice_id\";\n\tinclude(\"invoice_item_form.php\");\n\n}", "public function print_invoice($id='')\n\t{\n\t\tif(isset($this->session->isactive)){\n\n\t\t\tif($id){\n\t\t\t\t$this->load->model('invoice_model');\n\t\t\t\t$invoice = $this->invoice_model->get_invoice($id);\n\t\t\t\t$this->load->model('student_model');\n\t\t\t\t$student = $this->student_model->get_every_student_full($invoice[0]['gr_number']);\n\n\t\t\t\t$id = $id;\n\t\t\t\t$grnumber = $invoice[0]['gr_number'];\n\t\t\t\t$name = $student[0]['name'];\n\t\t\t\t$class = $student[0]['class'];\n\t\t\t\t$division = $student[0]['division'];\n\t\t\t\t$date = explode('-',$invoice[0]['date']);\n\t\t\t\t$date = $date[2].'-'.$date[1].'-'.$date[0];\n\t\t\t\t$grand_total = $invoice[0]['grand_total'];\n\t\t\t\t$particulars = explode(' ',$invoice[0]['particulars']);\n\t\t\t\t$amount = explode(' ',$invoice[0]['amount']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$id = $this->input->post('invoice_id');\n\t\t\t\t$grnumber = $this->input->post('grnumber');\n\t\t\t\t$name = $this->input->post('name');\n\t\t\t\t$class = $this->input->post('class');\n\t\t\t\t$division = $this->input->post('division');\n\t\t\t\t$date = $this->input->post('date');\n\t\t\t\t$grand_total = $this->input->post('grand_total');\n\t\t\t\t$particulars = explode(' ',$this->input->post('particulars'));\n\t\t\t\t$amount = explode(' ',$this->input->post('amount'));\n\t\t\t}\n\n\t\t\t$dhtml = '';\n\t\t\tfor ($i=0; $i<count($particulars); $i++) {\n\t\t\t\t$dhtml = $dhtml .\n\t\t\t\t\t\t\t\t \"<tr style='width:700px;text-align:center'>\n\t\t\t\t\t\t\t\t <td><br></td>\n\t\t\t\t\t\t\t\t <td style='width:250px;text-align:left;'>\".$particulars[$i].\"</td>\n\t\t\t\t\t\t\t\t <td style='width:250px;text-align:right;font:bold;border-left:1px solid black;'>\".$amount[$i].\"</td>\n\t\t\t\t\t\t\t\t </tr>\";\n\t\t\t}\n\n\t\t\tif(count($particulars)<15){\n\t\t\t\tfor ($i=count($particulars); $i<=15; $i++) {\n\t\t\t\t\t$dhtml = $dhtml .\n\t\t\t\t\t\t\t\t\t \"<tr style='width:700px;text-align:center'>\n\t\t\t\t\t\t\t\t\t <td><br></td>\n\t\t\t\t\t\t\t\t\t <td><br></td>\n\t\t\t\t\t\t\t\t\t <td style='border-left:1px solid black;'><br></td>\n\t\t\t\t\t\t\t\t\t </tr>\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$html = \"\n\t\t\t<html>\n\t\t\t\t<body style='margin-left:25px;'>\n\t\t\t\t\t<table style='width:700px;'>\n\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font:bold;font-size:25px;'>IQRA English Medium School</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font-size:18px;'>Mirjole, Majgaon Road,</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font-size:18px;'>Near Coast Guard Airport,</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font-size:18px;'>Ratnagiri</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font-size:15px;'>Email : [email protected]</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td><br></td></tr>\n\t\t\t\t\t\t<tr><td><br></td></tr>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center;'>\n\t\t\t\t\t\t\t<td style='font:bold;font-size:20px;'>Fees Receipt</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td><br></td></tr>\n\n\t\t\t\t\t</table>\n\n\t\t\t\t\t<table style='width:700px;font-size:17px;'>\n\t\t\t\t\t\t<tr style='width:700px;'>\n\t\t\t\t\t\t\t<td style='width:80px;'>Gr No.</td>\n\t\t\t\t\t\t\t<td style='width:400px;text-align:left;font:bold;'>: \".$grnumber.\"</td>\n\n\t\t\t\t\t\t\t<td style='width:80px;'>Invoice No.</td>\n\t\t\t\t\t\t\t<td style='width:100px;text-align:left;font:bold;'>: \".$id.\"</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;'>\n\t\t\t\t\t\t\t<td style='width:80px;'>Name</td>\n\t\t\t\t\t\t\t<td style='width:400px;text-align:left;font:bold;'>: \".$name.\"</td>\n\n\t\t\t\t\t\t\t<td style='width:80px;'>Date</td>\n\t\t\t\t\t\t\t<td style='width:100px;text-align:left;font:bold;'>: \".$date.\"</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;'>\n\t\t\t\t\t\t\t<td style='width:80px;'>Class</td>\n\t\t\t\t\t\t\t<td style='width:400px;text-align:left;font:bold;'>: \".$class.\"</td>\n\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='width:700px;'>\n\t\t\t\t\t\t\t<td style='width:80px;'>Division</td>\n\t\t\t\t\t\t\t<td style='width:400px;text-align:left;font:bold;'>: \".$division.\"</td>\n\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t</table>\n\n\t\t\t\t\t<br>\n\n\t\t\t\t\t<table style='width:700px;border-collapse:collapse;font-size:17px;'>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center'>\n\t\t\t\t\t\t\t<td style='width:200px;border-top:1px solid black;border-bottom:1px solid black;'><br></td>\n\t\t\t\t\t\t\t<td style='width:250px;text-align:left;border-top:1px solid black;border-bottom:1px solid black;'>Particulars</td>\n\t\t\t\t\t\t\t<td style='width:250px;text-align:right;border-left:1px solid black;border-top:1px solid black;border-bottom:1px solid black;'>Amount</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><br></td>\n\t\t\t\t\t\t\t<td><br></td>\n\t\t\t\t\t\t\t<td style='border-left:1px solid black;'><br></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\".$dhtml.\"\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t<tr style='width:700px;text-align:center'>\n\t\t\t\t\t\t\t<td style='width:200px;border-top:1px solid black;border-bottom:1px solid black;'><br></td>\n\t\t\t\t\t\t\t<td style='width:250px;text-align:center;border-top:1px solid black;border-bottom:1px solid black;'>Total</td>\n\t\t\t\t\t\t\t<td style='width:250px;text-align:right;font:bold;border-left:1px solid black;border-top:1px solid black;border-bottom:1px solid black;'>\".$grand_total.\"</td>\n\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t</table>\n\n\t\t\t\t\t<br><br><br><br><br><br>\n\t\t\t\t\t<div style='text-align:right;font-size:16px;margin-right:55px;'>Authorised Signatory</div>\n\n\t\t\t\t\t<footer>Developed by theShaibaz</footer>\n\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t\t\";\n\n\t\t\t// instantiate and use the dompdf class\n\t\t\t$dompdf = new Dompdf();\n\t\t\t$dompdf->loadHtml($html);\n\n\t\t\t// (Optional) Setup the paper size and orientation\n\t\t\t$dompdf->setPaper('A4', 'portrait');\n\n\t\t\t// Render the HTML as PDF\n\t\t\t$dompdf->render();\n\n\t\t\t// Output the generated PDF to Browser\n\t\t\t$dompdf->stream(\"invoice.pdf\", array(\"Attachment\" => false));\n\n\t\t}\n\t\telse {\n\t\t\tredirect('login');\n\t\t}\n\t}", "function m_displayInvoiceList()\n\t{\n\t\t#QUERY ORDER TABLE\n\t\t$this->obDb->query = \"SELECT iOrderid_PK,iInvoice,tmOrderDate,iOrderStatus FROM \".ORDERS.\" WHERE\t iCustomerid_FK= '\".$_SESSION['userid'].\"' ORDER BY tmOrderDate DESC\";\n\t\t$rsOrders = $this->obDb->fetchQuery();\n\t\tif($this->obDb->record_count>0)\n\t\t{\n\t\t\tfor($i=0;$i<$this->obDb->record_count;$i++)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATUS\",\"Incomplete\");\n\t\t\t\tif($rsOrders[$i]->iOrderStatus==1){\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATUS\",\"Complete\");\n\t\t\t\t}\n\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ORDERDATE\", $this->libFunc->dateFormat2($rsOrders[$i]->tmOrderDate));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_INVOICE\", $this->libFunc->m_displayContent($rsOrders[$i]->iInvoice));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_DETAILS_LINK\", $this->libFunc->m_safeUrl(SITE_SAFEURL.\"ecom/index.php?action=checkout.receipt&mode=\".$rsOrders[$i]->iOrderid_PK));\n\n\t\t\t\t$this->ObTpl->parse(\"orderlist_blk\",\"TPL_ORDERLIST_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->parse(\"orderlistmain_blk\",\"TPL_ORDERLISTMAIN_BLK\");\n\t\t}\n\t}", "public function show(Invoices $invoice)\n {\n return $invoice;\n }", "public function invoice($id = null)\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n //get the user's invoice\n $invoice = InvoiceModel::invoice($id);\n\n $this->View->Render('dashboard/invoice', ['invoice' => $invoice, 'user' => $user]);\n }", "public function display_billing_invoice()\n\t{\n\t\t$table_contact_select = '\n\t\t\t<tr>\n\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t<td>'.$this->ml_client_contact_select($this->account->client_id).'</td>\n\t\t\t</tr>\n\t\t';\n\n\t\t?>\n\t\t<h2>Invoice PDF</h2>\n\n\t\t<div id=\"invoice_data\">\n\t\t\t<?php $this->print_payment_form('none', $table_contact_select);?>\n\t\t</div>\n\n\t\t<div id=\"invoice_edit\">\n\t\t\t<div>\n\t\t\t\t<label>Client:</label><input type=\"text\" name=\"pdf_client\" value=\"<?= $this->account->name ?>\"><br/>\n\t\t\t\t<label>Contact Name:</label><input type=\"text\" name=\"pdf_contact\"><br/>\n\t\t\t\t<label>Inv Date:</label><input type=\"text\" name=\"pdf_date\" class=\"date_input\" value=\"<?php echo date(util::DATE);?>\"><br/>\n\t\t\t\t<label>Inv Number:</label><input type=\"text\" name=\"pdf_invoice_num\"><br/>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div>\n\t\t\t\t<label>Address 1:</label><input type=\"text\" name=\"pdf_address_1\"><br/>\n\t\t\t\t<label>Address 2:</label><input type=\"text\" name=\"pdf_address_2\"><br/>\n\t\t\t\t<label>Address 3:</label><input type=\"text\" name=\"pdf_address_3\"><br/>\n\t\t\t</div>\n\t\t\t\n\t\t\t<?= $this->print_pdf_wpro_phone() ?>\n\n\t\t\t<div id=\"pdf_charges\" ejo>\n\t\t\t\t<label>Charges</label>\n\t\t\t\t<table>\n\t\t\t\t\t<tr><th>Amount</th><th>Description</th></tr>\n\t\t\t\t</table>\n\t\t\t\t<input type=\"button\" id=\"pdf_add_charge\" value=\"Add Charge\">\n\t\t\t</div>\n\n\t\t\t<div>\n\t\t\t\t<label>Notes</label><br/>\n\t\t\t\t<input type=\"text\" name=\"pdf_notes\">\n\t\t\t</div>\n\n\t\t\t<input type=\"hidden\" name=\"pdf_type\" value=\"invoice\">\n\t\t\t<input type=\"submit\" a0=\"action_gen_pdf\" value=\"Generate Invoice\">\n\t\t</div>\n\t\t\n\t\t<div class=\"clear\"></div>\n\t\t<?php\n\t}", "public function invoice($param1 = \"\", $param2 = \"\") {\n // For creating new invoice\n if ($param1 == 'single') {\n $response = $this->crud_model->create_single_invoice();\n echo $response;\n }\n\n // For creating new mass invoice\n if ($param1 == 'mass') {\n $response = $this->crud_model->create_mass_invoice();\n echo $response;\n }\n\n // For editing invoice\n if ($param1 == 'update') {\n $response = $this->crud_model->update_invoice($param2);\n echo $response;\n }\n\n // For deleting invoice\n if ($param1 == 'delete') {\n $response = $this->crud_model->delete_invoice($param2);\n echo $response;\n }\n\n // Get the list of student. Here param2 defines classId\n if ($param1 == 'student') {\n $page_data['enrolments'] = $this->user_model->get_student_details_by_id('class', $param2);\n $this->load->view('backend/admin/student/dropdown', $page_data);\n }\n\n // showing the list of invoices\n if ($param1 == 'invoice') {\n $page_data['invoice_id'] = $param2;\n $page_data['folder_name'] = 'invoice';\n $page_data['page_name'] = 'invoice';\n $page_data['page_title'] = 'invoice';\n $this->load->view('backend/index', $page_data);\n }\n\n // showing the list of invoices\n if ($param1 == 'list') {\n $date = explode('-', $this->input->get('date'));\n $page_data['date_from'] = strtotime($date[0].' 00:00:00');\n $page_data['date_to'] = strtotime($date[1].' 23:59:59');\n $page_data['selected_class'] = htmlspecialchars($this->input->get('selectedClass'));\n $page_data['selected_status'] = htmlspecialchars($this->input->get('selectedStatus'));\n $this->load->view('backend/admin/invoice/list', $page_data);\n }\n // showing the index file\n if(empty($param1)){\n $page_data['folder_name'] = 'invoice';\n $page_data['page_title'] = 'invoice';\n $first_day_of_month = \"1 \".date(\"M\").\" \".date(\"Y\").' 00:00:00';\n $last_day_of_month = date(\"t\").\" \".date(\"M\").\" \".date(\"Y\").' 23:59:59';\n $page_data['date_from'] = strtotime($first_day_of_month);\n $page_data['date_to'] = strtotime($last_day_of_month);\n $page_data['selected_class'] = 'all';\n $page_data['selected_status'] = 'all';\n $this->load->view('backend/index', $page_data);\n }\n }", "public function invoice($order_id)\n\t{\n\t\t$check = DB::select(\"SELECT COUNT(*) as count FROM orders WHERE id = '\".$order_id.\"' AND customer = '\".customer('id').\"' LIMIT 1\")[0];\n\t\tif ($check->count == 0){\n\t\t\tabort(404);\n\t\t}\n\t\t$order = DB::select(\"SELECT * FROM orders WHERE id = '\".$order_id.\"'\")[0];\n\t\t$header = $this->header(translate('Invoice'),false,true);\n\t\t$fields = DB::select(\"SELECT name,code FROM fields ORDER BY id ASC\");\n\t\t$footer = $this->footer();\n\t\treturn view('invoice')->with(compact('header','order','fields','footer'));\n\t}", "public function printInvoice(){\r\n \t$data['table'] = $table = $this -> uri -> segment(4);\r\n\t\t$data['table2'] = $this -> uri -> segment(5);\r\n\t\t$data['table3'] = $this -> uri -> segment(6);\r\n\t\t\r\n\t\t//Status Method Parameters\r\n\t\t$main_table = 'request';\r\n\t\t$ref = 'request_id';\r\n\t\t$status = 'invoice_print_status';\r\n\r\n /*DOMpdf initialization\r\n require_once(\"application/helpers/dompdf/dompdf_config.inc.php\");\r\n $this->load->helper('dompdf', 'file');\r\n $this->load->helper('file');\r\n\r\n //DOMpdf configuration\r\n $dompdf = new DOMPDF();\r\n $dompdf->set_paper('A4');\r\n */\r\n\r\n //\r\n \t$data['reqid'] = $reqid = $this -> uri -> segment(3);\t\r\n \t$saveTo = './invoices';\r\n \t$invoicename = \"Invoice_\" . $data['reqid'] . \".pdf\";\r\n\t\t\t\r\n\t\t$data['test_data'] = Invoice_billing::getChargesPerClient($data['reqid']);\r\n\t\t$data['invoice_data'] = $invoice_data = Request::getInvoiceDetails($data['reqid']);\r\n\r\n\t\t//Get client info from main array\r\n\t\t$client_info = $invoice_data[0]['Clients'];\r\n\r\n\t\t//Get Invoice Number\r\n\t\t$coa_nos = Coa_number::getCoaNo($data['reqid']);\r\n\t\t$year = date('Y');\r\n\t\t$data['invoice_number'] = \"/\".$coa_nos[0]['number'];\r\n\t\t\r\n\t\t//Get client id\r\n\t\t$data['client_id'] = $this -> uri -> segment(7);\r\n\r\n\t\t//Get Total\r\n\t\t$data['total'] = Invoice_billing::getTotal($data['reqid']);\r\n\t\t$total_cost = $data['total'][0]['sum'];\t\r\n\r\n\t\t//Get Discount Data\r\n\t\t$client_discount_percentage = Clients::getDiscountPercentage($data['client_id']);\r\n\t\t$discount_percentage = $client_discount_percentage[0]['discount_percentage'];\r\n\t\t$discount_title = 'DISCOUNT '. $discount_percentage.'%';\r\n\t\r\n\t\t//Compute Discounts\r\n\t\t$discount = $discount_percentage/100 * $total_cost;\r\n\t\t$amount_payable = $total_cost - $discount;\r\n\r\n\t\t//Push amounts into array that generates totals footer depending on client eligible for discount/not\r\n\t\tif($discount_percentage != 0){\r\n\t\t\t$data['tr_array'] = array('TOTAL COST'=>$total_cost, $discount_title => $discount , 'AMOUNT PAYABLE' => $amount_payable);\r\n\t\t\t$data['discount_cols'] = 6;\r\n\t\t\t$data['discount_csp']= 2;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$data['tr_array'] = array('TOTAL COST'=>$total_cost, 'AMOUNT PAYABLE' => $amount_payable);\r\n\t\t\t$data['discount_cols'] = 5;\r\n\t\t\t$data['discount_csp'] = 1;\r\n\t\t}\r\n\r\n\t\t//Get method \r\n\t\t$data['method'] = $this -> router -> fetch_method();\r\n\r\n\t\t//Get Signatory Details\r\n\r\n\t\t$signatory = $this -> uri -> segment(8);\r\n\t\t$signatory_title = $this -> uri -> segment(9);\r\n\r\n\t\t//Replace special characters in signatory details\r\n\t\t$data['signatory'] = str_replace(\"%20\", \" \", $signatory_title);\r\n\t\t$data['signatory_title'] = str_replace(\"%20\", \" \", $signatory);\r\n\r\n\t\t/*Push to view\r\n $html = \r\n\t\t$this->load->view('invoice_pdf_v', $data, TRUE);\r\n \r\n\t\t$html = $this -> load -> view('invoice_pdf_v', $data, TRUE);\t\r\n\t\t$dompdf->load_html($html);\r\n $dompdf->render();\r\n write_file($saveTo . \"/\" . $invoicename, $dompdf->output());\r\n */\r\n\t\t\r\n //Excel Initialization\r\n $ei = new PHPExcel();\r\n\r\n //Get excel sheet metadata\r\n $creator = $this -> session -> userdata('full_name');\r\n $general_title = 'Invoice';\r\n $title = 'Invoice'.\" \".$data['reqid'];\r\n $description = 'Invoice for'.\" \".$data['reqid'];\r\n $subject = 'Final Invoice';\r\n $keywords = 'invoice, quotation, finance, pro forma';\r\n $category = 'Finance';\r\n\r\n //Set File Name\r\n $file_name = 'Invoice_'.$data['reqid'].'.xlsx';\r\n\r\n //Set excel sheet metadata\r\n $ei -> getProperties()\r\n \t-> setCreator($creator)\r\n \t-> setTitle($title)\r\n \t-> setLastModifiedBy($creator)\r\n \t-> setSubject($subject)\r\n \t-> setKeywords($keywords)\r\n \t-> setCategory($category)\r\n \t;\r\n\r\n //Set reference to worksheet\r\n $inv = $ei->getSheet(0);\r\n $inv -> setTitle($title);\r\n\r\n\t\t//Set descriptive items data\r\n\t\t$inv -> setCellValue('c1', $general_title); \r\n\r\n\t\t//var_dump(base_url().\"invoices/\".$title.\"/\".$file_name);\r\n\r\n\t\t//Fill Client Address Info\r\n\t\t$inv->fromArray($client_info, '', 'A4');\r\n\r\n\t\t//Define the invoices folder\r\n\t\t$inv_dir = \"invoices\";\r\n\r\n\t\t//Condition to find out if the folder exists/not\r\n\t\tif(!file_exists($inv_dir)){\r\n\t\t\tmkdir($inv_dir, 0744);\r\n\t\t}\r\n\r\n\t\t//Save excel sheet\r\n\t\t$writer = \\PHPExcel_IOFactory::createWriter($ei,'Excel2007');\r\n\t\t$writer->setOffice2003Compatibility(true); \r\n\t\t$writer->save($inv_dir.\"/\".$file_name);\r\n\r\n //Set invoice print status\r\n //$this -> setInvoicePrintStatus($reqid, $saveTo, $invoicename, $main_table, $ref, $status);\r\n\t}", "public function print_invoice_details_table() {\n\n // Language variables to be used in heredoc syntax\n $tableHeaderCategory = lang( 'report_th_category' );\n $tableHeaderDescription = lang( 'report_th_description' );\n $tableHeaderAmount = lang( 'report_th_amount' );\n\n // Get the invoice row details\n $invoiceRows = $this->mockinvoice_row_model->get_by( 'mockInvoiceId = ' . @$_POST['mockInvoiceId'] );\n\n $tableRows = '';\n\n foreach ( $invoiceRows as $row ) {\n\n // Add currency symbol Eg. '$' to the amount if we have one\n ( $row->amount != null ? $amount = lang( 'system_currency_symbol' ) . $row->amount : $amount = '' );\n // Replace new lines with HTML <br> tags\n $description = nl2br( $row->description );\n\n // Check if a row has some content and add it to the table if it does\n if ( ( $row->category != null ) or ( $row->description != null ) or ( $row->amount != null ) ) {\n $tableRows .= <<< HTML\n <tr id=\"invoice-details-row-{$row->mockInvoiceRowId}\">\n <td>{$row->category}</td>\n <td>{$description}</td>\n <td>{$amount}</td>\n </tr>\n\nHTML;\n }\n }\n\n // Output the HTML\n if ( $tableRows == '' ) {\n\n // Show that we have no details yet to display\n echo '<div class=\"alert alert-warning\">' . lang( 'report_minv_empty' ) . '</div>';\n } else {\n\n // Display the table with invoice details\n echo <<< HTML\n <table class=\"table table-striped table-bordered table-hover table-report\">\n <thead>\n <tr class=\"report-heading-row\">\n <th>{$tableHeaderCategory}</th>\n <th>{$tableHeaderDescription}</th>\n <th>{$tableHeaderAmount}</th>\n </tr>\n </thead>\n <tbody>\n\n{$tableRows}\n\n </tbody>\n </table>\n\nHTML;\n }\n }", "public function getInvoiceModel(){}", "public function invoiceprefix() { \n $data['page'] = 'Invoice Prefix';\n $data['page_title'] = 'Invoice Prefix';\n $data['page_module'] = 'setting';\n $data['invoice'] = $this->Fpo_Model->fpoByUserID($this->session->userdata('user_id'));\n $this->load->view('setting/invoice_prefix', $data); \t \n\t}", "public function show(ImportInvoice $importInvoice)\n {\n //\n }", "function order_invoice_view($param1 = '' , $param2 = '')\n\t{\n\t\tif ($this->session->userdata('admin_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login');\n\t\t$page_data['page_name'] = 'order_invoice_view';\n\t\t$page_data['order_id'] =\t$param1;\n\t\t$page_data['page_title'] = translate('order_invoice');\n\t\t$this->load->view('backend/index', $page_data);\n\t}", "public function invoice($invoice)\n {\n return view('barcode.invoice', [\n 'tabungan' => Tabungan::whereInvoice($invoice)->firstOrFail()\n ]);\n }", "public function getInvoicesDataTable($codigoInvoices='')\n {//var_dump($_POST);exit;\n echo ($this->invm->ShowInvoicesTable($codigoInvoices));\n }", "public function show(invoices_details $invoices_details)\n {\n //\n }", "function sale_invoice_view($param1 = '', $param2 = '')\n\t{\n\t\tif ($this->session->userdata('admin_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login');\n\t\t$page_data['invoice_id'] = $param1;\n\t\t$page_data['page_name'] = 'sale_invoice_view';\n\t\t$page_data['page_title'] = translate('sale_invoice');\n\t\t$this->load->view('backend/index', $page_data);\n\t}", "function purchase_invoice_view($param1 = '' , $param2 = '')\n\t{\n\t\tif ($this->session->userdata('admin_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login');\n\t\t$page_data['purchase_id'] = $param1;\n\t\t$page_data['page_name'] = 'purchase_invoice_view';\n\t\t$page_data['page_title'] = translate('purchase_invoice');\n\t\t$this->load->view('backend/index', $page_data);\n\t}", "public function index()\n { \n return view('admin.invoice.list');\n }", "public function invoice_inserted_data($invoice_id)\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('linvoice');\n\t\t$data = $CI->linvoice->invoice_html_data($invoice_id);\t\t\n\t\t$data['content'] = $this->load->view('dashboard_pharmacist/invoice/invoice_html',$data,true);\n\t\t$this->load->view('dashboard_pharmacist/main_wrapper',$data);\n\t}", "public function invoice($id='',$page = 'user/riwayatsewa/invoice_sewa')\n\t{\n\t\t$data['admin'] = $this->db->get_where('admin',['email'=>$this->session->userdata('email')])->row_array();\n\t\t$data['penyewa'] = $this->db->get_where('penyewa',['email'=>$this->session->userdata('email')])->row_array();\n\n\t\t$admin = $this->db->get_where('admin',['email'=>$this->session->userdata('email')])->row_array();\n\t\t$penyewa = $this->db->get_where('penyewa',['email'=>$this->session->userdata('email')])->row_array();\n\n\t\t$data['kontenDinamis']\t=\t$page;\n\t\t$transaksi\t=\t$this->M_transaksi;\n\t\t$sewa\t=\t$this->M_sewa;\n\t\t$verifikasi\t=\t$this->M_verifikasi;\n\n\t\t$data['content'] = $verifikasi->getJoinById($id);\n\t\t$data['invoice'] = $verifikasi->getJoinById($id)->row_array();\n\n\n\t\t$data['total'] = $sewa->getTotal2($id);\n\t\t$data['totalDP'] = $sewa->getTotalDP($id);\n\n\n\t\t\t\n\t\t\t$this->load->view($this->template,$data);\n\n\t}", "public function getInvoice($invoiceId);", "public function index()\n {\n return view('reports.invoice');\n }", "public function invoices() {\t\t\r\n\t\t\r\n $user = $this->session->userdata('user');\r\n if ($user['UserType'] == 'TYPE_CLI' && empty($user['AccountantAccess'])) {\r\n //setRedirect(site_url());\r\n } else {\r\n if (isset($_GET['clientID'])) {\r\n checkUserAccess(array('TYPE_ACC', 'TYPE_CLI'));\r\n } else {\r\n checkUserAccess(array('TYPE_CLI'));\r\n }\r\n }\r\n\t\t\r\n\t\t$page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;\r\n $user = $this->session->userdata('user');\t\r\n\t\t$VATYear = $this->session->userdata('VATYear');\r\n\t\t$quaters = vatQuaters($user['Params']['VATQuaters']);\r\n\t\t\t\t\r\n /* \tGet the customer list of the company. */\r\n $data['users'] = $this->clients->getUserList();\r\n\r\n $items = $this->clients->getInvoiceList(INVOICE_PAGINATION_LIMIT, $page);\r\n $data['Invoices'] = $items;\r\n //pr($data['Invoices']);\r\n $PaidVatQuarters = $this->clients->getPaidVatQuarters();\r\n\t\t$VATitems = $this->clients->getAllInvoices();\r\n $vat_listing = $this->clients->getVatType();\r\n\t\t\r\n $data['EXPitems'] = false;\r\n if($vat_listing->Type != 'flat') {\r\n $this->load->model('clients/expense');\r\n $EXPitems = $this->expense->getAllExpenses();\r\n $data['EXPitems'] = $EXPitems;\r\n }\r\n //echo '<pre>';print_r($PaidVatQuarters);echo '</pre>';die();\r\n\t\t//echo '<pre>';print_r($VATitems);echo '</pre>';//die();\r\n $data['VATitems'] = $VATitems;\r\n $data['PaidVatQuarters'] = $PaidVatQuarters;\r\n\r\n $total = $this->clients->totalInvoices();\t\t\r\n $data['pagination'] = $this->getPagination('invoices', INVOICE_PAGINATION_LIMIT, $total);\r\n if ($data['users'] == FALSE) {\r\n $data['users'] = array('0' => 'No users');\r\n }\r\n\r\n $data['vat_listing'] = $vat_listing;\r\n $data['page'] = 'invoices';\r\n $data['title'] = 'Cashman | Invoices';\r\n $this->load->view('client/invoices/default', $data);\r\n }", "public function show($id)\n\t{\n\t\tif(isset($this->session->isactive)){\n\t\t\t$this->load->model('invoice_model');\n\t\t\t$invoice = $this->invoice_model->get_invoice($id);\n\n\t\t\t$this->load->model('student_model');\n\t\t\t$name = $this->student_model->get_every_student($invoice[0]['gr_number']);\n\n\t\t\t// Formatting date as per datepicker jquery plugin\n\t\t\t$date = explode('-',$invoice[0]['date']);\n\t\t\t$invoice[0]['dd'] = $date[2];\n\t\t\t$invoice[0]['mm'] = $date[1];\n\t\t\t$invoice[0]['yy'] = $date[0];\n\n\t\t\t// Layout view is common view containing sidebar and navbar\n\t\t\t// in which respective view is loaded as main content view\n\t\t\t$data['invoice'] = $invoice;\n\t\t\t$data['name'] = $name[0]['name'];\n $data['view'] = 'invoice_show_view';\n\t\t\t$data['title'] = 'IQRA | Invoice';\n\t\t\t$data['breadcrumb_1'] = 'Invoice';\n\t\t\t$data['breadcrumb_2'] = 'Invoice';\n\t\t\t$data['breadcrumb_3'] = 'Show';\n $this->load->view('layout_view',$data);\n\t\t}\n\t\telse {\n\t\t\tredirect('login');\n\t\t}\n\n\t}", "public function view_invoice(){\n $search = $_POST['search']['value'];\n // $limit = $_POST['length'];\n // $start = $_POST['start'];\n $status = $this->input->post('status_bayar');\n $order_index = $_POST['order'][0]['column'];\n $order_field = $_POST['columns'][$order_index]['data'];\n $order_ascdesc = $_POST['order'][0]['dir'];\n $sql_total = $this->model_home->count_all_invoice($status);\n $sql_data = $this->model_home->filter_invoice($search,$order_field, $order_ascdesc,$status);\n $sql_filter = $this->model_home->count_filter_invoice($search,$status);\n $callback = array(\n 'draw' => $_POST['draw'],\n 'recordsTotal' => $sql_total,\n 'recordsFiltered' => $sql_filter,\n 'data' => $sql_data\n );\n\n header('Content-Type: application/json');\n echo json_encode($callback);\n }", "public function index($id = false)\r\n {\r\n $this->list_invoices($id);\r\n }", "function detail($InvoiceId)\n { \n // check if the invoice exists before trying to edit it\n $data['invoice'] = $this->Invoice_model->get_invoice($InvoiceId);\n $data['invoicedetail']=$this->GenricModel->singlequery('select distinct i.InvoiceId,i.BillNo,i.SupplierName,i.SupplierNumber,i.SupplierAddress,i.PurchaseDate,i.PurchaseDateBS,i.Description,id.TAmount,id.Item,id.Quantity,id.Price,id.Amount from invoice i join invoicedetail id on id.InvoiceId=i.InvoiceId where i.InvoiceId='.$InvoiceId);\n\t\t$data['item']=$this->GenricModel->query('select * from invoicedetail where InvoiceId='.$InvoiceId);\n\t\t\n\t\t//var_dump($data['item']);die;\n if(isset($data['invoice']['InvoiceId']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'BillNo' => $this->input->post('BillNo'),\n\t\t\t\t'PurchaseDate' => $this->input->post('PurchaseDate'),\n\t\t\t\t'PurchaseDateBS' => $this->input->post('PurchaseDateBS'),\n\t\t\t\t'SupplierName' => $this->input->post('SupplierName'),\n\t\t\t\t'SupplierNumber' => $this->input->post('SupplierNumber'),\n\t\t\t\t'SupplierAddress' => $this->input->post('SupplierAddress'),\n\t\t\t\t'Description' => $this->input->post('Description'),\n\t\t\t\t\n );\n $this->Invoice_model->update_invoice($InvoiceId,$params); \n redirect('invoice/index');\n }\n else\n {\n\t\t\t\t $userid = $this->session->userdata('userid');\n\t\t\t\t$data['users'] = $this->User_model->get_user($userid);\n $data['_view'] = 'invoice/detail';\n $this->load->view('layouts/main1',$data);\n }\n }\n else\n show_error('The invoice you are trying to edit does not exist.');\n }", "public function index()\n {\n if (! Gate::allows('invoice_access')) {\n return abort(401);\n }\n\n\n if (request('show_deleted') == 1) {\n if (! Gate::allows('invoice_delete')) {\n return abort(401);\n }\n $invoices = Invoice::onlyTrashed()->get();\n } else {\n $invoices = Invoice::all();\n }\n\n return view('admin.invoices.index', compact('invoices'));\n }", "public function show(Invoices $invoices)\n {\n //\n }", "public function index()\n { \n $this->isNotCashier();\n return view('invoice.invoice');\n }", "public function viewOrderInvoiceAction()\n {\n $id = $this->request->query->get('id');\n $easyadmin = $this->request->attributes->get('easyadmin');\n $entity = $easyadmin['item'];\n\n $html = $this->renderView('easy_admin/Order/viewInvoice.html.twig', array(\n 'entity' => $entity\n ));\n\n return new Response(\n $this->get('knp_snappy.pdf')->getOutputFromHtml($html),\n 200,\n array(\n 'Content-Type' => 'application/pdf',\n 'Content-Disposition' => 'attachment; filename=\"' . $entity->getClient()->getFirstname() . '.pdf\"'\n )\n );\n }", "public function invoices()\n {\n //\n $invoices = Invoice::orderBy('updated_at','DESC')->get();\n return view('reports.invoice',['invoices'=>$invoices]);\n }", "function view_voucher($demand_id)\n {\n }", "public function invoice_list() {\n //$this->output->enable_profiler(TRUE);\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $payment_status = $this->input->get('payment_status');\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 if (!empty($_GET)) {\n $totalrows = $this->reportsModel->get_all_invoice_count($tenant_id, $payment_status, $start_date, $end_date, $company_id);\n $records_per_page = RECORDS_PER_PAGE;\n $baseurl = base_url() . 'reports_finance/invoice_list/';\n $pageno = ($this->uri->segment(3)) ? $this->uri->segment(3) : 1;\n $offset = ($pageno * $records_per_page);\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.inv_date';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_all_invoice($tenant_id, $records_per_page, $offset, $field, $order_by, $payment_status, $start_date, $end_date, $company_id);\n $tabledata_count = count($tabledata);\n for ($i = 0; $i < $tabledata_count; $i++) {\n if ($tabledata[$i]->enrolment_mode === 'COMPSPON') {\n $tabledata[$i]->payment_status = $this->reportsModel->check_not_part_paid($tabledata[$i]->pymnt_due_id);\n }\n }\n $data['tabledata'] = $tabledata;\n $data['sort_order'] = $order_by;\n }\n $data['controllerurl'] = 'reports_finance/invoice_list/';\n $this->load->helper('pagination');\n $data['sort_link'] = $sort_link = \"payment_status=\" . $this->input->get('payment_status') . \"&start_date=\" . $this->input->get('start_date') . \"&end_date=\" . $this->input->get('end_date') . \"&company_id=\" . $this->input->get('company_id') . \"&company_name=\" . $this->input->get('company_name');\n $data['pagination'] = get_pagination($records_per_page, $pageno, $baseurl, $totalrows, $field, $order_by . '&' . $sort_link);\n $data['page_title'] = 'Accounting Reports - List and Search Invoice';\n $data['main_content'] = 'reports/invoice_list';\n $this->load->view('layout', $data);\n }", "public function print_invoice( $invoice_id ) {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Get invoice details\n $invoice = $this->invoice->get_invoice( $invoice_id ); \n \n // Verify if invoice exists\n if ( $invoice ) {\n \n if ( $invoice[0]->user_id === $this->user_id ) {\n \n // Get the invoice logo\n $invoice_logo = get_option( 'main-logo' );\n\n if ( get_option( 'invoice-logo' ) ) {\n\n $invoice_logo = get_option( 'invoice-logo' );\n\n }\n\n // Get the invoice billing period text\n $billing_period = 'Billing Period';\n\n if ( get_option( 'invoice-billing-period' ) ) {\n\n $billing_period = get_option( 'invoice-billing-period' );\n\n } \n\n // Get the invoice transaction id\n $transaction_id = 'Transaction ID';\n\n if ( get_option( 'invoice-transaction-id' ) ) {\n\n $transaction_id = get_option( 'invoice-transaction-id' );\n\n } \n\n // Get the invoice date format\n $date_format = 'dd-mm-yyyy';\n\n if ( get_option( 'invoice-date-format' ) ) {\n\n $date_format = get_option( 'invoice-date-format' );\n\n }\n\n // Get the invoice hello text\n $hello_text = 'Hello [username]';\n\n if ( get_option( 'invoice-hello-text' ) ) {\n\n $hello_text = get_option( 'invoice-hello-text' );\n\n }\n\n // Get the invoice message\n $message = 'Thanks for using using our services.';\n\n if ( get_option( 'invoice-message' ) ) {\n\n $message = get_option( 'invoice-message' );\n\n }\n\n // Get the invoice date word\n $date = 'Date';\n\n if ( get_option( 'invoice-date' ) ) {\n\n $date = get_option( 'invoice-date' );\n\n }\n\n // Get the invoice description word\n $description = 'Description';\n\n if ( get_option( 'invoice-description' ) ) {\n\n $description = get_option( 'invoice-description' );\n\n } \n\n // Get the invoice description text\n $description_text = 'Upgrade Payment';\n\n if ( get_option( 'invoice-description-text' ) ) {\n\n $description_text = get_option( 'invoice-description-text' );\n\n } \n\n // Get the invoice amount word\n $amount = 'Amount';\n\n if ( get_option( 'invoice-amount' ) ) {\n\n $amount = get_option( 'invoice-amount' );\n\n } \n\n // Get the invoice amount word\n $taxes = 'Taxes';\n\n if ( get_option( 'invoice-taxes' ) ) {\n\n $taxes = get_option( 'invoice-taxes' );\n\n } \n\n // Get the invoice taxes value\n $taxes_value = '';\n\n if ( get_option( 'invoice-taxes-value' ) ) {\n\n $taxes_value = get_option( 'invoice-taxes-value' );\n\n } \n\n // Get the invoice total word\n $total = 'Total';\n\n if ( get_option( 'invoice-total' ) ) {\n\n $total = get_option( 'invoice-total' );\n\n }\n\n // Get the no reply message\n $no_reply = 'Please do not reply to this email. This mailbox is not monitored and you will not receive a response. For assistance, please contact us to [email protected].';\n\n if ( get_option( 'invoice-no-reply' ) ) {\n\n $no_reply = get_option( 'invoice-no-reply' );\n\n } \n \n echo '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"1000px\">\n <tbody><tr><td align=\"center\" width=\"600\" valign=\"top\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tbody>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#ffffff\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-bottom:10px;\" width=\"100%\">\n <tbody><tr valign=\"bottom\"> \n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td align=\"left\" height=\"64\">\n <img alt=\"logo\" class=\"invoice-logo\" src=\"' . $invoice_logo . '\">\n </td> \n <td width=\"40\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td align=\"right\">\n <span style=\"padding-top:15px;padding-bottom:10px;font:italic 12px;color:#757575;line-height:15px;\">\n <span style=\"display:inline;\">\n <span class=\"invoice-billing-period\">' . $billing_period . '</span> <strong><span class=\"invoice-date-format billing-period-from\">' . $this->get_invoice_time($invoice[0]->from_period) . '</span> to <span class=\"invoice-date-format billing-period-to\">' . $this->get_invoice_time($invoice[0]->to_period) . '</span></strong>\n </span>\n <span style=\"display:inline;\">\n <br>\n <span class=\"invoice-transaction-id\">' . $transaction_id . '</span>: <strong class=\"transaction-id\">' . $invoice[0]->transaction_id . '</strong>\n </span>\n </span>\n </td>\n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n </tr>\n </tbody>\n </table>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding-bottom:10px;padding-top:10px;margin-bottom:20px;\" width=\"100%\">\n <tbody><tr valign=\"bottom\"> \n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td valign=\"top\" style=\"font-family:Calibri, Trebuchet, Arial, sans serif;font-size:15px;line-height:22px;color:#333333;\" class=\"yiv1811948700ppsans\">\n <p>\n </p><div style=\"margin-top:30px;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;\"><span style=\"color:#333333;font-weight:bold;font-family:arial, helvetica, sans-serif; margin-left: 2px;\" class=\"invoice-hello-text\">' . $this->get_invoice_placeholders($hello_text, array('username' => $invoice[0]->username) ) . ' </span><table><tbody><tr><td valign=\"top\" class=\"invoice-message\">' . $this->get_invoice_placeholders($message, array('username' => $invoice[0]->username) ) . '</td><td></td></tr></tbody></table><br><div style=\"margin-top:5px;\">\n <br><div class=\"yiv1811948700mpi_image\" style=\"margin:auto;clear:both;\">\n </div>\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"clear:both;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-top:20px;\" width=\"100%\">\n <tbody>\n <tr>\n <td style=\"text-align:left;border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" class=\"invoice-date\" width=\"10%\">' . $date . '</td>\n <td style=\"border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" width=\"80%\" class=\"invoice-description\">' . $description . '</td>\n <td style=\"text-align:right;border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" width=\"10%\" class=\"amount\">' . $amount . '</td>\n </tr>\n <tr>\n <td style=\"padding:10px;\" width=\"80%\">\n <span class=\"invoice-description-text\">' . $description_text . '</span>\n <br>\n\n <span style=\"display:inline;font-style: italic;color: #888888;\" class=\"invoice-plan-name\">' . $invoice[0]->plan_name . '</span>\n </td>\n <td style=\"text-align:right;padding:10px;\" width=\"10%\"></td>\n <td style=\"text-align:right;padding:10px;\" width=\"10%\" class=\"invoice-amount\">' . $invoice[0]->amount . ' ' . $invoice[0]->currency . '</td>\n </tr>\n </tbody>\n </table>\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-top:1px solid #ccc;border-bottom:1px solid #ccc;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-bottom:10px;\" width=\"100%\">\n <tbody>\n <tr>\n <td>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-top:10px;\">\n <tbody>\n <tr class=\"taxes-area\" style=\"display: none;\">\n <td style=\"width:80%;text-align:right;padding:0 10px 10px 0;\" class=\"invoice-taxes\">' . $taxes . '</td>\n <td style=\"width:20%;text-align:right;padding:0 10px 10px 0;\">\n <span style=\"display:inline;\" class=\"invoice-taxes-value\">' . $taxes_value . ' %</span>\n\n </td>\n </tr>\n <tr>\n <td style=\"width:80%;text-align:right;padding:0 10px 10px 0;\">\n <span style=\"color:#333333;font-weight:bold;\" class=\"invoice-total\">' . $total . '</span>\n </td>\n <td style=\"width:20%;text-align:right;padding:0 10px 10px 0;\" class=\"invoice-total-value\">' . $invoice[0]->total . ' ' . $invoice[0]->currency . '</td>\n </tr>\n </tbody></table>\n </td>\n </tr>\n\n </tbody></table>\n <span style=\"font-size:11px;color:#333;\" class=\"invoice-no-reply\">' . $no_reply . '</span></div>\n <span style=\"font-weight:bold;color:#444;\">\n </span>\n <span>\n </span>\n </div></td>\n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n </tr>\n </tbody>\n </table>\n <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>\n </td>\n </tr>\n </tbody>\n </table> \n </td>\n </tr>\n </tbody>\n </table>';\n \n exit();\n \n }\n \n }\n \n show_404();\n \n }", "public function invoice(){\n \n $page_name = 'invoice';\n \n $this->load->helper('num2word');\n \n // Check for valid request method\n if($this->input->server('REQUEST_METHOD') == 'POST') {\n \n // Get Student details\n $data['student_details'] = $this->pay_mdl->gets('student_details', $this->main->item('user_id'));\n \n // Get all form field values.\n $form_fields = $this->input->post(NULL);\n \n \n \n \n $pay_param = array(\n 'percent' => $form_fields['percentage'],\n 'schoolid' => $form_fields['schoolid'],\n 'exceptionid' => $form_fields['exceptionid'],\n 'can_name' => $data['student_details']['fname'] .' '. $data['student_details']['lname']. ' '.$data['student_details']['mname'],\n 'scheduleid' => $form_fields['scheduleid'],\n 'scheduletype' => $form_fields['scheduletype'],\n 'sessionname' => $form_fields['sessionname'],\n 'sessionid' => $form_fields['sessionid'],\n 'penalty_status' => $form_fields['penalty_status'],\n 'penalty' => $form_fields['penalty'],\n 'userid' => $this->main->item('user_id'),\n \"revenuehead\" => $form_fields['revenue_head'],\n );\n \n if($form_fields['penalty_status'] == \"active\"){\n \n //get the Calculated percentage of the amount to me paid if Penalty is active\n $pay_param['amount'] = $form_fields['amount'];\n $pay_param['amount2word'] = convert_number_to_words((double)$form_fields['amount']);\n \n }else{\n \n //get the Calculated percentage of the amount to me paid if Penalty is Inactive \n $paying_amount = (($form_fields['amount'] * $form_fields['percentage']) / 100);\n $pay_param['amount2word'] = convert_number_to_words((double)$paying_amount);\n $pay_param['amount'] = $paying_amount;\n }\n \n \n \n $data['form_fields'] = $pay_param;\n \n //build view page for Payment Invoice \n $page_content = $this->load->view($this->folder_name.'/'.$page_name, $data, true);\n $this->page->build($page_content, $this->folder_name, $page_name, $this->page_title ); \n }\n else{\n\n // Set error message for any request other than POST\n $error_msg = $this->lang->line('invalid_req_method'); \n $this->main->set_notification_message(MSG_TYPE_ERROR, $error_msg, TRUE); \n \n $this->index();\n }\n \n \n }", "public function show(Invoice $invoice) {\n\n\t\t$mydate = $invoice->name . \"-00 23:59:59\";\n\t\t$date = date_create_from_format(\"Y-F-d H:i:s\", $mydate);\n\t\t$income = 0;\n\t\t$expense = 0;\n\n\t\t$income = \\Auth::user()\n\t\t\t->transactions()\n\t\t\t->where('date', '<', $date)\n\t\t\t->where('type', \"income\")\n\t\t\t->sum('amount');\n\n\t\t$expense = \\Auth::user()\n\t\t\t->transactions()\n\t\t\t->where('date', '<', $date)\n\t\t\t->where('type', \"expense\")\n\t\t\t->sum('amount');\n\n\t\t$balance = $income - $expense;\n\t\t$return['balance'] = $balance;\n\t\t$transactions = \\App\\Invoice::find($invoice->id)->transactions;\n\n\t\t$return['transactions'] = $transactions->sortBy('date');\n\t\t$return['user'] = \\Auth::user();\n\t\t$return['downloadType'] = $invoice->name;\n\n\t\treturn view('/transactions/transactionOverview', $return);\n\t}", "public function actionInvoice($id){\n $invoice = Yii::$app->user->identity->getInvoices()\n ->where(['invoice_id' => (int) $id])->one();\n\n if(!$invoice) die(\"Invoice not found\");\n\n return $this->renderPartial('invoice', [\n 'invoice' => $invoice\n ]);\n }", "public function invoices()\n {\n $user = auth()->user();\n $facturas = DB::table('quotes')\n ->select('quotes.account_id', 'quotes.created_by_id', 'quotes.id as quoteId', 'quotes.quote_date',\n DB::raw(\"upper(quotes.quote_number) AS quote_number\"),\n 'quotes.invoice_date','quotes.stage_id',\n 'accounts.name as accountName','users.name as userName','stages.name as stageName',\n 'accounts.document_number','document_types.name as documenttype')\n ->join('accounts', 'accounts.id', '=', 'quotes.account_id')\n ->join('document_types', 'document_types.id', '=', 'accounts.document_type_id')\n ->join('stages', 'stages.id', '=', 'quotes.stage_id')\n ->join('users', 'users.id', '=', 'quotes.created_by_id')\n ->whereIn('quotes.stage_id', array(3,4))\n ->where('users.organization_id', $user->organization_id)\n ->orderByRaw('quotes.updated_at DESC')\n ->paginate(10);\n return view('quote.invoices',compact('facturas'));\n }", "function invoice_details_view($param1 = '')\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['code'] = $param1;\n $page_data['page_name'] = 'invoice_details';\n $page_data['page_title'] = get_phrase('invoice_details');\n $this->load->view('backend/index', $page_data);\n }", "public function index() {\n\n\t\t$invoices = \\Auth::user()\n\t\t\t->invoices()\n\t\t\t->get();\n\n\t\t$transactions = \\Auth::user()\n\t\t\t->transactions()\n\t\t\t->get();\n\n\t\tforeach ($invoices as $invoice) {\n\n\t\t\t$invoice->name_date = date('Y-m', strtotime($invoice->name));\n\t\t\t$invoice->sum_of_transactions = count($invoice->transactions);\n\n\t\t\t$income = $transactions\n\t\t\t\t->where('invoice_id', $invoice->id)\n\t\t\t\t->where('type', 'income')\n\t\t\t\t->sum('amount');\n\t\t\t$expense = $transactions\n\t\t\t\t->where('invoice_id', $invoice->id)\n\t\t\t\t->where('type', 'expense')\n\t\t\t\t->sum('amount');\n\n\t\t\t$invoice->change = $income - $expense;\n\t\t}\n\n\t\t$invoices = $invoices->sortBy('name_date');\n\t\t$return['invoices'] = $invoices;\n\n\t\treturn view('/invoices/invoicesOverview', $return);\n\t}", "public function view_invoice($enc_id)\n {\n \t$arr_data = $order_product = [];\n \t$id = base64_decode($enc_id);\n \t$arr_agent = [];\n\n $obj_agent = $this->AgentModel->where('status','=','1')->get();\n\n if($obj_agent)\n\n {\n\n $arr_agent = $obj_agent->toArray();\n\n\t\t}\n\n \t$obj_data = $this->BaseModel->with('get_city','get_delivery_type','get_shipment_details')\n \t\t\t\t\t\t\t\t\t\t->with(['get_customer_details'=>function($q){\n\t\t\t\t\t\t\t\t\t\t\t\t$q->with('get_group_details');\n\t\t\t\t\t\t\t\t\t\t\t}])\n \t\t\t\t\t\t\t\t\t\t->where('id',$id)->first();\n\n \tif($obj_data){\n \t\t$arr_data = $obj_data->toArray();\n \t\t// dd($arr_data);\n \t}\n\n\t\t$obj_datas = $this->PrintingOrderDetailsModel->with(['get_order_details'=>function($q){\n \t\t\t\t\t\t\t\t\t\t\t\t\t$q->with('get_order_finance_details');\n \t\t\t\t\t\t\t\t\t\t\t\t }])\n \t\t\t\t\t\t\t\t\t\t\t\t->with(['get_productoption_selected'=>function($q){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$q->with('get_option_details');\n\t\t\t\t\t\t\t\t\t\t\t\t\t }])\t\n \t\t\t\t\t\t\t\t\t\t\t\t ->with('get_product_details','get_combination_details')\n \t\t\t\t\t\t\t\t\t\t\t\t ->where('order_id',$id)->get();\n\n \tif($obj_datas){\n \t\t$arrs_data = $obj_datas->toArray();\n\t\t\t//dd($arrs_data);\n \t\t $i=1;\n \t\t//dd($arr_data);\n \t\tforeach ($arrs_data as $key => $value) {\n\t\t\t\t//dd($value);\t\n\t\t\t\t$product_op \t\t\t= isset($value['get_productoption_selected'])? $value['get_productoption_selected'] :'';\n\t\t\t\t\t//dd($product_op );\n\t\t\t\tforeach ($product_op as $ikey => $ivalue) {\n\t\t\t\t\t$arr_product_options[] = $ivalue['get_option_details']['english_name'];\n\t\t\t\t}\n\n\n\t\t\t\t$combination = isset($value['get_combination_details']['description'])? $value['get_combination_details']['description'] :'';\n\t\t\t\t//dd($combination);\n\t\t\t\t$arr_product_sub = [];\n\t\t\t\tforeach ($combination as $ikey => $subid) {\n\t\t\t\t\t//dd($subid);\n\t\t\t\t\t$sub_data = $this->SubOptionModel->where('id',$subid)->first();\n\t\t\t\t\tif($sub_data){\n\t\t\t\t\t\t$arr_product_engsub[] = $sub_data->english_name;\n\t\t\t\t\t\t$arr_product_arbsub[] = $sub_data->arabic_name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n \n\t\t\t\t$eng_option = implode(', ', $arr_product_engsub);\n\t\t\t\t$arb_option = implode(', ', $arr_product_arbsub);\n\t\t\t\t//$option = implode(',', $arr_product_options);\n\n\t\t\t\t$total_price = $value['quantity']*$value['unit_price'];\n\t \t\t$order_product['product_english'] = $value['get_product_details']['product_english_name'].'-'.$eng_option;\n\t \t\t$order_product['product_arabic'] = $value['get_product_details']['product_arabic_name'].'- '.$arb_option;\n\t \t\t$order_product['perquantity'] = 1;\n\t \t\t$order_product['unit_price'] = $value['unit_price'];\n\t \t\t$order_product['quantity'] = $value['quantity'];\n\t \t\t$order_product['total_price'] = $total_price;\n\t\t\t\t\t\t\t\t\n\t\t\t\t$arr_data['product_details'][] = $order_product;\t\t\t\t\n\t\t\t\t\t\t\t\t\n \t\t}\n\t\t} \n\n\t\t$this->arr_view_data['page_title'] = \"Manage \".$this->module_title;\n $this->arr_view_data['parent_module_icon'] = \"fa fa-home\";\n $this->arr_view_data['parent_module_title'] = \"Dashboard\";\n $this->arr_view_data['parent_module_url'] = url('/').'/admin/dashboard';\n $this->arr_view_data['module_icon'] = $this->module_icon;\n $this->arr_view_data['module_title'] = \"Manage \".$this->module_title;\n\t\t$this->arr_view_data['module_url_path'] = $this->module_url_path;\n\t\t$this->arr_view_data['admin_url_path'] = $this->admin_url_path;\n\t\t$this->arr_view_data['admin_panel_slug'] = $this->admin_panel_slug;\n\t\t$this->arr_view_data['arr_data'] \t\t= $arr_data;\n\t\t$this->arr_view_data['arr_agent'] = $arr_agent;\n\t\t\n\t\treturn view($this->module_view_folder.'.customer-invoice',$this->arr_view_data);\n }", "public function pos_invoice_inserted_data($invoice_id)\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_admin_auth();\n\t\t$CI->load->library('linvoice');\n\t\t$content = $CI->linvoice->pos_invoice_html_data($invoice_id);\t\t\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function index() {\n $this->load->model(\"Invoice_model\");\n $data['global'] = $this->common_model->getGlobalSettings();\n $data = $this->common_model->commonFunction();\n $data['user_session'] = $this->session->userdata('user_account');\n\n// $orders = $this->common_model->getRecords(TABLES::$ORDER_SUMMARY,\"*\", array('ord_user_fk' => $data['user_session']['user_id'] ));\n// $invices = $this->Invoice_model->getAllInvoices($data['user_session']['user_id']);\n $invices = $this->common_model->getRecords(TABLES::$MST_SERVICE_INVOICE, \"\", array(\"user_id\" => $data['user_session']['user_id']));\n $this->template->set('page', 'bloglist');\n $this->template->set('invices', $invices);\n $this->template->set('global', $data['global']);\n $this->template->set('user_session', $data['user_session']);\n $this->template->set_theme('default_theme');\n $this->template->set_layout('backend')\n ->title('Razorclean | Orders')\n ->set_partial('header', 'partials/header')\n ->set_partial('sidebar', $this->sidebar)\n ->set_partial('footer', 'partials/footer');\n $this->template->build('invoice/invoice_list');\n }", "public function index()\n {\n $invoice=Invoice::all()->toArray();\n\t\treturn view('invoice.index',compact('invoice'));\n }", "public function index()\n\t{\n\t\t// Database Queries\n\t\t$invoices = Invoice::with(['contract', 'contract.tenant', 'contract.asset'])->get();\n\t\treturn view('invoices.index', compact('invoices'));\n\t}", "function view() {\n if($this->active_invoice->isAccessible()) {\n if($this->active_invoice->canView($this->logged_user)) {\n if ($this->request->isMobileDevice()) {\n $payment_options = array();\n\n if ($this->active_invoice->payments()->hasDefinedGateways() && $this->active_invoice->payments()->canMake($this->logged_user) || ($this->logged_user->isFinancialManager())) {\n $payment_options[] = \"<a href='\" . $this->active_invoice->payments()->getAddUrl().\"' class='make_a_payment_btn'>\" . lang('Make a Payment') . \"</a>\";\n } // if\n\n $this->response->assign(array(\n 'payment_options' => $payment_options,\n 'invoice_template' => new InvoiceTemplate()\n ));\n } else if ($this->request->isWebBrowser()) {\n $this->wireframe->setPageObject($this->active_invoice, $this->logged_user);\n\n if ($this->request->isSingleCall() || $this->request->isQuickViewCall()) {\n $this->response->assign(array(\n 'invoice_template' => new InvoiceTemplate()\n ));\n\n // access log\n $this->active_invoice->accessLog()->log($this->logged_user);\n\n $this->render();\n } else {\n if ($this->active_invoice->getState() == STATE_ARCHIVED) {\n $this->__forward('archive', 'archive');\n } else {\n $this->__forward('index', 'index');\n } // if\n } // if\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }", "public function view() {\n\n $this->db->where('VCIF', 'XYZ');\n $q = $this->db->get('STRUCTURE')->result();\n }", "public function getIndex(ReceivableInvoice $invoice){\n //$invoices = ReceivableInvoice::pluck('number_id', 'number_id');\n $sale = Sale::get()->where('invoice_id', '=', $invoice->number_id)->first();\n return view('cashReceipts.create', compact('invoice', 'sale'));\n }", "function ras_invoice_view_invoice_item($invoice_item) {\n return 'This is an invoice item - ID: ' . $invoice_item->invoice_item_id;\n}", "public function BillInvoice()\n {\n // $pdf->LoadHtml('<h1>Header Without Style</h1>');\n // return $pdf->stream();\n\n $billings = Billing::with('user')->where('distributor_id',5)\n ->first();\n\n // return view('users.bill-invoice', ['data' => $billings]);\n\n $pdf = PDF::loadView('users.bill-invoice',['data' => $billings]);\n // return $pdf->download('invoice.pdf');\n return $pdf->stream();\n }", "public function index()\n {\n $invoice = Invoice::all();\n $data['invoice'] = $invoice;\n return view('invoice.index', $data);\n }", "public function viewDetails($invoice_id) {\n\t\t$results = DB::select(\n\t\t\t\"SELECT *\n\t\t\tFROM invoice_item \n\t\t\tJOIN item ON (invoice_item.item_id = item.id)\n\t\t\tWHERE invoice_item.invoice_id = :invoice_id\",\n\t\t\tarray(\n\t\t\t\t\":invoice_id\" => $invoice_id\n\t\t\t\t)\n\t\t\t);\n\t\t$list = DB::select(\"SELECT * FROM item\");\n\n\t\treturn view('invoiceDetails', ['results' => $results, 'invoice_id' => $invoice_id, 'list'=>$list]);\n\t}", "function XSAInvoicing($InvoiceNo, $orderno, $debtorno, $TypeInvoice, $tag, $serie, $folio, &$db)\n{\n\t$charelectronic='01';\n\t$charelectronicEmbarque='';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\tif ($TypeInvoice == 11) {\n\t\t$tabla = 'notesorders';\n\t}else{\n\t\t$tabla = 'salesorders';\n\t}\n\t$SQLInvoice = \"SELECT replace(debtortrans.trandate,'-','/') as trandate,debtortrans.ovamount,debtortrans.ovdiscount,\n\t\t\tdebtortrans.ovfreight,debtortrans.ovgst,debtortrans.rate as cambio,\n\t\t\tdebtortrans.order_,debtortrans.invtext,\tdebtortrans.consignment,\n\t\t\tdebtortrans.id AS iddocto, debtortrans.type,\n\t\t\tdebtorsmaster.name,debtorsmaster.address1,debtorsmaster.address2,\n\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\tcustbranch.taxid as rfc,paymentterms.terms,salesorders.deliverto,\n\t\t\tsalesorders.deladd1,salesorders.deladd2,salesorders.deladd3,\n\t\t\tsalesorders.deladd4,salesorders.deladd5,salesorders.deladd6,\n\t\t\tsalesorders.customerref,salesorders.orderno,salesorders.orddate,\n\t\t\tlocations.locationname,\tshippers.shippername,custbranch.brname,\n\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\tsalesman.salesmanname,debtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\treplace(origtrandate,'-','/') as origtrandate,debtortrans.currcode,custbranch.branchcode,\n\t\t\tsalesorders.salesman,salesorders.UserRegister,custbranch.phoneno as telofi,\n\t\t\tsalesorders.placa, salesorders.serie,salesorders.kilometraje,salesorders.comments,debtortrans.ref1,\n\t\t\tsalesorders.ordertype,debtortrans.paymentname,debtortrans.nocuenta,\n\t\t\tcustbranch.brnumext, custbranch.brnumint,custbranch.specialinstructions,\n\t\t\ttags.typegroup,debtortrans.id\n\t\tFROM debtortrans \n\t\t\tleft join shippers on debtortrans.shipvia=shippers.shipper_id \n\t\t\tjoin tags on tags.tagref=debtortrans.tagref,\n\t\t\tdebtorsmaster,custbranch,\".$tabla.\" as salesorders ,\n\t\t\tsalesman,locations,paymentterms\n\n\t\tWHERE debtortrans.order_ = salesorders.orderno\n\n\t\tAND debtortrans.type=\".$TypeInvoice.\"\n\t\tAND debtortrans.transno=\" . $InvoiceNo . \"\n\t\tAND debtortrans.tagref=\" . $tag . \"\n\n\t\tAND debtortrans.debtorno=debtorsmaster.debtorno\n\t\tAND salesorders.paytermsindicator=paymentterms.termsindicator\n\t\tAND debtortrans.debtorno=custbranch.debtorno\n\t\tAND debtortrans.branchcode=custbranch.branchcode\n\t\tAND salesorders.salesman=salesman.salesmancode\n\t\tAND salesorders.fromstkloc=locations.loccode \";\n\tif ($_SESSION['UserID']=='admin') {\n\n\t\t//echo '<pre>sql:<br>'.$SQLInvoice.'<br>';\n\t}\n\t$Result=DB_query($SQLInvoice,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t//impuestos federales\n\t\t$totretencionfederal=0;\n\t\t//$charelectronictaxslocal='|'.chr(13).chr(10);\n\t\t$qry = \"Select debtortranstaxesclient.*,sec_taxes.nametax from debtortranstaxesclient, sec_taxes\n\t\t\t\twhere debtortranstaxesclient.idtax = sec_taxes.idtax\n\t\t\t\tAND sec_taxes.typetax=1\n\t\t\t\tand debtortranstaxesclient.iddoc = \".$myrow['id'];\n\t\t\t\n\t\t$rs = DB_query($qry,$db);\n\t\t$totalImpuestosLocales=0;\n\t\tif (DB_num_rows($rs) > 0){\n\t\t\t$charelectronictaxsfederal='';\n\t\t\t$charelectronictaxsfederalini='|'.chr(13).chr(10).'06';\n\t\t\twhile ($regs = DB_fetch_array($rs)){\n\t\t\t\t$charelectronictaxsfederal.=$charelectronictaxsfederalini.\"|\".$regs['nametax'].\"|\".$regs['percent'].\"|\".$regs['amount'];\n\t\t\t\t$totretencionfederal=$totretencionfederal+$regs['amount'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//impuestos locales\n\t\t$totalretencionlocal=0;\n\t\t//$charelectronictaxslocal='|'.chr(13).chr(10);\n\t\t$qry = \"Select debtortranstaxesclient.*,sec_taxes.nametax from debtortranstaxesclient, sec_taxes\n\t\t\t\twhere debtortranstaxesclient.idtax = sec_taxes.idtax\n\t\t\t\tAND sec_taxes.typetax=2\n\t\t\t\tand debtortranstaxesclient.iddoc = \".$myrow['id'];\n\t\t\t\n\t\t$rs = DB_query($qry,$db);\n\t\t$totalImpuestosLocales=0;\n\t\tif (DB_num_rows($rs) > 0){\n\t\t\t$charelectronictaxslocal.='08';\n\t\t\twhile ($regs = DB_fetch_array($rs)){\n\t\t\t\t$charelectronictaxslocal.=\"|\".$regs['nametax'].\"|\".$regs['percent'].\"|\".$regs['amount'];\n\t\t\t\t$totalretencionlocal=$totalretencionlocal+$regs['amount'];\n\t\t\t}\n\t\t\t$charelectronictaxslocal.=chr(13).chr(10);\n\t\t}\n\t\t$totalretencion=$totretencionfederal+$totalretencionlocal;\n\t\t//Tipo agrupacion\n\t\t$TipoAgrupacionXTag=$myrow['typegroup'];\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\n\t\t$metodoPago = $myrow['paymentname'];\n\t\tif ($metodoPago==\"\")\n\t\t\t$metodoPago = \"No Identificado\";\n\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\")\n\t\t\t$nocuenta = \"No Identificado\";\n\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= FormatNumberERP($myrow['ovamount']);\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=FormatNumberERP($myrow['ovamount']+$myrow['ovgst']+$totalretencion);\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=FormatNumberERP($myrow['ovgst']);\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento trae desde el stockmoves\n\t\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento) as descuento\n\t\t\t\t FROM stockmoves\n\t\t\t\t WHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=FormatNumberERP($myrowdis['descuento']);\n\t\t\t}\n\t\t}else{\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento+(IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*totaldescuento)) as descuento\n\t\t\t \t\t\tFROM stockmoves inner join stockmaster on stockmaster.stockid=stockmoves.stockid\n\t\t\t\t\t\t\t-- LEFT JOIN taxauthrates ON stockmaster.taxcatid = taxauthrates.taxcatid\n\t\t\t\t\t\t\tLEFT JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\t\t\n\t\t\t\t\t \t\tWHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=FormatNumberERP($myrowdis['descuento']);\n\t\t\t}\t\n\t\t}\n\t\t$descuento=FormatNumberERP($descuento);\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n\t\t$moneda=$myrow['currcode'];\n\t\t// CANTIDAD CON LETRAS\n\t\t$totaletras=($myrow['ovamount']+$myrow['ovgst'])+$totalretencion;\n\t\t$totalx=str_replace(',', '', FormatNumberERP($totaletras));\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\t\t$separa2=explode(\".\", FormatNumberERP($total));\n\t\t$montoctvs2 = $separa2[1];\n\t\t\n\t\t\n\t\t$montoletra=Numbers_Words::toWords($montoletra,'es');\n\t\t\n\t\t$zeroPad = \"\";\n\t\tif (empty($_SESSION['Decimals'])) {\n\t\t\t$zeroPad = str_pad($zeroPad, 4, 0, STR_PAD_RIGHT);\n\t\t} else {\n\t\t\t$zeroPad = str_pad($zeroPad, $_SESSION['Decimals'], 0, STR_PAD_RIGHT);\n\t\t}\n\t\t\n\t\tif ($moneda=='MXN') {\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\"/1$zeroPad M.N.\";\n\t\t} else {\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/1$zeroPad USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=FormatRateNumberERP(1/$myrow['cambio']);\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t// observaciones 3\n\t\t$comments=$comments.' Cuenta de Referencia: '.$myrow['ref1'];\n\t\t$observaciones3='Id Factura:'.$InvoiceNo. '. La tenencia de esta factura no acredita su pago si no se justifica con el comprobante respectivo. '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\t\t// informacionExtra\n\t\t$infoextra=\"\";\n\t\t$numpago=0;\n\t\t$cadenapagares=\"\";\n\t\tif ($TypeInvoice==11){\n\t\t\t$tipodoc=0;\n\t\t}else{\n\t\t\t$tipodoc=70;\n\t\t}\n\t\t\n\t\t$SQL=\" SELECT trandate,case when ovamount<0 then (ovamount+ovgst)*-1 else ovamount+ovgst end as monto\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=\".$tipodoc.\"\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)>0) {\n\t\t\twhile ($myrowpagos=DB_fetch_array($Result)){\n\t\t\t\t$numpago=$numpago+1;\n\t\t\t\t$fechapago=ConvertSQLDate($myrowpagos['trandate']);\n\t\t\t\t$montopago=$myrowpagos['monto'];\n\t\t\t\t$montopago=FormatNumberERP($montopago);\n\t\t\t\t$cadenapagares=$cadenapagares.\" No:\".$numpago.\" Fecha: \".$fechapago.\" Monto: \".$montopago .' '.$moneda;\n\t\t\t}\n\t\t}\n\t\t$placa= $_SESSION['LabelText1'].' : '.$myrow['placa'];\n\t\t$serie=$_SESSION['LabelText3'].' : '.$myrow['serie'];\n\t\t$kilometraje=$_SESSION['LabelText2'].' : '.$myrow['kilometraje'];\n\t\t$comments1=' Extra: '.$myrow['comments'];\n\t\t$infoextra=$placa.' '.$serie.' '.$kilometraje.' '.$comments1.' Pagares: '. $cadenapagares;\n\n\n\t\t$charelectronic=$charelectronic.'|'.$infoextra;\n\n\t\t//cometarios nivel factura\n\t\t$charelectronic=$charelectronic.'|'.$myrow['invtext'];\n\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT count(*) as pagares\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$myrowpag = DB_fetch_array($Result);\n\t\t\t$numpagares=intval($myrowpag['pagares']);\n\t\t\tif ($numpagares<=1){\n\t\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t\t}else{\n\t\t\t\t$Tipopago=\"Parcialidades\";\n\t\t\t}\n\t\t}\n\t\tif ($TypeInvoice==11){\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}\n\t\t\n\t\t$Tipopago=$Tipopago;//.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|'.$terminospago;\n\t\t// metodo de pago\n\t\t$metodopago=$metodoPago;\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4 (no de cuenta)\n\t\t$observaciones4=$nocuenta;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$referenciacalle=\"Telefono. \".$myrow['telofi'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress2'];;\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t\n\t\t\n\t\t$charelectronicEmbarque='|'.chr(13).chr(10).'09';\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['specialinstructions'];\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr1'];//calle\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//noext\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//no int\n\t\t\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr2'];//colonia\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr3'];//municipio\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr4'];//cp\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr5'];//estado\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr6'];//pais\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr7'];\n\t\t\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\t$decimalplaces=6;\n\n\t\n\tif ($rfccliente!=\"XAXX010101000\"){//\n\t\tif($TipoAgrupacionXTag==1 and $TypeInvoice <> 111){\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\t-- stockmoves.stockid,\n\t\t\t\t\t ProdLine.prodLineId as stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\t-- stockmaster.description,\n\t\t\t\t\t\tProdLine.Description as description,\n\t\t\t\t\t\t/*stockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,*/\n\t\t\t\t\t\t0 as serialised,\n\t\t\t\t\t\t0 as controlled,\n\t\t\t\t\t\tsum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxnet,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)-totaldescuento)/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as subtotal,\n\t\t\t\t\t\t-- sum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)/case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tsum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV\n\t\t\t\tFROM stockmoves,stockmaster,stockcategory \n\t\t\t\t\t \tINNER JOIN ProdLine ON ProdLine.prodLineId=stockcategory.prodLineId \n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\tGROUP BY ProdLine.Description,ProdLine.prodLineId';\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.longdescription,\n\t\t\t\t\t\tstockmaster.mbflag,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV\n\t\t\t\tFROM stockmoves,stockmaster,stockcategory\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t}\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\tif($_SESSION['DescrLargaFact'] == $myrow2['mbflag']){\n\t\t\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'].' '.$myrow2['longdescription'];\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t\t}\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n// \t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n// \t\t\t\t$trab=$traba[0];\n\t\t\t\t$trab=$myrowprop['val'];\n\t\t\t\tif ($xt==0){\n\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\n\t\t\t/*\n\t\t\tif ($TypeInvoice==11){\n\t\t\t\t$tablades=0;\n\t\t\t}else{\n\t\t\t\t$tipodoc=70;\n\t\t\t}\n\t\t\t\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM salesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}*/\n\t\t\t//$descrnarrative=\"\";\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t$numberserie=\"\";\n\t\t\t$xserie=0;\n\t\t\t$sqlserials=\"SELECT stockserialitems.serialno as serie\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t//echo '<pre><br>'.$sqlserials;\n\t\t\t$Result= DB_query($sqlserials,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$numberserie=\"\";\n\t\t\t}else{\n\t\t\t\twhile ($myrownseries=DB_fetch_array($Result)){\n\t\t\t\t\tif ($xserie==0){\n\t\t\t\t\t\t$numberserie=' Series: '.$myrownseries['serie'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$numberserie=$numberserie.', '.$myrownseries['serie'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (strlen($numberserie)==0){\n\t\t\t\t$numberserie=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t/**/\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\n\n\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$nameaduana=$myrowaduana['aduana'];\n\t\t\t\t$numberaduana=$myrowaduana['noaduana'];\n\t\t\t\t$fechaaduana=$myrowaduana['fechaaduana'];\n\t\t\t\t//$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t//$nameaduana = $separaaduana[0];\n\t\t\t\t//$numberaduana= $separaaduana[1];\n\t\t\t\t//$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($myrow['type'] == 66) { // Si es factura remision\n\n\t\t\t\t$ordernotmp = $myrow['orderno'];\n\n\t\t\t\t$SQL = \"\n\t\t\t\t\tSELECT GROUP_CONCAT(debtortrans.order_) AS order_\n\t\t\t\t\tFROM invoicetoremision\n\t\t\t\t\tINNER JOIN debtortrans\n\t\t\t\t\tON debtortrans.id = invoicetoremision.idremision\n\t\t\t\t\tWHERE invoicetoremision.idinvoice = '{$myrow['iddocto']}'\n\t\t\t\t\";\n\n\t\t\t\t$rstmp = DB_query($SQL, $db);\n\t\t\t\t$rowtmp = DB_fetch_array($rstmp);\n\t\t\t\t$ordernotmp = $rowtmp['order_'];\n\n\t\t\t\tif(empty($ordernotmp) == FALSE) {\n\n\t\t\t\t\t$SQL = \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\tDATE_FORMAT(purchorderdetails.datecustoms,'%Y-%m-%d') AS fechaaduana,\n\t\t\t\t\t\tpedimento,\n\t\t\t\t\t\tcustoms AS aduana\n\t\t\t\t\t\tFROM purchorders\n\t\t\t\t\t\tINNER JOIN purchorderdetails\n\t\t\t\t\t\tON purchorderdetails.orderno = purchorders.orderno\n\t\t\t\t\t\tWHERE purchorders.requisitionno IN ($ordernotmp)\n\t\t\t\t\t\tAND purchorderdetails.itemcode = '$stockid'\n\t\t\t\t\t\";\n\n\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t$fechaaduana = $rowtmp['fechaaduana'];\n\t\t\t\t\t\t$numberaduana = $rowtmp['pedimento'];\n\t\t\t\t\t\t$nameaduana = $rowtmp['aduana'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t\n\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,\n\t\t\t\t\t\ttaxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\tif($TipoAgrupacionXTag==1){\n\t\t\t\t\t$taxratetotal=FormatNumberERP((($myrow3['taxrate']*($myrow2['subtotal']))*$myrow2['quantity']));\n\t\t\t\t}else{\n\t\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t}\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\tif($TipoAgrupacionXTag==1){\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\t-- stockmoves.stockid,\n\t\t\t\t\t ProdLine.prodLineId as stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\t-- stockmaster.description,\n\t\t\t\t\t\tProdLine.Description as description,\n\t\t\t\t\t\t/*stockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,*/\n\t\t\t\t\t\t0 as serialised,\n\t\t\t\t\t\t0 as controlled,\n\t\t\t\t\t\tsum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxnet,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))-totaldescuento)/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as subtotal,\n\t\t\t\t\t\t-- sum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)/case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tsum((stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV\n\t\t\t\tFROM stockmoves,stockmaster\n\t\t\t\t\t left JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno ,\n\t\t\t\t\tstockcategory\n\t\t\t\t\t \tINNER JOIN ProdLine ON ProdLine.prodLineId=stockcategory.prodLineId\n\t\t\t\t\t\t\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\tGROUP BY ProdLine.Description,ProdLine.prodLineId';\n\t\t\t\t\n\t\t\t\t\n\t\t}else{\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno \n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t}\n\t\t\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t \t\tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM salesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\t\t\t\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=$myrow3['taxrate']*($myrow2['subtotal']);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']+$taxtotalratex);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']+$taxtotalratex);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\n\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($myrow['type'] == 66) { // Si es factura remision\n\n\t\t\t\t$ordernotmp = $myrow['orderno'];\n\n\t\t\t\t$SQL = \"\n\t\t\t\t\tSELECT GROUP_CONCAT(debtortrans.order_) AS order_\n\t\t\t\t\tFROM invoicetoremision\n\t\t\t\t\tINNER JOIN debtortrans\n\t\t\t\t\tON debtortrans.id = invoicetoremision.idremision\n\t\t\t\t\tWHERE invoicetoremision.idinvoice = '{$myrow['iddocto']}'\n\t\t\t\t\";\n\n\t\t\t\t$rstmp = DB_query($SQL, $db);\n\t\t\t\t$rowtmp = DB_fetch_array($rstmp);\n\t\t\t\t$ordernotmp = $rowtmp['order_'];\n\n\t\t\t\tif(empty($ordernotmp) == FALSE) {\n\n\t\t\t\t\t$SQL = \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\tDATE_FORMAT(purchorderdetails.datecustoms,'%Y-%m-%d') AS fechaaduana,\n\t\t\t\t\t\tpedimento,\n\t\t\t\t\t\tcustoms AS aduana\n\t\t\t\t\t\tFROM purchorders\n\t\t\t\t\t\tINNER JOIN purchorderdetails\n\t\t\t\t\t\tON purchorderdetails.orderno = purchorders.orderno\n\t\t\t\t\t\tWHERE purchorders.requisitionno IN ($ordernotmp)\n\t\t\t\t\t\tAND purchorderdetails.itemcode = '$stockid'\n\t\t\t\t\t\";\n\n\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t$fechaaduana = $rowtmp['fechaaduana'];\n\t\t\t\t\t\t$numberaduana = $rowtmp['pedimento'];\n\t\t\t\t\t\t$nameaduana = $rowtmp['aduana'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\n\t\t\t/*$stockprecio=number_format($myrow2['fxnet']+$taxtotalratex,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet']+$taxtotalratex,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal*/\n\n\t\t}\n\t}\n\t\n\t// ivas retenidos\n//\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronictaxsfederal.$charelectronictaxslocal.$charelectronicEmbarque;\n\t\t$cadenaenviada=$cadenaenvio;//retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsfederal.$charelectronictaxs.$charelectronictaxslocal.$charelectronicEmbarque;\n\t\t$cadenaenviada=$cadenaenvio;//retornarString($cadenaenvio);\n\n\t}\n\t//echo $cadenaenviada;\n\treturn $cadenaenviada;\n}", "public function invoice($id)\n {\n $orders = Order::with('customer', 'payment', 'shipping', 'order_items')->findOrFail($id);\n $order_info = OrderInfo::with('product')->select('id', 'order_id', 'product_id', 'product_name', 'product_price', 'product_qty')->where('order_id', $id)->get();\n\n return view('backend.order.invoice', compact('orders', 'order_info'));\n }", "public function invoice($id){\n $directorio_regional= DB::table('directorio_regional')\n ->join('region','region.id','=','directorio_regional.id_region')\n ->select('directorio_regional.*','region.sostenimiento','region.region')\n ->get();\n $date = date('Y-m-d');\n $invoice = \"2222\";\n // print_r($materiales);\n $view = \\View::make('nomina.directorio_regional.invoice', compact('date', 'invoice','directorio_regional'))->render();\n //->setPaper($customPaper, 'landscape');\n $pdf = \\App::make('dompdf.wrapper');\n $pdf->setPaper('A4', 'portrait');\n $pdf->loadHTML($view);\n return $pdf->stream('invoice');\n }", "public function createInvoice()\r\n {\r\n }", "public function invoice($param1 = \"\", $param2 = \"\") {\n\t\t// showing the list of invoices\n\t\tif ($param1 == 'invoice') {\n\t\t\t$page_data['invoice_id'] = $param2;\n\t\t\t$page_data['folder_name'] = 'invoice';\n\t\t\t$page_data['page_name'] = 'invoice';\n\t\t\t$page_data['page_title'] = 'invoice';\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}\n\n\t\t// showing the index file\n\t\tif(empty($param1)){\n\t\t\t$page_data['folder_name'] = 'invoice';\n\t\t\t$page_data['page_title'] = 'invoice';\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}\n\t}", "public function index()\n { \n $invoices = $this->invoiceRepository->get();\n\n return view('chuckcms-module-booker::backend.invoices.index', compact('invoices'));\n }", "public function show(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function index() {\n\t\t$title = trans( 'invoice.invoice' );\n\t\t$fullPayment = $this->invoiceRepository->getAllFullPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->count();\n\t\t$partPayment = $this->invoiceRepository->getAllPartPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->count();\n\t\t$noPayment = $this->invoiceRepository->getAllNoPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->count();\n\t\t$fullPaymentSum = $this->invoiceRepository->getAllFullPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->sum( 'paid_amount' );\n\t\t$partPaymentSum = $this->invoiceRepository->getAllPartPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->sum( 'paid_amount' );\n\t\t$noPaymentSum = $this->invoiceRepository->getAllNoPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->sum( 'amount' );\n\n\t\treturn view( 'invoice.index', compact( 'title',\n\t\t\t'fullPayment', 'partPayment', 'noPayment',\n\t\t\t'fullPaymentSum', 'partPaymentSum', 'noPaymentSum' ) );\n\t}", "public function index()\n {\n return View::make('crm.invoices.index')->with($this->getDataAndPagination());\n }", "public function add_invoice()\n\t{\n\t\t$this->load->view('london/layout/header');\n\t\t$this->load->view('london/layout/sidenavbar');\n\t\t$this->load->view('london/pages/add-invoice');\n\t\t$this->load->view('london/layout/footer');\n\t}", "function invoice($param1 = '', $param2 = '', $param3 = '', $param4 = '') {\r\n if ($this->session->userdata('accountant_login') != 1)\r\n redirect(base_url(), 'refresh');\r\n\r\n if ($param1 == 'create') {\r\n \r\n $class_id = $this->input->post('class_id');\r\n $student_id = $this->input->post('student_id');\r\n \r\n $this->db->select('*')->from('invoice')->where('class_id', $class_id);\r\n $this->db->where('student_id', $student_id);\r\n $invoice_data = $this->db->get()->result_array();\r\n \r\n $num_rows = count($invoice_data);\r\n \r\n if($num_rows > 0){\r\n $next_payment_data = array();\r\n foreach ( $_POST as $key => $value )\r\n {\r\n $next_payment_data[$key] = $this->input->post($key);\r\n }\r\n $next_payment_data['creation_date'] = date('Y-m-d', strtotime($this->input->post('creation_date')));\r\n $next_payment_data['creation_timestamp'] = strtotime($this->input->post('creation_date'));\r\n\r\n unset($next_payment_data['class_id_select']);\r\n \r\n $this->db->insert('invoice', $next_payment_data);\r\n redirect(base_url() . 'index.php?admin/invoice', 'refresh');\r\n \r\n }else {\r\n $data = array();\r\n foreach ( $_POST as $key => $value )\r\n {\r\n $data[$key] = $this->input->post($key);\r\n }\r\n $data['creation_date'] = date('Y-m-d', strtotime($this->input->post('creation_date')));\r\n $data['creation_timestamp'] = strtotime($this->input->post('creation_date'));\r\n\r\n unset($data['class_id_select']);\r\n \r\n $this->db->insert('invoice', $data);\r\n redirect(base_url() . 'index.php?admin/invoice', 'refresh');\r\n } \r\n }\r\n if ($param1 == 'do_update') {\r\n $data['student_id'] = $this->input->post('student_id');\r\n $data['class_id'] = $this->input->post('class_id');\r\n $data['title'] = $this->input->post('title');\r\n $data['description'] = $this->input->post('description');\r\n $data['monthly_fees'] = $this->input->post('monthly_fees');\r\n $data['admission_fees'] = $this->input->post('admission_fees');\r\n $data['dev_fees'] = $this->input->post('dev_fees');\r\n $data['session_fee_1st_installment'] = $this->input->post('session_fee_1st_installment');\r\n $data['session_fee_2nd_installment'] = $this->input->post('session_fee_2nd_installment');\r\n $data['sports_fees'] = $this->input->post('sports_fees');\r\n $data['lib_fees'] = $this->input->post('lib_fees');\r\n $data['cultural_program'] = $this->input->post('cultural_program');\r\n $data['invoice_book'] = $this->input->post('invoice_book');\r\n $data['receipt_books'] = $this->input->post('receipt_books');\r\n $data['exam_fee'] = $this->input->post('exam_fee');\r\n $data['registration_fee'] = $this->input->post('registration_fee');\r\n $data['poor_fund'] = $this->input->post('poor_fund');\r\n $data['lab_charge'] = $this->input->post('lab_charge');\r\n $data['electricity_charge'] = $this->input->post('electricity_charge');\r\n $data['total_bill'] = $this->input->post('total_bill');\r\n $data['deposit'] = $this->input->post('deposit');\r\n $data['due'] = $this->input->post('due');\r\n $data['overdue'] = $this->input->post('overdue');\r\n $data['Fine'] = $this->input->post('Fine');\r\n $data['absence_fine'] = $this->input->post('absence_fine');\r\n $data['late_fine'] = $this->input->post('late_fine');\r\n $data['bad_behavior'] = $this->input->post('bad_behavior');\r\n $data['status'] = $this->input->post('status');\r\n $data['creation_timestamp'] = strtotime($this->input->post('date'));\r\n\r\n $this->db->where('invoice_id', $param2);\r\n $this->db->update('invoice', $data);\r\n redirect(base_url() . 'index.php?admin/invoice', 'refresh');\r\n } else if ($param1 == 'edit') {\r\n $page_data['edit_data'] = $this->db->get_where('invoice', array(\r\n 'invoice_id' => $param2\r\n ))->result_array();\r\n }\r\n if ($param1 == 'delete') \r\n\t\t{\r\n\t\t\t\r\n\t\t\t$this->db->delete('invoice',array('invoice_id'=>$param2));\r\n\t\t\t$this->db->delete('invoice_details',array('invoice_id'=>$param2));\r\n redirect(base_url() . 'index.php?admin/invoice', 'refresh');\r\n\t\t return;\r\n }\r\n \r\n if($this->uri->segment(3) == \"loadfee_by_class\") \r\n\t\t{\r\n $class_id = $this->uri->segment(4);\r\n $student_id = $this->uri->segment(5);\r\n \r\n $invoice_data = $this->db->select('*')->from('invoice')->where('class_id', $class_id)->where('student_id', $student_id)->get()->result_array();\r\n $num_rows = count($invoice_data);\r\n \r\n if($num_rows > 0){ \r\n foreach($invoice_data as $prev_invoice_info){ }\r\n \r\n $next_payment_data['total_bill_next'] = $prev_invoice_info['due']; \r\n echo json_encode ($next_payment_data);\r\n die;\r\n \r\n }else { \r\n $this->db->select('*')->from('fees_name')->join('fees_setup', 'fees_setup.fees_name_id = fees_name.fees_name_id');\r\n $fee_data = $this->db->where('fees_setup.class_id', $this->uri->segment(4))->get()->result_array();\r\n\r\n echo json_encode ($fee_data);\r\n die;\r\n }\r\n }\r\n \r\n $page_data['page_name'] = 'invoice';\r\n $page_data['page_title'] = get_phrase('Fees Payment');\r\n $this->db->order_by('invoice_id', 'asc');\r\n $page_data['invoices'] = $this->db->get('invoice')->result_array();\r\n //$page_data['invoices'] = $this->crud_model->get_all_invoice();\r\n $this->load->view('index', $page_data);\r\n }", "public function index()\n {\n $id = 2;\n $pos = PurchaseOrder::where('isGenerate','=',0)->get();\n $paids = PurchaseOrder::where('isPayment','=',1)->get();\n $cradits = PurchaseOrder::where('isPayment','=',0)->get();\n return view('admin.invoicePO.index',compact('pos','paids','cradits','id'));\n }", "public function index()\n {\n \t$scheme = Scheme::find(Auth::user()->scheme_id);\n \t$title = \"Invoice page\";\n \treturn view(\"invoice.index\",compact(\"scheme\",\"title\"));\n }", "function XSAInvoicing($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db,$nivelfacturacion=2,$descripcionOT='',$OT=''){\n\t// *********************************************** //\n // ********************************************** //\n // ******** No dejar echo en la funcion *********//\n // ******** Declarar Variables a usar ******** //\n // ******** Afecta al punto de venta ********* //\n // ****************************************** //\n // ***************************************** //\n\t\n $debug_sql = false;\n\t$charelectronic='01'; //Cad 01, pos 0\n\t$charelectronicEmbarque='';\n\t$charelectronic=$charelectronic.'|'.$serie; //Cad 01, pos 1\n\t$serieelect=$serie;\n $pedimento=\"\";\n $subtotalInvoice=0;\n $versionAddenda=0;\n \n if(isset($_GET['versionAddenda'])){\n $versionAddenda = $_GET['versionAddenda'];\n }\n\n if(isset($_POST['versionAddenda'])){\n $versionAddenda = $_POST['versionAddenda'];\n }\n\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n $folioelect=\"\";//$folio;//$InvoiceNoTAG;\n if ($TypeInvoice == 66) {\n \t$folioelect = $folio;\n }\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect; //Cad 01, pos 2\n\t$charelectronic=$charelectronic.'|'.$folioelect; //Cad 01, pos 3\n\t$charelectronictaxsfederal='';\n\t$charelectronictaxslocal='';\n\t$charelectronictaxsret = '';\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$rfccliente = \"\";\n\t$TipoAgrupacionXTag = \"\";\n $branch= \"\";\n $descrestante = \"\";\n\n\tif ($TypeInvoice==11){\n\t\t$tabla='notesorders';\n\t}else{\n\t\t$tabla='salesorders';\n\t}\n\t\n\t$decimalplaces=6;\n\t\n\tif ($_SESSION['DecimalPlacesInvoice']==''){\n\t\t$_SESSION['DecimalPlacesInvoice']=6;\n\t}\n\t$decimalplaces=$_SESSION['DecimalPlacesInvoice'];\n\n\t$arrayBDBombeo = array('erptycqsa','erptycqsa_CAPA','erptycqsa_DES' );\n\t$strFiltroBombeo=\"\";\n\tif(in_array($_SESSION['DatabaseName'], $arrayBDBombeo)){\n\t\tif($TypeInvoice=='66'){\n\t\t\t$strFiltroBombeo=\" AND stockmoves.stockid != 'SB'\";\n\t\t}\n\t\t\n\t}\n\n\t//Agregar datos de CFDI 3.3\n\t$SQLInvoice = \"SELECT replace(debtortrans.trandate,'-','/') as trandate,debtortrans.ovamount,debtortrans.ovdiscount,\n\t\t\tdebtortrans.ovfreight,debtortrans.ovgst,debtortrans.rate as cambio,\n\t\t\tdebtortrans.order_,debtortrans.invtext,\tdebtortrans.consignment,\n\t\t\tdebtortrans.id AS iddocto, debtortrans.type,\n\t\t\tdebtorsmaster.name,debtorsmaster.address1,debtorsmaster.address2,\n\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\tcustbranch.taxid as rfc,paymentterms.terms,salesorders.deliverto,\n\t\t\tsalesorders.deladd1,salesorders.deladd2,salesorders.deladd3,\n\t\t\tsalesorders.deladd4,salesorders.deladd5,salesorders.deladd6,\n\t\t\tsalesorders.customerref,salesorders.orderno,salesorders.orddate,\n\t\t\tlocations.locationname,\tshippers.shippername,custbranch.brname,\n\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\tsalesman.salesmanname,debtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\treplace(origtrandate,'-','/') as origtrandate,debtortrans.currcode,custbranch.branchcode,\n\t\t\tsalesorders.salesman,salesorders.UserRegister,custbranch.phoneno as telofi,\n\t\t\tsalesorders.placa, salesorders.serie,salesorders.kilometraje,salesorders.comments,debtortrans.ref1,\n\t\t\tsalesorders.ordertype,debtortrans.paymentname,debtortrans.nocuenta,\n\t\t\tcustbranch.brnumext, custbranch.brnumint,custbranch.specialinstructions,\n\t\t\ttags.typegroup,debtortrans.id, custbranch.custpais, IFNULL(paymentmethods.codesat,'') as codesat,\n\t\t\tdebtortrans.codesat as cadenacodesat, debtortrans.order_,\n\t\t\tdebtortrans.c_TipoDeComprobante,\n\t\t\tdebtortrans.c_UsoCFDI,\n\t\t\tdebtortrans.c_paymentid,\n\t\t\tdebtortrans.claveFactura,\n\t\t\tcurrencies.decimalplaces,\n\t\t\tcoalesce(log_cancelacion_sustitucion.id,0) as idsustitucion\n\t\tFROM debtortrans\n\t\t\tLEFT JOIN log_cancelacion_sustitucion ON debtortrans.id = log_cancelacion_sustitucion.id\n\t\t\tLEFT JOIN currencies ON currencies.currabrev = debtortrans.currcode\n\t\t\tLEFT JOIN paymentmethods ON debtortrans.paymentname = paymentmethods.paymentname\n\t\t\tleft join shippers on debtortrans.shipvia=shippers.shipper_id \n\t\t\tjoin tags on tags.tagref=debtortrans.tagref,\n\t\t\tdebtorsmaster,custbranch,\".$tabla.\" as salesorders \n\t\t\tleft join salesman on salesorders.salesman=salesman.salesmancode \n\t\t\tleft join locations on salesorders.fromstkloc=locations.loccode ,\n\t\t\tpaymentterms \n\n\t\tWHERE debtortrans.order_ = salesorders.orderno\n\t\t\tAND debtortrans.type='\".$TypeInvoice.\"'\n\t\t\tAND debtortrans.transno='\" . $InvoiceNo . \"'\n\t\t\tAND debtortrans.tagref='\" . $tag . \"'\n\t\t\tAND debtortrans.debtorno=debtorsmaster.debtorno\n\t\t\tAND salesorders.paytermsindicator=paymentterms.termsindicator\n\t\t\tAND debtortrans.debtorno=custbranch.debtorno\n\t\t\tAND debtortrans.branchcode=custbranch.branchcode\";\n\t\n if($_SESSION['UserID'] == \"desarrollo\"){\n echo '<pre> SQLInvoice 1 :<br>'.$SQLInvoice.'<br>';\n\n \t// echo \"<br>SQL XSAInvoicing: <pre>\";\n \t// \tprint_r($SQLInvoice);\n \t// echo \"</pre><br>\";\n\n\t}\n\t//echo '<pre>get > 1 :<br>'.$SQLInvoice.'<br>';\n\t//echo '<pre>get > 1 :<br>'.$SQLInvoice.'<br>';\n\t//echo '<pre>SQL Principal: <br>'.$SQLInvoice;\n\n //debug_sql($SQLInvoice, __LINE__,true,__FILE__);\n\t$Result=DB_query($SQLInvoice,$db);\n\t$blnFacturaAnticipo3_3 = false;\n\t$blnFlagAnticipo3_3 = false;\n\t$strLegendAnticipo=\"\";\n\t$dblImporteDescuentoAnticipo=0;\n\t//$strSearchAnticipo=\"\";\n\t$strSQLAnticipo=\"\";\n\t$queryFacturaAnticipo=\"\";\n\t$montoNotesorders_invoice = 0;\n\t\n\t$categoriaAnticipo=\"ANT\";\n\n\t$strSearchAnticipo=\"\";\n\t$myrow['type'] = \"\";\n\t$myrow['orderno'] = \"\";\n\t$myrow['iddocto'] = \"\";\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t$myrow['type'] = $myrow['type'];\n\t\t$myrow['orderno'] = $myrow['orderno'];\n\t\t$myrow['iddocto'] = $myrow['iddocto'];\n\t\t//impuestos federales\n\t\t$totretencionfederal=0;\n\t\t//$charelectronictaxslocal='|'.chr(13).chr(10);\n\t\tif(isset($_SESSION['ordenaimpuestos']) AND $_SESSION['ordenaimpuestos']==1 ){\n $qry = \"Select debtortranstaxesclient.*, sec_taxes.nametax, sec_taxes.flagimpuestolocal, sec_taxes.c_Impuesto, sec_taxes.c_TipoFactor, sec_taxes.percent\n \t\tfrom debtortranstaxesclient, sec_taxes\n\t\t\t\t\twhere debtortranstaxesclient.idtax = sec_taxes.idtax\n\t\t\t\t\t\tAND sec_taxes.typetax=1 and orden!=0\n\t\t\t\t\t\tand debtortranstaxesclient.iddoc = \".$myrow['id']. \" ORDER BY orden ASC\";\n\t\t}else{\n $qry = \"Select debtortranstaxesclient.*, sec_taxes.nametax, sec_taxes.flagimpuestolocal, sec_taxes.c_Impuesto, sec_taxes.c_TipoFactor, sec_taxes.percent\n \t\tfrom debtortranstaxesclient, sec_taxes\n\t\t\t\t\twhere debtortranstaxesclient.idtax = sec_taxes.idtax\n\t\t\t\t\t\tAND sec_taxes.typetax=1\n\t\t\t\t\t\tand debtortranstaxesclient.iddoc = \".$myrow['id'];\n\t\t}\n \n debug_sql($qry, __LINE__,$debug_sql,__FILE__);\n\t\t$rs = DB_query($qry,$db);//\n\t\t$totalImpuestosLocales=0;\n\t\tif (DB_num_rows($rs) > 0){\n\t\t\t//$charelectronictaxsfederalini='|'.chr(13).chr(10).'06';\n\t\t\twhile ($regs = DB_fetch_array($rs)){\n if($regs['flagimpuestolocal']==0){\n $charelectronictaxsfederal.='|'.chr(13).chr(10).'06'.\"|\".$regs['nametax'].\"|\".$regs['percent'].\"|\".$regs['amount'].\"|\".$regs['flagimpuestolocal'].\"|\".$regs['c_Impuesto'].\"|\".$regs['c_TipoFactor'].\"|\".$regs['percent'];\n\t\t\t\t$totretencionfederal=$totretencionfederal+$regs['amount'];\n }\n if($regs['flagimpuestolocal']==1){\n $charelectronictaxsfederal.='|'.chr(13).chr(10).'08'.\"|\".$regs['nametax'].\"|\".$regs['percent'].\"|\".$regs['amount'].\"|\".$regs['flagimpuestolocal'].\"|\".$regs['c_Impuesto'].\"|\".$regs['c_TipoFactor'].\"|\".$regs['percent'];\n\t\t\t\t$totretencionfederal=$totretencionfederal+$regs['amount'];\n }\n\t\t\t}\n\t\t}\n\n\t\t//impuestos locales\n\t\t$totalretencionlocal=0;\n\t\t//$charelectronictaxslocal='|'.chr(13).chr(10);\n\t\t$qry = \"Select debtortranstaxesclient.*, sec_taxes.nametax, sec_taxes.flagimpuestolocal, sec_taxes.c_Impuesto, sec_taxes.c_TipoFactor, sec_taxes.percent\n\t\t\t\tfrom debtortranstaxesclient, sec_taxes\n\t\t\t\twhere debtortranstaxesclient.idtax = sec_taxes.idtax\n\t\t\t\tAND sec_taxes.typetax=2\n\t\t\t\tand debtortranstaxesclient.iddoc = \".$myrow['id'];\n\t\tdebug_sql($qry, __LINE__,$debug_sql,__FILE__);\n\t\t$rs = DB_query($qry,$db);\n\t\t$totalImpuestosLocales=0;\n\t\tif (DB_num_rows($rs) > 0){\n\t\t\t$charelectronictaxslocal='08';\n\t\t\twhile ($regs = DB_fetch_array($rs)){\n\t\t\t\t$charelectronictaxslocal.=\"|\".$regs['nametax'].\"|\".$regs['percent'].\"|\".$regs['amount'].\"|\".$regs['flagimpuestolocal'].\"|\".$regs['c_Impuesto'].\"|\".$regs['c_TipoFactor'].\"|\".$regs['percent'];\n\t\t\t\t$totalretencionlocal=$totalretencionlocal+$regs['amount'];\n\t\t\t}\n\t\t\t$charelectronictaxslocal.=chr(13).chr(10);\n\t\t}\n\n\t\t$totalretencion=$totretencionfederal+$totalretencionlocal;\n\t\t//Tipo agrupacion\n\t\t$TipoAgrupacionXTag=$myrow['typegroup'];\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t\n\t\tif($myrow['idsustitucion'] > 0){\n\t\t\t//Para las factuas de sustitucion que tome la fecha actual\n\t\t\t\n\t\t\t$fechainvoice = date('Y/m/d h:i:s');\n\t\t}\n\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice; //Cad 01, pos 4\n\n\t\t/********\n\t\t$metodoPago = $myrow['paymentname'];\n\t\tif ($metodoPago==\"\")\n\t\t\t$metodoPago = \"No Identificado\";\n\t\t*/\n\t\t\n\t\t$metodoPago = \"\";\n\n\t\tif (trim($myrow['cadenacodesat'] != \"\")) {\n\t\t\t$metodoPago = $myrow['cadenacodesat'];\n\n\t\t\t$metodosDePagos = explode(\",\", $myrow['cadenacodesat']);\n\t\t\t$metodoPago=$metodosDePagos[0];\n\t\t}else{\n\t\t\t$metodoPago = $myrow['codesat'];\n\t\t\n\t\t\tif($metodoPago == \"\") {\n\t\t\t\t$metodoPago = \"99\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\")\n\t\t\t$nocuenta = \"No Identificado\";\n\t\n\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= number_format($myrow['ovamount'], $decimalplaces, '.', '');\n\t\t$subtotalInvoice = $subtotal;\n\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], $decimalplaces, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], $decimalplaces, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}\n\n\t\t$charelectronic=$charelectronic.'|'.$subtotal; //Cad 01, pos 5\n\t\t\n\t\t// total factura\n\t\t$decimalplacesuno=6;\n\t\tif($TypeInvoice==66 or $TypeInvoice==10 or $TypeInvoice==110){\n\t\t\t$decimalplacesuno=4;\n\t\t}\n\t\t$total= number_format($myrow['ovamount']+$myrow['ovgst']+$totalretencion,$decimalplaces,'.','');\n $total= number_format(round($myrow['ovamount'],2) + round($myrow['ovgst'],2) + round($totalretencion, 2), $decimalplaces, '.', '');\n\t\t\n\t\tif($TypeInvoice=='11'){\n\t\t\t$total = abs($total);\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$total; //Cad 01, pos 6\n\t\t// total de iva\n\t\t$iva=number_format($myrow['ovgst'],$decimalplaces,'.','');\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva; //Cad 01, pos 7\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret; //Cad 01, pos 8\n\n\t\t//descuento trae desde el stockmoves\n\t\tif ($rfccliente!=\"XEXX010101000\" OR $_SESSION['DesgloseIVA']==1){\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento) as descuento\n\t\t\t\t FROM stockmoves\n\t\t\t\t WHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=\"' . $tag . '\"\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n debug_sql($sqldiscount, __LINE__,$debug_sql,__FILE__);\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],$decimalplaces,'.','');\n\t\t\t}\n\t\t}else{\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento+(IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*totaldescuento)) as descuento\n\t\t\t \t\t\tFROM stockmoves inner join stockmaster on stockmaster.stockid=stockmoves.stockid\n\t\t\t\t\t\t\t-- LEFT JOIN taxauthrates ON stockmaster.taxcatid = taxauthrates.taxcatid\n\t\t\t\t\t\t\tLEFT JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\t\t\n\t\t\t\t\t \t\tWHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\t\t\t\tAND stockmoves.tagref=\"' . $tag . '\"\n\t\t\t\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n debug_sql($sqldiscount, __LINE__,$debug_sql,__FILE__);\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\t\n\t\t}\n\n\t\t$descuento=number_format($descuento,$decimalplaces,'.','');\n\n\t\t\n\n\t\t// if($_SESSION['DatabaseName'] == \"erppisumma\" or $_SESSION['DatabaseName'] == \"erppisumma_CAPA\" or $_SESSION['DatabaseName'] == \"erppisumma_DES\"){\n\t\t// \t$categoriaAnticipo=\"AN1\";\n\t\t// }\n\n\t\tif ($_SESSION['FacturaVersion'] == \"3.3\") {\n\t\t\t//Obtener si es una factura de anticipo\n\t\t\t$queryFacturaAnticipo=\"SELECT debtortrans.id,debtortrans.folio\t\t\t\t\n\t\t\t\t\t\t\t\t FROM stockmaster \n\t\t\t\t\t\t\t\t\t\tINNER JOIN stockmoves on stockmoves.stockid=stockmaster.stockid \n\t\t\t\t\t\t\t\t\t\tINNER JOIN debtortrans ON debtortrans.type=stockmoves.type and debtortrans.transno=stockmoves.transno\n\t\t\t\t\t\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\t\t\t\t\t\tSELECT ca1.transid_allocto, (sum(amt)/1.16) as monto\n\t\t\t\t\t\t\t\t\t\t\tFROM debtortrans dt1 \n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN debtorsmaster dm ON dt1.debtorno = dm.debtorno \n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN custallocns ca1 ON dt1.id = ca1.transid_allocfrom \n\t\t\t\t\t\t\t\t\t\t\t\tWHERE dt1.id='\".$myrow['id'].\"'\n\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY ca1.transid_allocto\n\t\t\t\t\t\t\t\t\t\t) as x ON debtortrans.id = x.transid_allocto\n\t\t\t\t\t\t\t\t\tWHERE stockmaster.flagadvance=1 AND stockmoves.qty<0\n\t\t\t\t\t\t\t\t\t\tAND (\n\t\t\t\t\t\t\t\t\t\t\t(debtortrans.invtext NOT LIKE '%cancel%')\n\t\t\t\t\t\t\t\t\t\t\tor (debtortrans.invtext LIKE '%cancel%' and debtortrans.ovamount <> 0)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\tAND\tdebtortrans.id='\".$myrow['id'].\"';\";\n \t\tif($_SESSION['UserID'] == \"desarrollo\"){\n \t\t\t//echo \"<br>sql ANTICIPO1: \".$queryFacturaAnticipo;\n \t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$resultFacturaAnticipo = DB_query($queryFacturaAnticipo,$db);\n\n\t\t\tif(DB_num_rows($resultFacturaAnticipo)<=0){\n\t\t\t\tif($_SESSION['DatabaseName'] == \"erpgruposii\" or $_SESSION['DatabaseName'] == \"erpgruposii_CAPA\" or $_SESSION['DatabaseName'] == \"erpgruposii_DES\"){\n\t\t\t\t\t$strSearchAnticipo=\" AND stockmaster.categoryid != 55\";\n\t\t\t\t\t$categoriaAnticipo=\"55\";\n\t\t\t\t}else{\n\t\t\t\t\t// if($_SESSION['DatabaseName'] == \"erppisumma\" or $_SESSION['DatabaseName'] == \"erppisumma_CAPA\" or $_SESSION['DatabaseName'] == \"erppisumma_DES\"){\n\t\t\t\t\t// \t$strSearchAnticipo=\" AND stockmaster.categoryid != 'AN1'\";\n\t\t\t\t\t// \t$categoriaAnticipo=\"AN1\";\n\t\t\t\t\t// }else{\n\t\t\t\t\t// \t$strSearchAnticipo=\" AND stockmaster.categoryid != 'ANT'\";\n\t\t\t\t\t// }\n\t\t\t\t\t$strSearchAnticipo=\" AND stockmaster.categoryid != 'ANT'\";\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//$strLegendAnticipo=\"'CFDI por remanente de un anticipo'\";\n\t\t\t}else{\n\t\t\t\t$blnFacturaAnticipo3_3 = true;\n\n\t\t\t}\n\n\t\t\tif($TypeInvoice == 11 OR $TypeInvoice=='119'){\n\t\t\t\t$strSearchAnticipo=\"\";\n\t\t\t\t$categoriaAnticipo=\"\";\n\t\t\t\t$blnFacturaAnticipo3_3 = true;\n\t\t\t}\n\t\t\t//blnFacturaAnticipo3_3 ES UNA FACTURA DE REMISION O NO LO ES\n\t\t\tif (!$blnFacturaAnticipo3_3) {\n\t\t\t\t$strSQLAnticipo=\"SELECT stockmoves.transno,\n\t\t\t \t\t\tstockmoves.type,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)) AS subtotal,\n\t\t\t\t\t\tsum(stockmoves.price) AS fxprice\n\t\t\t\t\tFROM stockmoves\n\t\t\t\t\tINNER JOIN stockmaster on stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type=\".$TypeInvoice.\"\n\t\t\t\t\tAND stockmoves.transno=\". $InvoiceNo .\"\n\t\t\t\t\tAND stockmoves.tagref='\". $tag .\"'\n\t\t\t\t\tAND stockmaster.categoryid='\". $categoriaAnticipo .\"'\n\t\t\t\t\tAND stockmaster.units ='Actividad'\n\t\t\t\t\tAND (stockmoves.show_on_inv_crds=1 or stockmoves.stockid ='facturaremision')\n\t\t\t\t\tGROUP BY stockmoves.transno,stockmoves.type,stockmoves.tagref;\";\n\t\t\t\t\tif($_SESSION['UserID']==\"desarrollo\"){\n\t\t\t\t\t\techo \"<br>sql ANTICIPO: \".$strSQLAnticipo;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$resultAnticipo=DB_query($strSQLAnticipo,$db);\n\t\t\t\tif (DB_num_rows($resultAnticipo)>0) {\n\t\t\t\t\t$blnFlagAnticipo3_3 = true;\n\t\t\t\t\t$strLegendAnticipo=\"CFDI por remanente de un anticipo\";\n\t\t\t\t\t$myRowAnticipo=DB_fetch_array($resultAnticipo);\n\t\t\t\t\t$dblImporteDescuentoAnticipo=$myRowAnticipo['subtotal'];\n\t\t\t\t\t$dblImporteDescuentoAnticipo=abs($dblImporteDescuentoAnticipo);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//**** SE COMENTA POR QUE ESTA DUPLICANDO DESCUENTO ***************\n\t\t\t// if($TypeInvoice==66){\n\t\t\t// \t$queryCFDI=\"SELECT SUM(monto) as m\n\t\t\t// \t\t\t\tFROM notesorders_invoice \n\t\t\t// \t\t\t\tLEFT JOIN debtortrans on notesorders_invoice.transid_relacion = debtortrans.id\n\t\t\t// \t\t\t\tWHERE notesorders_invoice.transid = '\".$myrow['id'].\"'\";\n\t\t\t// \t// echo \"<br>QuerySql; <pre>\";\n\t\t\t// \t// \tprint_r($queryCFDI);\n\t\t\t// \t// echo \"</pre><br>\";\n\t\t\t// \t$resultCFDI=DB_query($queryCFDI,$db);\n\t\t\t// \t$myrowCFDI = DB_fetch_array($resultCFDI);\n\t\t\t// \t$dblImporteDescuentoAnticipo += $myrowCFDI['m'];\n\t\t\t// \t$blnFlagAnticipo3_3 = true;\n\t\t\t// \t$blnFacturaAnticipo3_3 = true;\n\t\t\t// \t//echo \"<br>Monto; \".$dblImporteDescuentoAnticipo;\n\t\t\t// }\n\t\t\t\t//<ANTICIPOS/>\n\t\t\t//blnFlagAnticipo3_3 ES UNA APLICACION DE ANTYICIPO\n\t\t\tif($blnFlagAnticipo3_3){\n\t\t\t\t$charelectronic=$charelectronic.'|'.($descuento + $dblImporteDescuentoAnticipo ) ; //Cad 01, pos 9\n\t\t\t}else{\n\t\t\t\t$charelectronic=$charelectronic.'|'.$descuento ; //Cad 01, pos 9\n\t\t\t}\n\t\t}else{\n\t\t\t$charelectronic=$charelectronic.'|'.$descuento ; //Cad 01, pos 9\n\t\t}\n\t\t\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|'; //Cad 01, pos 10\n\t\t// tipo de moneda\n\t\t$moneda=$myrow['currcode'];\n\t\t// CANTIDAD CON LETRAS\n\t\t$totaletras=($myrow['ovamount']+$myrow['ovgst'])+$totalretencion;\n\t\t/*$decimalplacesuno=4;\n\t\tif($totaletras<0 and ($TypeInvoice==66 or $TypeInvoice==10 or $TypeInvoice==110)){\n\t\t\t$decimalplacesuno=2;\n\t\t}\n\t\t//$totalx=str_replace(',','',number_format($totaletras,$decimalplacesuno,'.',''));\n\t\t//$totalx = str_replace(',','',$total);\n\t\t$separa2=explode(\".\",$totalx,4);\n\t\t//$separa=explode(\".\",$totalx);//////\n\t\t$montoletra = $separa[0];\n\t\t$separa2=explode(\".\",number_format($totalx2,$decimalplacesuno));\n\t\t\n\t\tif($totaletras<0 and ($TypeInvoice==66 or $TypeInvoice==10 or $TypeInvoice==110)){\n\t\t\t$montoctvs2=\"0.00\";\n\t\t}else{\n\t\t\t$montoctvs2 = $separa2[1];\n\t\t}\n\t\t\n\t\t//$montoletra = Numbers_Words::toWords($montoletra,'es');\n\t\t//$montocentavos=$montoctvs2;\n\t\t$montoletra=Numbers_Words::toWords($montoletra,'es');\n\t\t//$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\tif ($moneda=='MXN'){\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\" /100 M.N.\";\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/100 USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;*/\n\t\t$totalx=str_replace(',','',$total);\n\t\t\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\t\t//\n\t\t//$separa2=explode(\".\",$totalx);//\n if(isset($_SESSION['DecimalPlacesLetra']) and $_SESSION['DecimalPlacesLetra'] <> \"\"){\n $montoctvs2 = substr($separa[1], 0,$_SESSION['DecimalPlacesLetra']);\n }else{\n $montoctvs2 = substr($separa[1], 0,6);\n }\n\t\t\n\t\t//$montoctvs2 = $separa[1];//\n \n\t\t$montoletra = Numbers_Words::toWords($montoletra,'es');\n\t\t//$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\tif ($moneda=='MXN'){\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\" /100 M.N.\";\n\t\t}elseif ($moneda=='EUR'){\n\t\t\t$montoletra=ucwords($montoletra) . \" Euros \". $montoctvs2 .\" /100 EUR\";\n\t\t}else{\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/100 USD\";\n\t\t}\n\n\t\t$charelectronic=$charelectronic.'|'.$montoletra; //Cad 01, pos 11\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda; //Cad 01, pos 12\n\t\t// tipo de cambio\n\t\t$rate=number_format((1/$myrow['cambio']),$decimalplaces,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref; //Cad 01, pos 13\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1; //Cad 01, pos 14\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription,t.legalid\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n // $legal = DB_fetch_array($Result);\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2; //Cad 01, pos 15\n\t\t// observaciones 3\n\t\t$comments=$comments.' Cuenta de Referencia: '.$myrow['ref1'];\n\t\t$observaciones3='Id Factura:'.$InvoiceNo. '. La tenencia de esta factura no acredita su pago si no se justifica con el comprobante respectivo. '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3; //Cad 01, pos 16\n\t\t// informacionExtra\n\t\t$infoextra=\"\";\n\t\t$numpago=0;\n\t\t$cadenapagares=\"\";\n\t\tif ($TypeInvoice==11){\n\t\t\t$tipodoc=0;\n\t\t}else{\n\t\t\t$tipodoc=70;\n\t\t}\n\t\t\n\t\t$SQL=\" SELECT trandate,case when ovamount<0 then (ovamount+ovgst)*-1 else ovamount+ovgst end as monto\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=\".$tipodoc.\"\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)>0) {\n\t\t\twhile ($myrowpagos=DB_fetch_array($Result)){\n\t\t\t\t$numpago=$numpago+1;\n\t\t\t\t$fechapago=ConvertSQLDate($myrowpagos['trandate']);\n\t\t\t\t$montopago=$myrowpagos['monto'];\n\t\t\t\t$montopago=number_format($montopago,$decimalplaces,'.','');\n\t\t\t\t$cadenapagares=$cadenapagares.\" No:\".$numpago.\" Fecha: \".$fechapago.\" Monto: \".$montopago .' '.$moneda;\n\t\t\t}\n\t\t}\n\t\t$placa= $_SESSION['LabelText1'].' : '.$myrow['placa'];\n\t\t$serie=$_SESSION['LabelText3'].' : '.$myrow['serie'];\n\t\t$kilometraje=$_SESSION['LabelText2'].' : '.$myrow['kilometraje'];\n\t\t$comments1=' Extra: '.$myrow['comments'];\n\t\t$infoextra=$placa.' '.$serie.' '.$kilometraje.' '.$comments1.' Pagares: '. $cadenapagares;\n\n\n\t\t$charelectronic=$charelectronic.'|'.$infoextra; //Cad 01, pos 17\n\n\t\t//cometarios nivel factura\n\t\t$charelectronic=$charelectronic.'|'.$myrow['invtext']; //Cad 01, pos 18\n\n\t\t//Agregar datos de CFDI 3.3\n\t\t$charelectronic=$charelectronic.'|'.$myrow['c_TipoDeComprobante']; // TipoDeComprobante //Cad 01, pos 20\n\t\t$charelectronic=$charelectronic.'|'.$myrow['c_UsoCFDI']; // UsoCFDI //Cad 01, pos 21\n\t\t$charelectronic=$charelectronic.'|'.$myrow['c_paymentid']; // MetodoPago //Cad 01, pos 22\n\t\t$charelectronic=$charelectronic.'|'.$myrow['claveFactura']; // Confirmacion //Cad 01, pos 23\n\t\t$charelectronic=$charelectronic.'|'.$myrow['decimalplaces']; // decimalplaces //Cad 01, pos 24\n\n\t\t// datos de la forma de pago\n\t\t//$charelectronic=$charelectronic.$charelectronicdetailUUID;\n\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT count(*) as pagares\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$myrowpag = DB_fetch_array($Result);\n\t\t\t$numpagares=intval($myrowpag['pagares']);\n\t\t\tif ($numpagares<=1){\n\t\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t\t}else{\n\t\t\t\t$Tipopago=\"Parcialidades\";\n\t\t\t}\n\t\t}\n\n\t\tif ($TypeInvoice==11){\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}\n\t\t\n\t\t$Tipopago=$Tipopago;//.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|'.$terminospago;\n\t\t// metodo de pago\n\t\t$metodopago=$metodoPago;\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4 (no de cuenta)\n\t\t$observaciones4=$nocuenta;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\n\t\t//DATOS DE ANTICIPO\n\t\t$strSQLNotaCredito=\"\";\n\t\t$resultNotaCredito=\"\";\n\t\t//echo \"facturaversion:\".$_SESSION['FacturaVersion'];\n\t\tif ($_SESSION['FacturaVersion'] == \"3.3\") {\n\t\t\t//<ANTICIPOS>\n\t\t\t//Si no es una factura de anticipo obtenemos uuid relacionados(donde se esta aplicando)\n\t\t\t//\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br> Si no es una factura de anticipo obtenemos uuid relacionados(donde se esta aplicando)\";\n echo \"<br/>blnFacturaAnticipo3_3: \".$blnFacturaAnticipo3_3;\n echo \"<br/>TypeInvoice: \".$TypeInvoice;\n }\n $charRelacion = \"\";\n\t\t\tif (!$blnFacturaAnticipo3_3 and $TypeInvoice!=66) {\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br>iNGRESO 1\";\n }\n\t\t\t\t//$blnFlagAnticipo3_3 = true;\t\t\n\t\t\t\t/*DB_data_seek($resultAnticipo,0);\n\t\t\t\t$myRowAnticipo=DB_fetch_array($resultAnticipo);\n\t\t\t\t$dblImporteDescuentoAnticipo=$myRowAnticipo['subtotal'];\n\t\t\t\t$dblImporteDescuentoAnticipo=abs($dblImporteDescuentoAnticipo);*/\n\n $strSQLUUID = \" SELECT UUID FROM log_cancelacion_sustitucion WHERE transNo='\".$InvoiceNo.\"' AND type ='\".$TypeInvoice.\"'\";\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br> SQL sustitucion: \".$strSQLUUID;\n }\n $resultSQLUUID=DB_query($strSQLUUID,$db);\n if(DB_num_rows($resultSQLUUID)>0){\n while ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n $charelectronic=$charelectronic.'|'.chr(13).chr(10).'011';\n $charelectronic=$charelectronic.'|04|'.$myrowUUID['UUID'];\n }\n\n }else{\n $strSQLUUID=\"SELECT debtortrans.uuid\n FROM stockmoves\n INNER JOIN (SELECT stockmoves.stkmovid\n FROM stockmoves\n INNER JOIN debtortrans on stockmoves.type = debtortrans.type and stockmoves.transno = debtortrans.transno and stockmoves.tagref = debtortrans.tagref\n inner join stockmaster on stockmoves.stockid = stockmaster.stockid\n AND stockmoves.type=\". $TypeInvoice .\"\n AND stockmoves.transno=\". $InvoiceNo .\"\n AND stockmoves.tagref=\". $tag .\"\n AND stockmaster.categoryid='\". $categoriaAnticipo .\"'\n AND stockmaster.units ='Actividad'\n AND (stockmoves.show_on_inv_crds=1 or stockmoves.stockid ='facturaremision')) dtstkmovid on stockmoves.stkmoveno = dtstkmovid.stkmovid\n INNER JOIN debtortrans on stockmoves.type = debtortrans.type and stockmoves.transno = debtortrans.transno and stockmoves.tagref = debtortrans.tagref ;\";\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br><br><pre>: ANTICIPOS\".$strSQLUUID.\"<br>\";\n }\n //********************** NUEVA CONSULTA PARA LOS ANTICIPOS **************************\n $strSQLUUID = \"SELECT DISTINCT debtortrans.folio, debtortrans.transno, debtortrans.type, transidanticipo, d.ref1 , (SELECT uuid FROM debtortrans d1 WHERE d1.id = d.ref1) AS uuid\n FROM salesinvoiceadvance \n INNER JOIN debtortrans ON debtortrans.id = salesinvoiceadvance.transidinvoice\n INNER JOIN debtortrans d ON d.id = salesinvoiceadvance.transidanticipo\n WHERE debtortrans.type = \". $TypeInvoice .\"\n AND debtortrans.transno = '\". $InvoiceNo .\"';\";\n\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br><br><pre>: ANTICIPOS2: \".$strSQLUUID.\"<br>\";\n }\n //********************** NUEVA CONSULTA PARA LOS ANTICIPOS **************************\n \n $resultSQLUUID=DB_query($strSQLUUID,$db);\n while ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n $charelectronic=$charelectronic.'|'.chr(13).chr(10).'011';\n $charelectronic=$charelectronic.'|07|'.$myrowUUID['uuid'];\n \n }\n }\n\n\t\t\t}\n if($blnFacturaAnticipo3_3==true and $TypeInvoice!=66) {\n $strSQLUUID = \" SELECT UUID FROM log_cancelacion_sustitucion WHERE transNo='\".$InvoiceNo.\"' AND type ='\".$TypeInvoice.\"'\";\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br> SQL sustitucion FLAGADVANCE: \".$strSQLUUID;\n }\n $resultSQLUUID=DB_query($strSQLUUID,$db);\n while ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n $charelectronic=$charelectronic.'|'.chr(13).chr(10).'011';\n $charelectronic=$charelectronic.'|04|'.$myrowUUID['UUID'];\n }\n }\n\n\t\t\tif(isset($TypeInvoice) and $TypeInvoice==66){\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br>iNGRESO 2\";\n }\n\n $strSQLUUID = \" SELECT UUID FROM log_cancelacion_sustitucion WHERE transNo='\".$InvoiceNo.\"' AND type ='\".$TypeInvoice.\"'\";\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br> SQL sustitucion: \".$strSQLUUID;\n }\n $resultSQLUUID=DB_query($strSQLUUID,$db);\n if(DB_num_rows($resultSQLUUID)>0){\n\t\t\t\t\twhile ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n \t\t\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'011';\n \t\t\t\t\t$charelectronic=$charelectronic.'|04|'.$myrowUUID['UUID'];\n \t\t\t\t\t\n \t\t\t\t}\n }else{\n $queryCFDI=\"SELECT '07' as c_TipoRelacion,debtortrans.uuid\n FROM notesorders_invoice \n LEFT JOIN debtortrans ON notesorders_invoice.transid_relacion = debtortrans.id\n WHERE notesorders_invoice.transid = '\".$myrow['id'].\"'\";\n $queryCFDI = \"SELECT DISTINCT '07' as c_TipoRelacion, debtortrans.folio, debtortrans.transno, debtortrans.type, transidanticipo, d.ref1 , (SELECT uuid FROM debtortrans d1 WHERE d1.id = d.ref1) AS uuid\n FROM salesinvoiceadvance \n INNER JOIN debtortrans ON debtortrans.id = salesinvoiceadvance.transidinvoice\n INNER JOIN debtortrans d ON d.id = salesinvoiceadvance.transidanticipo\n WHERE debtortrans.type = \". $TypeInvoice .\"\n AND debtortrans.transno = '\". $InvoiceNo .\"';\";\n $resultCFDI=DB_query($queryCFDI,$db);\n //echo \"<pre>sql:\".$queryCFDI;\n while ($myrowCFDI = DB_fetch_array($resultCFDI)) {\n $charelectronic=$charelectronic.'|'.chr(13).chr(10).'011';\n $charelectronic=$charelectronic.'|'.$myrowCFDI['c_TipoRelacion'];\n $charelectronic=$charelectronic.'|'.$myrowCFDI['uuid'];\n }\n\n }\n\t\t\t}\n\n\n\t\t\t//<ANTICIPOS/>\n\n\t\t\t//<NOTACREDITO>\n\t\t\t//echo \"<br>ver: \".$TypeInvoice;\n\t\t\tif(isset($TypeInvoice) and $TypeInvoice==11 ){\n\t\t\t\t$strSQLNotaCredito=\"SELECT debtortrans.id,debtortrans.uuid,'03' AS c_TipoRelacion\n\t\t\t\t\tFROM notesorderdetails\n\t\t\t\t\tLEFT JOIN debtortrans ON notesorderdetails.transid_invoice = debtortrans.id\n\t\t\t\t\tWHERE notesorderdetails.orderno = \".$myrow['order_'].\"\n\t\t\t\t\tGROUP BY debtortrans.id\n\t\t\t\t\tORDER BY debtortrans.id \";\n\t\t\t\t\n\t\t\t\t$resultNotaCredito=DB_query($strSQLNotaCredito,$db);\n\t\t\t\twhile ($myrowNCUUID=DB_fetch_array($resultNotaCredito)) {\n\t\t\t\t\t//validar si tiene relacion\n\t\t\t\t\t//if(isset($myrowNCUUID['uuid'])){\n\t\t\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'012';\n\t\t\t\t\t$charelectronic=$charelectronic.'|'.$myrowNCUUID['c_TipoRelacion'].'|'.$myrowNCUUID['uuid'];\n\t\t\t\t\t\n\t\t\t\t\t//}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//<NOTACREDITO/>\n\n\n\t\t}\n\t\t//$dblImporteDescuentoAnticipo=$descuento + $dblImporteDescuentoAnticipo;\n\t\t$subtotalInvoice = $subtotalInvoice + $dblImporteDescuentoAnticipo + $montoNotesorders_invoice;\n\t\t$charelectronicdetailUUID='';\n\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\t// if (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t// $pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))); //\"Mexico\";//$myrow['name'];\n\t\t//\t\t}else{\n\t\t// $pais=\"Mexico\";\n\t\t//\t\t} \n $pais= $myrow[\"custpais\"];\n if (empty($myrow[\"custpais\"])){\n $pais= \"Mexico\";\n } \n \n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t//$colonia=$myrow['address2'];\n\t\t\t$colonia=$myrow['braddress6'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$referenciacalle=$myrow['telofi'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t//\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t//\t\t}else{\n\t\t//\t\t\t$pais=\"Mexico\";\n\t\t//\t\t}\n \n $pais= $myrow[\"custpais\"];\n if (empty($myrow[\"custpais\"])){\n $pais= \"Mexico\";\n } \n \n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t\n\t\t//$colonia=$myrow['braddress6'];\n $colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t//$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t\n\t\t\n\t\t$charelectronicEmbarque='|'.chr(13).chr(10).'09';\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['specialinstructions'];\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr1'];//calle\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//noext\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//no int\n\t\t\n\t\t/*charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr2'];//colonia\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr3'];//municipio\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr4'];//cp\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr5'];//estado\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr6'];//pais*/\n \n $charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr6'];//colonia\n $charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr2'];//municipio\n $charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr3'];//cp\n $charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr4'];//estado\n //$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['custpais'];//pais\n \n if (!empty($myrow['brpostaddr7'])){\n $charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr7'];\n } else {\n $charelectronicEmbarque=$charelectronicEmbarque.'|0';\n }\n\t}\n\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\n\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n debug_sql($descripcionOT, __LINE__,false,__FILE__,'blue');\n debug_sql($nivelfacturacion, __LINE__,false,__FILE__,'blue');\n debug_sql($OT, __LINE__,false,__FILE__,'blue');\n\n\n // validar si existen las tablas de activos\n $consulta_col= \"SHOW TABLES LIKE '%leasingCharges%'\";\n $resultado_col= DB_query($consulta_col, $db);\n $cols_activo= \"\";\n $joins_activo= \"\";\n $usaactivos= false;\n \n if (DB_fetch_array($resultado_col)){\n\t\t$usaactivos= true;\n\n\t\tif(($versionAddenda == 2 ) AND ($_SESSION['DatabaseName'] == 'erppisumma' OR $_SESSION['DatabaseName'] == 'erppisumma_CAPA' OR $_SESSION['DatabaseName'] == 'erppisumma_DES' ) ){\n\n\t\t\t$addendaLowes = \"LEFT JOIN stockaddendahomedepot ON stockaddendahomedepot.stockid = stockmoves.stockid AND stockaddendahomedepot.addendaid = 2 \";\n\t\t\t$upc = \",stockaddendahomedepot.upc_ean \";\n\t\t}else{\n\t\t\t$upc = \"\";\n\t\t\t$addendaLowes = \"\";\n\t\t}\n\n $cols_activo= \", leasingCharges.barcode,\n \t\t\t\tleasingCharges.serialno,\n fixedassets.description AS desc_activo,\n CASE WHEN leasingCharges.hours IS NULL OR leasingCharges.hours= 0 THEN leasingCharges.days ELSE leasingCharges.hours END cantidad_activo,\n CASE WHEN leasingCharges.hours IS NULL OR leasingCharges.hours= 0 THEN 'Dias' ELSE 'Horas' END unidad_activo \".$upc;\n\t\t\n\t\t$joins_activo .= \" LEFT JOIN leasingCharges ON stockmoves.ref2 = leasingCharges.idleasincharges \";\n\t\t$joins_activo .= $addendaLowes;\n $joins_activo .= \"LEFT JOIN fixedassets ON leasingCharges.serialno = fixedassets.serialno AND leasingCharges.barcode= fixedassets.barcode \";\n\t}\n\t\n\n $totalRowAnticipo=0;\n //\n if($_SESSION['UserID'] ==\"desarrollo\"){\n \t//echo \"<br>\".$rfccliente .\" \".$_SESSION['DesgloseIVA'];\n }\n //Se cambio el RFC ya que tenia el generico local como generico extranjero\n\tif ($rfccliente!=\"XEXX010101000\" OR $_SESSION['DesgloseIVA']==1){\n\t\tif($TipoAgrupacionXTag==1 and $TypeInvoice <> 111){\n\t\t\t$sqldetails = 'SELECT distinct stockmoves.stkmoveno,\n\t\t\t\n\t\t\t\t\t\t-- stockmoves.stockid,\n\t\t\t\t\t ProdLine.prodLineId as stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\t-- stockmaster.description,\n\t\t\t\t\t\tProdLine.Description as description,\n\t\t\t\t\t\t/*stockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,*/\n\t\t\t\t\t\t0 as serialised,\n\t\t\t\t\t\t0 as controlled,\n\t\t\t\t\t\tsum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxnet,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)-totaldescuento)/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as subtotal,\n\t\t\t\t\t\t-- sum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)/case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tsum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV,\n\t\t\t\t\tsum(stockmoves.totaldescuento) as totaldescuento,\n\t\t\t\t\tstockmoves.ref4 as movorderline,\n\t\t\t\t\tstockmaster.flagadvance,\n\t\t\t\t\tstockmoves.ref2 ' . $cols_activo . '\n\t\t\t\tFROM stockmoves ' . $joins_activo . ',stockmaster,stockcategory \n\t\t\t\t\t \tINNER JOIN ProdLine ON ProdLine.prodLineId=stockcategory.prodLineId\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid ' . $strFiltroBombeo .'\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=\"' . $tag .'\" '. $strSearchAnticipo . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\tGROUP BY ProdLine.Description,ProdLine.prodLineId';\n\t\t}else{//\n\t\t\t// echo '<br>START<br>';\n\t\t\t$sqldetails = 'SELECT distinct stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.longdescription,\n\t\t\t\t\t\tstockmaster.mbflag,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV,\n\t\t\t\t\t\tstockmoves.totaldescuento,\n\t\t\t\t\t\tstockmaster.flagadvance,\n\t\t\t\t\t\tstockmoves.ref4 as movorderline,stockmoves.anticipo, stockmoves.ref2 ' . $cols_activo . '\n\t\t\t\tFROM stockmoves' . $joins_activo . ',stockmaster,stockcategory\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid ' . $strFiltroBombeo .'\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=\"' . $tag .'\" '. $strSearchAnticipo . '\n\t\t\t\t\tAND (stockmoves.show_on_inv_crds=1 or stockmoves.stockid =\"facturaremision\")\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t';\n\t\t}\n\n\t\tif ($_SESSION['UserID'] == \"desarrollo\") {\n\t\t\techo \"<pre>sqldetails: 29147 \".$sqldetails;\n\t\t}\n\t\t\n\t\tdebug_sql($sqldetails, __LINE__,$debug_sql,__FILE__);\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\tif($TypeInvoice == 11){\n \t$sqlAnt =\" SELECT abs(sum(qty* price)) totalAnt FROM stockmoves WHERE type = 11 AND transno = '\".$InvoiceNo.\"' AND qty<0 \";\n\n \t//echo \"SQL: \".$sql;\n \t$ResultAnt = DB_query($sqlAnt, $db);\n \tif(DB_num_rows($ResultAnt)>0){\n \t\t$blnFlagAnticipo3_3 = true;\n \t\t$rowAnt = DB_fetch_array($ResultAnt);\n \t\t$dblImporteDescuentoAnticipo = $rowAnt['totalAnt'];\n \t}\n \t\n }\n\t\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\tif(($TypeInvoice == '11' AND $myrow2['quantity'] >0) OR $TypeInvoice != '11'){// PARA NOTAS DE CREDITO CON ANT PROVISIONAL\n\n\t\t\t$stockid = \"\";\n\t\t\t$stockcantidad = 0;\n\t\t\t$stockcantidadCompleta = 0;\n\t\t\t$stocknegativo = 0; //obtener si es negativo para precio\n $movorderlineno = $myrow2['movorderline'];\n\n //echo \"<br>\".$subtotal. \" * \". $dblImporteDescuentoAnticipo . \" / \".$subtotalInvoice;\n //echo \"<br>\".$myrow2['subtotal']. \" * \". $dblImporteDescuentoAnticipo . \" / \".$subtotalInvoice;\n //dblImporteDescuentoAnticipo saber cuanto sobro de anticipo\n //PROVISIONAL PARA NOTAS DE CREDITO\n \n //PROVISIONAL PARA NOTAS DE CREDITO\n if($_SESSION['FacturaVersion'] == \"3.3\" and $blnFlagAnticipo3_3==true){\n \tif($myrow2['subtotal'] >=1.1 ){\n \t\t//Se omite opcion por el prorrateo\n \t\t//$totalRowAnticipo=(($myrow2['subtotal'] * $dblImporteDescuentoAnticipo) / $subtotalInvoice);\n \t\t$subPartida=$myrow2['subtotal'];\n \t\tif( $subPartida <= $dblImporteDescuentoAnticipo){\n \t\t\t$totalRowAnticipo = $subPartida -1;\n \t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t}elseif ($subPartida > $dblImporteDescuentoAnticipo) {\n \t\t\tif(($subPartida - $dblImporteDescuentoAnticipo) < 0.1){\n \t\t\t\t$totalRowAnticipo = $subPartida -1;\n \t\t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t\t}else{\n \t\t\t\t$totalRowAnticipo = $dblImporteDescuentoAnticipo;\n \t\t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t\t}\n \t\t}\n \t}else{\n \t\t$totalRowAnticipo='0.00';\n \t}\n\t }\n\t if($_SESSION['FacturaVersion'] == \"3.3\" and $blnFlagAnticipo3_3==true AND $TypeInvoice ='11'){ \n // PARA NOTA DE CREDITO\n\n\t }else{\n\t \t$totalRowAnticipo = $myrow2['anticipo'];\n\t }\n\t \n\n\t\t\tif(($versionAddenda == 2) AND ($_SESSION['DatabaseName'] == 'erppisumma' OR $_SESSION['DatabaseName'] == 'erppisumma_CAPA' OR $_SESSION['DatabaseName'] == 'erppisumma_DES' ) ){\n\t\t\t\t$stockid = $myrow2['upc_ean']; \n\n\t\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t\t$stockcantidad=number_format($myrow2['cantidad_activo'],$decimalplaces,'.','');\n\t\t\t\t}else{\n\t\t\t\t\t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n\t\t\t\t\t$stockcantidadCompleta = $myrow2['quantity'];\n\t\t\t\t}\n\t\t\t}\n else if ($usaactivos && !empty($myrow2['ref2'])){\n \t$stockid = $myrow2['barcode']; \n \t//$stockcantidad=number_format($myrow2['cantidad_activo'],$decimalplaces,'.','');\n \t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n \t$stockcantidadCompleta = $myrow2['quantity'];\n }else{\n \t$stockid = $myrow2['stockid']; \n \t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n \t$stockcantidadCompleta = $myrow2['quantity'];\n }\n if ($stockcantidad < 0) {\n \t//Cantidad en negativo\n \t$stocknegativo = 1;\n }\n\t\t\tif($_SESSION['DescrLargaFact'] == $myrow2['mbflag']){\n\t\t\t\t//$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'].' '.$myrow2['longdescription'];\n\t\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow2['longdescription'].' '.$strLegendAnticipo.' ';\n\t\t\t}else{\n\t\t\t\t//$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t\t$stockdescrip=$myrow2['description'].' '.$strLegendAnticipo.' ';\n\t\t\t}\n\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t$stockdescrip=$myrow2['desc_activo'].' '.$strLegendAnticipo.' ';\n\t\t\t}\n\t\t\t// if (!empty($myrow2['upc_ean'])){\n\t\t\t// \t$UPCAddenda =$myrow2['upc_ean'];\n\t\t\t// }\n\t\t\t\n\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid ;\n\n\t\t\t\n\t\t\t//$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t\n\t\t\t/*if ($_SESSION['UserID'] == 'desarrollo' or $_SESSION['UserID'] == 'iortiz') {\n\t\t\t\t$stockcantidad = abs($stockcantidad);\n\t\t\t}*/\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.abs($stockcantidad); //Cantidad como este en DB + o -\n\t\t\t\n\t\t\tif($TypeInvoice == 111){\n\t\t\t\t\n\t\t\t\t$SQL=\"SELECT chartmaster.accountcode,\n\t\t\t\t\t\t\tchartmaster.accountname\n\t\t\t\t\tFROM gltrans\n\t\t\t\t\t\tINNER JOIN chartmaster \tON gltrans.account = chartmaster.accountcode\n\t\t\t\t\tWHERE gltrans.type = '\".$TypeInvoice.\"'\n\t\t\t\t\t\tAND gltrans.typeno = '\".$InvoiceNo.\"'\n\t\t\t\t\t\tAND gltrans.stockid = '\".$stockid.\"'\n\t\t\t\t\t\tAND gltrans.amount > 0\";\n\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t$Result= DB_query($SQL,$db);\n\t\t\t\tif (DB_num_rows($Result)==1) {\n\t\t\t\t\t$myrowcuentas = DB_fetch_array($Result);\n\t\t\t\t\t$cuenta = \" Cuenta \".$myrowcuentas['accountcode'].\" \".$myrowcuentas['accountname'];\n\t\t\t\t}\n\t\t\t\t$stockdescrip = $stockdescrip.$cuenta;\n\t\t\t}\n\t\t\t\n\t\t\t// valores de los vendedorfees por linea//\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n p.complemento,\n sp.label\n FROM salesstockproperties p,\n stockcatproperties sp,\n stockmaster sm\n WHERE p.stkcatpropid=sp.stkcatpropid\n AND sp.categoryid=sm.categoryid\n AND sp.reqatprint=1\n AND p.orderno=\" . $orderno . \"\n AND p.typedocument IN(10,110, '\" . $TypeInvoice . \"')\n AND sm.stockid='\" . $stockid . \"'\n AND p.orderlineno = '\".$movorderlineno.\"'\";\n \n // echo \"sqlpropertyes: \".$sqlpropertyes;\n\t\t\t\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n \n $xt=0; \n \n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t// \t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t// \t\t\t\t$trab=$traba[0];\n\t\t\t\t// \t\t\t\t$trab=$myrowprop['val'];****\n\t\t\t\tif ($xt==0) {\n if (strpos(\"@\".$_SESSION[\"DatabaseName\"], \"servillantas\")) {\n $traba=explode(\" \",$myrowprop['val']);\n $noTraba=$traba[0];\n $descrprop=$descrprop.' '.$myrowprop['label'].':'.$noTraba;\n }else{\n $descrprop=$descrprop.' '.$myrowprop['label'].':'.$myrowprop['val'];\n }\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$myrowprop['val'];\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\n\n\t\t\t//Se ha eliminado el trabajador de la descripcion del XML\n\t\t\t//printecho(\"entroant\", \"echo\");\n\n\t\t\t$numberserie=\"\";\n\t\t\t$xserie= 0;\n\n /*if (strpos(\"@\".$_SESSION ['DatabaseName'], \"gruposervillantas\")) {\n $sqlserials=\"SELECT DISTINCT stockserialitems.serialno AS serie\n\t\t\t\t\t\t\tFROM workorders \n\t\t\t\t\t\t\tINNER JOIN stockserialitems ON workorders.wo= stockserialitems.wo\n\t\t\t\t\t\t\tWHERE orderno= '\".$orderno.\"'\n\t\t\t\t\t\t\tAND stockserialitems.customs= '\".$stockid.\"' \n\t\t\t\t\t\t\tAND qualitytext NOT LIKE '%rechaz%' AND stockserialitems.serialno NOT LIKE 'R-%'\n\t\t\t\t\t\t\tAND stockserialitems.stockid= 'cascli'\";\n\n\t\t\t\t$resultado= DB_query($sqlserials,$db);\n\t\t\t\t\n\t\t\t\twhile ($myrownseries=DB_fetch_array($resultado)) {\n\t\t\t\t\tif ($stockid!='cascli'){\n\t\t\t\t\t\t$consulta= \"SELECT DISTINCT stockserialitems.serialno AS serie\n\t\t\t\t\t\t\t\t\tFROM workorders \n\t\t\t\t\t\t\t\t\tINNER JOIN stockserialitems ON workorders.wo= stockserialitems.wo\n\t\t\t\t\t\t\t\t\tWHERE orderno= '\".$orderno.\"'\n\t\t\t\t\t\t\t\t\tAND stockserialitems.customs= '\".$stockid.\"'\n\t\t\t\t\t\t\t\t\tAND qualitytext LIKE '%rechaz%' \n\t\t\t\t\t\t\t\t\tAND stockserialitems.serialno LIKE '%\".$myrownseries['serie'].\"%';\";\n\t\t\t\t\t\t$resultado2= DB_query($consulta, $db);\n\n\t\t\t\t\t\tif ($registro=DB_fetch_array($resultado2)){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ($xserie==0){\n\t\t\t\t\t\t$numberserie=' Series: '.$myrownseries['serie'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$numberserie=$numberserie.', '.$myrownseries['serie'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$xserie++;\n\t\t\t\t}\n } */ \n\n\t\t\t$descrnarrative=\"\";\n //\n if($_SESSION ['FormatoDeComentarioEnPV']==1){\n \t$descrnarrative=str_replace('\\r','',str_replace('\\n', chr(60).'br'.chr(62),$myrow2['narrative']));\n\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative); \n\t\t\t\t$descrnarrative=str_replace(chr(10), chr(60).'br'.chr(62), $descrnarrative);\n }else{\n $descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\t$descrnarrative=str_replace(chr(10), chr(60).'br'.chr(62), $descrnarrative);\n }\t\t\n\t\t\t/*\n\t\t\tif ($TypeInvoice==11){\n\t\t\t\t$tablades=0;\n\t\t\t}else{\n\t\t\t\t$tipodoc=70;\n\t\t\t}\n\t\t\t*/\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\t\t\t\tFROM salesorderdetails \n\t\t\t\t\t\t\tWHERE salesorderdetails.orderno=\" . $orderno . \"\n\t\t\t\t \t\t\t\tAND salesorderdetails.stkcode='\" . $stockid . \"'\n\t\t\t\t \t\t\t\tAND salesorderdetails.orderlineno = '\" . $movorderlineno . \"'\";\n\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\tif ($myrownarrative['narrative'] != $myrow2['narrative']) {\n\t\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n\t\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative = \"\";\n\t\t\t}\n\n\t\t\t//$descrnarrative=\"\";\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\t\t\t\n\t\t\t$xserie=0;\n\t\t\t/*$sqlserials=\"SELECT stockserialitems.serialno as serie\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t//echo '<pre><br>'.$sqlserials;\n\t\t\t$Result= DB_query($sqlserials,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$numberserie=\"\";\n\t\t\t}else{\n\t\t\t\twhile ($myrownseries=DB_fetch_array($Result)){\n\t\t\t\t\tif ($xserie==0){\n\t\t\t\t\t\t$numberserie=' Series: '.$myrownseries['serie'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$numberserie=$numberserie.', '.$myrownseries['serie'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (strlen($numberserie)==0){\n\t\t\t\t$numberserie=\"\";\n\t\t\t}*/\n\t\t\t// para tyqsa;\n\t\t\tif($TypeInvoice == 119 AND ($_SESSION['DatabaseName']=='erptycqsa' OR $_SESSION['DatabaseName']=='erptycqsa_CAPA') ){\n\t\t\t\t$sqlrestante = \"SELECT quantity ordenada, concat(' Cant. Restante: ',quantity-abs(sum(qty) ),' M3' )remisionada \n\t\t\t\t\t\tFROM debtortrans \n\t\t\t\t\t\tINNER JOIN stockmoves ON stockmoves.type = debtortrans.type AND debtortrans.transno = stockmoves.transno\n\t\t\t\t\t\tINNER JOIN salesorderdetails ON salesorderdetails.orderno = debtortrans.order_ AND stockmoves.stockid= salesorderdetails.stkcode\n\t\t\t\t\t\tWHERE debtortrans.order_='\".$orderno.\"' AND stockmoves.type =119 AND stockmoves.transno <='\".$InvoiceNo.\"' AND stockmoves.stockid='\".$stockid.\"' AND debtortrans.tagref IN (5,6,16);\";\n\t\t\t\t//echo \"<br> calculo restante= \".$sqlrestante;\n\t\t\t\t$resultrestante=DB_query($sqlrestante,$db);\n\t\t\t\twhile ($myrowrestante=DB_fetch_array($resultrestante)){\n\t\t\t\t\t$descrestante = $myrowrestante['remisionada'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie.$descrestante;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie.$descrestante;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative.$numberserie.$descrestante;\n\t\t\t\t}\n\t\t\t}//while\n\n\t\t\t/******INICIO AGREGA LA DESCRIPCION DE LOS ACTIVOS FIJO FACTURADOS\n\t\t\tif($_SESSION ['DatabaseName'] == \"erpgosea\" or $_SESSION ['DatabaseName'] == \"erpgosea_CAPA\" or $_SESSION ['DatabaseName'] == \"erpgosea_DES\"){\n\t\t\t\t$descfixedassets = \"\";\n\t\t\t\t$sqldescfassets = \"SELECT CONCAT('Cod.:',l.barcode, ' Serie: ', l.serialno, ' ', f.longdescription) as descfixedassets\n\t\t\t\t\tFROM leasingCharges l\n\t\t\t\t\t\tLEFT JOIN fixedassets f ON l.serialno = f.serialno and l.barcode = f.barcode\n\t\t\t\t\tWHERE l.salesordernumber = \" . $orderno;\n\t\t\t\techo \"<br>DESC:\" . $sqldescfassets;\n\t\t\t\t$resultdescfassets = DB_query($sqldescfassets,$db);\n\t\t\t\twhile ($myrowfassets = DB_fetch_array($resultdescfassets)){\n\t\t\t\t\tif ($descfixedassets == \"\"){\n\t\t\t\t\t\t$descfixedassets = $myrowfassets['descfixedassets'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$descfixedassets = $descfixedassets . \"<br>\" . $myrowfassets['descfixedassets'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tif ($descfixedassets != \"\"){\n\t\t\t\t\t$stockdescripuno = $descfixedassets;\n\t\t\t\t}\n\t\t\t}*/\n\n\t\t\t/******INICIO AGREGA LA DESCRIPCION DE LOS ACTIVOS FIJO FACTURADOS*/\n\n\n\t\t\t/* Gosea pidio que se agregara una leyenda en la descripcion al inicio 'Renta de' o 'Servicio de' se agrego tambien el numero de serie */\n\n\t\t\tif($_SESSION ['DatabaseName'] == \"erpgosea\" or $_SESSION ['DatabaseName'] == \"erpgosea_CAPA\" or $_SESSION ['DatabaseName'] == \"erpgosea_DES\"){\n\t\t\t\tif (isset($tag) and $tag!=''){\n\t\t\t\t\t$SQL=\"SELECT tagref,legalid,legend FROM tagslegend where tagref = \" . $tag;\n\t\t\t\t\t$resulttaglegend=DB_query($SQL,$db);\n\t\t\t\t\t$rowtaglegend = DB_fetch_array($resulttaglegend);\n\t\t\t\t\tif($rowtaglegend['legend'] !=''){\n\t\t\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$rowtaglegend['legend'] .\" \".$stockdescripuno . \", No. Serie \". $myrow2['serialno'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno. \", No. Serie \". $myrow2['serialno'];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno. \", No. Serie \". $myrow2['serialno'];\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t}\n\t\t\t\n\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t//$stockprecio=number_format(($myrow2['fxprice']/$myrow2['cantidad_activo']),$decimalplaces,'.','');\n\t\t\t\t$stockprecio=number_format($myrow2['fxprice'],$decimalplaces,'.','');\n\t\t\t}else{\n\t\t\t\t$stockprecio=number_format($myrow2['fxprice'],$decimalplaces,'.','');\n\t\t\t}\n\n\t\t\tif($_SESSION['FacturaVersion'] == \"3.3\"){\n\t\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t\t//\t$stockneto=number_format(($myrow2['fxnet']/$myrow2['cantidad_activo']),$decimalplaces,'.','');\n\t\t\t\t\t$stockneto=number_format($myrow2['subtotal'],$decimalplaces,'.','');\n\t\t\t\t}else{\n\t\t\t\t\tif($blnFlagAnticipo3_3){\n\t\t\t\t\t\t//echo \"<br>((\".$myrow2['subtotal'].\" * \".$dblImporteDescuentoAnticipo.\")/\".$subtotalInvoice.\")\";\n\t\t\t\t\t\t$stockneto=number_format($myrow2['subtotal'] - $totalRowAnticipo,$decimalplaces,'.','');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$stockneto=number_format($myrow2['subtotal'],$decimalplaces,'.','');\n\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\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t\t$stockneto=number_format(($myrow2['fxnet']/$myrow2['cantidad_activo']),$decimalplaces,'.','');\n\t\t\t\t}else{\n\t\t\t\t\t$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\n\n\t\t\tif ($_SESSION['UserID'] == 'desarrollo') {\n\t\t\t\t//echo \"<br>stockcantidad: \".$stockcantidad.\" - stockcantidadCompleta \".$stockcantidadCompleta.\" - stockprecio: \".$stockprecio.\" - stockneto: \".$stockneto.\"<br>\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($myrow2['flagadvance'] == 1) {\t\n\t\t\t\t//Obtener total de la partida, si existe diferencia obtener precio unitario\n\t\t\t\t$totalPar = number_format($stockcantidad * $stockprecio,$decimalplaces,'.','');\n\t\t\t\t//echo \"<br>totalPar1: \".$totalPar.\"<br>\";\n\t\t\t\tif (abs($totalPar) != abs($stockneto)) {\n\t\t\t\t\t$stockprecio = number_format($stockneto/$stockcantidad,$decimalplaces,'.','');\n\t\t\t\t}\n\n\t\t\t\tif ($stockcantidad < 0 and $stockprecio > 0) {\n\t\t\t\t\t$stockprecio = $stockprecio * (-1);\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tif ($stocknegativo == 1 and $stockprecio > 0) {\n\t\t\t\t//Si cantidad es negativo, poner precio en negativo para operacion\n\t\t\t\t$stockprecio = $stockprecio * (-1);\n\t\t\t}\n\n\t\t\tif ($_SESSION['UserID'] == 'desarrollo') {\n\t\t\t\t//echo \"<br>stockprecio change: \".$stockprecio.\"<br>\";\n\t\t\t}\n\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t$stockunits=$myrow2['unidad_activo'];\n\t\t\t}else{\n\t\t\t\t$stockunits=$myrow2['units'];\n\t\t\t}\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t\n\t\t\t$subtotal=number_format($myrow2['totaldescuento'] + $totalRowAnticipo ,$decimalplaces,'.','');\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal ;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\n\n\t\t\t/*$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";*/\n\n\t\t\t//Validación de No. pedimento\n\t\t\tif($_SESSION['DatabaseName'] == 'erppisumma_DES' || $_SESSION['DatabaseName'] == 'erppisumma' || $_SESSION['DatabaseName'] == 'erppisumma_CAPA'){\n\t\t\t\t$sqladuana=\"SELECT nopedimento\n\t\t\t\t\t\tFROM pediment_aduanas \n\t\t\t\t\t\tWHERE orderno='\" . $orderno . \"'\n\t\t\t \t\t\t\tAND stockid='\" . $stockid . \"'\n\t\t\t \t\t\t\tAND orderlineno = '\" . $movorderlineno . \"'\";\n\t if ($_SESSION['UserID'] == \"desarrollo\"){\n\t\t\t\t\t//echo '<br/> sql aduanas: '.$sqladuana;\n\t\t\t\t} \n\t\t\t\tdebug_sql($sqladuana, __LINE__,false,__FILE__);\n\t\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t//$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t\t$nopedimento=\"\";\n\t\t\t\t}else{\n\t\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t\t$nopedimento=$myrowaduana['nopedimento'];\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t\t\n\t\t\t\t\t//$numberaduana=$myrowaduana['noaduana'];\n\t\t\t\t\t//$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t\t//$nameaduana = $separaaduana[0];\n\t\t\t\t\t//$numberaduana= $separaaduana[1];\n\t\t\t\t\t//$fechaaduana= $separaaduana[2];\n\t\t\t\t\t/*if (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*){\n\t\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$nameaduana = $myrowaduana['aduana'];\n\t\t\t\t\t$numberaduana = $myrowaduana['noaduana'];\n\t\t\t\t\t$fechaaduana = $myrowaduana['fechaaduana'];\n\t\t\t\t\t$pedimento = $myrowaduana['pedimento'];*/\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t$nopedimento=\"\";\n\t\t\t}\n \n\t\t\tif($myrow['type'] == 66) { \n // Si es factura remision\n\t\t\t\t$ordernotmp = $myrow['orderno'];\n\t\t\t\t$SQL = \"\n\t\t\t\t\tSELECT GROUP_CONCAT(debtortrans.order_) AS order_\n\t\t\t\t\tFROM invoicetoremision\n\t\t\t\t\tINNER JOIN debtortrans\n\t\t\t\t\tON debtortrans.id = invoicetoremision.idremision\n\t\t\t\t\tWHERE invoicetoremision.idinvoice = '\".$myrow['iddocto'].\"'\n\t\t\t\t\";\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\n\t\t\t\t$rstmp = DB_query($SQL, $db);\n\t\t\t\t$rowtmp = DB_fetch_array($rstmp);\n\t\t\t\t$ordernotmp = $rowtmp['order_'];\n\n\t\t\t\tif(empty($ordernotmp) == FALSE) {\n\t\t\t\t\t//Validación de No. pedimento\n\t\t\t\t\tif($_SESSION['DatabaseName'] == 'erppisumma_DES' || $_SESSION['DatabaseName'] == 'erppisumma' || $_SESSION['DatabaseName'] == 'erppisumma_CAPA'){\n\t\t\t\t\t\t$sqladuana=\"SELECT nopedimento\n\t\t\t\t\t\t\t\tFROM pediment_aduanas \n\t\t\t\t\t\t\t\tWHERE orderno='\" . $myrow['orderno'] . \"'\n\t\t\t\t\t \t\t\t\tAND stockid='\" . $stockid . \"'\n\t\t\t\t\t \t\t\t\tAND orderlineno = '\" . $movorderlineno . \"'\";\n\t\t\t if ($_SESSION['UserID'] == \"desarrollo\"){\n\t\t\t\t\t\t\techo '<br/> sql aduanas 66-1: '.$sqladuana;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t\t$fechaaduana = '';\n\t\t\t\t\t\t\t$nopedimento = $rowtmp['nopedimento'];\n\t\t\t\t\t\t\t$nameaduana = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$SQL = \"\n\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDATE_FORMAT(purchorderdetails.datecustoms,'%Y-%m-%d') AS fechaaduana,\n\t\t\t\t\t\t\tpedimento,\n\t\t\t\t\t\t\tcustoms AS aduana\n\t\t\t\t\t\t\tFROM purchorders\n\t\t\t\t\t\t\tINNER JOIN purchorderdetails\n\t\t\t\t\t\t\tON purchorderdetails.orderno = purchorders.orderno\n\t\t\t\t\t\t\tWHERE purchorders.requisitionno IN ($ordernotmp)\n\t\t\t\t\t\t\tAND purchorderdetails.itemcode = '$stockid'\n\t\t\t\t\t\t\";\n\n\t\t\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t\t$fechaaduana = $rowtmp['fechaaduana'];\n\t\t\t\t\t\t\t$nopedimento = $rowtmp['pedimento'];\n\t\t\t\t\t\t\t$nameaduana = $rowtmp['aduana'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nopedimento;\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$almacen;\n\t\t\t\n\t\t\tif($TipoAgrupacionXTag==1 and $TypeInvoice <> 111){\n\t\t\t\t\n\t\t\t\t$sqlstockmovestaxes=\"SELECT stockmovestaxes.stkmoveno,\n\t\t\t\t\t\t\t\t\t\t\ttaxauthid,taxrate,\n\t\t\t\t\t\t\t\t\t\t\ttaxcalculationorder,\n\t\t\t\t\t\t\t\t\t\t\ttaxontax,\n\t\t\t\t\t\t\t\t\t\t\ttaxauthorities.description,\n \t\t\t\t\t\t\t\t\t\t\tsum(stockmovestaxes.taxrate*(((stockmoves.price*(stockmoves.qty*-1))-(CASE WHEN stockmoves.type=11 then stockmoves.totaldescuento*-1 else stockmoves.totaldescuento end)))) as iva,\n \t\t\t\t\t\t\t\t\t\t\ttaxauthorities.c_Impuesto\n\t \t\t\t\t\t\t\t\tFROM stockmovestaxes inner join stockmoves on stockmoves.stkmoveno=stockmovestaxes.stkmoveno\n\t\t\t\t\t\t\t\t\t\tLEFT join stockmaster on stockmaster.stockid=stockmoves.stockid\n\t\t\t\t\t\t\t\t\t\tLEFT JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid \n\t\t\t\t\t\t\t\t\t\tLEFT JOIN taxauthorities ON taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t WHERE type=\".$TypeInvoice. \" AND transno=\".$InvoiceNo.\" And stockcategory.prodLineId='\".$myrow2['stockid'].\"'\";\n\t\t\t}else{\n\t\t\t\n\t\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\t\t\t\ttaxcalculationorder,\n\t\t\t\t\t\t\t\t\ttaxontax,\n\t\t\t\t\t\t\t\t\ttaxauthorities.description,\n\t\t\t\t\t\t\t\t\ttaxauthorities.c_Impuesto\n\t\t\t\t\t\t\t\t\tFROM stockmovestaxes\n\t\t\t\t\t\t\t\t\tLEFT JOIN taxauthorities ON taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t\t\t\tWHERE stkmoveno=\".$stkmoveno;\n\t\t\t}\n\n\t\t\tif($_SESSION['UserID'] ==\"desarrollo\"){\n\t\t\t\techo \"<br>sqlstockmovestaxes:<pre>\". $sqlstockmovestaxes .\"</pre>\";\n\t\t\t}\n\n \n debug_sql($sqlstockmovestaxes, __LINE__,$debug_sql,__FILE__);\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\tif ($_SESSION['UserID'] == \"admin\") {\n\t\t\t\t//echo \"<br>sqlstockmovestaxes 1: \".$sqlstockmovestaxes;\n\t\t\t}\n\t\t\t//Agregar datos de CFDI 3.3\n\t\t\tif(DB_num_rows($resultstockmovestaxes) > 0){\n\t\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t if(empty($myrow3['description']) == false){\n\t $impuesto=$myrow3['description'];\n\t }else{\n\t $impuesto=\"IVA\";\n\t }\n\t\t\t\t\t\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,$decimalplaces,'.','');\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t\tif($TipoAgrupacionXTag==1){\n\t\t\t\t\t\t//$taxratetotal=number_format(abs($myrow3['iva']),$decimalplaces,'.','');\n\t\t\t\t\t\t$taxratetotal = abs($myrow3['iva']);\n\t\t\t\t\t\t$taxratetotal = number_format($taxratetotal,$decimalplaces,'.','');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//$taxratetotal=number_format($myrow3['taxrate']*($subtot),$decimalplaces,'.','');\n\t\t\t\t\t\tif($_SESSION['FacturaVersion'] == \"3.3\"){\n\t\t\t\t\t\t\tif($blnFlagAnticipo3_3){\n\t\t\t\t\t\t\t\t$taxratetotal = $myrow3['taxrate'] * ($myrow2['subtotal'] - $totalRowAnticipo);\n\t\t\t\t\t\t\t\t//$taxratetotal = $myrow3['taxrate'] * ($myrow2['subtotal'] - (($myrow2['subtotal'] * $dblImporteDescuentoAnticipo) / $subtotalInvoice));\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$taxratetotal = $myrow3['taxrate'] * ($myrow2['subtotal']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$taxratetotal = $myrow3['taxrate'] * ($myrow2['subtotal']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$taxratetotal = number_format($taxratetotal,$decimalplaces,'.','');\n\t\t\t\t\t}\n\n\t\t\t\t\t$taxratetotal=number_format($taxratetotal,$decimalplaces,'.','');\n\t\t\t\t\t\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$myrow3['c_Impuesto']; //Codigo de impuesto\n\n\t\t\t\t\t//Obtener factor\n\t\t\t\t\t$c_TipoFactor = \"\";\n\t\t\t\t\t$sqlFactor = \"SELECT sat_tasas.c_TipoFactor\n\t\t\t\t\t\t\t\tFROM stockmaster\n\t\t\t\t\t\t\t\tLEFT JOIN taxcategories ON taxcategories.taxcatid = stockmaster.taxcatid\n\t\t\t\t\t\t\t\tLEFT JOIN sat_tasas ON sat_tasas.id = taxcategories.id_Tasa\n\t\t\t\t\t\t\t\tWHERE stockmaster.stockid = '\".$myrow2['stockid'].\"'\";\n\t\t\t\t\tif($_SESSION['UserID'] == 'desarrollo'){\n\t\t\t\t\t\t//echo \"<br><pre>$sqlFactor</pre>\";\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$resultFactor=DB_query($sqlFactor,$db);\n\t\t\t\t\tif(DB_num_rows($resultFactor) > 0){\n\t\t\t\t\t\t$rowFactor = DB_fetch_array($resultFactor);\n\t\t\t\t\t\t$c_TipoFactor = $rowFactor['c_TipoFactor']; //Factor de impuesto\n\t\t\t\t\t}\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$c_TipoFactor; //Factor de impuesto\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\t$sqlImp = \"SELECT \n taxauthorities.c_Impuesto,\n taxauthrates.taxrate,\n sat_tasas.c_TipoFactor, taxauthorities.description\n FROM stockmaster\n LEFT JOIN taxauthrates ON taxauthrates.taxcatid = stockmaster.taxcatid\n LEFT JOIN taxauthorities ON taxauthorities.taxid = taxauthrates.taxauthority\n LEFT JOIN taxcategories ON taxcategories.taxcatid = stockmaster.taxcatid\n LEFT JOIN sat_tasas ON sat_tasas.id = taxcategories.id_Tasa\n WHERE stockmaster.stockid = '\".$myrow2['stockid'].\"'\";\n $ErrMsg = _('El Sql que fallo fue');\n $DbgMsg = _('No se pudo obtener el impuesto del articulo '.trim($datos [2]));\n //echo \"<br>\".$sqlAnt.\"<br>\";\n $resultImp = DB_query($sqlImp, $db, $ErrMsg, $DbgMsg, true);\n //$importe = $importe - trim(number_format(($descuentoRow), $decimalplaces, '.', ''));\n\n if (DB_num_rows($resultImp) == 1) {\n $rowImp = DB_fetch_array($resultImp);\n $Impuesto = $rowImp['c_Impuesto'];\n $TipoFactor = $rowImp['c_TipoFactor'];\n $TasaOCuota = $rowImp['taxrate'];\n $impuesto=$rowImp['description'];\n if($TasaOCuota == 0) {\n $TasaOCuota = '0.000000';\n }\n }\n $taxratetotal = $TasaOCuota * $myrow2['subtotal'];\n\t\t\t\t$taxratetotal = number_format($taxratetotal, $decimalplaces,'.','');\n //$taxrate=number_format($myrow3['taxrate']*100,$decimalplaces,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$TasaOCuota;\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$Impuesto;\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$TipoFactor;\n\t\t\t}\n\n\n ///***************************************///\n $TotGeneralCantEmision = 0;\n if ($TypeInvoice == 119) {\n //*****se agrega cantidad emision solo en remisiones *///\n $wo = 'SELECT wo FROM workorders WHERE orderno=\"' . ($myrow['orderno']-1) . '\"';\n if ($_SESSION['UserID'] == \"desarrollo\" and $debug) {\n \t//echo '<pre>Busca OT'.$wo;\n }\n debug_sql($wo, __LINE__,$debug_sql,__FILE__);\n $rwo = DB_query($wo, $db);\n if(DB_num_rows($rwo) > 0){\n $fwo = DB_fetch_array($rwo);\n $woo=$fwo['wo'];\n $SQL=\" SELECT legalid\n FROM tags \n WHERE tagref='\".$tag.\"'\";\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n $legal = DB_query($SQL, $db);\n list($legalid) = DB_fetch_array($legal);\n\n $sqlRequRes = \"SELECT t.wostdcost, \n t.worequirements_id, t.stockid, t.description,t.units, t.decimalplaces,\n (t.requiredqty) as requiredqty,\n (t.expectedcost) as expectedcost,\n (t.stdcost) AS costperqty,\n t.mbflag,\n t.categoryid,\n t.categorydescription,\n t.taxrate\n FROM (\tSELECT\n worequirements.worequirements_id,\n worequirements.stdcost AS wostdcost,\n worequirements.stockid,\n stockmaster.longdescription as description ,\n stockmaster.decimalplaces,\n stockmaster.mbflag,\n stockmaster.units,\n (stockcostsxlegal.avgcost) as stdcost,\n stockmaster.categoryid,\n stockcategory.categorydescription,\n SUM(if(worequirements.ispercent=1,0,worequirements.qtypu)) AS requiredqty,\n SUM(worequirements.stdcost*worequirements.qtypu) AS expectedcost,\n AVG(worequirements.qtypu) as qtypu,\n stockmaster.taxcatid,\n taxauthrates.taxrate\n FROM worequirements\n INNER JOIN stockmaster ON worequirements.stockid=stockmaster.stockid\n INNER JOIN taxauthrates ON taxauthrates.taxcatid = stockmaster.taxcatid\n INNER JOIN stockcategory ON stockmaster.categoryid = stockcategory.categoryid\n INNER JOIN stockcostsxlegal ON stockmaster.stockid = stockcostsxlegal.stockid AND stockcostsxlegal.legalid = \" .$legalid. \"\n INNER JOIN woitems ON woitems.stockid=worequirements.masterparentid\n WHERE worequirements.wo='\" . $woo . \"' and woitems.wo=worequirements.wo\n AND stockmaster.mbflag <> 'M'\n /*AND stockmaster.stockid='DOR1-13'*/\n GROUP BY worequirements.stockid) AS t\n GROUP BY t.stockid\n ORDER BY t.categorydescription\";\n\n if ($_SESSION['UserID'] == \"desarrollo\" and $debug) {\n \t//echo '<pre>GET ReqRes:'.$sqlRequRes;\n }\n \n debug_sql($sqlRequRes, __LINE__,$debug_sql,__FILE__);\n $RequirementsResult = DB_query($sqlRequRes, $db);\n $TotGeneralCantEmision = 0;\n while ($RequirementsRow = DB_fetch_array($RequirementsResult)) {\n $SQL2 = \"SELECT trandate,\n (qty + Case When movs.cantidad Is Null Then 0 Else movs.cantidad End) as qty,\n standardcost\n FROM stockmoves\n Left Join (Select ref4, stockid, reference, sum(qty) as cantidad\n From stockmoves\n Where type= 815 Group by ref4, stockid, reference) as movs On stockmoves.stockid= movs.stockid \n and stockmoves.reference= movs.reference \n and stockmoves.stkmoveno= movs.ref4\n WHERE stockmoves.type=28\n AND stockmoves.reference = '\" . $woo['wo'] . \"'\n AND stockmoves.stockid = '\" . $RequirementsRow['stockid'] . \"'\";\n\t\t\t\t\t\t\tdebug_sql($SQL2, __LINE__,$debug_sql,__FILE__);\n $IssuesResult = DB_query($SQL2, $db, _('Could not retrieve the issues of the item because:'));\n if ($_SESSION['UserID'] == \"desarrollo\" and $debug) {\n\t\t\t\t\t\t\t\t//echo '<pre>ok'.$SQL2;\n\t\t\t\t\t\t\t\t//die('END');\n }\n if (DB_num_rows($IssuesResult) > 0) {\n while ($IssuesRow = DB_fetch_array($IssuesResult)) {\n $IssueQty -= $IssuesRow['qty']; // because qty for the stock movement will be negative\n $IssueCost -= ($IssuesRow['qty'] * $IssuesRow['standardcost']);\n }\n }\n if($IssueQty>0){\n \t$TotGeneralCantEmision = $IssueQty;\n }else{\n \t$TotGeneralCantEmision = 0;\n }\n }\n\t\t\t\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$TotGeneralCantEmision;\n \t}else{\n\t\t\t\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$TotGeneralCantEmision;\n \t}\n \n $SQLemision=\"SELECT sum(plcdata.value) AS total,folio\n FROM worequirements\n INNER JOIN workorders ON workorders.wo = worequirements.wo\n INNER JOIN plcdata ON plcdata.stockid = worequirements.stockid AND plcdata.wo = worequirements.wo\n INNER JOIN stockmaster ON stockmaster.stockid = worequirements.stockid\n INNER JOIN stockmaster AS encabezado ON encabezado.stockid = worequirements.parentstockid\n INNER JOIN debtortrans ON workorders.orderno = debtortrans.order_ AND debtortrans.type = 119 AND debtortrans.transno='\".$InvoiceNo.\"' AND plcdata.transno = debtortrans.transno\n WHERE folio IN (SELECT folio FROM debtortrans WHERE order_='\".$myrow['orderno'].\"') GROUP BY folio;\";\n //echo '<br>EmisionAnt'.$TotGeneralCantEmision;\n \n debug_sql($SQLemision, __LINE__,$debug_sql,__FILE__);\n $resultEmision= DB_query($SQLemision, $db);\n //echo '<pre>SQLEmision: '.$SQLemision;\n $myrowEmision= DB_fetch_array($resultEmision);\n $TotGeneralCantEmision = 0;\n $TotGeneralCantEmision=$myrowEmision['total'];\n //echo '<br>Emision: '.$TotGeneralCantEmision;\n //$charelectronicdetail=$charelectronicdetail.'|'.$TotGeneralCantEmision;\n //echo '<br>Cadena: '.$charelectronicdetail; \n\t\t\t\t\t//echo '<br>END</br>';\n }\n $charelectronicdetail=$charelectronicdetail.'|'.$TotGeneralCantEmision;\n $charelectronicdetail=$charelectronicdetail.'|'.$movorderlineno;\n $charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n $charelectronicdetail=$charelectronicdetail.'|'.$nopedimento;\n $charelectronicdetail=$charelectronicdetail.''.\"|\".$descrestante;\n\t\t\t\t$nolinea=$nolinea+1;\n\t /**FIN DE CALCULO DE EMISIONES***/\n\n\t\t\t}// FIN NOTAS CREDITO ANT PROVISIONAL \n\n \n }\n\n //************************************************************************************************\n // Al momento de aplicar el descuento tenemos un sobrante regresarselo a la(s) factura de anticipo\n //************************************************************************************************\n if($dblImporteDescuentoAnticipo >0){\n \t$sqlDevolucionAnticipo=\"SELECT stockmoves.stkmoveno as stkmoveno1, stkmove2.stkmoveno,stkmove2.price,stkmove2.qtyinvoiced\n\t\t\t\t\t\t\t\t\tFROM stockmoves\n\t\t\t\t\t\t\t\t\tINNER JOIN stockmaster on stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\t\tAND stockmoves.type='\". $TypeInvoice .\"'\n\t\t\t\t\t\t\t\t\tAND stockmoves.transno='\". $InvoiceNo .\"'\n\t\t\t\t\t\t\t\t\tAND stockmoves.tagref='\". $tag .\"'\n\t\t\t\t\t\t\t\t\tAND stockmaster.categoryid='\". $categoriaAnticipo .\"'\n\t\t\t\t\t\t\t\t\tAND stockmaster.units ='Actividad'\n\t\t\t\t\t\t\t\t\tAND (stockmoves.show_on_inv_crds=1 or stockmoves.stockid ='facturaremision')\n\t\t\t\t\t\t\t\t\tinner join stockmoves stkmove2 on stkmove2.stkmoveno =stockmoves.stkmovid\n\t\t\t\t\t\t\t\t\tgroup by stkmove2.stkmoveno\n\t\t\t\t\t\t\t\t\torder by stkmove2.stkmoveno desc;\";\n\t\t\t\t\t\t\t\t\t//echo \"<br>sql anrin:<pre>\".$sqlDevolucionAnticipo;\n\t\t\t$rsDevolucionAnticipo=DB_query($sqlDevolucionAnticipo,$db);\n\n\t\t\t$dblPendienteAplicar=$dblImporteDescuentoAnticipo;\n\t\t\twhile ($myrowDevolucionAnticipo = DB_fetch_array($rsDevolucionAnticipo)) {\n\n\t\t\t\t$Aplicado=($myrowDevolucionAnticipo['price'] * $myrowDevolucionAnticipo['qtyinvoiced']);\n\t\t\t\t//echo \"<br>plicado: \".$Aplicado;\n\t\t\t\t//echo \"<br>dblPendienteAplicar: \".$dblPendienteAplicar;\n\t\t\t\tif($dblPendienteAplicar > abs($Aplicado)){\n\t\t\t\t\t$dblPendienteAplicar = $Aplicado;\n\t\t\t\t}\n\n\t\t\t\tif($dblImporteDescuentoAnticipo >0){\n\t\t\t\t\t$sqlAplicarRegresoFactura=\"UPDATE stockmoves SET qtyinvoiced = (qtyinvoiced + \".$dblPendienteAplicar / $myrowDevolucionAnticipo['price'].\") WHERE stkmoveno='\".$myrowDevolucionAnticipo['stkmoveno'].\"'\";\n\t\t\t\t\t//$rs =DB_query($sqlAplicarRegresoFactura,$db);\n\t\t\t\t\t//echo \"<br>SQL<pre>\". $sqlAplicarRegresoFactura;\n\n\t\t\t\t\t$sqlAplicarRegresoAplicacion=\"UPDATE stockmoves SET qty = (qty - \".$dblPendienteAplicar / $myrowDevolucionAnticipo['price'].\") WHERE stkmoveno='\".$myrowDevolucionAnticipo['stkmoveno1'].\"'\";\n\t\t\t\t\t//echo \"<br>SQL<pre>\". $sqlAplicarRegresoAplicacion;\n\t\t\t\t\t//$rs =DB_query($sqlAplicarRegresoAplicacion,$db);\n\n\t\t\t\t}\n\n\t\t\t\t$dblImporteDescuentoAnticipo -= $dblPendienteAplicar;\n\t\t\t\t$dblPendienteAplicar=$dblImporteDescuentoAnticipo;\n\n\t\t\t}\n }\n\n\t}else{//\n\t\t//echo \"<br> XAXX010101000: \".$TipoAgrupacionXTag;\n\t\tif($TipoAgrupacionXTag==1 and $TypeInvoice <> 111){\n\t\t\t$sqldetails = 'SELECT distinct stockmoves.stkmoveno,\n\t\t\t\t\t\t-- stockmoves.stockid,\n\t\t\t\t\t ProdLine.prodLineId as stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\t-- stockmaster.description,\n\t\t\t\t\t\tProdLine.Description as description,\n\t\t\t\t\t\t/*stockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,*/\n\t\t\t\t\t\t0 as serialised,\n\t\t\t\t\t\t0 as controlled,\n\t\t\t\t\t\tsum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t/*sum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxnet,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))-totaldescuento)/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as subtotal,\n\t\t\t\t\t\t-- sum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)/case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tsum((stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,*/\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxnet,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)-totaldescuento)/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as subtotal,\n\t\t\t\t\t\t-- sum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)/case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tsum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV,\n\t\t\t\t\t\tsum(stockmoves.totaldescuento) as totaldescuento,\n stockmoves.ref4 as movorderline,\n stockmaster.flagadvance\n\t\t\t\tFROM stockmoves left JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno, stockmaster,\n\t\t\t\t\tstockcategory\n\t\t\t\t\t \tINNER JOIN ProdLine ON ProdLine.prodLineId=stockcategory.prodLineId\n\t\t\t\t\t\t\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid '. $strFiltroBombeo .'\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=\"' . $tag .'\" '. $strSearchAnticipo . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\tGROUP BY ProdLine.Description,ProdLine.prodLineId';\n\t\t}else{\n\t\t\t$sqldetails = 'SELECT distinct stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t/*((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,*/\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV,\n\t\t\t\t\t sum(stockmoves.totaldescuento) as totaldescuento,\n\t\t\t\t\t\tstockmaster.longdescription,\n\t\t\t\t\t\tstockmaster.mbflag,\n stockmoves.ref4 as movorderline,\n stockmaster.flagadvance\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno \n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid '. $strFiltroBombeo .'\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=\"' . $tag .'\" '. $strSearchAnticipo . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\tGROUP BY stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) ,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento ,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV,\n\t\t\t\t\t \n\t\t\t\t\t\tstockmaster.longdescription,\n\t\t\t\t\t\tstockmaster.mbflag,\n stockmoves.ref4,\n stockmaster.flagadvance';\n\t\t}\n\t\tif ($_SESSION['UserID'] == \"desarrollo\") {\n\t\t\t//echo \"<pre>sqldetails: 3684 \".$sqldetails;\n\t\t}\n debug_sql($sqldetails, __LINE__,$debug_sql,__FILE__);\n $resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stocknegativo = 0; //obtener si es negativo para precio\n\t\t\t$stockid=$myrow2['stockid'];\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n\t\t\t$stockcantidadCompleta = $myrow2['quantity'];\n\n\t\t\tif ($stockcantidad < 0) {\n \t//Cantidad en negativo\n \t$stocknegativo = 1;\n }\n\n\t\t\t/*if ($_SESSION['UserID'] == 'desarrollo' or $_SESSION['UserID'] == 'iortiz') {\n\t\t\t\t$stockcantidad = abs($stockcantidad);\n\t\t\t}*/\n\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.abs($stockcantidad); //Cantidad como este en DB + o -\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t$totalCantEmision = 0;\n $movorderlineno = $myrow2['movorderline'];\n\n if($_SESSION['FacturaVersion'] == \"3.3\" and $blnFlagAnticipo3_3==true){\n \tif($myrow2['subtotal'] >=1.1){\n \t\t//Se omite opcion por el prorrateo\n \t\t//$totalRowAnticipo=(($myrow2['subtotal'] * $dblImporteDescuentoAnticipo) / $subtotalInvoice);\n \t\t$subPartida=$myrow2['subtotal'];\n \t\tif( $subPartida <= $dblImporteDescuentoAnticipo){\n \t\t\t$totalRowAnticipo = $subPartida -1;\n \t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t}elseif ($subPartida > $dblImporteDescuentoAnticipo) {\n \t\t\tif(($subPartida - $dblImporteDescuentoAnticipo) < 0.1){\n \t\t\t\t$totalRowAnticipo = $subPartida -1;\n \t\t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t\t}else{\n \t\t\t\t$totalRowAnticipo = $dblImporteDescuentoAnticipo;\n \t\t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t\t}\n \t\t}\n \t}else{\n \t\t$totalRowAnticipo='0.00';\n \t}\n\t }\n\n\t\t\tif($_SESSION['DescrLargaFact'] == $myrow2['mbflag']){\n\t\t\t\t//$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'].' '.$myrow2['longdescription'];\n\t\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow2['longdescription'].' ';\n\t\t\t}else{\n\t\t\t\t//$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t\t$stockdescrip=$myrow2['description'].' ';\n\t\t\t}\n\t\t\t\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument IN(110, '\" . $TypeInvoice . \"')\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n \n //echo $sqlpropertyes;\n \n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\n\t\t\t/*if ($_SESSION[\"desarrollo\"]){\n\t\t\t\techo \"series 1: \".\"SELECT DISTINCT stockserialitems.serialno as serie\n\t\t\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\t\t\tAND stockserialitems.loccode='\".$myrow2['almacen'].\"' \n\t\t\t\t\t\t\tAND qualitytext NOT LIKE '%rechaz%' \n\t\t\t\t\t\t\tAND stockmoves.stockid='CASCLI'\";\t\t\n\t\t\t}*/\n\n\t\t\t$numberserie= \"\";\n\t\t\t$xserie=0;\n\n\t\t\tif (strpos(\"@\".$_SESSION ['DatabaseName'], \"gruposervillantas\")) {\n $sqlserials=\"SELECT DISTINCT stockserialitems.serialno AS serie\n\t\t\t\t\t\t\tFROM workorders \n\t\t\t\t\t\t\tINNER JOIN stockserialitems ON workorders.wo= stockserialitems.wo\n\t\t\t\t\t\t\tWHERE orderno= '\".$orderno.\"'\n\t\t\t\t\t\t\tAND stockserialitems.customs= '\".$stockid.\"' \n\t\t\t\t\t\t\tAND qualitytext NOT LIKE '%rechaz%' AND stockserialitems.serialno NOT LIKE 'R-%'\n\t\t\t\t\t\t\tAND stockserialitems.stockid= 'cascli'\";\n\t\t\t\t$resultado= DB_query($sqlserials,$db);\n\t\t\t\t\n\t\t\t\twhile ($myrownseries=DB_fetch_array($resultado)) {\n\t\t\t\t\tif ($stockid!='cascli'){\n\t\t\t\t\t\t$consulta= \"SELECT DISTINCT stockserialitems.serialno AS serie\n\t\t\t\t\t\t\t\t\tFROM workorders \n\t\t\t\t\t\t\t\t\tINNER JOIN stockserialitems ON workorders.wo= stockserialitems.wo\n\t\t\t\t\t\t\t\t\tWHERE orderno= '\".$orderno.\"'\n\t\t\t\t\t\t\t\t\tAND stockserialitems.customs= '\".$stockid.\"'\n\t\t\t\t\t\t\t\t\tAND qualitytext LIKE '%rechaz%' \n\t\t\t\t\t\t\t\t\tAND stockserialitems.serialno LIKE '%\".$myrownseries['serie'].\"%'\";\n\t\t\t\t\t\t$resultado2= DB_query($consulta, $db);\n\n\t\t\t\t\t\tif ($registro=DB_fetch_array($resultado2)){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ($xserie==0){\n\t\t\t\t\t\t$numberserie=' Series: '.$myrownseries['serie'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$numberserie=$numberserie.', '.$myrownseries['serie'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$xserie++;\n\t\t\t\t}\n\n\t\t\t\t\n }\n\t\t\t\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM salesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\t\t\t//para tyqsa \n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n if (strlen($descrnarrative)==0){\n $stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n }else{\n $stockdescripuno=$descrnarrative.$numberserie;\n }\n\t\t\t}\n\n\t\t\tif($_SESSION ['DatabaseName'] == \"erpgosea\" or $_SESSION ['DatabaseName'] == \"erpgosea_CAPA\" or $_SESSION ['DatabaseName'] == \"erpgosea_DES\"){\n\t\t\t\tif ($myrow2['stockid'] =='10001'){\n\t\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.\"RENTA DE \".$stockdescripuno;\n\t\t\t\t}else{\n\t\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t}\n \n\t\t\t// Se QUITO POR EL DE ARRIBA $charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],$decimalplaces,'.','');\n\t\t\t\n\t\t\t//$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\n\t\t\tif($_SESSION['FacturaVersion'] == \"3.3\"){\n\t\t\t\tif($blnFlagAnticipo3_3){\n\t\t\t\t\t//echo \"<br>((\".$myrow2['subtotal'].\" * \".$dblImporteDescuentoAnticipo.\")/\".$subtotalInvoice.\")\";\n\t\t\t\t\t$stockneto=number_format($myrow2['subtotal'] - $totalRowAnticipo,$decimalplaces,'.','');\n\t\t\t\t}else{\n\t\t\t\t\t$stockneto=number_format($myrow2['subtotal'],$decimalplaces,'.','');\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\t\t\t\n\t\t\t}\n\n\n\t\t\tif ($_SESSION['UserID'] == 'desarrollo') {\n\t\t\t\t//echo \"<br>stockcantidad: \".$stockcantidad.\" - stockcantidadCompleta \".$stockcantidadCompleta.\" - stockprecio: \".$stockprecio.\" - stockneto: \".$stockneto.\"<br>\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($myrow2['flagadvance'] == 1) {\n\t\t\t\t//Obtener total de la partida, si existe diferencia obtener precio unitario\n\t\t\t\t$totalPar = number_format($stockcantidad * $stockprecio,$decimalplaces,'.','');\n\t\t\t\t//echo \"<br>totalPar1: \".$totalPar.\"<br>\";\n\t\t\t\tif (abs($totalPar) != abs($stockneto)) {\n\t\t\t\t\t$stockprecio = number_format($stockneto/$stockcantidad,$decimalplaces,'.','');\n\t\t\t\t}\n\n\t\t\t\tif ($stockcantidad < 0 and $stockprecio > 0) {\n\t\t\t\t\t$stockprecio = $stockprecio * (-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($stocknegativo == 1 and $stockprecio > 0) {\n\t\t\t\t//Si cantidad es negativo, poner precio en negativo para operacion\n\t\t\t\t$stockprecio = $stockprecio * (-1);\n\t\t\t}\n\n\t\t\tif ($_SESSION['UserID'] == 'desarrollo') {\n\t\t\t\t//echo \"<br>stockprecio change: \".$stockprecio.\"<br>\";\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.($stockprecio);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.($stockneto);\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description, taxauthorities.c_Impuesto\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n debug_sql($sqlstockmovestaxes, __LINE__,$debug_sql,__FILE__);\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\tif ($_SESSION['UserID'] == \"desarrollo\") {\n\t\t\t\techo \"<br>sqlstockmovestaxes 2: \".$sqlstockmovestaxes;\n\t\t\t}\n\t\t\t//Agregar datos de CFDI 3.3\n\t\t\tif(DB_num_rows($resultstockmovestaxes)>0){\n\t\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,$decimalplaces,'.','');\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t\t//$subtot = number_format($myrow2['subtotal'], 2); //Siempre se manejo en 2\n\t\t\t\t\t//$taxratetotal=number_format($myrow3['taxrate']*($subtot),$decimalplaces,'.','');\n\t\t\t\t\t\n\t\t\t\t\t$taxratetotal = $myrow3['taxrate'] * $myrow2['subtotal'];\n\t\t\t\t\t$taxratetotal = number_format($taxratetotal, $decimalplaces,'.','');\n\n\t\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t\t$taxtotalratex=$myrow3['taxrate']*($myrow2['subtotal']);\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$myrow3['c_Impuesto']; //Codigo de impuesto\n\n\t\t\t\t\t//Obtener factor\n\t\t\t\t\t$c_TipoFactor = \"\";\n\t\t\t\t\t$sqlFactor = \"SELECT sat_tasas.c_TipoFactor\n\t\t\t\t\t\t\t\tFROM stockmaster\n\t\t\t\t\t\t\t\tLEFT JOIN taxcategories ON taxcategories.taxcatid = stockmaster.taxcatid\n\t\t\t\t\t\t\t\tLEFT JOIN sat_tasas ON sat_tasas.id = taxcategories.id_Tasa\n\t\t\t\t\t\t\t\tWHERE stockmaster.stockid = '\".$myrow2['stockid'].\"'\";\n\t\t\t\t\tif ($_SESSION['UserID'] == \"desarrollo\") {\n\t\t\t\t\t\techo \"<br>sqlstockmovestaxes 2: \".$sqlFactor;\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\n\t\t\t\t\t$resultFactor=DB_query($sqlFactor,$db);\n\t\t\t\t\tif(DB_num_rows($resultFactor) > 0){\n\t\t\t\t\t\t$rowFactor = DB_fetch_array($resultFactor);\n\t\t\t\t\t\t$c_TipoFactor = $rowFactor['c_TipoFactor']; //Factor de impuesto\n\t\t\t\t\t}\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$c_TipoFactor; //Factor de impuesto\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\n\n\n\t\t\t//$subtotal=number_format($myrow2['subtotal']+$taxtotalratex,$decimalplaces,'.','');\n\t\t\t$subtotal = $myrow2['subtotal'] + $taxtotalratex;\n\t\t\t$subtotal = number_format($subtotal,$decimalplaces,'.','');\n\n\t\t\t$subtotal=number_format($myrow2['totaldescuento'] + $totalRowAnticipo ,$decimalplaces,'.','');\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal ;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t\n\t\t\t/*$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t//$subtotal=number_format($myrow2['subtotal']+$taxtotalratex,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;*/\n\n\n\t\t\t/*$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";*/\n\n\t\t\t//Validación de No. pedimento\n\n if($_SESSION['DatabaseName'] == 'erppisumma_DES' || $_SESSION['DatabaseName'] == 'erppisumma' || $_SESSION['DatabaseName'] == 'erppisumma_CAPA'){\n\t\t\t\t$sqladuana=\"SELECT nopedimento\n\t\t\t\t\t\t\tFROM pediment_aduanas \n\t\t\t\t\t\t\tWHERE orderno=\" . $orderno . \"\n\t\t\t\t \t\t\t\tAND stockid='\" . $myrow2['stockid'] . \"'\n\t\t\t\t \t\t\t\tAND orderlineno = '\" . $movorderlineno . \"'\";\n\n\t\t\t\tif ($_SESSION['UserID'] == \"desarrollo\"){\n\t\t\t\t\t//echo '<br/> sql aduanas 2: '.$sqladuana;\n\t\t\t\t}\n\t\t\t\t debug_sql($sqladuana, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$nopedimento=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}else{\n\t\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t\t$nopedimento= $myrowaduana['nopedimento'];\n\t\t\t\t\t\n\t\t\t\t\t$nameaduana = '';\n\t\t\t\t\t$numberaduana = '';\n\t\t\t\t\t$fechaaduana = '';\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$nopedimento=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}\n\n\t\t\tif($myrow['type'] == 66) { // Si es factura remision\n\n\t\t\t\t$ordernotmp = $myrow['orderno'];\n\n\t\t\t\t$SQL = \"\n\t\t\t\t\tSELECT GROUP_CONCAT(debtortrans.order_) AS order_\n\t\t\t\t\tFROM invoicetoremision\n\t\t\t\t\tINNER JOIN debtortrans\n\t\t\t\t\tON debtortrans.id = invoicetoremision.idremision\n\t\t\t\t\tWHERE invoicetoremision.idinvoice = '{$myrow['iddocto']}'\n\t\t\t\t\";\n\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t$rstmp = DB_query($SQL, $db);\n\t\t\t\t$rowtmp = DB_fetch_array($rstmp);\n\t\t\t\t$ordernotmp = $rowtmp['order_'];\n\n\t\t\t\tif(empty($ordernotmp) == FALSE) {\n\t\t\t\t\t//Validación de No. pedimento\n\t\t\t\t\tif($_SESSION['DatabaseName'] == 'erppisumma_DES' || $_SESSION['DatabaseName'] == 'erppisumma' || $_SESSION['DatabaseName'] == 'erppisumma_CAPA'){\n\t\t\t\t\t\t$sqladuana=\"SELECT nopedimento\n\t\t\t\t\t\t\t\tFROM pediment_aduanas \n\t\t\t\t\t\t\t\tWHERE orderno='\" . $ordernotmp . \"'\n\t\t\t\t\t \t\t\t\tAND stockid='\" . $stockid . \"'\n\t\t\t\t\t \t\t\t\tAND orderlineno = '\" . $movorderlineno . \"'\";\n\t\t\t if ($_SESSION['UserID'] == \"desarrollo\"){\n\t\t\t\t\t\t\techo '<br/> sql aduanas 66-2: '.$sqladuana;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t\t$fechaaduana = '';\n\t\t\t\t\t\t\t$nopedimento = $rowtmp['nopedimento'];\n\t\t\t\t\t\t\t$nameaduana = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\t$SQL = \"\n\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDATE_FORMAT(purchorderdetails.datecustoms,'%Y-%m-%d') AS fechaaduana,\n\t\t\t\t\t\t\tpedimento,\n\t\t\t\t\t\t\tcustoms AS aduana\n\t\t\t\t\t\t\tFROM purchorders\n\t\t\t\t\t\t\tINNER JOIN purchorderdetails\n\t\t\t\t\t\t\tON purchorderdetails.orderno = purchorders.orderno\n\t\t\t\t\t\t\tWHERE purchorders.requisitionno IN ($ordernotmp)\n\t\t\t\t\t\t\tAND purchorderdetails.itemcode = '$stockid'\n\t\t\t\t\t\t\";\n\t\t\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t\t$fechaaduana = $rowtmp['fechaaduana'];\n\t\t\t\t\t\t\t$nopedimento = $rowtmp['pedimento'];\n\t\t\t\t\t\t\t$nameaduana = $rowtmp['aduana'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n \n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana.'aqui';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$almacen;\n\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$totalCantEmision;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$movorderlineno;\n\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nopedimento;\n\n\t\t\t/*$stockprecio=number_format($myrow2['fxnet']+$taxtotalratex,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet']+$taxtotalratex,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal*/\n\n\t\t}\n /*if($_SESSION['UserID'] == \"desarrollo\"){\n echo '<br><pre>$charelectronicdetail: '.$charelectronicdetail;\n }*/\n \n\t}\n\t// complemento INE\n $charelectronicdetailINEComplements=\"\";\n $permiso_complementos = 'SELECT typecomplement FROM custbranch WHERE debtorno=\"'.$branch.'\"';\n\t$resul_permiso = DB_query($permiso_complementos,$db);\n\tlist($permiso_complemento) = DB_fetch_array($resul_permiso);\n\tif($permiso_complemento==1){\n\t\t$Select_INE = \"SELECT typeprocess,\n\t\t\t\t\t\t\ttypecommittee,\n\t\t\t\t\t\t\tentity, \n\t\t\t\t\t\t\tidaccounting, \n\t\t\t\t\t\t\torderno,\n\t\t\t\t\t\t\tIFNULL(scope,'') as scope \n\t\t\t\t\t\tFROM complementsine \n\t\t\t\t\t\tWHERE orderno = '\" . $orderno .\"'\";\n\t\t$Result_INE = DB_query($Select_INE, $db);\n\t\t$charelectronicdetailINEComplements = '|'.chr(13).chr(10).'010';\n while($ine = DB_fetch_array($Result_INE)){\n \t$tipoproceso = utf8_decode($ine['typeprocess']);\n\n \t$tipoproceso = str_replace(chr(63),chr(241), $tipoproceso);\n\t\t\t$detallesINE .= $tipoproceso . '|'.$ine['typecommittee'].'|'.$ine['entity'].'|'.$ine['idaccounting'].'|'.$ine['orderno'].'|'.$ine['scope'];\n\t\t}\n\t\t$charelectronicdetailINEComplements=$charelectronicdetailINEComplements.'|'.$detallesINE;\n\t\tif ($_SESSION ['UserID'] == 'saplicaciones' ) {\n\t\t\techo \"<br>\" . $charelectronicdetailINEComplements;\n\t\t}\n }\n\t// ivas retenidos\n\n\tif($_SESSION['UserID'] == \"desarrollo\"){\n\t\t//\techo __line__.'<br><pre>$charelectronic: '.$charelectronic;\n\t\t//\techo __line__.'<br><pre>$charelectronicdetail: '.$charelectronicdetail;\n\t\t//\t\techo __line__.'<br><pre>$charelectronictaxsret: '.$charelectronictaxsret;\n\t\t//\t\techo __line__.'<br><pre>$charelectronictaxsfederal: '.$charelectronictaxsfederal;\n\t\t//\t\techo __line__.'<br><pre>$charelectronictaxslocal: '.$charelectronictaxslocal;\n\t\t//\t\techo __line__.'<br><pre>$charelectronicEmbarque: '.$charelectronicEmbarque;\n\t\t//\t\techo __line__.'<br><pre>$totalCantEmision: '.$totalCantEmision;\n\t\t// echo __line__.'<br><pre>$charelectronicdetailINEComplements: '.$charelectronicdetailINEComplements;\n\t}\n if(empty($totalCantEmision) == true){\n $totalCantEmision = 0;\n }\n if($nivelfacturacion==1){\n debug_sql('TIPO OT', __LINE__,$debug_sql,__FILE__);\n $stockid=$OT; \n $stockcantidad = 1;\n $stockdescrip = $descripcionOT;\n }elseif($nivelfacturacion==2){\n debug_sql('TIPO CONCEPTOS', __LINE__,$debug_sql,__FILE__);\n \n }elseif($nivelfacturacion==3){\n debug_sql('Productos manufacturacios', __LINE__,$debug_sql,__FILE__);\n }\n\t// \t die(\"END XSA\");\n\n\tif ($rfccliente==\"XEXX010101000\" && $_SESSION['DesgloseIVA']!=1){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronictaxsfederal.$charelectronictaxs.$charelectronictaxslocal.$charelectronicEmbarque.$totalCantEmision.$charelectronicdetailINEComplements;\n\t\t$cadenaenviada=$cadenaenvio;//retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsfederal.$charelectronictaxs.$charelectronictaxslocal.$charelectronicEmbarque.$totalCantEmision.$charelectronicdetailINEComplements;\n\t\t$cadenaenviada=$cadenaenvio;//retornarString($cadenaenvio);\n\t}\n \n //debug_sql('cadena origsinal <br>'.$cadenaenviada, __LINE__,true,__FILE__,'blue');\n \n if ($_SESSION['UserID'] == \"desarrollo\") {\n \techo \"<pre><br> Cadena Original: \".$cadenaenviada.\"<br><pre/>\";\t\n }\n \n return $cadenaenviada;\n}", "function invoices ($user_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT * FROM `invoice` WHERE user_id = '{$user_id}' ORDER BY invoice_date DESC\");\n }", "public function index()\n {\n// dd($this->invoice->getNoInvoice());\n $spk=$this->spk->getAll();\n $data=compact('harga','spk');\n return view('invoice.index',$data);\n }", "public function index()\n {\n $productinvoices = ProductInvoice::orderBy('created_at', 'desc')->paginate(10);\n $invoices = Invoice::orderBy('created_at', 'desc')->paginate(10);\n return view('invoices.index', compact(['invoices','productinvoices']));\n }", "public function invoiceAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n /**\n * Get order Id\n * @var unknown\n */\n $orderId = $this->getRequest ()->getParam ( 'id' );\n /**\n * Getting order product ids\n */\n $orderPrdouctIds = Mage::helper ( 'marketplace/vieworder' )->getOrderProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n /**\n * Getting cancel order items\n */\n $cancelOrderItemProductIds = Mage::helper ( 'marketplace/vieworder' )->cancelOrderItemProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n\n /**\n * Getting the sonfiguration for order manage.\n */\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Check whether product id count is greater than one\n */\n if (count ( $orderPrdouctIds ) >= 1 && $orderStatusFlag == 1) {\n $order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n $itemsarray = $itemsArr = array ();\n /**\n * prepare invoice items\n */\n foreach ( $order->getAllItems () as $item ) {\n $qty = 0;\n /**\n * Prepare invoice qtys\n */\n $itemProductId = $item->getProductId ();\n $itemId = $item->getItemId ();\n /**\n * check whether item is in array\n */\n if (in_array ( $itemProductId, $orderPrdouctIds ) && ! in_array ( $itemProductId, $cancelOrderItemProductIds )) {\n $itemsArr [] = $itemId;\n /**\n * Qty ordered for that item\n */\n $qty = $item->getQtyOrdered () - $item->getQtyInvoiced ();\n }\n $itemsarray [$itemId] = $qty;\n }\n\n try {\n /**\n * Create invoice\n */\n if ($order->canInvoice ()) {\n /**\n * Generate invoice for shippment.\n */\n Mage::getModel ( 'sales/order_invoice_api' )->create ( $order->getIncrementId (), $itemsarray, '', 1, 1 );\n\t\t Mage::getModel ( 'marketplace/order' )->updateSellerOrderItemsBasedOnSellerItems ( $itemsArr, $orderId, 1 );\n\t\t $order->setStatus('processing');\n\t\t $order->save();\n /**\n * add success message\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( 'The invoice has been created.' ) );\n }\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Checkk the permission for generate invoice.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }", "function view(){\n\t\t$sale_number = $this->uri->segment(3);\n\n\t\t$data['purchase'] = $this->m_sale->get_one($sale_number)->row_array();\n\t\t$data['purchdetail'] = $this->m_sale->get_detail($sale_number);\n\n\t\t$this->template->load('inv_template', 'orders/v_view_sale', $data);\n\t}", "public function select_installment_invoices()\r\n {\r\n /*\r\n $this->db->select(\"invoice.*,cost.*\");\r\n $this->db->from(\"invoice\");\r\n $this->db->join('cost','invoice.installment_id=cost.id');\r\n $this->db->where(\"invoice.invoice_of\",\"1\"); //2 means installment\r\n $this->db->order_by(\"invoice.id\",\"desc\");\r\n $result = $this->db->get();\r\n */\r\n\r\n $this->db->select(\"*\");\r\n $this->db->select(\"user.name as user_name\");\r\n $this->db->select(\"invoice.id as invoice_id\");\r\n $this->db->select(\"user.family_name as user_surname\");\r\n $this->db->from(\"invoice\");\r\n $this->db->join('user', \"invoice.user_id = user.id\",\"left\");\r\n $this->db->order_by(\"invoice.id\",\"desc\");\r\n $result = $this->db->get();\r\n\r\n\r\n\r\n if ($result->num_rows()) {\r\n \r\n return $result->result_array();\r\n } else {\r\n return array();\r\n }\r\n }", "public function pos_invoice(){\n\t\t\n\t\tredirect('dashboard_pharmacist/invoice/Cinvoice');\n\t\t\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('linvoice');\n\t\t$content = $CI->linvoice->pos_invoice_add_form();\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function action_index()\n\t{\n\t\t$data = array(); // Model_Pos_Profile::get_current_user()\n\n\t\t$this->template->title = \"Cashier\";\n\t\t$this->template->content = View::forge('pos/invoice/index', $data);\n\t}", "public function index()\n {\n\t$impinv=ImportInvoice::all();\n\treturn view('importinvoice.index',compact('impinv'));\n }", "function cplanilla_view() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"planilla\"] = new cplanilla();\n\n\t\t// Initialize other table object\n\t\t$GLOBALS['usuario'] = new cusuario();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'view', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'planilla', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\t}", "public function delete_invoice()\n {\n $data['nestedView']['pageTitle'] = 'Invoice Delete';\n $data['nestedView']['heading'] = \"Invoice Delete\";\n $data['nestedView']['cur_page'] = 'Invoice Delete';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Date Change','class'=>'active','url'=>'');\n \n \n\n $data['flag']=1;\n $this->load->view('rollback_invoice/rollback_invoice_delete_view',$data);\n }", "public function index()\n {\n $all_new_invoice=Sale::all();\n return view('pos.new_invoices.index',compact('all_new_invoice'));\n }", "public function invoice_id(){\n return parent::get_fk_object(\"invoice_id\");\n }", "public function print_invoice($user_id,$record_reference_number)\n {\n \t$data = ['title' => 'Invoice'];\n \t$pdf = PDF::loadView('/gateready/invoice',$data);\n \t\n\n \treturn $pdf->download('invoice.pdf');\n }" ]
[ "0.77131456", "0.7550216", "0.7402858", "0.7220962", "0.7219168", "0.7168501", "0.7164234", "0.7164234", "0.7164234", "0.7149205", "0.7120361", "0.70605505", "0.70223105", "0.69906026", "0.6976979", "0.69416827", "0.69383657", "0.6937983", "0.69285184", "0.69051737", "0.68916273", "0.6883539", "0.68805194", "0.68788934", "0.6872975", "0.6872827", "0.6848418", "0.6841893", "0.68320906", "0.6814425", "0.68059325", "0.6802779", "0.6797133", "0.6790573", "0.6776744", "0.67588276", "0.675349", "0.6747807", "0.6730186", "0.6704619", "0.6691719", "0.66851586", "0.66781855", "0.6659057", "0.66554856", "0.66524094", "0.6632593", "0.6628296", "0.66153586", "0.6604857", "0.6600773", "0.6593475", "0.657993", "0.65799075", "0.65796906", "0.65689915", "0.6568259", "0.65558016", "0.655512", "0.6551472", "0.6542371", "0.6540957", "0.6536107", "0.65199417", "0.6514164", "0.6513216", "0.65115297", "0.65048134", "0.6492717", "0.6492461", "0.64869493", "0.64790046", "0.64650494", "0.6455283", "0.6454052", "0.6451588", "0.6451089", "0.6450428", "0.6449345", "0.6439822", "0.64330226", "0.642932", "0.64283824", "0.64278245", "0.642014", "0.64099723", "0.6407639", "0.64058334", "0.64043075", "0.64033103", "0.6385527", "0.6384718", "0.63757855", "0.6373822", "0.63648874", "0.6363683", "0.63568926", "0.6354697", "0.63541704", "0.6348496" ]
0.69584805
15
function removeInvoice This function is used to remove the invoice . Database Tables used in this function are : tbl_invoice
function removeInvoice($argPostIDs, $varPortalFilter) { $ctr = 0; if (isset($argPostIDs['deleteType']) && $argPostIDs['deleteType'] == 'sD') { $varWhereSdelete = " pkInvoiceID = '" . $argPostIDs['frmID'] . "' " . $varPortalFilter; $num = $this->delete(TABLE_INVOICE, $varWhereSdelete); if ($num > 0) { $ctr++; } } else { foreach ($argPostIDs['frmID'] as $varDeleteID) { $varWhr = " pkInvoiceID = '" . $varDeleteID . "'"; $varWhereCondition = $varWhr . $varPortalFilter; $num = $this->delete(TABLE_INVOICE, $varWhereCondition); if ($num > 0) { $ctr++; } } } return $ctr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_invoice_items($id){\n $this->company_db->delete('tbl_invoice_item', array(\"header_id\"=>$id));\n }", "public function remove(): int {\n $where = 'invoice_id = ?';\n $values = [$this->invoiceId];\n return $this->delete($where, $values);\n }", "public function delete_invoice() {\n\n // Make sure we were sent a mock invoice id\n if ( isset( $_POST[ 'mockInvoiceId' ] ) ) {\n\n // Get all entry ids that were part of the invoice so we can pass them back\n $entryArray = $this->mockinvoice_model->get_entry_ids( $_POST[ 'mockInvoiceId' ] );\n // Remove all entries from the invoice\n $this->mockinvoice_model->remove_all_entries( $_POST[ 'mockInvoiceId' ] );\n // Delete all mock invoice rows\n $this->mockinvoice_row_model->delete_where( 'mockInvoiceId', $_POST[ 'mockInvoiceId' ] );\n // Delete the mock invoice\n $this->mockinvoice_model->delete( $_POST[ 'mockInvoiceId' ] );\n\n }\n // Error handling - return some JSON if delete was processed\n if ( !empty( $entryArray ) ) {\n // Send back the timesheet entry ids as JSON\n $this->json_library->print_array_json_unless_empty( $entryArray );\n }\n }", "public function destroy(Invoice $invoice)\n {\n\n }", "function discard( $invoiceID ) {\n \n $this->company_db->trans_start(); \n \n $q = 'DELETE FROM invoices_details WHERE fk_invoice_id = '.$invoiceID; \n $this->company_db->query($q);\n \n $q = 'DELETE FROM hiring_invoices_control WHERE fk_invoice_id = '.$invoiceID; \n $this->company_db->query($q);\n \n $q = 'UPDATE invoices \n SET creation_date = null, \n fk_contract_id = null, \n subtotal = null, \n vat = null,\n total = null,\n accepted = null\n WHERE pk_id = '.$invoiceID;\n $this->company_db->query($q);\n \n $this->company_db->trans_complete();\n return $this->company_db->trans_status();\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "function deleteReceipt()\n\t{\n\t\tglobal $db;\n\n\t\t$query = 'DELETE FROM '.receipt_table.' WHERE receipt_id = '.$this->receipt_id;\n\t\t$db->query($query);\n\t}", "function delete()\n {\n $this->getDi()->hook->call(Am_Event::INVOICE_BEFORE_DELETE, array('invoice' => $this));\n foreach ($this->getItems() as $item) {\n $item->delete();\n }\n // $this->deleteFromRelatedTable('?_invoice_log'); // not good idea to delete\n $this->deleteFromRelatedTable('?_invoice_payment');\n $this->deleteFromRelatedTable('?_invoice_refund');\n $this->deleteFromRelatedTable('?_invoice_item_option');\n foreach ($this->getAccessRecords() as $access) {\n $access->delete();\n }\n parent::delete();\n $this->getUser()->checkSubscriptions(true);\n $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_DELETE, array('invoice' => $this));\n return $this;\n }", "function pnh_remove_invoice_in_packed_list()\r\n\t{\r\n\t\t$user=$this->auth(ADMINISTRATOR_ROLE);\r\n\t\tif(!$_POST)\r\n\t\t\tdie();\r\n\t\t$invoices=$this->input->post('invoice_nos');\r\n\t\t\r\n\t\tif($invoices)\r\n\t\t{\r\n\t\t\t$inv=implode(',',$invoices);\r\n\t\t\t\r\n\t\t\t$this->db->query(\"update shipment_batch_process_invoice_link set tray_id=0,packed_by=0,packed_on=0,packed=0 where invoice_no in ($inv) limit 1\");\r\n\t\t\t\r\n\t\t\tif($this->db->affected_rows())\r\n\t\t\t{\r\n\t\t\t\t$tray_territory_id=array();\r\n\t\t\t\t$cur_datetime=cur_datetime();\r\n\t\t\t\tforeach ($invoices as $invno)\r\n\t\t\t\t{\r\n\t\t\t\t\t$tray_inv_status=2;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// remove shipments/invoice from tray\r\n\t\t\t\t\t$tray_inv_link = $this->db->query(\"select tray_inv_id,tray_terr_id from pnh_t_tray_invoice_link where invoice_no = ? and status = 1 order by tray_inv_id desc limit 1 \",$invno)->row_array();\r\n\t\t\t\t\r\n\t\t\t\t\t// update tray invoice status = 2 for invno\r\n\t\t\t\t\t$this->db->query(\"update pnh_t_tray_invoice_link set status = $tray_inv_status,modified_on=?,modified_by=? where status = 1 and tray_inv_id = ? \",array($cur_datetime,$user['userid'],$tray_inv_link['tray_inv_id']));\r\n\t\t\t\t\t$tray_territory_id[]=$tray_inv_link['tray_terr_id'];\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tforeach($tray_territory_id as $id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$tray_inv_link = $this->db->query(\"select tray_inv_id,tray_terr_id,invoice_no from pnh_t_tray_invoice_link where tray_terr_id=? and status = 1 order by tray_inv_id desc limit 1 \",$id);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($tray_inv_link->num_rows())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$this->db->query(\"update pnh_t_tray_territory_link set is_active = 0,modified_on=?,modified_by=? where is_active = 1 and tray_terr_id = ? \",array($cur_datetime,$user['userid'],$id));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->session->set_flashdata(\"erp_pop_info\",\"Selected invoices removed in packed list\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tredirect($_SERVER['HTTP_REFERER']);;\r\n\t}", "public function delete_client_invoice($delete_id){\n\t\n\t$this->db->where('client_id', $delete_id);\n\t\t\n\treturn $this->db->delete('invoice');\n\t\n}", "public function destroy(Invoice $invoice) {\n\t\t//\n\t}", "function AfterDelete($where,&$deleted_values,&$message,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid = $deleted_values['proid'];\n\n\n//get related bill in student record\n$sql_bill= \"select student_bill_id from student_billing where proid='$proid'\";\n$q_bill = db_query($sql_bill,$conn);\n$row_bill=db_fetch_array($q_bill);\n\n//delete payment record\ndo{\n$student_bill_id=$q_bill['student_bill_id'];\n$sql_del2=\"DELETE FROM student_payment WHERE student_bill_id='$student_bill_id'\";\ndb_exec($sql_del2,$conn);\t \n}while($row_bill=db_fetch_array($q_bill));\n\n//then delete student bill\n$sql_del=\"DELETE FROM student_billing WHERE proid='$proid'\";\ndb_exec($sql_del,$conn);\t \n\n\n\n\n\n\n\n\n\n\n\n\n;\t\t\n}", "function unacknowledgeInvoice($invoice_id) {\n\n // attempting to use $wpdb directly to update timestamp to null\n // results in it being set to \"0000-00-00 00:00:00\"\n // so using direct SQL instead\n $dblink = new DbTransaction();\n try {\n $stmt = $dblink->mysqli->prepare(\n \"UPDATE wp_invoice\n SET acknowledged_date = NULL\n WHERE id = ?\");\n $stmt->bind_param('i', $invoice_id);\n if(false === $stmt->execute()) {\n throw new DatabaseException(\"Error occurred updating wp_invoice: \".$dblink->mysqli->error);\n }\n $stmt->close();\n \n } catch(Exception $ex) {\n $dblink->mysqli->rollback();\n $dblink->mysqli->close();\n throw $ex;\n }\n \n $dblink->mysqli->commit();\n $dblink->mysqli->close();\n }", "public function destroy(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function destroy(PurchaseInvoice $purchaseInvoice)\n {\n //\n }", "public function managerPurchaseDelete($invoice , $cashbook_id)\n {\n // get purchas information\n $purchase_info_query = DB::table('purchase')->where('cashbook_id',$cashbook_id)->where('invoice',$invoice)->first();\n\n $bill_added_id = $purchase_info_query->added_id ;\n $bill_tr_date = $purchase_info_query->purchase_date ;\n $bill_created_at = $purchase_info_query->created_at ;\n $total_price = $purchase_info_query->total_price;\n $total_payment = $purchase_info_query->total_payment ;\n $total_qty = $purchase_info_query->total_quantity ;\n $memo = $purchase_info_query->memo_no ;\n $supplier_id = $purchase_info_query->supplier_id ;\n\n $was_supplier_due = $total_price - $total_payment ;\n\n // purchase product item\n $product_item = DB::table('purchase_product')->where('branch_id',$this->branch_id)->where('cashbook_id',$cashbook_id)->where('invoice_number',$invoice)->get();\n $itam = array();\n $qty = array();\n $price= array();\n foreach ($product_item as $value_iteam) {\n $itam[] = $value_iteam->product_id ;\n $qty[] = $value_iteam->total_quantity ;\n $price[] = $value_iteam->purchase_price ;\n }\n $item_implode = implode(',', $itam);\n $qty_implode = implode(',', $qty);\n $price_implode = implode(',', $price);\n #----------------------------- pettycash amount ----------------------------------#\n #----------------------------------- update pettycash ------------------------------------#\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',2)->limit(1)->first();\n // petty cash update\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $current_pettycash_amt + $total_payment ;\n // update pettycash amount\n $data_update_pettycash = array();\n $data_update_pettycash['pettycash_amount'] = $now_pettycash_amt; \n DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',2)->update($data_update_pettycash);\n #----------------------------------- end update pettycash ------------------------------------ #\n #----------------------------------- insert date into delete history---------------------------#\n $data_delete_history = array();\n $data_delete_history['admin_type'] = 2 ;\n $data_delete_history['branch_id'] = $this->branch_id ;\n $data_delete_history['status'] = 16 ;\n $data_delete_history['tr_status'] = 1 ;\n $data_delete_history['before_pettycash_amt'] = $current_pettycash_amt ;\n $data_delete_history['after_pettycash_amt'] = $now_pettycash_amt ;\n $data_delete_history['bill_added_id'] = $bill_added_id ;\n $data_delete_history['bill_remove_id'] = $this->loged_id ;\n $data_delete_history['bill_tr_date'] = $bill_tr_date ;\n $data_delete_history['bill_remove_date'] = $this->rcdate ;\n $data_delete_history['bill_created_date'] = $bill_created_at ;\n $data_delete_history['bill_remove_time'] = $this->current_time ; \n DB::table('delete_history')->insert($data_delete_history);\n #----------------------------------- end insert data into delete history -----------------------#\n // get last delete history\n $last_delete_history_query = DB::table('delete_history')->orderBy('id','desc')->limit(1)->first();\n $last_delete_history_id = $last_delete_history_query->id ; \n #----------------------------- end pettycash amount -------------------------------#\n #----------------------------- insert delete purcahse ------------------------------#\n $delete_purchase = array();\n $delete_purchase['cashbook_id'] = $cashbook_id ;\n $delete_purchase['invoice'] = $invoice ;\n $delete_purchase['memo_no'] = $memo ;\n $delete_purchase['supplier_id'] = $supplier_id ;\n $delete_purchase['branch_id'] = $this->branch_id ;\n $delete_purchase['total_quantity'] = $total_qty ;\n $delete_purchase['total_price'] = $total_price ;\n $delete_purchase['total_payment'] = $total_payment ;\n $delete_purchase['product_id'] = $item_implode ;\n $delete_purchase['product_qty'] = $qty_implode ;\n $delete_purchase['product_price'] = $price_implode ;\n $delete_purchase['bill_added_id'] = $bill_added_id;\n $delete_purchase['bill_remove_id'] = $this->loged_id ; \n $delete_purchase['bill_tr_date'] = $bill_tr_date ;\n $delete_purchase['bill_remove_date'] = $this->rcdate ;\n $delete_purchase['bill_created_date'] = $bill_created_at;\n $delete_purchase['bill_remove_time'] = $this->current_time;\n DB::table('delete_purchase')->insert($delete_purchase);\n #----------------------------- end insert delete purchase ---------------------------#\n #----------------------------- update supplier due-----------------------------------#\n $supplier_due_query = DB::table('supplier_due')->where('supplier_id',$supplier_id)->first();\n $database_supplier_due = $supplier_due_query->total_due_amount ;\n $now_supplier_due = $database_supplier_due - $was_supplier_due ;\n $data3 = array();\n $data3['total_due_amount'] = $now_supplier_due ;\n $update_supplier_due = DB::table('supplier_due')->where('supplier_id',$supplier_id)->update($data3);\n\n #----------------------------- end update supplier due -------------------------------#\n #----------------------------- delete cash book --------------------------------------# \n DB::table('cashbook')->where('id',$cashbook_id)->delete();\n\n #----------------------------- end delete cash book ----------------------------------#\n #----------------------------- delete payment ledger --------------------------------#\n DB::table('payment_ledger')->where('branch_id',$this->branch_id)->where('cashbook_id',$cashbook_id)->where('invoice',$invoice)->where('status',1)->where('supplier_id',$supplier_id)->delete();\n #---------------------------- end delete payment ledger -----------------------------#\n #---------------------------- delete purchase product -------------------------------#\n DB::table('purchase_product')->where('branch_id',$this->branch_id)->where('cashbook_id',$cashbook_id)->where('invoice_number',$invoice)->delete();\n #---------------------------- end delete purchas product-----------------------------#\n #---------------------------- delete purchase ---------------------------------------#\n DB::table('purchase')->where('cashbook_id',$cashbook_id)->where('invoice',$invoice)->delete();\n #---------------------------- end delete purchase -----------------------------------#\n Session::put('succes','Thanks , Purchase Deleted Successfully');\n return Redirect::to('managerPurchaseReport');\n\n }", "public function delete_invoice( $invoice_id ) {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n \n // Get invoice details\n $invoice = $this->invoice->delete_invoice( $invoice_id ); \n \n // Verify if invoice exists\n if ( $invoice ) {\n \n echo json_encode(1);\n \n }\n \n }", "public function remove_ind_enrll() \n {\n $this->output->enable_profiler(TRUE);\n $tenant_id = $this->tenant_id;\n\n $logged_in_user_id = $this->user->user_id;\n $invoice_id = $this->input->post('invoice_no1');\n $user_id = $this->input->post('user_id1');\n $user = $this->input->post('user1');\n $pymnt_due_id = $this->input->post('pymnt_due_id1');\n $course_id = $this->input->post('crouse_id1');\n $class_id = $this->input->post('class_id1');\n \n $status = $this->classtraineemodel->remove_individual_enrollment($tenant_id, $logged_in_user_id,$user_id, $course_id, $class_id,$invoice_id, $pymnt_due_id);\n if ($status) \n {\n \n $this->session->set_flashdata(\"success\", \"Successfully removed trainee '\" . $user . \"'\");\n } \n else \n {\n $this->session->set_flashdata(\"error\", \"We were not able to remove the selected trainee(s). Please try again later.\");\n }\n \n redirect(\"class_trainee\");\n }", "function delete_insurance($ins_id)\n\t{\n\t\tglobal $db;\n\t\n\t\t//Right They Want To Delete A QuarterMile Time\n\t\tif (empty($ins_id))\n\t\t{\n\t \t\tmessage_die(GENERAL_ERROR, 'Insurance ID Not Entered', '', __LINE__, __FILE__);\n\t\t}\n\n\t\t//Time To Delete The Actual Insurance Premium\n\t\t$this->delete_rows(GARAGE_INSURANCE_TABLE, 'id', $ins_id);\t\n\t\n\t\treturn ;\n\t}", "public function delete_invoice()\n {\n $data['nestedView']['pageTitle'] = 'Invoice Delete';\n $data['nestedView']['heading'] = \"Invoice Delete\";\n $data['nestedView']['cur_page'] = 'Invoice Delete';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Date Change','class'=>'active','url'=>'');\n \n \n\n $data['flag']=1;\n $this->load->view('rollback_invoice/rollback_invoice_delete_view',$data);\n }", "public function purchase_unsaved_delete()\n {\n $purchase_no = $this->input->post('purchase_no');\n /** Remove auto created purchase journal */\n $journal = $this->MAc_journal_master->get_by_doc('Purchase', $purchase_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created payment receipt for partial or full cash purchase */\n $payment = $this->MAc_payment_receipts->get_by_doc('Purchase', $purchase_no);\n if (count($payment) > 0)\n {\n $this->MAc_payment_receipts->delete($payment['id']);\n }\n /** Remove purchase */\n $this->MPurchase_details->delete_by_purchase_no($purchase_no);\n $this->MPurchase_master->delete_by_purchase_no($purchase_no);\n }", "public function delete_invoice_row() {\n\n $deleteFlag = false;\n\n // Count the entries and rows from the invoice\n $count = $this->mockinvoice_model->count_invoice_entries( $_POST[ 'mockInvoiceId' ] );\n\n // Don't delete, but clear the data if it is the last one\n if ( $count[0]->invoiceRowCount == 1 ) {\n // Set null values\n $data = array(\n 'category' => null,\n 'description' => null,\n 'amount' => null\n );\n // Clear the data of the mock invoice row\n $this->mockinvoice_row_model->save( $data, $_POST[ 'mockInvoiceRowId' ] );\n\n // Else, more than 1 row so we delete\n } else {\n // Delete the mock invoice row\n $this->mockinvoice_row_model->delete_where( 'mockInvoiceRowId', $_POST[ 'mockInvoiceRowId' ] );\n $deleteFlag = true;\n }\n\n\n // Send back how many rows there were and if 1 was deleted\n $returnArray[] = array( 'initialCount' => $count, 'rowDeleted' => $deleteFlag );\n $this->json_library->print_array_json_unless_empty( $returnArray );\n }", "public function removePurchaseDetail() { \n\n $result = 0;\n $purchaseDelIds = !empty($_GET['purchaseDelIds']) ? $_GET['purchaseDelIds'] : '';\n $totalss = !empty($_GET['totalss']) ? $_GET['totalss'] : '';\n $totalr = !empty($_GET['totalr']) ? $_GET['totalr'] : '';\n $otherChargess = !empty($_GET['otherChargess']) ? $_GET['otherChargess'] : '';\n $purchaseIds = !empty($_GET['purchaseIds']) ? $_GET['purchaseIds'] : '';\n $grandTotals = !empty($_GET['grandTotals']) ? $_GET['grandTotals'] : '';\n \n \n //if (!empty($purchaseDelIds)) {\n $purhaseModel = new PurhaseModel();\n $result = $purhaseModel->deletePurhaseDetails($purchaseDelIds,$purchaseIds,$totalss,$totalr,$otherChargess,$grandTotals);\n //}\n echo $result;\n\n \n }", "public function cashierDeleteOPDDueCollection($id , $invoice , $year_invoice , $daily_invoice , $cashbook_id , $invoice_tr_id , $status)\n {\n // due collection info\n $collection_info = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('id',$id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->first();\n $total_payable = $collection_info->total_payable ;\n $total_discount = $collection_info->total_discount ;\n $total_rebate = $collection_info->total_rebate ;\n $total_payment = $collection_info->total_payment ;\n $bill_added_id = $collection_info->added_id ;\n $bill_tr_date = $collection_info->tr_date ;\n $bill_created_time = $collection_info->created_time ;\n $bill_created_at = $collection_info->created_at ;\n\n // get opd bill info\n $opd_bill_info_query = DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->limit(1)->first();\n $opd_status = $opd_bill_info_query->opd_status ;\n\n if($opd_status == '2'){\n $check_pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n // petty cash check\n $check_current_pettycash_amt = $check_pettycash_amount->pettycash_amount ;\n if($check_current_pettycash_amt < $total_payment){\n Session::put('failed','Sorry ! Pettycash Amount Small Than Delete Collection Amount. Please Delete This Collection After Available Pettycash');\n return Redirect::to('cashierOPDDueCollectionReport');\n exit();\n }\n }\n // check doctor discount\n $count_doctor_discount = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',2)->count();\n if($count_doctor_discount > 0){\n Session::put('failed','Sorry ! Given Doctor Discount Of This OPD Bill. First Delete Doctor Discount Of This Bill Then Try To Delete OPD Due Collection');\n return Redirect::to('cashierOPDDoctorDiscountReport');\n exit();\n \n }\n\n if($opd_status == '2'){\n // delete cashbook id\n DB::table('cashbook')->where('id',$cashbook_id)->delete();\n // reduce pettycash amount\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $current_pettycash_amt - $total_payment ;\n // update pettycash amount\n $data_update_pettycash = array();\n $data_update_pettycash['pettycash_amount'] = $now_pettycash_amt; \n DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->update($data_update_pettycash);\n }else{\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $pettycash_amount->pettycash_amount ;\n }\n\n $due_status = 2 ;\n // change opd bill status\n $data_pathlogy_due_status = array() ;\n $data_pathlogy_due_status['due_status'] = $due_status ;\n DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->update($data_pathlogy_due_status);\n \n // insert data into\n $data_delete_history = array();\n $data_delete_history['admin_type'] = 3 ;\n $data_delete_history['branch_id'] = $this->branch_id ;\n $data_delete_history['status'] = 5 ;\n $data_delete_history['tr_status'] = 1 ;\n $data_delete_history['before_pettycash_amt'] = $current_pettycash_amt ;\n $data_delete_history['after_pettycash_amt'] = $now_pettycash_amt ;\n $data_delete_history['bill_added_id'] = $bill_added_id ;\n $data_delete_history['bill_remove_id'] = $this->loged_id ;\n $data_delete_history['bill_tr_date'] = $bill_tr_date ;\n $data_delete_history['bill_remove_date'] = $this->rcdate ;\n $data_delete_history['bill_created_date'] = $bill_created_at ;\n $data_delete_history['bill_created_time'] = $bill_created_time ;\n $data_delete_history['bill_remove_time'] = $this->current_time ; \n DB::table('delete_history')->insert($data_delete_history);\n // get last delete history\n $last_delete_history_query = DB::table('delete_history')->orderBy('id','desc')->limit(1)->first();\n $last_delete_history_id = $last_delete_history_query->id ; \n // insert into delete pathlogy bill\n $data_delete_pathology_bill = array();\n $data_delete_pathology_bill['delete_history_id'] = $last_delete_history_id ;\n $data_delete_pathology_bill['branch_id'] = $this->branch_id ;\n $data_delete_pathology_bill['cashbook_id'] = $cashbook_id ;\n $data_delete_pathology_bill['invoice_number'] = $invoice;\n $data_delete_pathology_bill['year_invoice_number'] = $year_invoice ;\n $data_delete_pathology_bill['daily_invoice_number'] = $daily_invoice;\n $data_delete_pathology_bill['invoice_tr_id'] = $invoice_tr_id ;\n $data_delete_pathology_bill['total_payable'] = $total_payable;\n $data_delete_pathology_bill['total_payment'] = $total_payment;\n $data_delete_pathology_bill['total_discount'] = $total_discount;\n $data_delete_pathology_bill['total_rebate'] = $total_rebate;\n $data_delete_pathology_bill['status'] = $status ;\n $data_delete_pathology_bill['opd_status'] = $opd_status ;\n $data_delete_pathology_bill['bill_added_id'] = $bill_added_id;\n $data_delete_pathology_bill['bill_remove_id'] = $this->loged_id ; \n $data_delete_pathology_bill['bill_tr_date'] = $bill_tr_date ;\n $data_delete_pathology_bill['bill_remove_date'] = $this->rcdate ;\n $data_delete_pathology_bill['bill_created_date'] = $bill_created_at;\n $data_delete_pathology_bill['bill_created_time'] = $bill_created_time ;\n $data_delete_pathology_bill['bill_remove_time'] = $this->current_time;\n DB::table('delete_opd_bill')->insert($data_delete_pathology_bill);\n // now delete patylogy bill transaction\n DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('id',$id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->delete();\n Session::put('succes','Thanks , OPD Due Collection Deleted Successfully');\n return Redirect::to('cashierOPDDueCollectionReport');\n }", "function removeRegistro($id) {\n GLOBAL $con;\n\n //busca info\n $querybusca = \"select * from kardexs where id='\" . $id . \"'\";\n $qry = mysql_query($querybusca);\n $linha = mysql_fetch_assoc($qry);\n\n //Apagua\n $query = \"delete from kardexs where id='\" . $id . \"'\";\n mysql_query($query, $con) or die(mysql_error());\n\n if (saldoExiste($linha['produto_id'], $linha['estoque_id'])) {\n //atualiza retirando saldo\n $saldoAtual = saldoByEstoque($linha['produto_id'], $linha['estoque_id']);\n if ($linha['sinal'] == '+') {\n $saldoAtual_acerto = $saldoAtual - $linha['qtd'];\n } else {\n $saldoAtual_acerto = $saldoAtual + $linha['qtd'];\n }\n\n\n saldo_atualiza($linha['produto_id'], $linha['estoque_id'], $saldoAtual_acerto);\n }\n}", "function remove() {\n\n global $db;\n\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key LIKE 'MODULE\\_PAYMENT\\_CCBILL\\_%'\");\n\n $tcSql = 'drop table if exists ccbill';\n\n $db->Execute($tcSql);\n\n $tcSql = 'ALTER TABLE orders DROP COLUMN ccbill_id';\n\n $db->Execute($tcSql);\n\n $this->notify('NOTIFY_PAYMENT_CCBILL_UNINSTALLED');\n\n //$messsageStack->add_session('CCBill payment module successfully removed.', 'error');\n //zen_redirect(zen_href_link(FILENAME_MODULES, 'set=payment', 'NONSSL'));\n\n }", "public function destroy(Request $request)\n{\n$id = $request->id;\n$invoice = invoice::find($id)\n->get()\n->first();\n$invoice->delete();\nsession()->flash('delete', 'deletet successfully');\nreturn back();\n}", "function export_cp_remove_items($invoice_number, $script_nos) {\n\n if ( ! $script_nos) return;\n\n global $mssql;\n $mssql = $mssql ?: new Mssql_Cp();\n\n $order_id = $invoice_number - 2; //TODO SUPER HACKY\n $script_nos = \"('\".implode(\"', '\", $script_nos).\"')\";\n\n //$sql = \"SirumWeb_RemoveScriptNosFromOrder '$invoice_number', '$script_nos'\";\n\n $sql1 = \"\n DELETE csomline\n FROM csomline\n JOIN cprx ON cprx.rx_id = csomline.rx_id\n WHERE csomline.order_id = '$order_id'\n AND script_no IN $script_nos\n AND rxdisp_id = 0 -- if the rxdisp_id is set on the line, you have to call CpOmVoidDispense first.\n \";\n\n $sql2 = \"\n UPDATE csom\n SET csom.liCount = (SELECT COUNT(*) FROM csomline WHERE order_id = '$order_id')\n WHERE order_id = '$order_id'\n \";\n\n $res = $mssql->run($sql1);\n $res = $mssql->run($sql2);\n}", "function eliminar_insumos($objeto){\n\t\t$sql=\"\tDELETE FROM\n\t\t\t\t\t app_producto_material\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto =\".$objeto['id'];\n\t\t// return $sql;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}", "function remove() {\n $keys = \"\";\n $keys_array = $this->keys();\n for ($i = 0; $i < sizeof($keys_array); $i ++) {\n $keys .= \"'\" . $keys_array[$i] . \"',\";\n }\n $keys = substr($keys, 0, - 1);\n \n if (MODULE_PAYMENT_CGP_DROP_TABLE === 'True') {\n tep_db_query(\"DROP TABLE IF EXISTS `CGP_orders_table`\");\n }\n \n tep_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key IN (\" . $keys . \")\");\n }", "public function delete($invoice_id, $id) {\n\t\tDB::select(\n\t\t\t\"DELETE FROM invoice_item\n\t\t\tWHERE invoice_item.item_id = :id\",\n\t\t\tarray(\":id\" => $id));\n\t\treturn redirect('invoices/details/' . $invoice_id);\n\t}", "function eliminaStock($codigo)\r\n{\r\n $link=conectar();\r\n $sql=\"DELETE FROM producto_ubicacion WHERE pu_id ='$codigo'\";\r\n $res=mysql_query($sql,$link) or die(\"Error en: $sql: \" . mysql_error());\r\n if(mysql_affected_rows()>0)\r\n {\r\n return '1';\r\n }\r\n mysql_close($link);\r\n}", "function remove($pr_id) {\n\t\t$db=htvcenter_get_db_connection();\n\t\t$rs = $db->Execute(\"delete from \".$this->_db_table.\" where pr_id=$pr_id\");\n\t}", "public function destroy($id)\n {\n RetailSaleModel::where('invoice_id',$id)->delete();\n RetailSaleChildModel::where('invoice_id',$id)->delete();\n Session::flash('success','Invoice Deleted Successfully');\n return back();\n }", "function ciniki_sapos_hooks_invoiceItemDelete($ciniki, $tnid, $args) {\n\n if( !isset($args['invoice_id']) || $args['invoice_id'] == '' \n || !isset($args['object']) || $args['object'] == '' \n || !isset($args['object_id']) || $args['object_id'] == '' \n ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.3', 'msg'=>'No invoice or item specified.'));\n }\n\n //\n // Load the settings\n //\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_sapos_settings', 'tnid', $tnid, 'ciniki.sapos', 'settings', '');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $settings = isset($rc['settings'])?$rc['settings']:array();\n\n //\n // Get the details of the item\n //\n $strsql = \"SELECT id, uuid, invoice_id, object, object_id, quantity \"\n . \"FROM ciniki_sapos_invoice_items \"\n . \"WHERE invoice_id = '\" . ciniki_core_dbQuote($ciniki, $args['invoice_id']) . \"' \"\n . \"AND object = '\" . ciniki_core_dbQuote($ciniki, $args['object']) . \"' \"\n . \"AND object_id = '\" . ciniki_core_dbQuote($ciniki, $args['object_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['item']) ) { \n // Item doesn't exist, return ok\n return array('stat'=>'ok');\n// return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.382', 'msg'=>'Unable to find invoice item'));\n }\n $item = $rc['item'];\n\n //\n // Check to make sure the invoice hasn't been paid\n //\n $strsql = \"SELECT id, uuid, status \"\n . \"FROM ciniki_sapos_invoices \"\n . \"WHERE ciniki_sapos_invoices.id = '\" . ciniki_core_dbQuote($ciniki, $item['invoice_id']) . \"' \"\n . \"AND ciniki_sapos_invoices.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'invoice');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['invoice']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.6', 'msg'=>'Invoice does not exist'));\n }\n $invoice = $rc['invoice'];\n\n //\n // Invoice has already been paid, we don't want to remove this item\n //\n if( $invoice['status'] >= 50 && (!isset($settings['rules-invoice-paid-change-items']) || $settings['rules-invoice-paid-change-items'] == 'no')) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.7', 'msg'=>'Invoice has been paid, unable to remove item'));\n }\n\n //\n // Check to make sure the item isn't part of a shipment\n //\n $strsql = \"SELECT id \"\n . \"FROM ciniki_sapos_shipment_items \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND item_id = '\" . ciniki_core_dbQuote($ciniki, $item['id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_rows'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.8', 'msg'=>'Item is part of a shipment and cannot be removed.'));\n }\n\n //\n // Check for a callback for the item object\n //\n if( $item['object'] != '' && $item['object_id'] != '' ) {\n list($pkg,$mod,$obj) = explode('.', $item['object']);\n $rc = ciniki_core_loadMethod($ciniki, $pkg, $mod, 'sapos', 'itemDelete');\n if( $rc['stat'] == 'ok' ) {\n $fn = $rc['function_call'];\n $rc = $fn($ciniki, $tnid, $item['invoice_id'], $item);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n }\n\n //\n // Remove the item\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n $rc = ciniki_core_objectDelete($ciniki, $tnid, 'ciniki.sapos.invoice_item', \n $item['id'], $item['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check if invoice should be deleted when nothing in it\n //\n if( $invoice['status'] < 50 && isset($args['deleteinvoice']) && $args['deleteinvoice'] == 'yes' ) {\n $remove = 'yes';\n //\n // Check for invoice items\n //\n $strsql = \"SELECT COUNT(ciniki_sapos_invoice_items.id) \"\n . \"FROM ciniki_sapos_invoice_items \"\n . \"WHERE ciniki_sapos_invoice_items.invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice['id']) . \"' \"\n . \"AND ciniki_sapos_invoice_items.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_sapos_invoice_items.id <> '\" . ciniki_core_dbQuote($ciniki, $item['id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbSingleCount');\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.sapos', 'num_items');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['num_items']) || $rc['num_items'] != 0 ) {\n $remove = 'no';\n }\n //\n // Check for invoice shipments\n //\n $strsql = \"SELECT COUNT(ciniki_sapos_shipments.id) \"\n . \"FROM ciniki_sapos_shipments \"\n . \"WHERE ciniki_sapos_shipments.invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice['id']) . \"' \"\n . \"AND ciniki_sapos_shipments.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.sapos', 'num_items');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['num_items']) || $rc['num_items'] != 0 ) {\n $remove = 'no';\n }\n //\n // Check for invoice transactions\n //\n $strsql = \"SELECT COUNT(ciniki_sapos_transactions.id) \"\n . \"FROM ciniki_sapos_transactions \"\n . \"WHERE ciniki_sapos_transactions.invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice['id']) . \"' \"\n . \"AND ciniki_sapos_transactions.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.sapos', 'num_items');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['num_items']) || $rc['num_items'] != 0 ) {\n $remove = 'no';\n }\n\n if( $remove == 'yes' ) {\n //\n // Remove the invoice\n //\n $rc = ciniki_core_objectDelete($ciniki, $tnid, 'ciniki.sapos.invoice', $invoice['id'], $invoice['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.sapos');\n return $rc;\n }\n }\n }\n\n if( !isset($remove) || $remove != 'yes' ) {\n //\n // Update the invoice status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'invoiceUpdateShippingTaxesTotal');\n $rc = ciniki_sapos_invoiceUpdateShippingTaxesTotal($ciniki, $tnid, $item['invoice_id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the invoice status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'invoiceUpdateStatusBalance');\n $rc = ciniki_sapos_invoiceUpdateStatusBalance($ciniki, $tnid, $item['invoice_id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $tnid, 'ciniki', 'sapos');\n\n return array('stat'=>'ok');\n}", "public function destroy(Invoice $invoice)\n {\n // DB::beginTransaction();\n // $invoice->is_active = 0;\n // $invoice->save();\n // DB::commit();\n\n // return Response::json(['message' => 'Data berhasil dinon-aktifkan'], 200);\n }", "public function destroy($id_payable_invoice)\n {\n $invoice = InvoicePayable::findOrFail($id_payable_invoice);\n InvoicePayabledetail::where('id_payable_invoice', $id_payable_invoice)->delete();\n $invoice->delete();\n\n return redirect()->back()->with('messagehapus','Data Invoice Berhasil dihapus');\n }", "public function delete() {\n\t$stmt = $this->_database->prepare('DELETE FROM planetterrains WHERE refid = ?');\n\t$stmt->bind_param('i', $this->refid);\n\t$stmt->execute();\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->delete();\n\t}\n }", "public function delete()\n {\n if (post_param_integer('confirmed', 0) != 1) {\n $url = get_self_url();\n $text = do_lang_tempcode('DELETE_INVOICE');\n\n $hidden = build_keep_post_fields();\n $hidden->attach(form_input_hidden('confirmed', '1'));\n $hidden->attach(form_input_hidden('from', get_param_string('from', 'browse')));\n\n return do_template('CONFIRM_SCREEN', array('_GUID' => '45707062c00588c33726b256e8f9ba40', 'TITLE' => $this->title, 'FIELDS' => $hidden, 'PREVIEW' => $text, 'URL' => $url));\n }\n\n $GLOBALS['SITE_DB']->query_delete('invoices', array('id' => get_param_integer('id')), '', 1);\n\n $url = build_url(array('page' => '_SELF', 'type' => post_param_string('from', 'browse')), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }", "function delete_invoice_master()\n {\n $this->db->select('*');\n $this->db->from('srp_erp_customerinvoicedetails');\n $this->db->where('invoiceAutoID', trim($this->input->post('invoiceAutoID')));\n $datas = $this->db->get()->row_array();\n\n $this->db->select('invoiceCode');\n $this->db->from('srp_erp_customerinvoicemaster');\n $this->db->where('invoiceAutoID', trim($this->input->post('invoiceAutoID')));\n $master = $this->db->get()->row_array();\n\n if ($datas) {\n $this->session->set_flashdata('e', 'please delete all detail records before delete this document.');\n return true;\n } else {\n $lenth=strlen($master['invoiceCode']);\n if($lenth > 1){\n $data = array(\n 'isDeleted' => 1,\n 'deletedEmpID' => current_userID(),\n 'deletedDate' => current_date(),\n );\n $this->db->where('invoiceAutoID', trim($this->input->post('invoiceAutoID')));\n $this->db->update('srp_erp_customerinvoicemaster', $data);\n return true;\n\n }else{\n $this->db->where('invoiceAutoID', $this->input->post('invoiceAutoID'));\n $results = $this->db->delete('srp_erp_customerinvoicemaster');\n if ($results) {\n $this->db->where('InvoiceAutoID', $this->input->post('InvoiceAutoID'));\n $this->db->delete('srp_erp_customerinvoicedetails');\n $this->session->set_flashdata('s', 'Deleted Successfully');\n return true;\n }\n }\n\n }\n }", "function delete_item($id,$id_documento){\n $db = new MySQL();\n $sql = \"DELETE FROM facturas_detalle WHERE id='$id'\";\n $db->consulta($sql);\n \n /*\n * actualizar nuevos saldos\n */\n $this->actualizar_totales($id_documento);\n }", "function cancel_invoice($id)\r\n\t{\r\n\t\t\r\n\t\t$data['check'] = $this->My_model->select_any_row('invoice',array('INVOICE_NO' => $id)); \r\n\t\tif($data['check']->STATUS == 1)\r\n\t\t{\r\n\t\t\t$status = 0;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$status = 1;\r\n\t\t}\r\n\t\t$this->My_model->update_any_table('invoice',array('STATUS' => $status),array('INVOICE_NO ' => $id));\r\n\t\t$this->session->set_flashdata('msg','<div class=\"alert alert-dark alert-danger\">Invoice Cancelled Successfully</div>');\r\n\t\tredirect('Welcome');\r\n\t}", "public function cashierDeletePathologyDueCollection($invoice , $year_invoice , $daily_invoice , $cashbook_id , $invoice_tr_id , $status)\n {\n // due collection info\n $collection_info = DB::table('pathology_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->first();\n $total_payable = $collection_info->total_payable ;\n $total_discount = $collection_info->total_discount ;\n $total_rebate = $collection_info->total_rebate ;\n $total_payment = $collection_info->total_payment ;\n $bill_added_id = $collection_info->added_id ;\n $bill_tr_date = $collection_info->tr_date ;\n $bill_created_time = $collection_info->created_time ;\n $bill_created_at = $collection_info->created_at ;\n // petty cash check\n $check_pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $check_current_pettycash_amt = $check_pettycash_amount->pettycash_amount ;\n if($check_current_pettycash_amt < $total_payment){\n Session::put('failed','Sorry ! Pettycash Amount Small Than Delete Collection Amount. Please Delete This Collection After Available Pettycash');\n return Redirect::to('cashierPathologyDueCollectionReport');\n exit();\n }\n\n \t// check doctor discount\n \t$count_doctor_discount = DB::table('pathology_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',2)->count();\n \tif($count_doctor_discount > 0){\n Session::put('failed','Sorry ! Given Doctor Discount Of This Pathology Bill. First Delete Doctor Discount Of This Bill Then Try To Delete Pathology Due Collection');\n return Redirect::to('cashierPathologyDoctorDiscountReport');\n exit();\n \n \t}\n\n\n \t$due_status = 2 ;\n \t// delete cashbook id\n \tDB::table('cashbook')->where('id',$cashbook_id)->delete();\n \t// change pathology bill status\n \t$data_pathlogy_due_status = array() ;\n \t$data_pathlogy_due_status['due_status'] = $due_status ;\n \tDB::table('pathology_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->update($data_pathlogy_due_status);\n \t// reduce pettycash amount\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $current_pettycash_amt - $total_payment ;\n // update pettycash amount\n $data_update_pettycash = array();\n $data_update_pettycash['pettycash_amount'] = $now_pettycash_amt; \n DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->update($data_update_pettycash);\n // insert data into\n $data_delete_history \t\t\t\t= array();\n $data_delete_history['admin_type'] \t= 3 ;\n $data_delete_history['branch_id'] \t= $this->branch_id ;\n $data_delete_history['status'] \t\t= 1 ;\n $data_delete_history['tr_status'] \t= 1 ;\n $data_delete_history['before_pettycash_amt'] = $current_pettycash_amt ;\n $data_delete_history['after_pettycash_amt'] = $now_pettycash_amt ;\n $data_delete_history['bill_added_id'] \t\t= $bill_added_id ;\n $data_delete_history['bill_remove_id'] \t\t= $this->loged_id ;\n $data_delete_history['bill_tr_date'] \t\t\t= $bill_tr_date ;\n $data_delete_history['bill_remove_date'] \t\t= $this->rcdate ;\n $data_delete_history['bill_created_date'] \t= $bill_created_at ;\n $data_delete_history['bill_created_time'] \t= $bill_created_time ;\n $data_delete_history['bill_remove_time'] \t\t= $this->current_time ;\t\n DB::table('delete_history')->insert($data_delete_history);\n // get last delete history\n $last_delete_history_query = DB::table('delete_history')->orderBy('id','desc')->limit(1)->first();\n $last_delete_history_id = $last_delete_history_query->id ; \n // insert into delete pathlogy bill\n $data_delete_pathology_bill = array();\n $data_delete_pathology_bill['delete_history_id'] = $last_delete_history_id ;\n $data_delete_pathology_bill['branch_id'] = $this->branch_id ;\n $data_delete_pathology_bill['cashbook_id'] = $cashbook_id ;\n $data_delete_pathology_bill['invoice_number'] = $invoice;\n $data_delete_pathology_bill['year_invoice_number'] = $year_invoice ;\n $data_delete_pathology_bill['daily_invoice_number'] = $daily_invoice;\n $data_delete_pathology_bill['invoice_tr_id'] = $invoice_tr_id ;\n $data_delete_pathology_bill['total_payable'] = $total_payable;\n $data_delete_pathology_bill['total_payment'] = $total_payment;\n $data_delete_pathology_bill['total_discount'] = $total_discount;\n $data_delete_pathology_bill['total_rebate'] = $total_rebate;\n $data_delete_pathology_bill['status'] = $status ;\n $data_delete_pathology_bill['bill_added_id'] = $bill_added_id;\n $data_delete_pathology_bill['bill_remove_id'] = $this->loged_id ; \n $data_delete_pathology_bill['bill_tr_date'] = $bill_tr_date ;\n $data_delete_pathology_bill['bill_remove_date'] = $this->rcdate ;\n $data_delete_pathology_bill['bill_created_date'] = $bill_created_at;\n $data_delete_pathology_bill['bill_created_time'] = $bill_created_time ;\n $data_delete_pathology_bill['bill_remove_time'] = $this->current_time;\n DB::table('delete_pathology_bill')->insert($data_delete_pathology_bill);\n // now delete patylogy bill transaction\n DB::table('pathology_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->delete();\n Session::put('succes','Thanks , Pathology Due Collection Deleted Successfully');\n return Redirect::to('cashierPathologyDueCollectionReport');\n }", "function Revoke($objInvoice, $objAccount)\n \t{\n \t\t// Delete the charge\n \t\treturn (bool)$this->_qryDelete->Execute(\"DELETE FROM Charge WHERE Account = {$objAccount->Id} AND ChargeType = '{$this->_cfgModuleConfig->ChargeType}' AND invoice_run_id = '{$objInvoice->invoice_run_id}'\");\n \t}", "public function destroy(CustomerInvoiceEmail $customerInvoiceEmail)\n {\n //\n }", "public function cashierDeletePathologyDoctorDiscount($invoice , $year_invoice , $daily_invoice , $cashbook_id , $invoice_tr_id , $status)\n {\n $collection_info = DB::table('pathology_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->first();\n \t$total_payable = $collection_info->total_payable ;\n \t$total_discount = $collection_info->total_discount ;\n \t$total_rebate = $collection_info->total_rebate ;\n \t$total_payment = $collection_info->total_payment ;\n \t$bill_added_id = $collection_info->added_id ;\n \t$bill_tr_date = $collection_info->tr_date ;\n \t$bill_created_time = $collection_info->created_time ;\n \t$bill_created_at = $collection_info->created_at ;\n\n \t// $due_status = 2 ;\n \t// delete cashbook id\n \tDB::table('cashbook')->where('id',$cashbook_id)->delete();\n \t// // change pathology bill status\n \t// $data_pathlogy_due_status = array() ;\n \t// $data_pathlogy_due_status['due_status'] = $due_status ;\n \t// DB::table('pathology_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->where('cashbook_id',$cashbook_id)->update($data_pathlogy_due_status);\n \t// reduce pettycash amount\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $current_pettycash_amt + $total_discount ;\n // update pettycash amount\n $data_update_pettycash = array();\n $data_update_pettycash['pettycash_amount'] = $now_pettycash_amt; \n DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->update($data_update_pettycash);\n // insert data into\n $data_delete_history \t\t\t\t= array();\n $data_delete_history['admin_type'] \t= 3 ;\n $data_delete_history['branch_id'] \t= $this->branch_id ;\n $data_delete_history['status'] \t\t= 2 ;\n $data_delete_history['tr_status'] \t= 1 ;\n $data_delete_history['before_pettycash_amt'] = $current_pettycash_amt ;\n $data_delete_history['after_pettycash_amt'] = $now_pettycash_amt ;\n $data_delete_history['bill_added_id'] \t\t= $bill_added_id ;\n $data_delete_history['bill_remove_id'] \t\t= $this->loged_id ;\n $data_delete_history['bill_tr_date'] \t\t\t= $bill_tr_date ;\n $data_delete_history['bill_remove_date'] \t\t= $this->rcdate ;\n $data_delete_history['bill_created_date'] \t= $bill_created_at ;\n $data_delete_history['bill_created_time'] \t= $bill_created_time ;\n $data_delete_history['bill_remove_time'] \t\t= $this->current_time ;\t\n DB::table('delete_history')->insert($data_delete_history);\n // get last delete history\n $last_delete_history_query = DB::table('delete_history')->orderBy('id','desc')->limit(1)->first();\n $last_delete_history_id = $last_delete_history_query->id ; \n // insert into delete pathlogy bill\n $data_delete_pathology_bill = array();\n $data_delete_pathology_bill['delete_history_id'] = $last_delete_history_id ;\n $data_delete_pathology_bill['branch_id'] = $this->branch_id ;\n $data_delete_pathology_bill['cashbook_id'] = $cashbook_id ;\n $data_delete_pathology_bill['invoice_number'] = $invoice;\n $data_delete_pathology_bill['year_invoice_number'] = $year_invoice ;\n $data_delete_pathology_bill['daily_invoice_number'] = $daily_invoice;\n $data_delete_pathology_bill['invoice_tr_id'] = $invoice_tr_id ;\n $data_delete_pathology_bill['total_payable'] = $total_payable;\n $data_delete_pathology_bill['total_payment'] = $total_payment;\n $data_delete_pathology_bill['total_discount'] = $total_discount;\n $data_delete_pathology_bill['total_rebate'] = $total_rebate;\n $data_delete_pathology_bill['status'] = $status ;\n $data_delete_pathology_bill['bill_added_id'] = $bill_added_id;\n $data_delete_pathology_bill['bill_remove_id'] = $this->loged_id ; \n $data_delete_pathology_bill['bill_tr_date'] = $bill_tr_date ;\n $data_delete_pathology_bill['bill_remove_date'] = $this->rcdate ;\n $data_delete_pathology_bill['bill_created_date'] = $bill_created_at;\n $data_delete_pathology_bill['bill_created_time'] = $bill_created_time ;\n $data_delete_pathology_bill['bill_remove_time'] = $this->current_time;\n DB::table('delete_pathology_bill')->insert($data_delete_pathology_bill);\n // now delete patylogy bill transaction\n DB::table('pathology_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->delete();\n Session::put('succes','Thanks , Pathology Doctor Discount Deleted Successfully');\n return Redirect::to('cashierPathologyDoctorDiscountReport');\n }", "public function delete_invoice($id)\n\t{\n\t\tif(isset($this->session->isactive)){\n\t\t\t$this->load->model('invoice_model');\n\t\t\tif($this->invoice_model->delete_invoice($id)){\n\t\t\t\t$this->input->set_cookie('message_code','2',1);\n\t\t\t\tredirect('invoice/show_all');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->input->set_cookie('message_code','4',1);\n\t\t\t\tredirect('invoice/show_all');\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tredirect('login');\n\t\t}\n\t}", "public function excluir(){\n\t\tglobal $tabela_links;\n\t\t$consulta = new conexao();\n\t\t$endereco = $consulta->sanitizaString($this->end_link);\n\t\t$funcionalidade_tipo = (int) $this->funcionalidade_tipo;\n\t\t$funcionalidade_id = (int) $this->funcionalidade_id;\n\t\t//echo(\"$endereco\t $funcionalidade_tipo\t$funcionalidade_id\");\n\t\t$consulta->connect();\n\t\t$consulta->solicitar(\"DELETE FROM $tabela_links \n\t\t\t\t\t\t\t\tWHERE endereco = '$endereco'\n\t\t\t\t\t\t\t\tAND funcionalidade_tipo\t= '$funcionalidade_tipo'\n\t\t\t\t\t\t\t\tAND funcionalidade_id\t= '$funcionalidade_id'\");\n\t\t\n\t\n\t}", "public function destroy($invoice_id,$file_id)\n {\n $Attachment = Attachment::findOrFail($file_id);\n\n $file = $Attachment->invoice_number.'/'.$Attachment->file_name;\n\n // file system storage public_upload\n if(Storage::disk(\"public_uploads\")->exists($file)){\n Storage::disk('public_uploads')->delete($file);\n }\n\n $Attachment->delete();\n\n request()->session()->flash('msgSuccess', 'تم حذف المرفق بنجاح');\n return back();\n }", "public function remove_company_enrollment() {\n $tenant_id = $this->tenant_id;\n $logged_in_user_id = $this->user->user_id;\n $invoice_id = $this->input->post('comp_invoice_id');\n $payment_due_id = $this->input->post('comp_pymnt_due_id');\n $company_id = $this->input->post('company_id');\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $seleced_trainee_list = $this->input->post('checked_trainees');\n $status = $this->classtraineemodel->remove_company_enrollment($tenant_id, $logged_in_user_id, $course_id, $class_id, $company_id\n , $invoice_id, $payment_due_id, $seleced_trainee_list);\n if ($status) {\n $trainee_name_list = $this->get_trainee_names($seleced_trainee_list, $tenant_id);\n $this->session->set_flashdata(\"success\", \"Successfully removed trainee(s) '\" . $trainee_name_list . \"' from the Invoice #: '\" . $invoice_id . \"'\");\n } else {\n $this->session->set_flashdata(\"error\", \"We were not able to remove the selected trainee(s). Please try again later.\");\n }\n redirect(\"class_trainee\");\n }", "public function cashierDeleteOPDDoctorDiscount ($id , $invoice , $year_invoice , $daily_invoice , $cashbook_id , $invoice_tr_id , $status)\n {\n $collection_info = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('id',$id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->first();\n $total_payable = $collection_info->total_payable ;\n $total_discount = $collection_info->total_discount ;\n $total_rebate = $collection_info->total_rebate ;\n $total_payment = $collection_info->total_payment ;\n $bill_added_id = $collection_info->added_id ;\n $bill_tr_date = $collection_info->tr_date ;\n $bill_created_time = $collection_info->created_time ;\n $bill_created_at = $collection_info->created_at ;\n // get opd bill info\n $opd_bill_info_query = DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->limit(1)->first();\n $opd_status = $opd_bill_info_query->opd_status ;\n if($opd_status == '2'){\n // delete cashbook id\n DB::table('cashbook')->where('id',$cashbook_id)->delete();\n \n // incress pettycash amount\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $current_pettycash_amt + $total_discount ;\n // update pettycash amount\n $data_update_pettycash = array();\n $data_update_pettycash['pettycash_amount'] = $now_pettycash_amt; \n DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->update($data_update_pettycash);\n }else{\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $pettycash_amount->pettycash_amount ;\n }\n // insert data into\n $data_delete_history = array();\n $data_delete_history['admin_type'] = 3 ;\n $data_delete_history['branch_id'] = $this->branch_id ;\n $data_delete_history['status'] = 4 ;\n $data_delete_history['tr_status'] = 1 ;\n $data_delete_history['before_pettycash_amt'] = $current_pettycash_amt ;\n $data_delete_history['after_pettycash_amt'] = $now_pettycash_amt ;\n $data_delete_history['bill_added_id'] = $bill_added_id ;\n $data_delete_history['bill_remove_id'] = $this->loged_id ;\n $data_delete_history['bill_tr_date'] = $bill_tr_date ;\n $data_delete_history['bill_remove_date'] = $this->rcdate ;\n $data_delete_history['bill_created_date'] = $bill_created_at ;\n $data_delete_history['bill_created_time'] = $bill_created_time ;\n $data_delete_history['bill_remove_time'] = $this->current_time ; \n DB::table('delete_history')->insert($data_delete_history);\n // get last delete history\n $last_delete_history_query = DB::table('delete_history')->orderBy('id','desc')->limit(1)->first();\n $last_delete_history_id = $last_delete_history_query->id ; \n // insert into delete pathlogy bill\n $data_delete_pathology_bill = array();\n $data_delete_pathology_bill['delete_history_id'] = $last_delete_history_id ;\n $data_delete_pathology_bill['branch_id'] = $this->branch_id ;\n $data_delete_pathology_bill['cashbook_id'] = $cashbook_id ;\n $data_delete_pathology_bill['invoice_number'] = $invoice;\n $data_delete_pathology_bill['year_invoice_number'] = $year_invoice ;\n $data_delete_pathology_bill['daily_invoice_number'] = $daily_invoice;\n $data_delete_pathology_bill['invoice_tr_id'] = $invoice_tr_id ;\n $data_delete_pathology_bill['total_payable'] = $total_payable;\n $data_delete_pathology_bill['total_payment'] = $total_payment;\n $data_delete_pathology_bill['total_discount'] = $total_discount;\n $data_delete_pathology_bill['total_rebate'] = $total_rebate;\n $data_delete_pathology_bill['opd_status'] = $opd_status;\n $data_delete_pathology_bill['status'] = $status ;\n $data_delete_pathology_bill['bill_added_id'] = $bill_added_id;\n $data_delete_pathology_bill['bill_remove_id'] = $this->loged_id ; \n $data_delete_pathology_bill['bill_tr_date'] = $bill_tr_date ;\n $data_delete_pathology_bill['bill_remove_date'] = $this->rcdate ;\n $data_delete_pathology_bill['bill_created_date'] = $bill_created_at;\n $data_delete_pathology_bill['bill_created_time'] = $bill_created_time ;\n $data_delete_pathology_bill['bill_remove_time'] = $this->current_time;\n DB::table('delete_opd_bill')->insert($data_delete_pathology_bill);\n // now delete patylogy bill transaction\n DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('id',$id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->delete();\n Session::put('succes','Thanks , OPD Doctor Discount Deleted Successfully');\n return Redirect::to('cashierOPDDoctorDiscountReport');\n }", "function ciniki_writingfestivals_sapos_cartItemDelete($ciniki, $tnid, $invoice_id, $args) {\n\n if( !isset($args['object']) || $args['object'] == '' \n || !isset($args['object_id']) || $args['object_id'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.writingfestivals.131', 'msg'=>'No registration specified', 'err'=>$rc['err']));\n }\n\n //\n // Check to make sure the registration exists\n //\n if( $args['object'] == 'ciniki.writingfestivals.registration' ) {\n //\n // Get the current details for the registration\n //\n $strsql = \"SELECT status \"\n . \"FROM ciniki_writingfestival_registrations \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $args['object_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.writingfestivals', 'item');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.writingfestivals.135', 'msg'=>'Unable to find registrations', 'err'=>$rc['err']));\n }\n if( !isset($rc['item']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.writingfestivals.136', 'msg'=>'Unable to find registration'));\n }\n $item = $rc['item'];\n\n if( $item['status'] != 6 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.writingfestivals.137', 'msg'=>'This registration cannot be removed.'));\n }\n\n //\n // Change the status back to Draft\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.writingfestivals.registration', $args['object_id'], array('status'=>5));\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.writingfestivals.138', 'msg'=>'Error trying to remove registration.', 'err'=>$rc['err']));\n }\n\n return array('stat'=>'ok');\n }\n\n return array('stat'=>'ok');\n}", "public function destroy($invoiceid) \n {\n\n \n Invoice::destroy($invoiceid);\n\n Session::flash('flash_message', 'Invoice deleted!');\n\n return redirect('invoice/index');\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function manage_invoice_invoice_id()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('linvoice');\n $invoice_no = $this->input->post('invoice_no');\n $data =$this->linvoice->invoice_list_invoice_no($invoice_no);\n\t\t$data['content'] = $this->load->view('dashboard_pharmacist/invoice/invoice',$data,true);\n\t\t$this->load->view('dashboard_pharmacist/main_wrapper',$data);\n\t}", "public function delete_invoice_item($invoice_item_id)\n\t{\n\t\tif($this->db->delete('invoice_item', array('invoice_item_id' => $invoice_item_id)))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function supprimer1($connexion,$nomTable,$nomClePrimaire,$valeurClePrimaire) { \n $req =$connexion -> query(\"DELETE FROM $nomTable WHERE $nomClePrimaire = '$valeurClePrimaire'\");\n }", "public function deleteInvoice($id) {\n\t\ttry{\n\t\t\t$invoiceTbl = $this->_serviceManager->get('Invoice\\Model\\InvoiceTable');\n\t\n\t\t\t$invoice_row = $invoiceTbl->getInvoiceById($id);\n\t\t\t$data = array();\n\t\t\t$data['status'] = \"DELETED\";\n\t\n\t\t\t$xml = \"<Invoice>\n\t\t\t\t\t\t<InvoiceNumber>\" . $invoice_row['invoice_number'] . \"</InvoiceNumber>\n\t\t\t\t\t\t<Status>DELETED</Status>\n\t\t\t\t\t</Invoice>\";\n\t\n\t\t\t$response = $this->_XeroOAuth->request('POST', $this->_XeroOAuth->url('Invoices', 'core'), array(), $xml);\n\t\t\tif ($this->_XeroOAuth->response['code'] == 200) {\n\t\t\t\t$invoices = $this->_XeroOAuth->parseResponse($this->_XeroOAuth->response['response'], $this->_XeroOAuth->response['format']);\n\t\t\t\t\n\t\t\t\t$invoiceTbl->tableGateway->update($data, array(\"id\" => $id)); \n\t\t\t\treturn true;\n\t\t\t }\n\t\t\t \n\t\t\t return false;\n\t\t}catch(\\Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . urldecode($response['response']) . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n }", "public function testDeleteInvoice() {\n\t\t$randomInvoice = rand();\n\n\t\t$tokenizer = new Token($_SESSION['accessToken']);\n\n\t\t$tokenizer->ip('173.49.87.94')\n\t\t\t\t->expirationMonth(12)\n\t\t\t\t->expirationYear(30)\n\t\t\t\t->cardNumber('4321000000001119')\n\t\t\t\t->cvv('333')\n\t\t\t\t->cardType('VS')\n\t\t\t\t->name('John Smith')\n\t\t\t\t->zip('65000')\n\t\t\t\t->address('65 Main Street')\n\t\t\t\t->post();\n\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->total(100)\n\t\t\t\t->clerk('1')\n\t\t\t\t->invoiceNumber($randomInvoice)\n\t\t\t\t->tokenValue($tokenizer->getToken())\n\t\t\t\t->purchaseCard(array(\n\t\t\t\t\t'customerReference' => 412348,\n\t\t\t\t\t'destinationPostalCode' => 19134,\n\t\t\t\t\t'productDescriptors' => array('rent')\n\t\t\t\t))\n\t\t\t\t->sale();\n\n\t\t$output = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ': CARD AND TRANSACTION CREATION');\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $output\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t// Deleting an invoice requires the transaction be sent in the header\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->deleteInvoice($randomInvoice);\n\n\t\t$result = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__);\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ' INVOICE: ' . $_SESSION['invoiceForTest5']);\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $result\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\n\t\t$this->assertNotNull($result);\n\n\t}", "function delete_enquiry($enquiry_id)\n {\n $this->db->update('tbl_enquiry',$this,array('enquiry_id'=>$enquiry_id));\n //echo $this->db->last_query();\n }", "public function invoice_id(){\n return parent::get_fk_object(\"invoice_id\");\n }", "public function removeInvoiceDetail(\\Crm\\AppBundle\\Entity\\InvoiceDetail $invoiceDetail)\n {\n $this->invoiceDetails->removeElement($invoiceDetail);\n\n }", "public function delete_innersidebar_seopages_id($seopages_id){\n $sqld_seo = \"delete from digital_marketing where journal_id='$seopages_id'\";\n $resultd_seo = mysqli_query($this->db,$sqld_seo);\n return $resultd_seo; \n }", "public function deleted(CustomerInquiry $customerInquiry)\n {\n\n }", "function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}", "public function destroy($id)\n {\n if (Auth::user()->role == User::ROLE_SUPERADMIN) {\n $invoice = InvoiceLists::findOrFail($id);\n\n $POLists = PurchaseOrderLists::findOrFail($invoice->purchase_order_list_code_id);\n $POData['fix_data'] = 0;\n $POLists->update($POData);\n\n InvoiceLists::destroy($id);\n InvoiceListsDetail::where('invoice_list_id', $id)->delete();\n\n $old_data_payment = InvoiceListsPayment::where('invoice_list_id', $id)->get();\n if (count($old_data_payment) > 0) {\n foreach ($old_data_payment as $payment) {\n InvoiceListsPayment::where('invoice_list_id', $id)->delete();\n $image_payment_path = app_path(\"../../files/invoice-payment/\" . $payment->file_payment . \"\");\n unlink($image_payment_path);\n }\n }\n if ($invoice->file != '') {\n $image_path = app_path(\"../../files/invoice/\" . $invoice->file . \"\");\n unlink($image_path);\n }\n\n\n Alert::success('Your data already deleted !', 'Success !');\n }\n return redirect('admin/invoice-list');\n }", "function delItem( $rowID ) {\n \n $query = 'SELECT item_type, fk_contract_item, qty, fk_invoice_id FROM invoices_details WHERE pk_id = '.$rowID;\n $contractItem = $this->company_db->query($query)->row();\n $this->company_db->trans_start();\n if ( $contractItem->item_type == 1) {\n \n $q = 'UPDATE collections_items SET qty_sold_items_invoiced = ifnull(qty_sold_items_invoiced,0) -'.$contractItem->qty.' WHERE fk_contract_item_id = '.$contractItem->fk_contract_item;\n $this->company_db->query($q);\n }\n \n $q = 'DELETE FROM invoices_details WHERE pk_id = '.$rowID;\n $this->company_db->query($q);\n \n $q = 'UPDATE collections_items \n SET last_invoiced_date = (SELECT max(creation_date) FROM invoices WHERE pk_id = '.$contractItem->fk_invoice_id.' AND creation_date != last_invoiced_date )\n WHERE fk_contract_item_id = '.$contractItem->fk_contract_item;\n $this->company_db->query($q);\n \n $this->company_db->trans_start();\n return $this->company_db->trans_complete();\n }", "function remove_customer()\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"DELETE FROM preorder_customers WHERE prc_preorderID=$this->preorderID AND prc_customerID=$this->customerID\";\n\t\tmysql_query($sql,$db);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\t}", "function removeFromCart($email, $id){\n $db = databaseConnection();\n $db -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $email = $db -> quote($email);\n $query = \"DELETE FROM Carrello WHERE email=$email AND id_prodotto=$id;\";\n $rows = $db -> query($query);\n return 0;\n}", "public function eliminar($data)\n {\n $cliente=$this->db->query('delete from tab_cliente where id_cliente='.$data); \n }", "public function sales_unsaved_delete()\n {\n $sales_no = $this->input->post('sales_no');\n /** Remove auto created sales journal */\n $journal = $this->MAc_journal_master->get_by_doc('Sales', $sales_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created money receipt for partial or full cash sales */\n $mr = $this->MAc_money_receipts->get_by_doc('Sales', $sales_no);\n if (count($mr) > 0)\n {\n $this->MAc_money_receipts->delete($mr['id']);\n }\n /** Remove sales */\n $this->MSales_details->delete_by_sales_no($sales_no);\n $this->MSales_master->delete_by_sales_no($sales_no);\n }", "function delete_prodInv($prodID)\n {\n $sql = \"delete from product where ProdID=\" . $prodID;\n $query = $this->db->query($sql);\n }", "function delete() {\n\t \t$sql = \"DELETE FROM evs_database.evs_identification\n\t \t\t\tWHERE idf_id=?\";\n\t \t$this->db->query($sql, array($this->idf_id));\n\t\t\n\t }", "function XSAInvoicing($InvoiceNo, $orderno, $debtorno, $TypeInvoice, $tag, $serie, $folio, &$db)\n{\n\t$charelectronic='01';\n\t$charelectronicEmbarque='';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\tif ($TypeInvoice == 11) {\n\t\t$tabla = 'notesorders';\n\t}else{\n\t\t$tabla = 'salesorders';\n\t}\n\t$SQLInvoice = \"SELECT replace(debtortrans.trandate,'-','/') as trandate,debtortrans.ovamount,debtortrans.ovdiscount,\n\t\t\tdebtortrans.ovfreight,debtortrans.ovgst,debtortrans.rate as cambio,\n\t\t\tdebtortrans.order_,debtortrans.invtext,\tdebtortrans.consignment,\n\t\t\tdebtortrans.id AS iddocto, debtortrans.type,\n\t\t\tdebtorsmaster.name,debtorsmaster.address1,debtorsmaster.address2,\n\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\tcustbranch.taxid as rfc,paymentterms.terms,salesorders.deliverto,\n\t\t\tsalesorders.deladd1,salesorders.deladd2,salesorders.deladd3,\n\t\t\tsalesorders.deladd4,salesorders.deladd5,salesorders.deladd6,\n\t\t\tsalesorders.customerref,salesorders.orderno,salesorders.orddate,\n\t\t\tlocations.locationname,\tshippers.shippername,custbranch.brname,\n\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\tsalesman.salesmanname,debtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\treplace(origtrandate,'-','/') as origtrandate,debtortrans.currcode,custbranch.branchcode,\n\t\t\tsalesorders.salesman,salesorders.UserRegister,custbranch.phoneno as telofi,\n\t\t\tsalesorders.placa, salesorders.serie,salesorders.kilometraje,salesorders.comments,debtortrans.ref1,\n\t\t\tsalesorders.ordertype,debtortrans.paymentname,debtortrans.nocuenta,\n\t\t\tcustbranch.brnumext, custbranch.brnumint,custbranch.specialinstructions,\n\t\t\ttags.typegroup,debtortrans.id\n\t\tFROM debtortrans \n\t\t\tleft join shippers on debtortrans.shipvia=shippers.shipper_id \n\t\t\tjoin tags on tags.tagref=debtortrans.tagref,\n\t\t\tdebtorsmaster,custbranch,\".$tabla.\" as salesorders ,\n\t\t\tsalesman,locations,paymentterms\n\n\t\tWHERE debtortrans.order_ = salesorders.orderno\n\n\t\tAND debtortrans.type=\".$TypeInvoice.\"\n\t\tAND debtortrans.transno=\" . $InvoiceNo . \"\n\t\tAND debtortrans.tagref=\" . $tag . \"\n\n\t\tAND debtortrans.debtorno=debtorsmaster.debtorno\n\t\tAND salesorders.paytermsindicator=paymentterms.termsindicator\n\t\tAND debtortrans.debtorno=custbranch.debtorno\n\t\tAND debtortrans.branchcode=custbranch.branchcode\n\t\tAND salesorders.salesman=salesman.salesmancode\n\t\tAND salesorders.fromstkloc=locations.loccode \";\n\tif ($_SESSION['UserID']=='admin') {\n\n\t\t//echo '<pre>sql:<br>'.$SQLInvoice.'<br>';\n\t}\n\t$Result=DB_query($SQLInvoice,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t//impuestos federales\n\t\t$totretencionfederal=0;\n\t\t//$charelectronictaxslocal='|'.chr(13).chr(10);\n\t\t$qry = \"Select debtortranstaxesclient.*,sec_taxes.nametax from debtortranstaxesclient, sec_taxes\n\t\t\t\twhere debtortranstaxesclient.idtax = sec_taxes.idtax\n\t\t\t\tAND sec_taxes.typetax=1\n\t\t\t\tand debtortranstaxesclient.iddoc = \".$myrow['id'];\n\t\t\t\n\t\t$rs = DB_query($qry,$db);\n\t\t$totalImpuestosLocales=0;\n\t\tif (DB_num_rows($rs) > 0){\n\t\t\t$charelectronictaxsfederal='';\n\t\t\t$charelectronictaxsfederalini='|'.chr(13).chr(10).'06';\n\t\t\twhile ($regs = DB_fetch_array($rs)){\n\t\t\t\t$charelectronictaxsfederal.=$charelectronictaxsfederalini.\"|\".$regs['nametax'].\"|\".$regs['percent'].\"|\".$regs['amount'];\n\t\t\t\t$totretencionfederal=$totretencionfederal+$regs['amount'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//impuestos locales\n\t\t$totalretencionlocal=0;\n\t\t//$charelectronictaxslocal='|'.chr(13).chr(10);\n\t\t$qry = \"Select debtortranstaxesclient.*,sec_taxes.nametax from debtortranstaxesclient, sec_taxes\n\t\t\t\twhere debtortranstaxesclient.idtax = sec_taxes.idtax\n\t\t\t\tAND sec_taxes.typetax=2\n\t\t\t\tand debtortranstaxesclient.iddoc = \".$myrow['id'];\n\t\t\t\n\t\t$rs = DB_query($qry,$db);\n\t\t$totalImpuestosLocales=0;\n\t\tif (DB_num_rows($rs) > 0){\n\t\t\t$charelectronictaxslocal.='08';\n\t\t\twhile ($regs = DB_fetch_array($rs)){\n\t\t\t\t$charelectronictaxslocal.=\"|\".$regs['nametax'].\"|\".$regs['percent'].\"|\".$regs['amount'];\n\t\t\t\t$totalretencionlocal=$totalretencionlocal+$regs['amount'];\n\t\t\t}\n\t\t\t$charelectronictaxslocal.=chr(13).chr(10);\n\t\t}\n\t\t$totalretencion=$totretencionfederal+$totalretencionlocal;\n\t\t//Tipo agrupacion\n\t\t$TipoAgrupacionXTag=$myrow['typegroup'];\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\n\t\t$metodoPago = $myrow['paymentname'];\n\t\tif ($metodoPago==\"\")\n\t\t\t$metodoPago = \"No Identificado\";\n\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\")\n\t\t\t$nocuenta = \"No Identificado\";\n\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= FormatNumberERP($myrow['ovamount']);\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=FormatNumberERP($myrow['ovamount']+$myrow['ovgst']+$totalretencion);\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=FormatNumberERP($myrow['ovgst']);\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento trae desde el stockmoves\n\t\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento) as descuento\n\t\t\t\t FROM stockmoves\n\t\t\t\t WHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=FormatNumberERP($myrowdis['descuento']);\n\t\t\t}\n\t\t}else{\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento+(IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*totaldescuento)) as descuento\n\t\t\t \t\t\tFROM stockmoves inner join stockmaster on stockmaster.stockid=stockmoves.stockid\n\t\t\t\t\t\t\t-- LEFT JOIN taxauthrates ON stockmaster.taxcatid = taxauthrates.taxcatid\n\t\t\t\t\t\t\tLEFT JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\t\t\n\t\t\t\t\t \t\tWHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=FormatNumberERP($myrowdis['descuento']);\n\t\t\t}\t\n\t\t}\n\t\t$descuento=FormatNumberERP($descuento);\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n\t\t$moneda=$myrow['currcode'];\n\t\t// CANTIDAD CON LETRAS\n\t\t$totaletras=($myrow['ovamount']+$myrow['ovgst'])+$totalretencion;\n\t\t$totalx=str_replace(',', '', FormatNumberERP($totaletras));\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\t\t$separa2=explode(\".\", FormatNumberERP($total));\n\t\t$montoctvs2 = $separa2[1];\n\t\t\n\t\t\n\t\t$montoletra=Numbers_Words::toWords($montoletra,'es');\n\t\t\n\t\t$zeroPad = \"\";\n\t\tif (empty($_SESSION['Decimals'])) {\n\t\t\t$zeroPad = str_pad($zeroPad, 4, 0, STR_PAD_RIGHT);\n\t\t} else {\n\t\t\t$zeroPad = str_pad($zeroPad, $_SESSION['Decimals'], 0, STR_PAD_RIGHT);\n\t\t}\n\t\t\n\t\tif ($moneda=='MXN') {\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\"/1$zeroPad M.N.\";\n\t\t} else {\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/1$zeroPad USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=FormatRateNumberERP(1/$myrow['cambio']);\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t// observaciones 3\n\t\t$comments=$comments.' Cuenta de Referencia: '.$myrow['ref1'];\n\t\t$observaciones3='Id Factura:'.$InvoiceNo. '. La tenencia de esta factura no acredita su pago si no se justifica con el comprobante respectivo. '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\t\t// informacionExtra\n\t\t$infoextra=\"\";\n\t\t$numpago=0;\n\t\t$cadenapagares=\"\";\n\t\tif ($TypeInvoice==11){\n\t\t\t$tipodoc=0;\n\t\t}else{\n\t\t\t$tipodoc=70;\n\t\t}\n\t\t\n\t\t$SQL=\" SELECT trandate,case when ovamount<0 then (ovamount+ovgst)*-1 else ovamount+ovgst end as monto\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=\".$tipodoc.\"\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)>0) {\n\t\t\twhile ($myrowpagos=DB_fetch_array($Result)){\n\t\t\t\t$numpago=$numpago+1;\n\t\t\t\t$fechapago=ConvertSQLDate($myrowpagos['trandate']);\n\t\t\t\t$montopago=$myrowpagos['monto'];\n\t\t\t\t$montopago=FormatNumberERP($montopago);\n\t\t\t\t$cadenapagares=$cadenapagares.\" No:\".$numpago.\" Fecha: \".$fechapago.\" Monto: \".$montopago .' '.$moneda;\n\t\t\t}\n\t\t}\n\t\t$placa= $_SESSION['LabelText1'].' : '.$myrow['placa'];\n\t\t$serie=$_SESSION['LabelText3'].' : '.$myrow['serie'];\n\t\t$kilometraje=$_SESSION['LabelText2'].' : '.$myrow['kilometraje'];\n\t\t$comments1=' Extra: '.$myrow['comments'];\n\t\t$infoextra=$placa.' '.$serie.' '.$kilometraje.' '.$comments1.' Pagares: '. $cadenapagares;\n\n\n\t\t$charelectronic=$charelectronic.'|'.$infoextra;\n\n\t\t//cometarios nivel factura\n\t\t$charelectronic=$charelectronic.'|'.$myrow['invtext'];\n\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT count(*) as pagares\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$myrowpag = DB_fetch_array($Result);\n\t\t\t$numpagares=intval($myrowpag['pagares']);\n\t\t\tif ($numpagares<=1){\n\t\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t\t}else{\n\t\t\t\t$Tipopago=\"Parcialidades\";\n\t\t\t}\n\t\t}\n\t\tif ($TypeInvoice==11){\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}\n\t\t\n\t\t$Tipopago=$Tipopago;//.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|'.$terminospago;\n\t\t// metodo de pago\n\t\t$metodopago=$metodoPago;\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4 (no de cuenta)\n\t\t$observaciones4=$nocuenta;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$referenciacalle=\"Telefono. \".$myrow['telofi'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress2'];;\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t\n\t\t\n\t\t$charelectronicEmbarque='|'.chr(13).chr(10).'09';\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['specialinstructions'];\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr1'];//calle\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//noext\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//no int\n\t\t\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr2'];//colonia\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr3'];//municipio\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr4'];//cp\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr5'];//estado\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr6'];//pais\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr7'];\n\t\t\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\t$decimalplaces=6;\n\n\t\n\tif ($rfccliente!=\"XAXX010101000\"){//\n\t\tif($TipoAgrupacionXTag==1 and $TypeInvoice <> 111){\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\t-- stockmoves.stockid,\n\t\t\t\t\t ProdLine.prodLineId as stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\t-- stockmaster.description,\n\t\t\t\t\t\tProdLine.Description as description,\n\t\t\t\t\t\t/*stockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,*/\n\t\t\t\t\t\t0 as serialised,\n\t\t\t\t\t\t0 as controlled,\n\t\t\t\t\t\tsum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxnet,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)-totaldescuento)/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as subtotal,\n\t\t\t\t\t\t-- sum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)/case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tsum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV\n\t\t\t\tFROM stockmoves,stockmaster,stockcategory \n\t\t\t\t\t \tINNER JOIN ProdLine ON ProdLine.prodLineId=stockcategory.prodLineId \n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\tGROUP BY ProdLine.Description,ProdLine.prodLineId';\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.longdescription,\n\t\t\t\t\t\tstockmaster.mbflag,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV\n\t\t\t\tFROM stockmoves,stockmaster,stockcategory\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t}\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\tif($_SESSION['DescrLargaFact'] == $myrow2['mbflag']){\n\t\t\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'].' '.$myrow2['longdescription'];\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t\t}\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n// \t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n// \t\t\t\t$trab=$traba[0];\n\t\t\t\t$trab=$myrowprop['val'];\n\t\t\t\tif ($xt==0){\n\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\n\t\t\t/*\n\t\t\tif ($TypeInvoice==11){\n\t\t\t\t$tablades=0;\n\t\t\t}else{\n\t\t\t\t$tipodoc=70;\n\t\t\t}\n\t\t\t\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM salesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}*/\n\t\t\t//$descrnarrative=\"\";\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t$numberserie=\"\";\n\t\t\t$xserie=0;\n\t\t\t$sqlserials=\"SELECT stockserialitems.serialno as serie\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t//echo '<pre><br>'.$sqlserials;\n\t\t\t$Result= DB_query($sqlserials,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$numberserie=\"\";\n\t\t\t}else{\n\t\t\t\twhile ($myrownseries=DB_fetch_array($Result)){\n\t\t\t\t\tif ($xserie==0){\n\t\t\t\t\t\t$numberserie=' Series: '.$myrownseries['serie'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$numberserie=$numberserie.', '.$myrownseries['serie'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (strlen($numberserie)==0){\n\t\t\t\t$numberserie=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t/**/\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\n\n\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$nameaduana=$myrowaduana['aduana'];\n\t\t\t\t$numberaduana=$myrowaduana['noaduana'];\n\t\t\t\t$fechaaduana=$myrowaduana['fechaaduana'];\n\t\t\t\t//$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t//$nameaduana = $separaaduana[0];\n\t\t\t\t//$numberaduana= $separaaduana[1];\n\t\t\t\t//$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($myrow['type'] == 66) { // Si es factura remision\n\n\t\t\t\t$ordernotmp = $myrow['orderno'];\n\n\t\t\t\t$SQL = \"\n\t\t\t\t\tSELECT GROUP_CONCAT(debtortrans.order_) AS order_\n\t\t\t\t\tFROM invoicetoremision\n\t\t\t\t\tINNER JOIN debtortrans\n\t\t\t\t\tON debtortrans.id = invoicetoremision.idremision\n\t\t\t\t\tWHERE invoicetoremision.idinvoice = '{$myrow['iddocto']}'\n\t\t\t\t\";\n\n\t\t\t\t$rstmp = DB_query($SQL, $db);\n\t\t\t\t$rowtmp = DB_fetch_array($rstmp);\n\t\t\t\t$ordernotmp = $rowtmp['order_'];\n\n\t\t\t\tif(empty($ordernotmp) == FALSE) {\n\n\t\t\t\t\t$SQL = \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\tDATE_FORMAT(purchorderdetails.datecustoms,'%Y-%m-%d') AS fechaaduana,\n\t\t\t\t\t\tpedimento,\n\t\t\t\t\t\tcustoms AS aduana\n\t\t\t\t\t\tFROM purchorders\n\t\t\t\t\t\tINNER JOIN purchorderdetails\n\t\t\t\t\t\tON purchorderdetails.orderno = purchorders.orderno\n\t\t\t\t\t\tWHERE purchorders.requisitionno IN ($ordernotmp)\n\t\t\t\t\t\tAND purchorderdetails.itemcode = '$stockid'\n\t\t\t\t\t\";\n\n\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t$fechaaduana = $rowtmp['fechaaduana'];\n\t\t\t\t\t\t$numberaduana = $rowtmp['pedimento'];\n\t\t\t\t\t\t$nameaduana = $rowtmp['aduana'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t\n\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,\n\t\t\t\t\t\ttaxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\tif($TipoAgrupacionXTag==1){\n\t\t\t\t\t$taxratetotal=FormatNumberERP((($myrow3['taxrate']*($myrow2['subtotal']))*$myrow2['quantity']));\n\t\t\t\t}else{\n\t\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t}\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\tif($TipoAgrupacionXTag==1){\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\t-- stockmoves.stockid,\n\t\t\t\t\t ProdLine.prodLineId as stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\t-- stockmaster.description,\n\t\t\t\t\t\tProdLine.Description as description,\n\t\t\t\t\t\t/*stockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,*/\n\t\t\t\t\t\t0 as serialised,\n\t\t\t\t\t\t0 as controlled,\n\t\t\t\t\t\tsum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxnet,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))-totaldescuento)/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as subtotal,\n\t\t\t\t\t\t-- sum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)/case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tsum((stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV\n\t\t\t\tFROM stockmoves,stockmaster\n\t\t\t\t\t left JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno ,\n\t\t\t\t\tstockcategory\n\t\t\t\t\t \tINNER JOIN ProdLine ON ProdLine.prodLineId=stockcategory.prodLineId\n\t\t\t\t\t\t\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\tGROUP BY ProdLine.Description,ProdLine.prodLineId';\n\t\t\t\t\n\t\t\t\t\n\t\t}else{\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno \n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t}\n\t\t\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t \t\tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM salesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\t\t\t\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=$myrow3['taxrate']*($myrow2['subtotal']);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']+$taxtotalratex);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']+$taxtotalratex);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\n\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($myrow['type'] == 66) { // Si es factura remision\n\n\t\t\t\t$ordernotmp = $myrow['orderno'];\n\n\t\t\t\t$SQL = \"\n\t\t\t\t\tSELECT GROUP_CONCAT(debtortrans.order_) AS order_\n\t\t\t\t\tFROM invoicetoremision\n\t\t\t\t\tINNER JOIN debtortrans\n\t\t\t\t\tON debtortrans.id = invoicetoremision.idremision\n\t\t\t\t\tWHERE invoicetoremision.idinvoice = '{$myrow['iddocto']}'\n\t\t\t\t\";\n\n\t\t\t\t$rstmp = DB_query($SQL, $db);\n\t\t\t\t$rowtmp = DB_fetch_array($rstmp);\n\t\t\t\t$ordernotmp = $rowtmp['order_'];\n\n\t\t\t\tif(empty($ordernotmp) == FALSE) {\n\n\t\t\t\t\t$SQL = \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\tDATE_FORMAT(purchorderdetails.datecustoms,'%Y-%m-%d') AS fechaaduana,\n\t\t\t\t\t\tpedimento,\n\t\t\t\t\t\tcustoms AS aduana\n\t\t\t\t\t\tFROM purchorders\n\t\t\t\t\t\tINNER JOIN purchorderdetails\n\t\t\t\t\t\tON purchorderdetails.orderno = purchorders.orderno\n\t\t\t\t\t\tWHERE purchorders.requisitionno IN ($ordernotmp)\n\t\t\t\t\t\tAND purchorderdetails.itemcode = '$stockid'\n\t\t\t\t\t\";\n\n\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t$fechaaduana = $rowtmp['fechaaduana'];\n\t\t\t\t\t\t$numberaduana = $rowtmp['pedimento'];\n\t\t\t\t\t\t$nameaduana = $rowtmp['aduana'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\n\t\t\t/*$stockprecio=number_format($myrow2['fxnet']+$taxtotalratex,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet']+$taxtotalratex,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal*/\n\n\t\t}\n\t}\n\t\n\t// ivas retenidos\n//\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronictaxsfederal.$charelectronictaxslocal.$charelectronicEmbarque;\n\t\t$cadenaenviada=$cadenaenvio;//retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsfederal.$charelectronictaxs.$charelectronictaxslocal.$charelectronicEmbarque;\n\t\t$cadenaenviada=$cadenaenvio;//retornarString($cadenaenvio);\n\n\t}\n\t//echo $cadenaenviada;\n\treturn $cadenaenviada;\n}", "public function rollback_invoice_delete()\n {\n $data['nestedView']['pageTitle'] = 'Invoice Delete Details';\n $data['nestedView']['heading'] = \"Invoice Delete Details\";\n $data['nestedView']['cur_page'] = 'Invoice Delete Details';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Invoice Delete','class'=>'active','url'=>SITE_URL.'delete_invoice'); \n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Invoice Delete Details','class'=>'active','url'=>'');\n\n $invoice_number=$this->input->post('invoice_id',TRUE);\n $invoice_id=$this->Rollback_invoice_m->get_invoice_id($invoice_number);\n $count_receipt_invoice = $this->Common_model->get_data('receipt_invoice',array('invoice_id'=>$invoice_id));\n $count_gatepass = $this->Common_model->get_data('gatepass_invoice',array('invoice_id'=>$invoice_id));\n if(count($count_receipt_invoice)>0 || count($count_gatepass)>0)\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice is involved in Gatepass/StockReceiving. Please Check! </div>');\n redirect(SITE_URL.'delete_invoice'); exit();\n }\n $invoice_type=$this->Rollback_invoice_m->get_invoice_type($invoice_id);\n if($invoice_type['type'] == 2)\n {\n \n $invoice_plant_products=$this->Rollback_invoice_m->get_invoice_do_product($invoice_id);\n \n if(count($invoice_plant_products)!='')\n {\n \n foreach($invoice_plant_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['from']=$value['from'];\n $results['to']=$value['to'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n //echo \"<pre>\"; print_r($invoice_plant_products); exit;\n $col=array_column($invoice_plant_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n $data['tin_num']=37280114257;\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_plant_product']=$invoice_plant_products;\n $data['flag']=3;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n }\n elseif($invoice_type['type']== 1)\n {\n $invoice_dist_products=$this->Rollback_invoice_m->get_invoice_do_distributor_product($invoice_id);\n \n if(count($invoice_dist_products)!='')\n {\n foreach($invoice_dist_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['distributor_code']=$value['distributor_code'];\n $results['tin_num']=$value['vat_no'];\n $results['mobile']=$value['mobile'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['amount']=$value['amount'];\n $results['agency_name']=$value['agency_name'];\n $results['address']=$value['address'];\n $results['lifting']=$value['lifting'];\n $results['location']=$value['distributor_place'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n $col=array_column($invoice_dist_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_dist_product']=$invoice_dist_products;\n $data['flag']=2;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n \n \n \n $this->load->view('rollback_invoice/rollback_invoice_delete_view',$data);\n }", "function borrarImagenes($id){\n $conn=connexioBD();\n $sql=\"DELETE FROM imatges WHERE producte_id='$id'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n $conn->close();\n}", "public function cashierDeletePathologyBill($invoice , $year_invoice , $daily_invoice ,$cashbook_id)\n {\n $pathology_tr_info = DB::table('pathology_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',1)->where('status',0)->first();\n\n $total_payable = $pathology_tr_info->total_payable ;\n $total_discount = $pathology_tr_info->total_discount ;\n $total_rebate = $pathology_tr_info->total_rebate ;\n $total_payment = $pathology_tr_info->total_payment ;\n $check_pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n // petty cash update\n $check_current_pettycash_amt = $check_pettycash_amount->pettycash_amount ;\n if($check_current_pettycash_amt < $total_payment){\n Session::put('failed','Sorry ! Pettycash Amount Small Than Delete Bill Payment Amount. Please Delete This Bill After Available Pettycash');\n return Redirect::to('cashierPathologyBillReport');\n exit();\n }\n\n //check doctor discount of this invoice\n \t$doctor_discount_count = DB::table('pathology_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',2)->count();\n \tif($doctor_discount_count > 0){\n Session::put('failed','Sorry ! Given Doctor Discount Of This Pathology Bill. First Delete Doctor Discount Of This Bill Then Try To Delete Pathology Bill');\n return Redirect::to('cashierPathologyDoctorDiscountReport');\n exit();\n \t}\n \t$due_collection_count = DB::table('pathology_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',1)->count();\n \tif($due_collection_count > 0){\n Session::put('failed','Sorry ! Due Collection Of This Pathology Bill. First Delete Due Collection Of This Bill Then Try To Delete Pathology Bill');\n return Redirect::to('cashierPathologyDueCollectionReport');\n exit();\n \t}\n $delete_count = DB::table('pathology_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->whereNotIn('status',[0])->count();\n \tif($delete_count > 0){\n Session::put('failed','Sorry ! Delete Doctor Discount And Due Collection If You Given It. Manualy Check That And Try To Delete Pathology Bill');\n return Redirect::to('cashierPathologyBillReport');\n exit();\n \t}\n // get pathology bill info\n \t$pathology_info = DB::table('pathology_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->where('cashbook_id',$cashbook_id)->first();\n \t$bill_added_id = $pathology_info->added_id ;\n \t$bill_tr_date = $pathology_info->bill_date ;\n \t$bill_created_time = $pathology_info->bill_time ;\n \t$bill_created_at = $pathology_info->created_at ;\n \t$doctor_id = $pathology_info->doctor_id ;\n \t$pc_id \t\t\t = $pathology_info->pc_id ;\n \t$patient_id = $pathology_info->patient_id ;\n \t$due_status = $pathology_info->due_status ;\n\n \t$pathoogy_item = DB::table('pathology_bill_item')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('cashbook_id',$cashbook_id)->get();\n \t$itam = array();\n \tforeach ($pathoogy_item as $value_iteam) {\n \t\t$itam[] = $value_iteam->test_id ;\n \t}\n \t$item_implode = implode(',', $itam);\n // delete cashbook id\n \tDB::table('cashbook')->where('id',$cashbook_id)->delete();\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n // petty cash update\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $current_pettycash_amt - $total_payment ;\n // update pettycash amount\n $data_update_pettycash = array();\n $data_update_pettycash['pettycash_amount'] = $now_pettycash_amt; \n DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->update($data_update_pettycash);\n // pc info\n if($pc_id != '0'){\n \t// get pc amount of this invoice\n \t$pc_amt_query = DB::table('pc_ledger')->where('branch_id',$this->branch_id)->where('cashbook_id',$cashbook_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('invoice_type',1)->where('pc_id',$pc_id)->where('status',1)->first();\n \t // reduce pc amount\n \t // update pc due\n $pc_amount = $pc_amt_query->payable_amount ;\n $pc_due_query = DB::table('pc_due')->where('pc_id',$pc_id)->limit(1)->first();\n $pc_due_amount = $pc_due_query->total_due_amount ;\n $now_pc_due_amount = $pc_due_amount - $pc_amount ;\n // updte pc due amount\n $data_pc_due_update = array();\n $data_pc_due_update['total_due_amount'] = $now_pc_due_amount; \n DB::table('pc_due')->where('pc_id',$pc_id)->update($data_pc_due_update);\n \t// pc ledger delete\n \tDB::table('pc_ledger')->where('branch_id',$this->branch_id)->where('cashbook_id',$cashbook_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('invoice_type',1)->where('pc_id',$pc_id)->where('status',1)->delete();\t\n }// pc ledger ended\n if($pc_id == '0'){\n \t$bill_pc_amount = 0 ;\n }else{\n \t$bill_pc_amount = $pc_amount ;\n }\n \n // insert data into\n $data_delete_history \t\t\t\t= array();\n $data_delete_history['admin_type'] \t= 3 ;\n $data_delete_history['branch_id'] \t= $this->branch_id ;\n $data_delete_history['status'] \t\t= 3 ;\n $data_delete_history['tr_status'] \t= 1 ;\n $data_delete_history['before_pettycash_amt'] = $current_pettycash_amt ;\n $data_delete_history['after_pettycash_amt'] = $now_pettycash_amt ;\n $data_delete_history['bill_added_id'] \t\t= $bill_added_id ;\n $data_delete_history['bill_remove_id'] \t\t= $this->loged_id ;\n $data_delete_history['bill_tr_date'] \t\t\t= $bill_tr_date ;\n $data_delete_history['bill_remove_date'] \t\t= $this->rcdate ;\n $data_delete_history['bill_created_date'] \t= $bill_created_at ;\n $data_delete_history['bill_created_time'] \t= $bill_created_time ;\n $data_delete_history['bill_remove_time'] \t\t= $this->current_time ;\t\n DB::table('delete_history')->insert($data_delete_history);\n\t // get last delete history\n $last_delete_history_query = DB::table('delete_history')->orderBy('id','desc')->limit(1)->first();\n $last_delete_history_id = $last_delete_history_query->id ; \n // insert into delete pathlogy bill\n $data_delete_pathology_bill = array();\n $data_delete_pathology_bill['delete_history_id'] = $last_delete_history_id ;\n $data_delete_pathology_bill['branch_id'] = $this->branch_id ;\n $data_delete_pathology_bill['cashbook_id'] = $cashbook_id ;\n $data_delete_pathology_bill['invoice_number'] = $invoice;\n $data_delete_pathology_bill['year_invoice_number'] = $year_invoice ;\n $data_delete_pathology_bill['daily_invoice_number'] = $daily_invoice;\n $data_delete_pathology_bill['invoice_tr_id'] = 1 ;\n $data_delete_pathology_bill['doctor_id'] = $doctor_id;\n $data_delete_pathology_bill['patient_id'] = $patient_id;\n $data_delete_pathology_bill['pc_id'] = $pc_id;\n $data_delete_pathology_bill['total_payable'] = $total_payable;\n $data_delete_pathology_bill['total_payment'] = $total_payment;\n $data_delete_pathology_bill['total_discount'] = $total_discount;\n $data_delete_pathology_bill['total_rebate'] = $total_rebate;\n $data_delete_pathology_bill['test_id'] = $item_implode;\n $data_delete_pathology_bill['due_status'] = $due_status;\n $data_delete_pathology_bill['pc_amount'] = $bill_pc_amount;\n $data_delete_pathology_bill['status'] = 0 ;\n $data_delete_pathology_bill['bill_added_id'] = $bill_added_id;\n $data_delete_pathology_bill['bill_remove_id'] = $this->loged_id ; \n $data_delete_pathology_bill['bill_tr_date'] = $bill_tr_date ;\n $data_delete_pathology_bill['bill_remove_date'] = $this->rcdate ;\n $data_delete_pathology_bill['bill_created_date'] = $bill_created_at;\n $data_delete_pathology_bill['bill_created_time'] = $bill_created_time ;\n $data_delete_pathology_bill['bill_remove_time'] = $this->current_time;\n DB::table('delete_pathology_bill')->insert($data_delete_pathology_bill);\n // delete pathlogy bill transaction\n DB::table('pathology_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',0)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',1)->delete();\n // delete pathlogy bill iteam\n DB::table('pathology_bill_item')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('cashbook_id',$cashbook_id)->delete();\n // delete pathlogy bill\n DB::table('pathology_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->where('cashbook_id',$cashbook_id)->delete();\n Session::put('succes','Thanks , Pathology Bill Deleted Successfully');\n return Redirect::to('cashierPathologyBillReport');\n }", "function eliminarUcedifobracivil(){\n\t\t$this->procedimiento='snx.ft_ucedifobracivil_ime';\n\t\t$this->transaccion='SNX_UDOC_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_ucedifobracivil','id_ucedifobracivil','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function EliminarIngredientes()\n{\nif($_SESSION['acceso'] == \"administrador\") {\n\n\t$sql = \" select codingrediente from productosvsingredientes where codingrediente = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codingrediente\"])) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$sql = \" delete from ingredientes where codingrediente = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codingrediente);\n\t\t$codingrediente = base64_decode($_GET[\"codingrediente\"]);\n\t\t$stmt->execute();\n\n\t\theader(\"Location: ingredientes?mesage=1\");\n\t\texit;\n\n\t} else {\n\n\t\theader(\"Location: ingredientes?mesage=2\");\n\t\texit;\n\t} \n\n} else {\n\n\theader(\"Location: ingredientes?mesage=3\");\n\texit;\n}\t\n}", "public function itemRemove(Request $request)\n {\n \n $customId = $request->customId;\n $invoiceId = $request->tempInv; \n\n DB::table('temp_invoices_custom_items')\n ->where('custom_id',$customId)\n ->delete();\n\n $items = DB::table('temp_invoices_custom_items')\n ->where('item_id','!=',0) \n ->where('invoice_id',$invoiceId)\n ->orderBy('custom_id')\n ->get();\n\n \n\n $i=1; $itemTotal = 0;\n\n if($items) {\n ?>\n <table class=\"table table-striped table-hover table-bordered\">\n <thead><tr><th>#</th><th>Item</th><th>Quantity</th><th>Received</th><th>Not Received</th><th>Unit Price</th> <th>Total</th><th>&nbsp;</th></tr></thead>\n <?php foreach($items as $item) {?>\n <tr>\n <td><?php echo $i;?></td>\n <td><?php echo $item->item_name; ?></td>\n <td><?php echo $item->qty; ?></td>\n <td><?php echo $item->quantity_received; ?></td>\n <td><?php echo $item->quantity_not_received; ?></td>\n <td><?php echo $item->unit_price; ?></td>\n <td><?php echo $item->total_amount; $itemTotal+=$item->total_amount;?></td>\n <td><button class=\"delItemButton\" value=\"<?php echo $item->custom_id;?>\"><i class=\"fa fa-trash\"></i></button></td>\n </tr><?php $i++; } ?>\n <tr>\n <td colspan=\"6\" style=\"text-align:right !important\"><strong>Store Total</strong></td><td colspan=\"2\" ><?php echo $itemTotal;?>\n <input type=\"hidden\" name=\"store_total\" id=\"store_total\" value=\"<?php echo $itemTotal;?>\"></td></tr> \n </tbody>\n </table>\n <?php } else {?>\n <input type=\"hidden\" name=\"store_total\" id=\"store_total\" value=\"0\"></td></tr> \n <?php }\n }", "public function delete_extraproduct(){\n if($this->uri->segment(3) == \"temp\"){\n $id = $this->uri->segment(4);\n $result = MU_Model::deletedRecordById(\"temp_table\",array(\"ID\" => $id));\n }else{\n $id = $this->uri->segment(3);\n $result = MU_Model::deletedRecordById(\"extra_acti\",array(\"extraproduct_id\" => $id));\n }\n if($result) echo 't';\n }", "public function deleted(OnlineInquiry $onlineInquiry)\n {\n //\n }", "public function cashierDeleteOPDBill($invoice , $year_invoice , $daily_invoice ,$cashbook_id)\n {\n $pathology_tr_info = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',1)->where('status',0)->first();\n\n $total_payable = $pathology_tr_info->total_payable ;\n $total_discount = $pathology_tr_info->total_discount ;\n $total_rebate = $pathology_tr_info->total_rebate ;\n $total_payment = $pathology_tr_info->total_payment ;\n\n $opd_bill_info_query = DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->limit(1)->first();\n $opd_status = $opd_bill_info_query->opd_status ;\n\n if($opd_status == '2'){\n $check_pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n // petty cash update\n $check_current_pettycash_amt = $check_pettycash_amount->pettycash_amount ;\n if($check_current_pettycash_amt < $total_payment){\n Session::put('failed','Sorry ! Pettycash Amount Small Than Delete Bill Payment Amount. Please Delete This Bill After Available Pettycash');\n return Redirect::to('cashierOPDBillReport');\n exit();\n }\n }\n //check doctor discount of this invoice\n $doctor_discount_count = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',2)->count();\n if($doctor_discount_count > 0){\n Session::put('failed','Sorry ! Given Doctor Discount Of This OPD Bill. First Delete Doctor Discount Of This Bill Then Try To Delete OPD Bill');\n return Redirect::to('cashierOPDDoctorDiscountReport');\n exit();\n }\n $due_collection_count = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',1)->count();\n if($due_collection_count > 0){\n Session::put('failed','Sorry ! Due Collection Of This OPD Bill. First Delete Due Collection Of This Bill Then Try To Delete OPD Bill');\n return Redirect::to('cashierOPDDueCollectionReport');\n exit();\n }\n $delete_count = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->whereNotIn('status',[0])->count();\n if($delete_count > 0){\n Session::put('failed','Sorry ! Delete Doctor Discount And Due Collection If You Given It. Manualy Check That And Try To Delete OPD Bill');\n return Redirect::to('cashierOPDBillReport');\n exit();\n } \n // get pathology bill info\n $pathology_info = DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->where('cashbook_id',$cashbook_id)->first();\n $bill_added_id = $pathology_info->added_id ;\n $bill_tr_date = $pathology_info->bill_date ;\n $bill_created_time = $pathology_info->bill_time ;\n $bill_created_at = $pathology_info->created_at ;\n $doctor_id = $pathology_info->doctor_id ;\n $patient_id = $pathology_info->patient_id ;\n $due_status = $pathology_info->due_status ;\n\n $pathoogy_item = DB::table('opd_bill_item')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('cashbook_id',$cashbook_id)->get();\n $itam = array();\n foreach ($pathoogy_item as $value_iteam) {\n $itam[] = $value_iteam->opd_fee_id ;\n }\n $item_implode = implode(',', $itam);\n if($opd_status == '2'){\n // delete cashbook id\n DB::table('cashbook')->where('id',$cashbook_id)->delete();\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n // petty cash update\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $current_pettycash_amt - $total_payment ;\n // update pettycash amount\n $data_update_pettycash = array();\n $data_update_pettycash['pettycash_amount'] = $now_pettycash_amt; \n DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->update($data_update_pettycash);\n }else{\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $pettycash_amount->pettycash_amount ;\n }\n\n // insert data into\n $data_delete_history = array();\n $data_delete_history['admin_type'] = 3 ;\n $data_delete_history['branch_id'] = $this->branch_id ;\n $data_delete_history['status'] = 6 ;\n $data_delete_history['tr_status'] = 1 ;\n $data_delete_history['before_pettycash_amt'] = $current_pettycash_amt ;\n $data_delete_history['after_pettycash_amt'] = $now_pettycash_amt ;\n $data_delete_history['bill_added_id'] = $bill_added_id ;\n $data_delete_history['bill_remove_id'] = $this->loged_id ;\n $data_delete_history['bill_tr_date'] = $bill_tr_date ;\n $data_delete_history['bill_remove_date'] = $this->rcdate ;\n $data_delete_history['bill_created_date'] = $bill_created_at ;\n $data_delete_history['bill_created_time'] = $bill_created_time ;\n $data_delete_history['bill_remove_time'] = $this->current_time ; \n DB::table('delete_history')->insert($data_delete_history);\n // get last delete history\n $last_delete_history_query = DB::table('delete_history')->orderBy('id','desc')->limit(1)->first();\n $last_delete_history_id = $last_delete_history_query->id ;\n // insert into delete pathlogy bill\n $data_delete_pathology_bill = array();\n $data_delete_pathology_bill['delete_history_id'] = $last_delete_history_id ;\n $data_delete_pathology_bill['branch_id'] = $this->branch_id ;\n $data_delete_pathology_bill['cashbook_id'] = $cashbook_id ;\n $data_delete_pathology_bill['invoice_number'] = $invoice;\n $data_delete_pathology_bill['year_invoice_number'] = $year_invoice ;\n $data_delete_pathology_bill['daily_invoice_number'] = $daily_invoice;\n $data_delete_pathology_bill['invoice_tr_id'] = 1 ;\n $data_delete_pathology_bill['doctor_id'] = $doctor_id;\n $data_delete_pathology_bill['patient_id'] = $patient_id;\n $data_delete_pathology_bill['total_payable'] = $total_payable;\n $data_delete_pathology_bill['total_payment'] = $total_payment;\n $data_delete_pathology_bill['total_discount'] = $total_discount;\n $data_delete_pathology_bill['total_rebate'] = $total_rebate;\n $data_delete_pathology_bill['opd_fee_id'] = $item_implode;\n $data_delete_pathology_bill['due_status'] = $due_status;\n $data_delete_pathology_bill['status'] = 0 ;\n $data_delete_pathology_bill['opd_status'] = $opd_status ;\n $data_delete_pathology_bill['bill_added_id'] = $bill_added_id;\n $data_delete_pathology_bill['bill_remove_id'] = $this->loged_id ; \n $data_delete_pathology_bill['bill_tr_date'] = $bill_tr_date ;\n $data_delete_pathology_bill['bill_remove_date'] = $this->rcdate ;\n $data_delete_pathology_bill['bill_created_date'] = $bill_created_at;\n $data_delete_pathology_bill['bill_created_time'] = $bill_created_time ;\n $data_delete_pathology_bill['bill_remove_time'] = $this->current_time;\n DB::table('delete_opd_bill')->insert($data_delete_pathology_bill);\n // delete pathlogy bill transaction\n DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',0)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',1)->delete();\n // delete pathlogy bill iteam\n DB::table('opd_bill_item')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('cashbook_id',$cashbook_id)->delete();\n // delete pathlogy bill\n DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->where('cashbook_id',$cashbook_id)->delete();\n Session::put('succes','Thanks , OPD Bill Deleted Successfully');\n return Redirect::to('cashierOPDBillReport');\n\n }", "function remove_rows($table_id, $data) {\n\t$cmsEditDel = new cmsEditDel($table_id, $data);\n\t$delete_id = $cmsEditDel->dbChange();\n\tunset($cmsEditDel);\n\t\n\tif (empty($delete_id)) return;\n\t\n\t$child = getChildTables($table_id);\n\treset($child);\n\twhile (list($table_id, $field_name) = each($child)) {\n\t\tremove_rows($table_id, array($field_name => $delete_id));\n\t}\n\t\n}", "function updateRequisitionAsRemove($requisition_number)\n{\n\tglobal $mysqli;\n\tupdateBudgetAsRemove($requisition_number);\n\t$update_data = \"update usaid_requisition set status = 'Remove' where requisition_number='\".$requisition_number.\"'\";\n\t$result_data = $mysqli->query($update_data);\n\n\t###remove all award of this requisition\n\tremoveRequisitionAward($requisition_number);\n}", "function deletePhotoTable($con){\n\t$sql = \"DROP TABLE IF EXISTS csgp07_13_14 . Photo\";\n\tif(mysqli_query($con, $sql)){\n\t\techo \"Table Photo deleted successfully\\n\";\n\t}\n\telse{\n\t\techo \"Could Not Delete Photo Table\" . mysqli_error($con);\n\t}\t\n}", "public function delete()\n {\n global $connection;\n //echo \"Im on the purchases ->delete()\";\n\n //else\n //{\n #set_error_handler\n #set_exception_handler\n #call the stored procedure\n //$SQLQuery = \"DELETE FROM purchases \" \n // . \" WHERE purchase_id = :purchase_id;\";\n $SQLQuery = \"CALL purchases_delete(\"\n . \":purchase_id);\";\n $PDOStatement = $connection->prepare($SQLQuery);\n $PDOStatement->bindParam(\":purchase_id\", $this->purchase_id); \n $PDOStatement->execute(); \n }", "function clean_up1($res, $obj)\n{\n\t$res = $obj->query1(\"delete from reg_pro where pro_id in (\n'###############',\n'################',\n'##################',\n'**************',\n'****************')\");\n\twhile(odbc_fetch_row($res)){\n\t\techo 'deleted';\n\t}\t\t\n}", "function delete_($id){\r\nglobal $mod_id;\r\nglobal $db;\r\nglobal $_POST;\r\nglobal $tbl_name_main;\r\nglobal $tbl_name_detail;\r\n\r\n$sql =\"DELETE \";\r\n$sql .=\"FROM \".$tbl_name_main.\" \";\r\n$sql .=\"WHERE id_form_rfk_02_jp_main = '$id'\";\r\n\r\n$sqlresult = $db->Execute($sql);\r\n}", "public function remove_row() {\n\t\t\t$email = $this->input->post('email');\n\n\t\t\t$this->load->model('users_table');\n\t\t\t$data = $this->users_table->remove_row($email);\n\t\t}", "public function removePurhaseOrderById(Request $request)\n { \n $poId = $request->input('id');\n if (!empty($poId)) {\n\n $getTicketAttachmentData = DB::table('purchase_order_image')\n ->select('*')\n ->where('po_id', $poId)\n ->where('is_deleted_status', 'N')\n ->get()\n ->toArray(); \n if (!empty($getTicketAttachmentData)) {\n foreach ($getTicketAttachmentData as $attachment) {\n $unlinkPath = $_SERVER['DOCUMENT_ROOT'].'/fintech/laravel/public/po_image/';\n unlink($unlinkPath.$attachment->image);\n }\n }\n\n $purhaseOrderModel = new PurhaseOrderModel();\n $result = $purhaseOrderModel->deletePurhaseOrder($poId);\n \n return ['success'=> true, 'message' => 'Purhase Order has been deleted.'];\n \n }\n }", "public function remove(int $id): void\n {\n $this->db->query(\"DELETE FROM pois WHERE id=\" . $id);\n // $this->db->query(\"DELETE FROM assoc_pois_missions WHERE poi=$id\");\n }", "public function EliminarIngredientesProductos()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t$sql = \" delete from productosvsingredientes where codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codproducto);\n\t\t$stmt->bindParam(2,$codingrediente);\n\t\t$codproducto = base64_decode($_GET[\"codproducto\"]);\n\t\t$codingrediente = base64_decode($_GET[\"codingrediente\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> EL INGREDIENTE FUE ELIMINADO EXITOSAMENTE </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\n\t} else {\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> USTED NO PUEDE ELIMINAR INGREDIENTES AGREGADOS, NO ERES EL ADMINISTRADOR DEL SISTEMA </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\t}\n\n}", "public function purchase_return_unsaved_delete()\n {\n $purchase_return_no = $this->input->post(\"purchase_return_no\");\n /** Remove auto created purchase journal */\n $journal = $this->MAc_journal_master->get_by_doc('Purchase Return', $purchase_return_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created payment receipt for partial or full cash purchase */\n $payment = $this->MAc_payment_receipts->get_by_doc('Purchase', $purchase_return_no);\n if (count($payment) > 0)\n {\n $this->MAc_payment_receipts->delete($payment['id']);\n }\n /** Remove purchase */\n $this->MPurchase_return_details->delete_by_purchase_return_no($purchase_return_no);\n $this->MPurchase_return_master->delete_by_purchase_return_no($purchase_return_no);\n }", "public function delete_method_unit($method_unit){\r\t\t\t$query=\"delete from `\".$this->table_name_smu.\"` where `id`=$method_unit\";\r\t\t\tmysqli_query($this->conn,$query);\r\t\t}" ]
[ "0.71376467", "0.7025082", "0.6896601", "0.68586695", "0.6800109", "0.66648006", "0.66648006", "0.66648006", "0.66648006", "0.66648006", "0.66648006", "0.66223586", "0.6615044", "0.65465087", "0.6542511", "0.6501806", "0.6494774", "0.6310268", "0.62761074", "0.6245779", "0.6220684", "0.6179205", "0.6157219", "0.6150094", "0.6139477", "0.612122", "0.6100447", "0.6065767", "0.60569596", "0.60475993", "0.604459", "0.6030027", "0.6023452", "0.5995576", "0.5991898", "0.598975", "0.59875935", "0.5984437", "0.59761584", "0.59480906", "0.5911644", "0.58990115", "0.58979166", "0.5888719", "0.58654046", "0.5858705", "0.585598", "0.5850326", "0.58417714", "0.58348703", "0.58324516", "0.58308136", "0.5825056", "0.58113456", "0.58101517", "0.5797468", "0.5788338", "0.5787693", "0.577549", "0.57741165", "0.5768346", "0.5767127", "0.5761962", "0.57428104", "0.5735657", "0.5735619", "0.57329667", "0.5732034", "0.57305413", "0.5729631", "0.5728278", "0.5727452", "0.57229435", "0.5708158", "0.57050616", "0.57041967", "0.56977373", "0.56861895", "0.5685948", "0.5675678", "0.56736577", "0.56688124", "0.56643414", "0.5662353", "0.5660384", "0.56598943", "0.5646263", "0.5644375", "0.56439674", "0.56407243", "0.5630896", "0.5629701", "0.5624467", "0.5621934", "0.5616923", "0.56145203", "0.5608019", "0.5602449", "0.5600611", "0.5600009" ]
0.6001635
33
Log::info('lenght of '.$appId.' is '. strlen($appId));
protected function genRefNo($appId) { return env('REF_PREFIX').(strlen($appId)<3? str_pad($appId, 4-(strlen($appId) ), "0", STR_PAD_LEFT): $appId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLength() {}", "public function getLength() {}", "public function getLength() {}", "public function getLength() {}", "function getPayloadLength();", "public function getLength(): int;", "public function getLength(): int;", "function getLength(): int\n {\n return $this->length;\n }", "public function getLength();", "public function length();", "public function length();", "private function countLength() {\n\n $this->_length = strlen($this->_value);\n }", "public function getAppId(): int;", "function getLength ()\n\t{\n\t\treturn $this->_len ; \n\t}", "public function length() : int;", "public function strlen($date)\n {\n echo \"<h3><u> length of a string of $date </h2></u>\";\n $a=strlen($date);\n echo $a;\n echo \"<hr>\";\n }", "public function getTotalLength() {}", "public function getTotalLength() {}", "abstract public function getLength();", "private final function getLength() {\n\t\t\treturn $this->length;\n\t\t}", "function length() {\r\n return $this->count();\r\n }", "function length(){\n\t\t//return strlen($this->_String4);\n\t\treturn Translate::Length($this->_String4,$this->getEncoding());\n\t}", "public function length()\n {\n return $this->provider->length();\n }", "function getSaltLength() ;", "function length(): int;", "public function length()\n {\n return $this->length;\n }", "public function getLength()\n {\n return 0;\n }", "public function getLength()\n {\n return strlen($this->data);\n }", "public function getTotalLength();", "public function getTotalLength();", "public function length()\n {\n return $this->count();\n }", "public function getSaltLength() {}", "public function getSaltLength() {}", "public function length() {\n return $this->count();\n }", "function getSize(): int {\n return \\strlen($this->buffer);\n }", "public function length(){\n return sizeof($this->flights);\n }", "public function getLength() {\r\n return $this->length;\r\n }", "public function getLength()\r\n {\r\n return $this->length;\r\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "function acf_strlen($str)\n{\n}", "public function get_bodylength() {\n return \"Lichaamslengte = \" . $this->bodylength . \"m\";\n }", "public function count()\n {\n return $this->length;\n }", "public function getLen()\n {\n return $this->_len;\n }", "public function getLengthLimit()\n {\n }", "public function length()\n {\n return strlen($this->buffer);\n }", "public function getAppId(): string;", "public function testGenerateLength()\n {\n $length = mt_rand(10, 1000);\n $password = PasswordGenerator::generate($length, PasswordGenerator::PASSWORD_HARD);\n $passwordLength = mb_strlen($password);\n\n $this->assertEquals($length,$passwordLength);\n }", "public function count()\n {\n return $this->length();\n }", "public function getLength()\n\t\t{\n\t\t\treturn $this->length;\n\t\t}", "#[\\ReturnTypeWillChange]\n public function count() {\n return mb_strlen($this->string);\n }", "public function getLength() {\n return $this->_length;\n }", "public function getAppId() : int\n {\n return $this->appId;\n }", "public function hasLength(){\n return $this->_has(2);\n }", "public function count()\n {\n return $this->length;\n }", "public function count() {\n return $this->length;\n }", "public function hasDataLength(){\n return $this->_has(6);\n }", "private function msgCount()\n {\n $msg = request('message');\n $final_msg = $msg . ' ' . env('OPT_OUT');\n\n if (strlen($final_msg) <= 160) {\n return $msg_count = 1;\n } else {\n return $msg_count = ceil(utf8_encode(strlen($final_msg))/env('SMS_LENGTH'));\n }\n }", "function getLength(): ?int;", "public function getOutputLength();", "public function getAnswerLength();", "public function getKeyLength() {\n\t\treturn $this->current_key_length;\n\t}", "public function count()\n {\n return $this->length();\n }", "public function getAppId()\n {\n }", "public function getLength() {\n \n return $this->_length;\n }", "public function count() {\n\t\treturn $this->length();\n\t}", "public function length()\n {\n return count($this->__data);\n }", "public function length() {\n\t\treturn sizeof( $this->array );\n\t}", "public function length()\n\t{\n\t\treturn (sizeof($this->shortcodes));\n\t}", "private function getHmacSize() {\n\t// Make a dummy hash and figure out how big it is.\n\t// Note: there's a different way to do this, but I'm doing\n\t// this way so when the config changes the system can\n\t// dynamically adjust.\n\treturn strlen($this->getHmac(\"X\", $this->getHash(\"Y\")));\n }", "public function strlen(string $key): int\r\n\t{\r\n\t\treturn $this->connection->strlen($key);\r\n\t}", "public function getCharLength();", "public function getLength() {\n\t\treturn null;\n\t}", "public function length() {\r\n return strlen($this->contents);\r\n }", "public function length() {\n \n return $this->getLength();\n }", "public function get_size()\n {\n }", "public function getLength()\n {\n return $this->int_length;\n }", "protected function getSize()\n {\n return strlen($this->data);\n }", "public function count() {\n \n return $this->getLength();\n }", "public function getMaxLength() {}", "public static function length($value){\n return mb_strlen($value);\n }", "public function flowControlledLength()\n {\n $padding_len = ($this->padding_length) ? $this->padding_length + 1 : 0;\n return strlen($this->data) + $padding_len;\n }", "public function size() {}", "protected function getStringSize($value){\n\t\tif (function_exists('mb_strlen')) return mb_strlen($value);\n\n\t\treturn strlen($value);\n\t}", "public function inputLength()\r\n\t{\r\n\t\treturn $this->input_stats['size'];\r\n\t}", "public function testGenerateLength()\n {\n $length = mt_rand(10, 1000);\n $password = PasswordGenerator::generate($length, PasswordGenerator::PASSWORD_STRENGTH_HARD);\n $passwordLength = mb_strlen($password);\n\n $this->assertEquals($length, $passwordLength);\n }", "public function getLength($atOffset = false) {}", "public function getTextLength();", "public function length()\n {\n return UTF8::strlen($this->str, $this->encoding);\n }", "function length($read, $count)\n{\n global $end;\n \n if (strlen($read) > 80) {\n echo \"\\e[0;31m Erreur : \\e[0;34m ligne $count : \\e[0;31m Ligne de plus de 80 caractères. \\e[0;m\\n\";\n $end += 1;\n }\n}", "public function length() {\n\t\treturn count($this->_value);\n\t}", "function totalStringLength ($stringOne, $stringTwo)\n{\n $number = strlen($stringOne) + strlen($stringTwo);\n\nreturn $number;\n}", "public function length($value)\n {\n return 'LEN(' . $value . ')';\n }", "public function getCompleteLength()\n {\n return $this->complete_length;\n }", "public function size() {\n return sizeof(array_keys($this->_hash));\n }" ]
[ "0.6623482", "0.6623482", "0.6623482", "0.6622914", "0.64988464", "0.6445004", "0.6445004", "0.64297515", "0.6421472", "0.6387477", "0.6387477", "0.6349549", "0.6321102", "0.62894446", "0.62504196", "0.61635333", "0.61251825", "0.6123524", "0.61180747", "0.6115277", "0.60379225", "0.60237783", "0.60162216", "0.6014084", "0.59713686", "0.59515035", "0.59292245", "0.59280574", "0.5907122", "0.5907122", "0.588073", "0.5878817", "0.5878817", "0.5866504", "0.5842484", "0.58424515", "0.5839764", "0.58239144", "0.58189046", "0.58189046", "0.58189046", "0.58189046", "0.58189046", "0.58189046", "0.58189046", "0.58189046", "0.5814945", "0.5783628", "0.5770148", "0.57662797", "0.5739896", "0.57373947", "0.57346505", "0.57266617", "0.5717617", "0.5712346", "0.5706427", "0.56815684", "0.5646325", "0.56450725", "0.5643129", "0.5630199", "0.562403", "0.562166", "0.5618326", "0.56141204", "0.5603494", "0.56008637", "0.5597827", "0.5586253", "0.5581996", "0.55537325", "0.5552424", "0.5551348", "0.5551039", "0.5547601", "0.55470055", "0.5543512", "0.5527999", "0.55255264", "0.5524782", "0.55213207", "0.55124736", "0.54994947", "0.54939055", "0.5490858", "0.5477177", "0.54485416", "0.54419", "0.54378945", "0.54324037", "0.54177654", "0.54036504", "0.54026264", "0.53917897", "0.5387267", "0.5382195", "0.53555274", "0.5350111", "0.5346772", "0.53466266" ]
0.0
-1
Test login error messagebag.
public function testLoginError() { $response = $this->post('/login', ['email' => '[email protected]']); $response->assertSessionHasErrors(['password']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testLoginFailedFunctionality()\n {\n $this->expectOutputString(\"err_login_failed\");\n $email = '[email protected]';\n $ctrl = new Controller();\n // Give it the wrong password\n $ctrl->login($email,'wrong password');\n\n }", "public function test_fail_login() {\n $_POST = array('name' => \"customer2\", 'password' => \"123:\");\n $expected = json_encode(array(\"status\" => 0, \"message\" => \"Username or password is incorrect\"));\n $this->expectOutputString($expected);\n $this->object->main();\n }", "private function loginFailed()\n {\n //Login failed...\n }", "public function testCantLoginWithInvalidCredentials()\n {\n // arrange \n $user = User::factory()->create();\n\n // act\n $response = $this->post(\"/login\", [\n \"email\" => $user->email,\n \"password\" => \"invalidpassword\"\n ]);\n\n // assert\n $response->assertStatus(302);\n $response->assertSessionHas(\"errors\");\n\n $messages = session(\"errors\")->getMessages();\n $this->assertEquals($messages[\"email\"][0], \"These credentials do not match our records.\");\n // dd($messages);\n }", "public function testProcessLoginFailed(){\n\n Sentinel::disableCheckpoints();\n\n $credentials = [\n 'email' => '[email protected]',\n 'password' => 'passwords',\n ];\n\n $response = $this->post(route('login.action', $credentials));\n\n $response->assertSessionHas('failed');\n $response->assertRedirect(route('login.form'));\n }", "public function testLoginValidationLog() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => 'aaaaa', 'password' => ''])\n ->see('Please enter a valid password.');\n }", "public function testLoginValidation() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => ''])\n ->see('Please enter a valid username.')\n ->see('Please enter a valid password.');\n }", "public function testInvalidLogin()\n {\n $response = $this->post('admin', [\n 'email' => '[email protected]',\n 'password' => 'pass',\n ], [\n 'HTTP_REFERER' => url('admin'), // So it redirects back to self\n ]);\n\n // Check that user is redirected back to login but there are errors\n $response->assertRedirect('admin');\n $response->assertSessionHasErrors();\n }", "public function testLoginValid(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => 'Wrong'\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertTrue($validLogin);\r\n\t\t}", "public function testLoginValidationFailPassword()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"token\": \"QpwL5tke4Pnpja7X4\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->post('api/user/login', ['email' => 'email'], $this->headers)\n ->assertStatus(422)\n ->assertJson(json_decode('{\"errors\":{\"password\":[\"The password field is required.\"]},\"message\":\"The given data was invalid.\"}', true));\n\n }", "public function testLoginValidationPass() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => 'sfaff'])\n ->see('Please enter a valid username.');\n }", "public function testLoginname(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => '',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function testLoginFailure()\n {\n $mock = new MockHandler([\n new Response(400, [], '{\"error\": \"login failure\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->post('api/user/login', ['email' => '[email protected]', 'password' => 'password'], $this->headers)\n ->assertStatus(400)\n ->assertSeeText('login failure');\n\n }", "public function testLoginNoCredentials()\n {\n $response = $this->post($this->getLoginSubmitUrl());\n $response->assertSessionHasErrors([\n 'email', 'password'\n ]);\n }", "public function testInvalidLogin()\n {\n $this->visit('/')\n ->see('Login')\n ->click('Login')\n ->seePageIs('/auth/login')\n ->type('[email protected]', 'email')\n ->type('password', 'password')\n ->press('Login')\n ->seePageIs('/auth/login')\n ->see('These credentials do not match our records.');\n\n }", "public function testWrongUser(){\n Session::flush();\n $user = $this->postuser(array('username'=>'XxX','password'=>'XxX'));\n $status_message = $this->getJsonResponse();\n $this->assertResponseStatus('401');\n $this->assertTrue($status_message['message'] == 'login refused');\n }", "public function testFailLogin()\n {\n $response = $this->call('GET', '/api/v1/[email protected]&password=12345');\n \n $this->assertEquals(401, $response->status());\n }", "public function testLoginWithoutUserDetails() :void\n {\n $res = self::$dataService->login(\"login\", null, $this->userEmpty[\"user\"], $this->userEmpty[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserDetails' );\n $this->assertCount(2, $res, 'testLoginWithoutUserDetails' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter username.\" ], $res, 'testLoginWithoutUserDetails' );\n }", "public function testInvalidCredentialsCantLogin()\n {\n $this->browse( function( Browser $browser ){\n $browser->visit( '/admin' );\n $browser->type( 'email', '[email protected]' );\n $browser->type( 'password', 'wrongpassword' );\n $browser->click( '.button.is-primary' );\n $browser->assertSee( 'Your username or password were incorrect' );\n });\n }", "public function testLogin() {\n $this->assert_title(\"Login\");\n\n //Failed login\n testMacros::login($this->driver, \"[email protected]\", \"passwordwrong\");\n $this->assert_title(\"Login\");\n\n //Successful Login\n testMacros::login($this->driver, \"[email protected]\", \"password1\");\n $this->assert_title(\"CheckinChildren\");\n\n //Logout\n $this->get_element(\"name=profile\")->click();\n $this->get_element(\"name=logout\")->click();\n }", "public function testLoginFail()\n {\n $this->createAdmin();\n\n $response = $this->post(\n route('login'),\n [\n 'email' => $this->admin_data['email'],\n 'password' => '123'\n ]\n );\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n\n $response = $this->post(\n route('login'),\n [\n 'email' => '[email protected]',\n 'password' => '123456'\n ]\n );\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n }", "public function testLoginWithoutUserName() : void\n {\n $res = self::$dataService->login(\"login\", null, $this->userEmpty[\"user\"], $this->userFake[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserName' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserName' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserName' );\n $this->assertCount(2, $res, 'testLoginWithoutUserName' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter username.\" ], $res, 'testLoginWithoutUserName' );\n }", "public function testInvalidUserLogin()\n {\n $this->withoutExceptionHandling();\n\n $credentials = [\n \"email\" => \"[email protected]\",\n \"password\" => \"1111\",\n ];\n\n $response = $this->post(route(\"login.attempt\"),$credentials);\n\n $response->assertRedirect(route(\"home\"));\n $response->assertSessionHas(\"error\");\n }", "public function testMustEnterUserNameAndPassword()\n {\n $response = $this->post(route('auth.authenticate'));\n\n $response->assertSessionHasErrors(\n [\n 'userName' => 'user name không được để trống.',\n 'password' => 'password không được để trống.'\n ]\n );\n $response->assertStatus(Response::HTTP_FOUND);\n }", "public function testLogin() : void\n {\n $res = self::$dataService->login( \"login\", null, $this->userA[\"user\"], $this->userA[\"pass\"], [ \"user_agent\" => $this->userA[\"getBrowserName\"], \"time\" => $this->userA[\"getCurrentDateTime\"], \"ip\" => $this->userA[\"getReqIp\"] ] );\n\n $this->assertIsArray( $res, 'testLogin' );\n $this->assertArrayHasKey('status', $res, 'testLogin' );\n $this->assertArrayHasKey('msg', $res, 'testLogin' );\n $this->assertArrayHasKey('uid', $res, 'testLogin' );\n $this->assertArrayHasKey('name', $res, 'testLogin' );\n $this->assertArrayHasKey('token', $res, 'testLogin' );\n $this->assertCount(5, $res, 'testLogin' );\n $this->assertEquals( [ \"status\" => true, \"msg\" => \"Welcome \".$this->userA[\"name\"], \"uid\" => \"112387623\", \"name\" => \"test5\", \"token\" => $res[\"token\"] ], $res, 'testLogin' );\n }", "function ft_hook_loginfail() {}", "public function testLoginIncorrectPassword()\n {\n $this->createUser();\n\n $response = $this->post($this->getLoginSubmitUrl(), [\n 'email' => $this->getCorrectEmail(),\n 'password' => 'incorrectPassword'\n ]);\n\n //Regardless of incorrect email/password, email is sent as error key.\n $response->assertSessionHasErrors(['email']);\n }", "public function testForgotPasswordFailLoggedin()\n {\n $this->session(['Auth.User' => [\n 'id' => 1,\n 'role_id' => 1,\n ]]);\n\n $this->get('/users/forgotPassword');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n }", "public function test_login8()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('1','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "public function testLoginSubmissionWrongEmailAndPassword()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('txt-email', '[email protected]')\n ->type('txt-password', 'wrongpassword123')\n ->press('Sign in')\n ->assertSee('Invalid credentials entered.');\n });\n }", "public function testLoginPassword(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function testLoginWithoutUserPass() : void\n {\n $res = self::$dataService->login( \"login\", null, $this->userA[\"user\"], $this->userEmpty[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserPass' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserPass' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserPass' );\n $this->assertCount(2, $res, 'testLoginWithoutUserPass' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter password.\" ], $res, 'testLoginWithoutUserPass' );\n }", "function login() {\n\n $this->visitPath('/user/login');\n\n $loginForm = $this->getSession()->getPage()->findById('user-login-form');\n if (is_null($loginForm)) {\n throw new ExpectationException('Cannot find the login form.', $this->getSession()->getDriver());\n }\n\n $usernameField = $loginForm->findById('edit-name');\n $passwdField = $loginForm->findById('edit-pass');\n\n if (is_null($usernameField) or is_null($passwdField)) {\n throw new ExpectationException('Cannot find the authentication fields.', $this->getSession()->getDriver());\n }\n\n $usernameField->setValue($this->admin_username);\n $passwdField->setValue($this->admin_passwd);\n $loginForm->submit();\n\n $this->assertSession()->elementNotExists('css', '.messages--error');\n }", "function testLoginFail()\r\n {\r\n \t$this->User = new User();\r\n \t//check with wrong email and wrong pass\r\n\t\t$this->assertFalse( $this->User->login('wrongemail', 'wrongpass') );\r\n\t\t\r\n\t\t//check with valid password but wrong email\r\n\t\t$this->assertFalse( $this->User->login('wrongemail', 'password') );\r\n\t\t\r\n\t\t//check with valid email but wrong pass\r\n\t\t$this->assertFalse( $this->User->login('[email protected]', 'wrongpass') );\r\n\t\t\r\n\t\t//check with valid email but no password\r\n\t\t$this->assertFalse( $this->User->login('[email protected]', '') );\r\n\t\t\r\n\t\t//check with empty user-data\r\n\t\t$this->assertFalse( $this->User->login('', '') );\r\n\t}", "public function test_login4()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('12345678','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "public function testLoginUsername(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => '',\r\n\t\t\t\t'password' => 'thisisit'\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function testLoginActionWithBadPassword()\n {\n $data = [\n '_username' => 'user1',\n '_password' => 'badpassword',\n ];\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/login');\n $form = $crawler->filter('form[action$=\"login_check\"].form-horizontal button[type=\"submit\"]')->form();\n $client->submit($form, $data);\n $crawler = $client->followRedirect();\n $this->assertSame('The presented password is invalid.', $crawler->filter('div.alert.alert-error')->text());\n $security = $client->getContainer()->get('security.context');\n $this->assertFalse($security->isGranted('ROLE_USER'));\n }", "public function testForm() {\n $this->controller->process();\n $errors = $this->controller->getPlaceholder('loginfp.errors');\n $this->assertEmpty($errors);\n $this->assertEquals(1,$this->controller->emailsSent);\n }", "public function testIsValidLogIn_InCorrectPassword_ReturnsErrorMessage()\n {\n $user = new User();\n\n $user -> email = \"[email protected]\";\n $user -> password = \"secret\";\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/login')\n ->pause(1000)\n ->type('@login-email-input', $user->email)\n ->type('@login-password-input', 'test')\n ->click('@login-button')\n ->assertSee('These credentials do not match our records.');\n });\n }", "public function test_login2()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('123456','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "public static function userLoginFailed(){\n self::$IntelligenceService->addToIntelligenceStack(self::USER_INTELLIGENCE_LOGIN_KEY, self::USER_INTELLIGENCE_FAILED);\n }", "public function testLoginSuccessfulFunctionality()\n {\n\tunset($_SESSION);\n $email = '[email protected]';\n $ctrl = new Controller();\n $ctrl->login($email,'ooo');\n\n $this->assertEquals($_SESSION['email'], $email);\n\n }", "public function testVerifyCreateError()\n {\n $response = $this->withHeaders([\n 'X-Header' => 'Value',\n ])->post('/login', [\n 'name' => 'admin',\n 'password' => 'wrong'\n ]);\n\n $response->assertSessionHasErrors();\n $response->assertStatus(302);\n $response->assertSee('Redirect');\n $response->assertRedirect('/');\n }", "public function testWrongLoginNotWorks()\n {\n // Create a user\n $user = User::create([\n 'password' => Hash::make('password1234'),\n 'email' => '[email protected]',\n 'name' => 'John Doe',\n ]);\n\n // Create room with post\n $response = $this->from('/login')->post('/login', [\n 'email' => '[email protected]',\n 'password' => 'not-the-password',\n ]);\n\n // Redirect back\n $response->assertStatus(302);\n $response->assertRedirect('/login');\n\n // Error: These credentials do not match our records.\n $response->assertSessionHasErrors();\n\n $this->assertGuest();\n }", "public function testRegisterFail()\n {\n $response = $this->post('/register');\n\n $response->assertSessionHasErrors(['name', 'email', 'password']);\n }", "public function testLoginForm()\n {\n $this->get('/login');\n\n $this->assertResponseSuccess();\n $this->assertNoRedirect();\n\n $this->assertResponseContains('<input type=\"email\" name=\"email\" id=\"email\">');\n $this->assertResponseContains('<input type=\"password\" name=\"password\" id=\"password\" value=\"\">');\n\n $this->assertSession(null, 'Auth.User.id');\n }", "function testLoginSuccess()\r\n\t{\r\n \t$state = $this->User->login('[email protected]', 'password');\r\n\t\t$this->assertTrue($state);\r\n\t}", "public function testLoginWithInvalidEmail() : void\n {\n $res = self::$dataService->login( \"login\", null, $this->userFake[\"user\"], $this->userEmpty[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithNotValidEmail' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithNotValidEmail' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithNotValidEmail' );\n $this->assertCount(2, $res, 'testLoginWithNotValidEmail' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => $this->userFake[\"user\"].\" is not a valid email address\" ], $res, 'testLoginWithNotValidEmail' );\n }", "public function failedValidation(MessageBag $message)\n {\n $msg = '';\n $messages = $this->formatErrors($message);\n if (!empty($messages)) {\n $msg = current(current($messages));\n }\n throw new LoginException(\":\" . $msg, LoginException::ERROR_MISS_PARAM);\n }", "public function test_login6()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('','password')\n ->press('Login')\n ->see('The password field is required.');\n }", "public function testLoginSubmissionRightEmailAndWrongPassword()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('txt-email', '[email protected]')\n ->type('txt-password', 'wrongpassword123')\n ->press('Sign in')\n ->assertSee('Invalid credentials entered.');\n });\n }", "public function testSubmitWrongAuthentication()\n\t{\n\t\t$crawler = $this->client->request('GET', '/login');\n\t\t$loginForm = $crawler->selectButton(\"Connexion\")->form();\n\n\t\t$this->assertNotEquals(null, $loginForm);\n\n\t\t$loginForm['username'] = 'xxx';\n\t\t$loginForm['password'] = 'xxx';\n\n\t\t$crawler = $this->client->submit($loginForm);\n\t\t$crawler = $this->client->followRedirect();\n\n\t\t$this->assertStringContainsString('Username could not be found.', $crawler->text(null,false));\n\t}", "public function testEmailValidation() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => 'dfdfdfd', 'password' => '11'])\n ->see('Your Username or Password has not been recognised. Please try again.');\n }", "public function testMessage()\r\n {\r\n\r\n $this->flash->message(\"testMessage\");\r\n $this->assertEquals(\"testMessage\", $_SESSION[\"flash\"][\"messages\"][\"message\"][0]);\r\n\r\n }", "public function testApplicationLogin()\n {\n $this->visit('/login')\n ->type($this->user->email, 'email')\n ->type('password', 'password')\n ->press('submit')\n ->seeIsAuthenticatedAs($this->user)\n ->seePageIs('/admin/post');\n }", "public function testFailedDifferentUserLoggedIn(): void\n {\n self::$httpAuthorizationToken = AccessTokenFixture::DATA['access-token-juliette']['id'];\n\n $this->checkFailedAccessDenied();\n }", "public function testPostInvalidMessage(){\n\t\t//test to make sure non-admin can not post\n\t\t//sign out as admin, log-in as a voulenteer\n\t\t$logout = $this->guzzle-get('https://bootcamp-coders.cnm.edu/~cberaun2/bread-basket/public_html/php/controllers/sign-out-controller.php');\n\n\t\t$volLogin = new stdClass();\n\t\t$volLogin->email = \"[email protected]\";\n\t\t$volLogin->password = \"passwordabc\";\n\t\t$login = $this->guzzle->post('https://bootcamp-coders.cnm,edu/~cberaun2/bread-basket/public_html/php/controllers/sign-out-controller.php', ['allow_redirects' => ['strict' => true], 'json' => $volLogin, 'headers' => ['X-XSRF_TOKEN' => $this->token]]);\n\n\t\t$message = new Message(null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$response = $this->guzzle->post('https://bootcamp-coders.cnm,edu/~cberaun2/bread-basket/public_html/php/api/message', ['allow_redirects' => ['strict' => true], 'json' => $volLogin, 'headers' => ['X-XSRF_TOKEN' => $this->token]]);\n\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedMess = json_decode($body);\n\n\t\t//Make sure the organization was not entered into the databaase\n\t\t$shouldNotExist = Message::getMessageByMessageId($this->getPDO(), $this->VALID_MESSAGE_ID);\n\t\t$this->assertSame($shouldNotExist->getSize(), 0);\n\n\t\t//makeSure 401 error is returned for trying to access an admin method as a volunteer\n\t\t$this->asserSame(401, $retrievedMess->status);\n\t}", "public function test_login()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->assertSee('Email')\n ->type(\"#email\", '[email protected]')\n ->type('#password', '11111111')\n ->press('button[type=\"submit\"]')\n ->waitFor('#menu')\n ->assertSee('수강목록');\n });\n }", "public function testLoginCorrect()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Login')\n ->assertSee('Password')\n ->type('username', 'peinfant')\n ->type('password', 'pablo1')\n ->press('Login')\n ->assertPathIs('/admin/index')\n ->assertSee('Welcome')\n ->clickLink('Logout');\n\n $browser->assertSee('Login')\n ->assertSee('Password');\n });\n }", "public function test_users_store_long_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 256);\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function testException() {\n\t\ttry {\n\t\t\t$this->user->getUser('');\n\t\t\t$this->fail(\"Username Required\");\n\t\t} catch (\\Throwable $ex) {\n\t\t\t$this->assertEquals($ex->getMessage(), \"Username Required\");\n\t\t}\n\n\t}", "public function test_login7()\n {\n $this->visit('login')\n ->type('', 'email')\n ->type('','password')\n ->press('Login')\n ->see('The password field is required.' &&'The password field is required.');\n }", "public function test_login5()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('','password')\n ->press('Login')\n ->see('The password field is required.');\n }", "public function testLoginWrongPassword(): void { }", "public function testWrongFieldsData()\n {\n $response = $this->call('POST','api/auth/login',array(\"email\"=>\"[email protected]\",\"password\"=>\"test\"));\n\n $this->assertEquals(401,$response->status());\n }", "function smarty_function_login_error($params,&$smarty) {\n\tglobal $user;\n\tif (SMIAction::action() == 'Log In' && !$user->valid()) return 'Bad login or password!';\n}", "public function test_users_store_no_password_error(){\n $this->signInUser();\n unset($this->user['password']);\n $response = $this->post(route('users.store', $this->user)); $response->assertSessionHasErrors(['password']);\n }", "public function testLoginTest()\n {\n $this->browse(function (Browser $browser) {\n $browser\n // ->visit('logout')\n ->visit('/login')\n ->type('email','[email protected]')\n ->type('password','123456')\n ->click('#btnsubmit')\n ->waitForText('Welcome')\n ->assertSee('Welcome');\n });\n }", "public function testLoginValidationFailEmail()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"token\": \"QpwL5tke4Pnpja7X4\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->post('api/user/login', ['password' => 'password'], $this->headers)\n ->assertStatus(422)\n ->assertJson(json_decode('{\"errors\":{\"email\":[\"The email field is required.\"]},\"message\":\"The given data was invalid.\"}', true));\n\n }", "public function testLoginWithWrongValidation()\n {\n $this->artisan('db:seed');\n $this->json('post', 'api/auth/login', [\n 'email' => $this->faker->email,\n 'password' => 'invalidpassword'\n ])->seeJson([\n 'message' => 'invalid_credentials'\n ])->assertResponseStatus(401);\n }", "public function testLogin()\n {\n $data= [\n 'email' => '[email protected]',\n 'password' => '12345678',\n ];\n\n /* @var $responce \\Illuminate\\Foundation\\Testing\\TestResponse */\n $responce = $this->json('post', '/api/auth/login', $data);\n\n $content = $responce->getContent();\n print \"\\n\" . $content . \"\\n\";\n $this->assertNotTrue(boolval(strstr($content, 'errors')));\n //$responce->assertOk();\n }", "public function loginCheck()\n {\n $this->getHelperAssert()->assertTextPresent('Dashboard');\n }", "public function loginCheck()\n {\n $this->getHelperAssert()->assertTextPresent('Dashboard');\n }", "public function testWrongUsernameLogin() {\n $this->client->setDefaultOption('headers', array('Accept' => 'application/json'));\n $jsonContent = json_encode(array('username' => 'asIfIcare'));\n try {\n $this->client->post(\"http://localhost:8000/user/login\")\n ->setBody($jsonContent, 'application/json')\n ->send()\n ->json();\n } catch (ClientErrorResponseException $e) {\n $error = json_decode($e->getResponse()->getBody(TRUE), TRUE);\n $this->assertEquals(\"Username not found\", $error);\n }\n }", "function failed_login () {\n\t\n return 'Your username and/or password is incorrect.';\n\n}", "public function testLogin(){\n Session::flush();\n $user = $this->postuser();\n\n $this->assertTrue(Auth::user()->username == $user['username']);\n }", "public function testLoginPasswordCaseSensitivity()\n {\n\n $this->expectOutputString(\"err_login_failed\");\n $email = '[email protected]';\n $ctrl = new Controller();\n // Give it the wrong case password\n $ctrl->login($email,'testpwor');\n\n }", "public function testPostSomethingWrong()\n {\n $this->flushSession();\n $response = $this->post('/form',['first_name'=>'tset']);\n $response->assertSessionHas('errors');\n }", "public function testLogin()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->check('remember')\n ->press('Login')\n ->seePageIs('/home')\n ->see('You are logged in!');\n\n });\n }", "public function testLoginAtionWithEmptyValue()\n {\n $data = [\n '_username' => '',\n '_password' => '',\n ];\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/login');\n $form = $crawler->filter('form[action$=\"login_check\"].form-horizontal button[type=\"submit\"]')->form();\n $client->submit($form, $data);\n $crawler = $client->followRedirect();\n $this->assertSame('Bad credentials', $crawler->filter('div.alert.alert-error')->text());\n }", "public function testUserCanNotLoginWithIncorrectPassword()\n {\n $user = factory(User::class)->create();\n $login = factory(Login::class)->create([\n 'user_id' => $user->id,\n 'password' => bcrypt($password = 'boss'),\n ]);\n\n $response = $this->from(route('login'))->post(route('login'), [\n 'email' => $login->email,\n 'password' => 'wrong_pass',\n ]);\n\n $response->assertRedirect(route('login'));\n $response->assertSessionHasErrors('email');\n $this->assertGuest();\n }", "public function testProcessLogin(){\n\n $credentials = [\n 'email' => '[email protected]',\n 'password' => 'password',\n ];\n\n $response = $this->post(route('login.action', $credentials));\n $response->assertSessionHas('success');\n $response->assertRedirect(route('dashboard'));\n }", "public function test_valid_user_login()\n {\n Session::start();\n $response = $this->call('POST', '/login', [\n 'email' => '[email protected]',\n 'password' => 'password',\n '_token' => csrf_token()\n ]);\n $response->assertStatus(302);\n $response->assertRedirect('/home');\n }", "function login_obscure()\n {\n return '<strong>Whoops</strong>: Your username or password are incorrect, please try again.';\n }", "public function test_users_store_authenticated_long_name_error(){\n $this->signInUser();\n $this->user['name'] = str_repeat('A', 256);\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['name']);\n }", "public function test_users_store_short_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 2);\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function testLoginTokenFaillure(){\n $client = static::createClient();\n $data = '{\n \"login\": \"error_login\",\n \"token_temp\": \"error_token_temp\",\n \"expiration\": \"2010-02-02 05:00:00\"\n }';\n $crawler = $client->request(\n 'POST', '/login/token', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n );\n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_session', $body);\n $this->assertArrayHasKey('validity', $body);\n $this->assertEquals(null,$body['token_session']);\n $this->assertEquals(null,$body['validity']);\n }", "public function testLoginView()\n {\n $response = $this->get('/login');\n\n $response->assertStatus(200);\n $response->assertSee('Log in to play');\n }", "public function testLoginButLogin(){\n $user = User::find(1);\n $this->be($user);\n\n $response =$this->get(route('login'));\n $response->assertRedirect(route('home'));\n }", "public function testLogin()\n {\n $this->loginHelper('dummy', 'foo', 'http://localhost/login', 200);\n $this->loginHelper('dummy', 'dummy', 'http://localhost/jury', 200);\n }", "function errorLogin() {\n\t\t\t\n\t$loginError = new stdClass();\n\t$loginError->type = 'message';\n\t$loginError->message = $GLOBALS['lang']['error_login_login'];\n\t\n\t$returnArray = array(\n\t\t'error' => array()\n\t);\n\tarray_push($returnArray['error'], $loginError);\n\t\n\treturn $returnArray;\n}", "public function testLoggedStatus(){\n Session::flush();\n $user = $this->postuser();\n $status_message = $this->getStatus();\n $this->assertResponseOk();\n $this->assertTrue($status_message['message'] == 'user logged in');\n }", "function alt_failed_login()\n {\n return 'The login information you have entered is incorrect.';\n }", "private function compare_with_login()\n {\n }", "public function testRegisterValidationFailPassword()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"token\": \"QpwL5tke4Pnpja7X4\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->post('api/user/create-user', ['email' => 'email'], $this->headers)\n ->assertStatus(422)\n ->assertJson(json_decode('{\"errors\":{\"password\":[\"The password field is required.\"]},\"message\":\"The given data was invalid.\"}', true));\n\n }", "public function testLoginActionPass()\n {\n // creating a new user\n $user = $this->Users->newEntity([\n 'email' => '[email protected]',\n 'password' => 'test',\n ]);\n\n $user->set('role_id', 1);\n $user->set('active', 1);\n\n $this->Users->save($user);\n\n $login = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $this->post('/users/login', $login);\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/admin/manager/users');\n\n $this->assertSession(5, 'Auth.User.id');\n $this->assertSession('[email protected]', 'Auth.User.email');\n }", "public function testExample()\n {\n $response = $this->get(route('login_form'));\n\n $response->assertStatus(200)\n ->assertViewIs('two_factor_auth.login_form')\n ->assertSee('ログイン')\n ->assertSee('パスワード');\n }", "public function testLoginScreen()\n {\n $response = $this->get('admin');\n $response->assertStatus(200);\n }", "public function test_user_can_view_a_login_form()\n {\n //\n $response = $this->get('/login');\n $response->assertSuccessful();\n $response->assertViewIs('auth.login');\n }", "public function test_login3()\n {\n $this->visit('login')\n ->type('', 'email')\n ->type('123456','password')\n ->press('Login')\n ->see('The email field is required.');\n }" ]
[ "0.72976077", "0.7211856", "0.72001415", "0.7194656", "0.7149142", "0.6939885", "0.6877418", "0.67970085", "0.6767706", "0.6703715", "0.6697657", "0.668701", "0.66855484", "0.6662124", "0.66285294", "0.6624921", "0.66187966", "0.66072", "0.6591176", "0.65838015", "0.6552334", "0.6533904", "0.65316236", "0.65014124", "0.648639", "0.64825374", "0.6468337", "0.645761", "0.6457074", "0.64510715", "0.6448464", "0.641086", "0.64078593", "0.63932776", "0.6387132", "0.63823473", "0.6380684", "0.63773936", "0.6298775", "0.62947005", "0.62711906", "0.6269682", "0.62589246", "0.62542915", "0.6243423", "0.6242951", "0.62388337", "0.62151635", "0.62143856", "0.620858", "0.62030905", "0.6201305", "0.6188318", "0.61843514", "0.61821157", "0.61809593", "0.61806214", "0.61770344", "0.6174687", "0.6173693", "0.6162941", "0.6155162", "0.6153737", "0.6148919", "0.61487854", "0.6147166", "0.6147071", "0.61225855", "0.61121064", "0.6094669", "0.6070467", "0.6069018", "0.6069018", "0.60645646", "0.6047947", "0.6047908", "0.6047716", "0.6046244", "0.6046043", "0.60397", "0.60391843", "0.60386646", "0.6037739", "0.6037388", "0.60345095", "0.602524", "0.6021139", "0.60168105", "0.6013632", "0.6012699", "0.6007779", "0.6007085", "0.5994365", "0.5987777", "0.5981294", "0.5977136", "0.59727037", "0.59725267", "0.597016", "0.59694624" ]
0.7768425
0
this is to let you categorise events into streams
function improv_analysis_analysis_edit() { ?> <div class="wrap"> <h1>Improv Analysis Editing</h1> <?php // Catch bad url_id in improv_analysis_analysis_edit_submit(), not here global $wpdb; $query = "SELECT * FROM improv_analysis_analyses WHERE ". "url_id = '".$wpdb->_real_escape($_GET['analysis'])."'"; $result = $wpdb->get_results( $query ); $analysis = $result[0]; echo "<h2>Editing ".$analysis->title." - ".$analysis->performer."</h2>"; $query = "SELECT * FROM improv_analysis_events WHERE ". "analysis_id = '".$analysis->id."'"; $result = $wpdb->get_results( $query ); $streams = improv_analysis_stream_data(); ?> <form action="<?php echo improv_analysis_analysis_edit_link($analysis->url_id) ?>" method="post" accept-charset="utf-8"> <table> <tr> <th>Time</th> <?php foreach ($streams as $stream) { ?><th><?php echo $stream["name"] ?></th><?php } ?> <th>Comment</th> </tr> <?php foreach ($result as $key => $value) { ?> <tr> <td><?php echo $value->time; ?></td> <?php foreach ($streams as $stream) { ?><td class="<?php echo strtolower($stream['name']); ?>"><?php improv_analysis_stream_radio_button($stream, $value); ?></td><?php } ?> <td><?php echo $value->comment; ?></td> </tr><?php } ?></table> <p><input type="submit" value="Submit changes &rarr;"></p> </form> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __invoke()\n {\n foreach ($this->identityMap as $eventSourcedAggregateRoot) {\n $pendingStreamEvents = $this->aggregateTranslator->extractPendingStreamEvents($eventSourcedAggregateRoot);\n\n if (count($pendingStreamEvents)) {\n $this->streamStrategy->appendEvents(\n $this->aggregateType,\n $this->aggregateTranslator->extractAggregateId($eventSourcedAggregateRoot),\n $pendingStreamEvents,\n $eventSourcedAggregateRoot\n );\n }\n }\n }", "public static function getSubscribedEvents();", "public static function getSubscribedEvents();", "public function getSubscribedEvents();", "public function getSubscribedEvents()\n {\n return [FeedFacade::FEED_EVENT];\n }", "public function events(Request $request): array\n {\n // 1 server event\n // 2 swoole event\n $type = (int)$request->query('type');\n\n if ($type === 1) {\n return ServerListenerCollector::getCollector();\n }\n\n if ($type === 2) {\n return SwooleListenerCollector::getCollector();\n }\n\n return [\n 'server' => ServerListenerCollector::getCollector(),\n 'swoole' => SwooleListenerCollector::getCollector(),\n ];\n }", "public function events(Request $request): array\n {\n // 1 server event\n // 2 swoole event\n $type = (int)$request->query('type');\n\n if ($type === 1) {\n return ServerListenerCollector::getCollector();\n }\n\n if ($type === 2) {\n return SwooleListenerCollector::getCollector();\n }\n\n return [\n 'server' => ServerListenerCollector::getCollector(),\n 'swoole' => SwooleListenerCollector::getCollector(),\n ];\n }", "private function filterEvents( $filter_string , $events ){\n\t\t$filters = explode(',' , $filter_string );\n\n\t\t$events_filtered = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['original']))\n\t\t\t\t$event_text = $event['original'];\n\t\t\telse\n\t\t\t\t$event_text = $event['summary'];\n\t\t\t$fits = FALSE;\n\t\t\tforeach( $filters as $filter ){\n\t\t\t\t$filter_without_semicolons = str_replace([' :',':'], '', $filter );\n\n\t\t\t\tif(stristr($event_text,$filter) || stristr(str_replace(' :',':',$event_text), $filter) || strtolower(substr(trim($event_text), 0, strlen($filter_without_semicolons))) === strtolower($filter_without_semicolons) ){\n\t\t\t\t\t// stripping the category from the title\n\t\t\t\t\t$prefixes = [ $filter , str_replace(':',' :',$filter) ];\n\t\t\t\t\tforeach($prefixes as $prefix){\n\t\t\t\t\t\tif (substr(strtolower($event_text), 0, strlen($prefix)) == strtolower($prefix)) {\n \t\t\t\t\t\t// $event_text = substr($event_text, strlen($prefix));\n \t\t\t\t\t\t// $event['category'] = str_replace(':','',strtolower($prefix));\n \t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// echo 'fits filter '.$filter.'<br>';\n\t\t\t\t\t// $event['summary'] = $event_text;\n\t\t\t\t\t$fits = TRUE;\n\t\t\t\t\t$analyse_summary = Event::filterType($event_text);\n\t\t\t\t\t$event['original'] = $event_text;\n\t\t\t\t\t$event['summary'] = $analyse_summary['summary'];\n\t\t\t\t\t$event['city'] = isset($analyse_summary['city'])?$analyse_summary['city']:'';\n\t\t\t\t\t$event['category'] = isset($analyse_summary['type'])?$analyse_summary['type']:'';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Adding some info to help\n\t\t\tif(!isset($event['start']['dateTime']) && isset($event['start']['date'])){\n\t\t\t\t$event['start']['dateTime'] = $event['start']['date'];\n\t\t\t}\n\t\t\t$datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t$event['start']['weekday'] = $datetime->format('N');\n\n\t\t\t// Adding the picture\n\t\t\t// $creator_email = isset($event['creator']['email'])?$event['creator']['email']:null;\n\t\t\t$organizer_id = isset($event['extendedProperties']['shared']['organizer_id'])?$event['extendedProperties']['shared']['organizer_id']:null;\n\t\t\t\n\t\t\tif(!is_null($organizer_id) && !isset($event['school'])){\n\t\t\t\t\n\t\t\t\t$school = School::findOne($organizer_id);\n\n\t\t\t\tif($school){\n\t\t\t\t\t$event['email'] = $school->email;\n\t\t\t\t\t$event['school'] = array();\n\t\t\t\t\t$event['school']['picture'] = $school->getPictureUrl();\n\t\t\t\t\t$event['school']['thumb'] = $school->getThumbUrl();\n\t\t\t\t\t$event['school']['name'] = $school->name;\n\t\t\t\t\tif(isset($school->website))\n\t\t\t\t\t\t$event['school']['url'] = $school->website;\n\t\t\t\t\telse if(isset($school->facebook))\n\t\t\t\t\t\t$event['school']['url'] = $school->facebook;\n\t\t\t\t\tif($school->email){\n\t\t\t\t\t\t$event['email'] = $school->email;\n\t\t\t\t\t}\n\t\t\t\t\tif($school->active == false){\n\t\t\t\t\t\t$fits = FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($event['extendedProperties']['shared']['disabled']) && $event['extendedProperties']['shared']['disabled'] == 1){\n\t\t\t\t$fits = FALSE;\n\t\t\t}\n\t\t\tif( $fits == TRUE ){\n\t\t\t\t$events_filtered[$event['id']] = $event;\n\t\t\t}\n\n\t\t}\n\t\treturn $events_filtered;\n\t}", "public function getOtherEvents();", "public function onGetFeedDataFilter($buffer) {\nglobal $_LW;\nstatic $event_types;\nif (!empty($_LW->REGISTERED_APPS['ems']['custom']['event_types_map'])) { // if there is an event type map\n\tif (!empty($buffer) && @$buffer['type']=='ical' && strpos(@$buffer['url'], $_LW->CONFIG['LIVE_URL'].'/ems/')!==false && !empty($buffer['items']['default'])) { // if the feed is an EMS ICAL feed with items\n\t\tif ($this->initEMS()) { // if EMS loaded\n\t\t\tif (!isset($this->client->event_types)) { // get the EMS event types\n\t\t\t\t$this->client->getEventTypes($_LW->REGISTERED_APPS['ems']['custom']['username'], $_LW->REGISTERED_APPS['ems']['custom']['password']);\n\t\t\t};\n\t\t\tif (!isset($event_types)) { // get the LiveWhale event types\n\t\t\t\t$event_types=[];\n\t\t\t\tforeach($_LW->dbo->query('select', 'id, title', 'livewhale_events_categories', false, 'title ASC')->run() as $event_type) {\n\t\t\t\t\t$event_types[$event_type['id']]=$_LW->setFormatClean($event_type['title']);\n\t\t\t\t};\n\t\t\t};\n\t\t\tforeach($buffer['items']['default'] as $key=>$val) { // for each feed item\n\t\t\t\tif (!empty($val['categories']) || !empty($val['unknown_categories'])) { // if there are categories or unknown categories\n\t\t\t\t\tif (!empty($val['categories'])) { // if there are categories\n\t\t\t\t\t\tforeach($val['categories'] as $key2=>$val2) { // for each category\n\t\t\t\t\t\t\t$val2=$_LW->setFormatClean($val2);\n\t\t\t\t\t\t\t$val2_id='';\n\t\t\t\t\t\t\tforeach($this->client->event_types as $key3=>$val3) { // convert the category to the EMS event type ID\n\t\t\t\t\t\t\t\tif (strtolower($val3['title'])==strtolower($val2)) {\n\t\t\t\t\t\t\t\t\t$val2_id=$val3['id'];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (!empty($val2_id) && isset($_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id])) { // if the EMS event type was found in map\n\t\t\t\t\t\t\t\t$new_categories=$_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id];\n\t\t\t\t\t\t\t\tif (!is_array($new_categories)) {\n\t\t\t\t\t\t\t\t\t$new_categories=[$new_categories];\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tforeach($new_categories as $val3) { // format the translated categories\n\t\t\t\t\t\t\t\t\t$val3=$_LW->setFormatClean($val3);\n\t\t\t\t\t\t\t\t\tif ($val3==='Open to the Public') {\n\t\t\t\t\t\t\t\t\t\t$val3=' Open to the Public';\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tif (in_array($val3, $event_types)) { // if the translated category is a known LiveWhale event type\n\t\t\t\t\t\t\t\t\t\t$val4=array_search($val3, $event_types); // translate the EMS event type to the corresponding LiveWhale event type ID\n\t\t\t\t\t\t\t\t\t\tif (!in_array($val4, $buffer['items']['default'][$key]['categories'])) {\n\t\t\t\t\t\t\t\t\t\t\t$buffer['items']['default'][$key]['categories'][]=$val4;\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t\tif (!empty($val['unknown_categories'])) { // if there are unknown categories\n\t\t\t\t\t\tforeach($val['unknown_categories'] as $key2=>$val2) { // for each unknown category\n\t\t\t\t\t\t\t$val2=$_LW->setFormatClean($val2);\n\t\t\t\t\t\t\t$val2_id='';\n\t\t\t\t\t\t\tforeach($this->client->event_types as $key3=>$val3) { // convert the unknown category to the EMS event type ID\n\t\t\t\t\t\t\t\tif (strtolower($val3['title'])==strtolower($val2)) {\n\t\t\t\t\t\t\t\t\t$val2_id=$val3['id'];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (!empty($val2_id) && isset($_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id])) { // if the EMS event type was found in map\n\t\t\t\t\t\t\t\tif (!is_array($buffer['items']['default'][$key]['categories'])) { // ensure that there is an array of known categories\n\t\t\t\t\t\t\t\t\t$buffer['items']['default'][$key]['categories']=[];\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t$new_categories=$_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id];\n\t\t\t\t\t\t\t\tif (!is_array($new_categories)) {\n\t\t\t\t\t\t\t\t\t$new_categories=[$new_categories];\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tforeach($new_categories as $val3) { // format the translated categories\n\t\t\t\t\t\t\t\t\t$val3=$_LW->setFormatClean($val3);\n\t\t\t\t\t\t\t\t\tif ($val3==='Open to the Public') {\n\t\t\t\t\t\t\t\t\t\t$val3=' Open to the Public';\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tif (in_array($val3, $event_types)) { // if the translated category is a known LiveWhale event type\n\t\t\t\t\t\t\t\t\t\t$val4=array_search($val3, $event_types); // translate the EMS event type to the corresponding LiveWhale event type ID\n\t\t\t\t\t\t\t\t\t\tif (!in_array($val4, $buffer['items']['default'][$key]['categories'])) {\n\t\t\t\t\t\t\t\t\t\t\t$buffer['items']['default'][$key]['categories'][]=$val4;\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tunset($buffer['items']['default'][$key]['unknown_categories'][$key2]); // remove the unknown category\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n};\nreturn $buffer;\n}", "static public function getSubscribedEvents()\n {\n return array(\n JobEventsMap::STATE_START => array('logJobEvent'),\n JobEventsMap::STATE_FAIL => array('logJobEvent'),\n JobEventsMap::STATE_ERROR => array('logJobEvent'),\n JobEventsMap::STATE_ADD => array('logJobEvent'),\n JobEventsMap::STATE_FINISH => array('logJobEvent'),\n \n WorkerEventsMap::WORKER_START => array('logWorkerEvent'),\n WorkerEventsMap::WORKER_FINISH => array('logWorkerEvent'),\n WorkerEventsMap::WORKER_ERROR => array('logWorkerEvent'),\n \n QueueEventsMap::QUEUE_LIST => array('logQueueListEvent'),\n QueueEventsMap::QUEUE_LOCK => array('logQueueLockEvent'),\n QueueEventsMap::QUEUE_UNLOCK => array('logQueueUnlockEvent'),\n \n QueueEventsMap::QUEUE_LOOKUP => array('logQueueLookupEvent'),\n QueueEventsMap::QUEUE_PURGE => array('logQueuePurgeEvent'),\n QueueEventsMap::QUEUE_PURGE_ACTIVITY => array('logQueuePurgeActivityEvent'),\n QueueEventsMap::QUEUE_QUERY_ACTIVITY => array('logQueueQueryActivityEvent'),\n \n QueueEventsMap::QUEUE_REC => array('logQueueReceiveEvent'),\n QueueEventsMap::QUEUE_REMOVE => array('logQueueRemoveEvent'),\n QueueEventsMap::QUEUE_SENT => array('logQueueSendEvent'),\n \n \n MonitoringEventsMap::MONITOR_COMMIT => array('logMonitorCommitEvent'),\n MonitoringEventsMap::MONITOR_LOCK => array('logMonitorLockEvent'),\n MonitoringEventsMap::MONITOR_QUERY => array('logMonitorQueryEvent'),\n MonitoringEventsMap::MONITOR_RUN => array('logMonitorRunEvent')\n );\n }", "public function getSourceOfListeners() {\n//\t\t# if terrestrial_delay = 0, then the event was from Terrestrial radio\n//\t\t# if terrestrial_delay > 0 then the event was from Streaming radio\n//\t\tSelect count(*)\n//\t\tfrom airshr_events\n//\t\twhere terrestrial_delay > '0' and station_id = '8' and time(created_at) > '06:00' and time(created_at) < '22:00'\n\t\ttry {\n\t\t\t$station = \\Auth::User()->station;\n\t\t\t$timezone = $station->getStationTimezone();\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\t$stream = \\DB::table('airshr_events')\n\t\t\t\t->where('terrestrial_delay', '>', 0)\n\t\t\t\t->where('station_id', '=', $station->id)\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\") //\"MOD(record_timestamp + {$offset}, 86400)\" gets second since midnight\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\")// We then compare the hours from midnight to check if it is between the hours we want\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->count();\n\n\t\t\t$terrestrial = \\DB::table('airshr_events')\n\t\t\t\t->where('terrestrial_delay', '=', 0)\n\t\t\t\t->where('station_id', '=', $station->id)\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\")\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\")\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->count();\n\n\t\t\t$streaming_users = \\DB::select(\\DB::raw('select count(*) as count from (select user_id, date(created_at), time(created_at), count(*)\n\t\t\t\t\tfrom airshr_streaming_status\n\t\t\t\t\tgroup by 1\n\t\t\t\t\torder by 4 desc) as T'));\n\t\t\t\n\t\t\treturn response()->json(array('code' => 0, 'stream' => $stream, 'terrestrial' => $terrestrial, 'streaming_users' => $streaming_users));\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\n\t}", "private static function get_events() {\n\t\treturn array(\n\t\t\t'formidable_send_usage' => 'weekly',\n\t\t);\n\t}", "public function getEventType(): string;", "public function getEvents();", "public function getEvents();", "public function getEventSubscriber();", "public static function eventSubscriptions() : iterable;", "function collectAction( KalturaStatsEvent $event )\r\n\t{\r\n\t\t$evenLogFullPath = kConf::get ( \"event_log_file_path\" );\r\n\t\t\r\n\t\t// if no file path - do nothing\r\n\t\tif ( ! $evenLogFullPath ) return;\r\n\t\t\r\n\t\t$http_referrer = isset ( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : \"\";\r\n\t\t\r\n\t\t$users_timestamp = $event->eventTimestamp;\r\n\t\t\r\n\t\t$eventLine = \r\n\t\t\t$event->clientVer . self::SEPARATOR \r\n\t\t\t. $event->eventType . self::SEPARATOR\r\n\t\t\t. date ( \"Y-m-d H:i:s\" , time() ) . self::SEPARATOR // use server time\r\n\t\t\t. $event->sessionId . self::SEPARATOR\r\n\t\t\t. $event->partnerId . self::SEPARATOR\r\n\t\t\t. $event->entryId . self::SEPARATOR\r\n\t\t\t. $event->uniqueViewer . self::SEPARATOR\r\n\t\t\t. $event->widgetId . self::SEPARATOR\r\n\t\t\t. $event->uiconfId . self::SEPARATOR\r\n\t\t\t. $event->userId . self::SEPARATOR\r\n\t\t\t. $event->currentPoint . self::SEPARATOR\r\n\t\t\t. $event->duration . self::SEPARATOR\r\n\t\t\t. requestUtils::getRemoteAddress() . self::SEPARATOR\r\n\t\t\t. $event->processDuration . self::SEPARATOR\r\n\t\t\t. $event->controlId . self::SEPARATOR\r\n\t\t\t. $event->seek . self::SEPARATOR\r\n\t\t\t. $event->newPoint . self::SEPARATOR\r\n\t\t\t. ( $event->referrer ? $event->referrer : \"\" )\t. self::SEPARATOR\t// duw to the way flash sends the referrer - allow it to override\r\n\t\t\t. $users_timestamp . self::SEPARATOR\r\n\t\t\t. PHP_EOL \r\n\t\t;\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$res = $this->writeToFile ( $evenLogFullPath , $eventLine);\r\n\t\t\tif ( ! $res )\r\n\t\t\t\tKalturaLog::err( \"Error while trying to write event to log. Event:\\n\". $eventLine );\r\n }\r\n catch ( Exception $ex )\r\n {\r\n \tKalturaLog::err( \"Error while trying to write event to log. Event:\\n\". $eventLine );\t\r\n }\r\n\t\treturn true;\r\n\t}", "public function streamAction()\n {\n $env = $this->getEnvironment();\n $this->setProcessTitle('IcingaDB Event Stream');\n $streamer = new IcingaEventToRedisStreamer($env->getCoreApi());\n $streamer->stream();\n }", "function com_event_sink($comobject, $sinkobject, $sinkinterface = null) {}", "public function _add_incident_filters()\n\t{\n\t\t$params = Event::$data;\n\t\t$params = array_merge($params, $this->params);\n\t\tEvent::$data = $params;\n\t}", "public function testAggregateEvents()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function parseEventMessage(\\PhpAmqpLib\\Message\\AMQPMessage $message)\n {\n Yii::info(\"Got new amqp message: '{$message->body}'\", StringHelper::basename(self::class));\n $channel = $message->getChannel();\n // Send a message with the string \"quit\" to cancel the consumer.\n if ($message->body === 'quit') {\n $channel->basic_cancel($message->getConsumerTag());\n } else {\n try {\n $array = Json::decode($message->body);\n $data = ArrayHelper::getValue($array, 'data.event', []);\n } catch (\\InvalidArgumentException $e) {\n Yii::error($e->getMessage(), StringHelper::basename(self::class));\n $message->ack();\n\n return;\n }\n\n $sport_id = intval(ArrayHelper::getValue($data, 'sport_id', 0));\n\n if (!$sport_id) {\n $message->ack();\n\n return;\n }\n if (!isset($this->_detailsMapping[$sport_id])) {\n if (Yii::$app->cache->exists('statscore-details-' . $sport_id)) {\n $this->_detailsMapping[$sport_id] = Yii::$app->cache->get('statscore-details-' . $sport_id);\n $this->_statsMapping[$sport_id] = Yii::$app->cache->get('statscore-stats-' . $sport_id);\n $this->_resultsMapping[$sport_id] = Yii::$app->cache->get('statscore-results-' . $sport_id);\n } else {\n try {\n $sport = $this->getSport((string)$sport_id);\n\n $this->_detailsMapping[$sport_id] = ArrayHelper::index($sport->details, 'id');\n $this->_statsMapping[$sport_id] = ArrayHelper::index($sport->stats, 'id');\n $this->_resultsMapping[$sport_id] = ArrayHelper::index($sport->results, 'id');\n\n Yii::$app->cache->set(\n 'statscore-details-' . $sport_id,\n $this->_detailsMapping[$sport_id],\n 60 * 60 * 24\n );\n Yii::$app->cache->set(\n 'statscore-stats-' . $sport_id,\n $this->_statsMapping[$sport_id],\n 60 * 60 * 24\n );\n Yii::$app->cache->set(\n 'statscore-results-' . $sport_id,\n $this->_resultsMapping[$sport_id],\n 60 * 60 * 24\n );\n } catch (HttpException $e) {\n Yii::error($e->getMessage(), StringHelper::basename(self::class));\n $message->ack();\n\n return;\n }\n }\n }\n\n $details = ArrayHelper::remove($data, 'details', []);\n $participants = ArrayHelper::remove($data, 'participants', []);\n $event = new Event();\n $event->setAttributes($data);\n\n foreach ($details as $d) {\n if (!isset($d['id'])) {\n continue;\n }\n $detail = new Detail();\n $detail->setAttributes(ArrayHelper::merge($d, [\n 'name' => ArrayHelper::getValue($this->_detailsMapping, [$sport_id, $d['id'], 'name']),\n 'description' => ArrayHelper::getValue($this->_detailsMapping, [$sport_id, $d['id'], 'description'])\n ]));\n\n $event->details[] = $detail;\n }\n foreach ($participants as $p) {\n $stats = ArrayHelper::remove($p, 'stats', []);\n $results = ArrayHelper::remove($p, 'results', []);\n// $subParticipants = ArrayHelper::remove($p, 'subparticipants', []);\n $participant = new Participant();\n $participant->setAttributes($p);\n\n foreach ($stats as $s) {\n if (!isset($s['id'])) {\n continue;\n }\n $stat = new Stat();\n $stat->setAttributes(ArrayHelper::merge($s, [\n 'short_name' => ArrayHelper::getValue(\n $this->_statsMapping,\n [$sport_id, $s['id'], 'short_name']\n ),\n 'name' => ArrayHelper::getValue($this->_statsMapping, [$sport_id, $s['id'], 'name']),\n 'code' => ArrayHelper::getValue($this->_statsMapping, [$sport_id, $s['id'], 'code']),\n 'data_type' => ArrayHelper::getValue($this->_statsMapping, [$sport_id, $s['id'], 'data_type'])\n ]));\n\n $participant->stats[] = $stat;\n }\n foreach ($results as $r) {\n if (!isset($r['id'])) {\n continue;\n }\n $result = new Result();\n $result->setAttributes(ArrayHelper::merge($r, [\n 'short_name' => ArrayHelper::getValue(\n $this->_resultsMapping,\n [$sport_id, $r['id'], 'short_name']\n ),\n 'name' => ArrayHelper::getValue($this->_resultsMapping, [$sport_id, $r['id'], 'name']),\n 'code' => ArrayHelper::getValue($this->_resultsMapping, [$sport_id, $r['id'], 'code']),\n 'type' => ArrayHelper::getValue($this->_resultsMapping, [$sport_id, $r['id'], 'type']),\n 'data_type' => ArrayHelper::getValue($this->_resultsMapping, [$sport_id, $r['id'], 'data_type'])\n ]));\n\n $participant->results[] = $result;\n }\n\n $event->participants[] = $participant;\n }\n\n $this->trigger(self::EVENT_AMQP_NEW_EVENT, new AMQPNewEventEvent([\n 'sender' => $this,\n 'event' => $event\n ]));\n }\n $message->ack();\n }", "private function getEvents($type)\r\n {\r\n if ($type == Stat::TYPE_INQUIRY) {\r\n $inqs = $this->container->get('jcs.ds')->getGroup('inquiry');\r\n return !empty($inqs) ? $inqs : [];\r\n }\r\n elseif ($type == Stat::TYPE_FAMILY_HELP) {\r\n $events = $this->container->getParameter('stat_events');\r\n\r\n return isset($events[$type]) ? $events[$type] : [];\r\n }\r\n }", "public static function getSubscribedEvents()\n {\n echo 'Test';\n }", "public function getStreams();", "public function run()\n {\n $events = [\n [\n \"Bitcorn Harvest #3\",\n \"2,625,000 Bitcorn - What a lovely day in Autumn it will be!\",\n \"https://bitcorn.org/storage/events/fNg2Fz6NmAPe2JCr7f15ikr3ADJJsozGny0moJqC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2018-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #4\",\n \"2,625,000 Bitcorn - Last harvest at this level. Halvening soon!\",\n \"https://bitcorn.org/storage/events/EGcAKsTaubN9nFqsCTUQOvSuSQPDAvt4vC4VkuOF.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #5\",\n \"1,312,500 Bitcorn - Harvesting has become back breaking work...\",\n \"https://bitcorn.org/storage/events/Wjmuakz7IvVHce4jBUbvIviG4ObTqWv4sR6TfN6Q.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #6\",\n \"1,312,500 Bitcorn - Remember 2018? Pepperidge Farms remembers...\",\n \"https://bitcorn.org/storage/events/ABZtytBwKBj0YvmqcvORZ9iZsIe9MUSuTXWd6CKC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #7\",\n \"1,312,500 Bitcorn - Spooktacular harvest everyone! See you soon in 2020...\",\n \"https://bitcorn.org/storage/events/a9JmkLquKviuAC7emrkfe9IY0PUtZuVeu0Uzycld.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #8\",\n \"1,312,500 Bitcorn - BURRRR... I thought the future would be warmer!\",\n \"https://bitcorn.org/storage/events/14xL5Ta2roxBRtFi0uis9Qzzy3gHsktnx56lzk3o.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #9\",\n \"787,500 Bitcorn - Ooph! Someone check the BITCORNSILO we're running low!?\",\n \"https://bitcorn.org/storage/events/uAJ2L3c6azRYyTyI5FANZj4Nl4JiTrGmGrx8QRZo.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #10\",\n \"787,500 Bitcorn - If this keeps up we're going to run out of corn!\",\n \"https://bitcorn.org/storage/events/ksxx5ho2VLUYtZZjTbhmvB0ufYbnWVMnVI2VULrI.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #11\",\n \"787,500 Bitcorn - Autumn corn tastes better with 11 herbs and spices.\",\n \"https://bitcorn.org/storage/events/ka3t2sCKOMCmWQMgd891dXxd83Ket5If8tpJF6fN.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #12\",\n \"787,500 Bitcorn - Final halvening is now on the horizon. This is fine...\",\n \"https://bitcorn.org/storage/events/3wRU6wNaUqVP6proNvYwqAMVL70cPSyn0w34rN1n.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #13\",\n \"525,000 Bitcorn - It's a good thing that my coop is alpha... #SQUADGOALS\",\n \"https://bitcorn.org/storage/events/eh3evSat3inAoQ4dSRnba0ffUoIVR8Au24xwY4Cj.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-04-10 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #14\",\n \"525,000 Bitcorn - Extreme heat and over-farming is taking its toll...\",\n \"https://bitcorn.org/storage/events/qgGOigYkbkjOMR5kGVpytXZGE0blXddsHd18wIV5.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #15\",\n \"525,000 Bitcorn - Denial begins to set in about who will win #BRAGGING rights.\",\n \"https://bitcorn.org/storage/events/7CyP2gfcWq1Lr37IxLnD2xEQAN5Jv9VjmyPtViVa.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #16\",\n \"525,000 Bitcorn - The roots of all BITCORN CROPS are tapped dry. Sad!\",\n \"https://bitcorn.org/storage/events/knIRPINIE4RZyr0DEIx46q5y5nvyaEZNgX6rPkf0.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2022-01-01 00:00:00\"\n ]\n ];\n\n foreach($events as $event)\n {\n Event::create([\n 'name' => $event[0],\n 'description' => $event[1],\n 'image_url' => $event[2],\n 'event_url' => $event[3],\n 'scheduled_at' => $event[4],\n ]);\n }\n }", "public function getEvents(array $filters = array());", "public function testEmittedEventName()\n {\n $expected = array(\n 'request.before_send' => 'onBeforeSend'\n );\n $this->assertEquals($expected, DaWandaPlugin::getSubscribedEvents());\n }", "public function getName()\n {\n return 'streams';\n }", "public function GetStreamingEvents($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "protected static function events()\n {\n foreach (self::fetch('app/events', false) as $file) {\n Bus::need($file);\n }\n //\n Event::register();\n }", "function aidtransparency_print_events()\r\n{\r\n $events = new IATI_Event_Collection();\r\n if( $events->findPosts() > 0 ) :\r\n ?>\r\n <ol>\r\n <?php\r\n foreach ($events->getPosts() as $event) :\r\n ?>\r\n <li><a href=\"<?php echo get_permalink($event->ID); ?>\" title=\"<?php echo $event->post_title; ?>\"><?php echo $event->post_title; ?></a>\r\n <span class=\"when\"><?php echo $event->getWhere(); ?> </span>\r\n </li>\r\n <?php endforeach; ?>\r\n </ol>\r\n <?php endif;\r\n}", "public function getIterator() {\n return new \\ArrayIterator($this->events);\n}", "public function processAction()\n {\n $env = $this->getEnvironment();\n $this->setProcessTitle('IcingaDB Event Stream: ' . $env->get('name'));\n $handler = new IcingaEventHandler($env);\n $handler->processEvents();\n }", "public function viewEvents();", "public function onEvent();", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "public function publish_to_stream($activity)\n {\n\n }", "function getEvents() {\n return [];\n }", "public static function events();", "public abstract function collect(StreamCollector $collector): mixed;", "public function broadcastOn() {\n return ['convertVideoAction'];\n }", "public function shouldDiscoverEvents()\n {\n return true;\n }", "private function makeDayEventListArray()\n\t{\n\t\t$outevents = array();\n\t\t$n = 0;\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\t\t\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\t\n\t\tif(count($outevents)) {\n\t\t\treturn $outevents;\n\t\t}\n\t\treturn false;\n\t}", "function setEventType()\n {\n $this->_eventType = 12;\n }", "protected function getRegisteredEvents() {\n// $events = [];\n// foreach ($this->loadMultiple() as $rules_config) {\n// $event = $rules_config->getEvent();\n// if ($event && !isset($events[$event])) {\n// $events[$event] = $event;\n// }\n// }\n// return $events;\n }", "public function viewAllEvents();", "public function createEvents()\n {\n //\n\n return 'something';\n }", "private function addEventToLatestContextIdEvents($event)\n\t{\n\t\t$eventType = $event['eventType'];\n\t\t$eventAttributes = $event[$this->getEventAttributesKey($eventType)];\n\t\t\n\t\tif (isset($eventAttributes['activityId'])) {\n\t\t\t//this only catches ActivityTaskScheduled\n\t\t\t$this->addEventToLatestActivityIdEvents(\n\t\t\t\t$event, $eventAttributes['activityId']);\n\t\t}\n\t\t\n\t\t//for other events, we need to find the scheduled event\n\t\tif (isset($eventAttributes['scheduledEventId'])) {\n\t\t\t$scheduledEventId = $eventAttributes['scheduledEventId'];\n\t\t\tif ('ActivityTaskScheduled'\n\t\t\t\t== $this->eventTypeReferenceForScheduledEventId($eventType)\n\t\t\t) {\n\t\t\t\tforeach ($this->latestActivityIdEvents as\n\t\t\t\t\t$activityId => $reference\n\t\t\t\t) {\n\t\t\t\t\t//find the eventId that matches the scheduled eventId\n\t\t\t\t\t//if we find it, we know we have the right activityId\n\t\t\t\t\tforeach ($reference as $eventId) {\n\t\t\t\t\t\tif ($eventId == $scheduledEventId) {\n\t\t\t\t\t\t\t$this->addEventToLatestActivityIdEvents(\n\t\t\t\t\t\t\t\t$event, $activityId);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (isset($eventAttributes['timerId'])) {\n\t\t\t//this only catches TimerStarted\n\t\t\t$this->addEventToLatestTimerIdEvents(\n\t\t\t\t$event, $eventAttributes['timerId']);\n\t\t}\n\t\t\n\t\t//for events that reference TimerStarted, we need to find the event\n\t\tif (isset($eventAttributes['startedEventId'])) {\n\t\t\t$startedEventId = $eventAttributes['startedEventId'];\n\t\t\tif ('TimerStarted'\n\t\t\t\t== $this->eventTypeReferenceForStartedEventId($eventType)\n\t\t\t) {\n\t\t\t\tforeach ($this->latestTimerIdEvents as\n\t\t\t\t\t$timerId => $reference\n\t\t\t\t) {\n\t\t\t\t\t//find the eventId that matches the started eventId\n\t\t\t\t\t//if we find it, we know we have the right timerId\n\t\t\t\t\tforeach ($reference as $eventId) {\n\t\t\t\t\t\tif ($eventId == $startedEventId) {\n\t\t\t\t\t\t\t$this->addEventToLatestTimerIdEvents(\n\t\t\t\t\t\t\t\t$event, $timerId);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (isset($eventAttributes['workflowId'])) {\n\t\t\t//this only catches StartChildWorkflowExecutionInitiated\n\t\t\t$this->addEventToLatestWorkflowIdEvents($event,\n\t\t\t\t$eventAttributes['workflowId']);\n\t\t\t\n\t\t\tif (isset($eventAttributes['signalName'])) {\n\t\t\t\t$this->addEventToLatestWorkflowIdAndSignalNameEvents(\n\t\t\t\t\t$event,\n\t\t\t\t\t$eventAttributes['workflowId'],\n\t\t\t\t\t$eventAttributes['signalName']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif (isset($eventAttributes['initiatedEventId'])) {\n\t\t\t$initiatedEventId = $eventAttributes['initiatedEventId'];\n\t\t\t$referencedEventType\n\t\t\t\t= $this->eventTypeReferenceForInitiatedEventId($eventType);\n\t\t\tif ('StartChildWorkflowExecutionInitiated'\n\t\t\t\t== $referencedEventType\n\t\t\t\t|| 'RequestCancelExternalWorkflowExecutionInitiated'\n\t\t\t\t== $referencedEventType\n\t\t\t\t|| 'SignalExternalWorkflowExecutionInitiated'\n\t\t\t\t== $referencedEventType\n\t\t\t) {\n\t\t\t\tforeach ($this->latestWorkflowIdEvents as\n\t\t\t\t\t$workflowId => $reference\n\t\t\t\t) {\n\t\t\t\t\t//find the eventId that matches the initiated eventId\n\t\t\t\t\t//if we find it, we know we have the right workflowId\n\t\t\t\t\tforeach ($reference as $eventId) {\n\t\t\t\t\t\tif ($eventId == $initiatedEventId) {\n\t\t\t\t\t\t\t$this->addEventToLatestWorkflowIdEvents(\n\t\t\t\t\t\t\t\t$event, $workflowId);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//signal names\n\t\t\tif ('SignalExternalWorkflowExecutionInitiated'\n\t\t\t\t== $referencedEventType\n\t\t\t) {\n\t\t\t\tforeach ($this->latestWorkflowIdAndSignalNameEvents as\n\t\t\t\t\t$workflowId => $signalNameEvents\n\t\t\t\t) {\n\t\t\t\t\tforeach ($signalNameEvents\n\t\t\t\t\t\tas $signalName => $eventReference\n\t\t\t\t\t) {\n\t\t\t\t\t\tforeach ($eventReference as $eventId) {\n\t\t\t\t\t\t\tif ($eventId == $initiatedEventId) {\n\t\t\t\t\t\t\t\t$this->addEventToLatestWorkflowIdAndSignalNameEvents(\n\t\t\t\t\t\t\t\t\t$event,$workflowId,$signalName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function formatEvents($objUserEvent) {\n\t\t\t$arrEvents = array();\n\t\t\t$strUrlPrefix = AppConfig::get('SiteUrl') . AppConfig::get('BaseUrl');\n\t\t\t\n\t\t\twhile(list(, $objUserEventRecord) = $objUserEvent->each()) {\n\t\t\t\t$strEvent = null;\n\t\t\t\t$arrMetaData = $objUserEventRecord->get('raw');\n\t\t\t\t\n\t\t\t\tswitch ($objUserEventRecord->get('type')) {\n\t\t\t\t\tcase 'friend:connected':\n\t\t\t\t\t\tif ($objUserEventRecord->get('tally') > 1) {\n\t\t\t\t\t\t\t$strEvent = sprintf('<a href=\"%s/user/%s/\">%s</a> became friends with <a href=\"%s/user/%s/\">%s</a> and %d others', \n\t\t\t\t\t\t\t\t$strUrlPrefix,\n\t\t\t\t\t\t\t\t$objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t\t$objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t\t$strUrlPrefix,\n\t\t\t\t\t\t\t\t$arrMetaData['username'],\n\t\t\t\t\t\t\t\t$arrMetaData['username'],\n\t\t\t\t\t\t\t\t$objUserEventRecord->get('tally') - 1\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$strEvent = sprintf('<a href=\"%s/user/%s/\">%s</a> became friends with <a href=\"%s/user/%s/\">%s</a>', \n\t\t\t\t\t\t\t\t$strUrlPrefix,\n\t\t\t\t\t\t\t\t$objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t\t$objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t\t$strUrlPrefix,\n\t\t\t\t\t\t\t\t$arrMetaData['username'],\n\t\t\t\t\t\t\t\t$arrMetaData['username']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'follow:connected':\n\t\t\t\t\t\tif ($objUserEventRecord->get('tally') > 1) {\n\t\t\t\t\t\t\t$strEvent = sprintf('<a href=\"%s/user/%s/\">%s</a> started following <a href=\"%s/user/%s/\">%s</a> and %d others ', \n\t\t\t\t\t\t\t\t$strUrlPrefix,\n\t\t\t\t\t\t\t\t$objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t\t$objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t\t$strUrlPrefix,\n\t\t\t\t\t\t\t\t$arrMetaData['username'],\n\t\t\t\t\t\t\t\t$arrMetaData['username'],\n\t\t\t\t\t\t\t\t$objUserEventRecord->get('tally') - 1\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$strEvent = sprintf('<a href=\"%s/user/%s/\">%s</a> started following <a href=\"%s/user/%s/\">%s</a>', \n\t\t\t\t\t\t\t\t$strUrlPrefix,\n\t\t\t\t\t\t\t\t$objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t\t$objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t\t$strUrlPrefix,\n\t\t\t\t\t\t\t\t$arrMetaData['username'],\n\t\t\t\t\t\t\t\t$arrMetaData['username']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'user:status':\n\t\t\t\t\t\t$strEvent = sprintf('<a href=\"%s/user/%s/\">%s</a> said <em>%s</em>', \n\t\t\t\t\t\t\t$strUrlPrefix,\n\t\t\t\t\t\t\t$objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t$objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t$arrMetaData['status']\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($strEvent) {\n\t\t\t\t\tif ($objUserEventRecord->get('tally') > 1) {\n\t\t\t\t\t\t$arrEvents[] = array(\n\t\t\t\t\t\t\t'event'\t\t=> $strEvent,\n\t\t\t\t\t\t\t'username'\t=> $objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t'avatars'\t=> $this->formatAvatars($objUserEventRecord->get('avatar')),\n\t\t\t\t\t\t\t'count'\t\t=> $objUserEventRecord->get('tally')\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arrEvents[] = array(\n\t\t\t\t\t\t\t'id'\t\t=> $objUserEventRecord->get('__id'),\n\t\t\t\t\t\t\t'userid'\t=> $objUserEventRecord->get('userid'),\n\t\t\t\t\t\t\t'username'\t=> $objUserEventRecord->get('username'),\n\t\t\t\t\t\t\t'avatars'\t=> $this->formatAvatars($objUserEventRecord->get('avatar')),\n\t\t\t\t\t\t\t'event'\t\t=> $strEvent,\n\t\t\t\t\t\t\t'created'\t=> $objUserEventRecord->get('created')\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\treturn $arrEvents;\n\t\t}", "abstract public function collect_events($object, $from, $to, $image_width, $image_height);", "public static function getSubscribedEvents()\n {\n return array(\n 'beforeScenario' => array('prepareDrupal', 10),\n 'beforeOutline' => array('prepareDrupal', 10),\n 'afterScenario' => array('teardownDrupal', -10),\n 'afterOutline' => array('teardownDrupal', -10)\n );\n }", "public function send_events()\n {\n }", "public static function getSubscribedEvents()\n {\n return [\n //Step 4:Classname::ConstantName or event name 'kernel.request' => 'functionameyouliketocall' - onKernelRequest()\n KernelEvents::REQUEST => 'onKernelRequest',\n ];\n }", "public static function get_subscribed_events() {\r\n\t\treturn [\r\n\t\t\t'rocket_buffer' => [\r\n\t\t\t\t[ 'extract_ie_conditionals', 1 ],\r\n\t\t\t\t[ 'inject_ie_conditionals', 34 ],\r\n\t\t\t],\r\n\t\t];\r\n\t}", "public function streamConnected();", "function chronological($events) {\n\t\tforeach($events as $time => $timeEvents) {\n\t\t\tforeach($timeEvents as $key => $message) {\n\t\t\t\t$player = explode('## ', $message)[0];\n\t\t\t\t$msg = explode('## ', $message)[1];\n\t\t\t\t$t = timeFormat($time);\n\n\t\t\t\tif($msg === 'grabs flag 1') {\n\t\t\t\t\tforeach($timeEvents as $_key => $_message) {\n\t\t\t\t\t\t$_player = explode('## ', $_message)[0];\n\t\t\t\t\t\t$_msg = explode('## ', $_message)[1];\n\t\t\t\t\t\t$_t = timeFormat($_time);\n\n\t\t\t\t\t\tif($msg != $_msg) {\n\t\t\t\t\t\t\tif($_msg == 'drops flag 1') {\n\t\t\t\t\t\t\t\tunset($events[$time][$key]);\n\t\t\t\t\t\t\t\t$events[$time+1][0] = $player . '## grabs flag 1';\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tksort($events);\n\t\t// error_log(print_r($events, true));\n\n\t\treturn $events;\n\t}", "public function getSubscribedEvents(): array\n {\n return [\n Events::onFlush\n ];\n }", "public function loadMultipleByEvent($event, $type = 'outgoing');", "private function initEvents() : void {\n\n $arenas = MineceitCore::getArenas()->getEventArenas();\n\n foreach($arenas as $arena) {\n $this->createEvent($arena);\n }\n }", "public function _feed_rss()\n\t{\n\t\t$incident_id = Event::$data;\n\t\tif ($incident_id)\n\t\t{\n\t\t\t$action_item = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $incident_id)\n\t\t\t\t->find();\n\t\t\tif ($action_item->loaded)\n\t\t\t{\n\t\t\t\tif ($action_item->actionable == 1)\n\t\t\t\t{\n\t\t\t\t\techo \"<actionable>YES</actionable>\\n\";\n\t\t\t\t\techo \"<urgent>NO</urgent>\\n\";\n\t\t\t\t}\n\t\t\t\telseif ($action_item->actionable == 2)\n\t\t\t\t{\n\t\t\t\t\techo \"<actionable>YES</actionable>\\n\";\n\t\t\t\t\techo \"<urgent>YES</urgent>\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"<actionable>NO</actionable>\\n\";\n\t\t\t\t\techo \"<urgent>NO</urgent>\\n\";\n\t\t\t\t}\n\n\t\t\t\tif ($action_item->action_taken)\n\t\t\t\t{\n\t\t\t\t\techo \"<actiontaken>YES</actiontaken>\\n\";\n\t\t\t\t} else {\n\t\t\t\t\techo \"<actiontaken>NO</actiontaken>\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<actionable>NO</actionable>\\n\";\n\t\t\t\techo \"<urgent>NO</urgent>\\n\";\n\t\t\t\techo \"<actiontaken>NO</actiontaken>\\n\";\n\t\t\t}\n\t\t}\n\t}", "function event()\n {\n $this->load->library('service');\n $data = file_get_contents('php://input');\n $ret = array(\n 'out' => $this->service->handle('event', $data)\n );\n $this->output($ret);\n }", "public function _feed_rss()\n\t{\n\t\t$incident_id = Event::$data;\n\t\tif ($incident_id)\n\t\t{\n\t\t\t$action_item = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $incident_id)\n\t\t\t\t->find();\n\t\t\tif ($action_item->loaded)\n\t\t\t{\n\t\t\t\tif ($action_item->actionable == 1)\n\t\t\t\t{\n\t\t\t\t\techo \"<actionable>YES</actionable>\\n\";\n\t\t\t\t\techo \"<urgent>NO</urgent>\\n\";\n\t\t\t\t}\n\t\t\t\telseif ($action_item->actionable == 2)\n\t\t\t\t{\n\t\t\t\t\techo \"<actionable>YES</actionable>\\n\";\n\t\t\t\t\techo \"<urgent>YES</urgent>\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"<actionable>NO</actionable>\\n\";\n\t\t\t\t\techo \"<urgent>NO</urgent>\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($action_item->action_taken == 1)\n\t\t\t\t{\n\t\t\t\t\techo \"<actiontaken>ACTION TAKEN</actiontaken>\\n\";\n\t\t\t\t} else if ($action_item->action_taken == 2){\n\t\t\t\t\techo \"<actiontaken>RESOLVED</actiontaken>\\n\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\techo \"<actiontaken>NO</actiontaken>\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<actionable>NO</actionable>\\n\";\n\t\t\t\techo \"<urgent>NO</urgent>\\n\";\n\t\t\t\techo \"<actiontaken>NO</actiontaken>\\n\";\n\t\t\t}\n\t\t}\n\t}", "public static function getSubscribedEvents(): array\n {\n return [\n Events::FIGURE_CREATED => 'onFigureCreated',\n ];\n }", "public static function __events () {\n \n }", "public function getEventInfos() {\n // today will be useful \n $today = new \\DateTime(\"today midnight\");\n \n // get all events\n $events = $this->_machine->plugin(\"DB\")->getEventsFromDB(\"AND events.active = 1\");\n \n // retrieve dates with events\n $dates = [];\n foreach ($events as $ev) {\n $from = new \\DateTimeImmutable($ev[\"time_from\"]);\n $to = new \\DateTimeImmutable($ev[\"time_to\"]);\n $date = $from;\n while ($date <= $to) {\n $dates = $this->_insertDate($dates, $date);\n $date = $date->modify(\"+1 day\");\n }\n }\n \n // retrieve events for today\n $today_events = $this->getEventsForRange(\n $today, $today\n );\n \n // retrieve events for next weekend\n $next_weekend_events = $this->getNextWeekendEvents();\n\n $result = [\n \"tot\" => count($events),\n \"dates\" => $dates,\n \"today\" => $today_events,\n \"next_weekend\" => $next_weekend_events,\n \"events\" => $events\n ];\n \n return $result;\n }", "public function __construct()\n {\n $this->events = new ArrayCollection();\n }", "public function getEvents() { return $this->_events; }", "protected function getEvents(ContainerBuilder $container)\r\n {\n $events = array();\n \n foreach ($container->get('synd_metrics.finder')->getConfig() as $groupName => $groupConfig) {\n foreach ($groupConfig['funnel'] as $event) {\r\n $events[] = $event;\r\n }\n }\n\n return $events;\r\n }", "public function broadcastOn()\n {\n return ['RecordChanges'];\n }", "public function getSubscribedEvents()\n\t{\n\t\treturn [\n\t\t\tEvents::onFlush\n\t\t];\n\t}", "function get_type_events()\n{\n return 'atu_events';\n}", "public function events()\n {\n return $this->events;\n }", "public function events()\n {\n return $this->events;\n }", "abstract protected function formatSubject($event);", "public function subscribeOn(): array\n {\n }", "protected function _write($event)\n {\n $this->logs[] = $event;\n }", "public static function getSubscribedEvents()\n {\n return array(\n KernelEvents::REQUEST => 'onMatchRequest'\n );\n }", "public static function getSubscribedEvents(): array\n {\n return [\n WsServerEvent::HANDSHAKE_SUCCESS => 'handshakeOk',\n WsServerEvent::MESSAGE_RECEIVE => 'messageReceive',\n WsServerEvent::CLOSE_BEFORE => 'messageReceive',\n ];\n }", "public static function getSubscribedEvents(): array\n {\n return [\n 'Enlight_Controller_Front_RouteShutdown' => ['handleError', 1000],\n 'Enlight_Controller_Front_PostDispatch' => ['handleError', 1000],\n 'Shopware_Console_Add_Command' => ['handleError', 1000],\n 'Enlight_Controller_Front_DispatchLoopShutdown' => ['handleException', 1000],\n ];\n }", "function parse_application_events($file)\r\n {\r\n $doc = new DOMDocument();\r\n $result = array();\r\n\r\n $doc->load($file);\r\n $object = $doc->getElementsByTagname('application')->item(0);\r\n $result['name'] = $object->getAttribute('name');\r\n\r\n // Get events\r\n $events = $doc->getElementsByTagname('event');\r\n $trackers = array();\r\n\r\n foreach ($events as $index => $event)\r\n {\r\n $event_name = $event->getAttribute('name');\r\n $trackers = array();\r\n\r\n // Get trackers in event\r\n $event_trackers = $event->getElementsByTagname('tracker');\r\n $attributes = array('name', 'active');\r\n\r\n foreach ($event_trackers as $index => $event_tracker)\r\n {\r\n $property_info = array();\r\n\r\n foreach ($attributes as $index => $attribute)\r\n {\r\n if ($event_tracker->hasAttribute($attribute))\r\n {\r\n $property_info[$attribute] = $event_tracker->getAttribute($attribute);\r\n }\r\n }\r\n $trackers[$event_tracker->getAttribute('name')] = $property_info;\r\n }\r\n\r\n $result['events'][$event_name]['name'] = $event_name;\r\n $result['events'][$event_name]['trackers'] = $trackers;\r\n }\r\n\r\n return $result;\r\n }", "public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }", "public function getDatastreams() {\n \n }", "public function shouldDiscoverEvents(): bool\n {\n return false;\n }", "public function streams(): HasMany\n {\n return $this->hasMany(Stream::class);\n }", "public function getEventNames(){\n return array($this->getEventName() => array($this,'handle'));\n }", "function listEventInfo() {\n\t\t$query = \"SELECT e_description, c_name, tag_name, start_datetime, end_datetime, capacity, v.name AS vname, address,o.name AS oname, v.address, v.city, v.state, v.postal_code \n\t\tFROM yam14.F_event e, yam14.F_venue v, yam14.F_category c, yam14.F_topic t, yam14.F_organizer o\n\t\tWHERE e.venue_id = v.v_id \n\t\tAND c.c_id = e.c_id \n\t\tAND t.tag_id = e.tag_id \n\t\tAND o.o_id = e.organizer_id\n\t\tAND e.e_id = $this->eid ;\";\n\t\t\n\t\t$result = mysql_query($query);\n\t\tif (!$result) {\n\t\t\t$message='Invalid Query' .mysql_errno().\" \\n\";\n\t\t $message .= 'Whole Query' . $query;\n\t\t die($message);\n\t\t}//end if\n\t\t\n\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t$this->category = $row['c_name'];\n\t\t\t$this->tag = $row['tag_name'];\n\t\t\t$this->description = $row['e_description'];\n\t\t\t$this->startdate = date('l, M d, Y',strtotime($row['start_datetime']));\n\t\t\t$this->starttime = date('H:i A',strtotime($row['start_datetime']));\n\t\t\t$this->enddate = date('l, M d, Y',strtotime($row['end_datetime']));\n\t\t\t$this->endtime =date('H:i A',strtotime($row['end_datetime']));\n\t\t\t$this->capacity = $row['capacity'];\n\t\t\t$this->venue = $row['vname'];\n\t\t\t$this->address = $row['address'] . \", \" . $row['city'] . \", \" . $row['state'] . \" \" . $row['postal_code'];\n\t\t\t$this->organizer = $row['oname'];\n\t\t\techo \"<hr />\";\n\t\t\techo \"<div class=\\\"panel panel-default\\\">\";\n\t\t\techo \t\"<div class=\\\"panel-heading\\\">\";\n\t\t\techo \t\"<h3 class=\\\"panel-title\\\">Event Information</h3>\";\n\t\t\techo \t\"</div>\";\n\t\t\techo \t\"<div class=\\\"panel-body\\\">\";\n\t\t\techo \"<p><b>Description: </b>$this->description</p>\";\n\t\t\techo \t\"<p><b>Category: </b>$this->category</p>\";\n\t\t\techo \t\"<p><b>Topic: </b>$this->tag</p>\";\n\t\t\techo \t\"<p><b>Start Date: </b>$this->startdate</p>\";\n\t\t\techo \t\"<p><b>Start Time: </b>$this->starttime</p>\";\n\t\t\techo \t\"<p><b>End Date: </b>$this->enddate</p>\";\n\t\t\techo \t\"<p><b>End Time: </b>$this->endtime</p>\";\n\t\t\techo \t\"<p><b>Capacity: </b>$this->capacity</p>\";\n\t\t\techo \t\"<p><b>Organizer: </b>$this->organizer</p>\";\n\t\t\techo \t\"<p><b>Location: </b>$this->venue</p>\";\n\t\t\techo \t\"<p><b>Address: </b>$this->address</p>\";\n\t\t\t\n\t\t\techo \t\"</div>\";\n\t\t\techo \t\"</div>\";\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\n\t\t}\t\n\t\t\n\t\tmysql_free_result($result);\n\t}", "public static function getSubscribedEvents()\n {\n return array(\n GetFormDataControllerEvent::NAME => array(\n array('getFormDataNewsController')\n )\n );\n }", "public function broadcastOn()\n {\n return ['channel-status'];\n }", "protected function getAttributeEvents()\n {\n $events = [];\n foreach($this->dispatchesEvents as $event => $class) {\n if(strpos($event, ':') !== false) {\n $events[$event] = $class;\n }\n }\n return $events;\n }", "abstract public function getEventName();", "public function fetchEvents()\n {\n // TODO: Implement fetchEvents() method.\n }", "public function eventsStream($since = null, $until = null, $filters = array())\n {\n return $this->streamingParser->parseJsonStream(\n $this->browser->requestStreaming(\n 'GET',\n $this->uri->expand(\n 'events{?since,until,filters}',\n array(\n 'since' => $since,\n 'until' => $until,\n 'filters' => $filters ? json_encode($filters) : null\n )\n )\n )\n );\n }", "public function makeStreamAnswer(Request $request)\n {\n $data['broadcaster'] = $request->broadcaster;\n $data['answer'] = $request->answer;\n event(new StreamAnswer($data));\n }", "public function filterTest($event) {\n\t\t$event->data['request']->params['eventName'] = $event->name();\n\t}", "static function getSubscribedEvents() {\n $events[KernelEvents::VIEW][] = array('onHtmlFragment', 100);\n $events[KernelEvents::VIEW][] = array('onHtmlPage', 50);\n\n return $events;\n }", "public static function getSubscribedEvents()\n {\n return array(\n Constants::OMNIPAY_REQUEST_BEFORE_SEND => array('onOmnipayRequestBeforeSend', self::PRIORITY),\n Constants::OMNIPAY_RESPONSE_SUCCESS => array('onOmnipayResponseSuccess', self::PRIORITY),\n Constants::OMNIPAY_REQUEST_ERROR => array('onOmnipayRequestError', self::PRIORITY),\n );\n }", "function getSupportedFilters() {\n return array('event' => array(\n 'event_type_id' => array(\n 'form_field_name' => 'event_type_id',\n 'operator' => 'IN',\n ))\n );\n }", "public function listeners($event);" ]
[ "0.5672442", "0.54948413", "0.54948413", "0.5488594", "0.5463214", "0.54588133", "0.54588133", "0.54454726", "0.53373635", "0.5319139", "0.52828515", "0.52634954", "0.5258248", "0.52410316", "0.51671255", "0.51671255", "0.5153348", "0.5136496", "0.51184505", "0.511448", "0.50985897", "0.5095075", "0.50881875", "0.506801", "0.5063801", "0.50572884", "0.50507283", "0.5049677", "0.50211066", "0.5008828", "0.5005551", "0.4998512", "0.49916184", "0.4971488", "0.49665383", "0.4940008", "0.49300042", "0.49242815", "0.49226308", "0.4897662", "0.48970845", "0.489677", "0.48914978", "0.48860574", "0.48773763", "0.48748875", "0.48707435", "0.48686233", "0.4865618", "0.48605502", "0.4857018", "0.48492795", "0.4847897", "0.48455673", "0.48301062", "0.48273554", "0.48106033", "0.47995573", "0.4796553", "0.47859898", "0.47743693", "0.4772784", "0.47492132", "0.47487056", "0.47475123", "0.47436023", "0.47364938", "0.47263402", "0.47226286", "0.47222888", "0.47170833", "0.47071052", "0.4703332", "0.4698568", "0.46915764", "0.46915764", "0.4684177", "0.4678292", "0.46775532", "0.46742702", "0.46732536", "0.46729308", "0.46697465", "0.46679586", "0.4660448", "0.46576002", "0.46564123", "0.46520737", "0.46483344", "0.46436378", "0.4641237", "0.46407118", "0.4640145", "0.46396235", "0.4632731", "0.46323255", "0.46306", "0.46303046", "0.46269512", "0.46251288", "0.46223384" ]
0.0
-1
For internal only. DO NOT USE IT.
public function deserialize($param) { if ($param === null) { return; } if (array_key_exists("Codec",$param) and $param["Codec"] !== null) { $this->Codec = $param["Codec"]; } if (array_key_exists("Fps",$param) and $param["Fps"] !== null) { $this->Fps = $param["Fps"]; } if (array_key_exists("Bitrate",$param) and $param["Bitrate"] !== null) { $this->Bitrate = $param["Bitrate"]; } if (array_key_exists("ResolutionAdaptive",$param) and $param["ResolutionAdaptive"] !== null) { $this->ResolutionAdaptive = $param["ResolutionAdaptive"]; } if (array_key_exists("Width",$param) and $param["Width"] !== null) { $this->Width = $param["Width"]; } if (array_key_exists("Height",$param) and $param["Height"] !== null) { $this->Height = $param["Height"]; } if (array_key_exists("FillType",$param) and $param["FillType"] !== null) { $this->FillType = $param["FillType"]; } if (array_key_exists("Vcrf",$param) and $param["Vcrf"] !== null) { $this->Vcrf = $param["Vcrf"]; } if (array_key_exists("Gop",$param) and $param["Gop"] !== null) { $this->Gop = $param["Gop"]; } if (array_key_exists("PreserveHDRSwitch",$param) and $param["PreserveHDRSwitch"] !== null) { $this->PreserveHDRSwitch = $param["PreserveHDRSwitch"]; } if (array_key_exists("CodecTag",$param) and $param["CodecTag"] !== null) { $this->CodecTag = $param["CodecTag"]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __init__() { }", "private function __() {\n }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "private function __construct()\t{}", "private function init()\n\t{\n\t\treturn;\n\t}", "final private function __construct() {}", "final private function __construct() {}", "final private function __construct(){\r\r\n\t}", "final private function __construct() {\n\t\t\t}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function _i() {\n }", "protected function fixSelf() {}", "protected function fixSelf() {}", "protected final function __construct() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function init()\n\t{\n\t\t\n\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct() {\r\n\t\t\r\n\t}", "protected function init() {return;}", "final private function __construct()\n\t{\n\t}", "private function __construct () {}", "final private function __construct()\n {\n }", "private final function __construct() {}", "public function __init(){}", "public function helper()\n\t{\n\t\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct()\n\t{\n\t\t\n\t}" ]
[ "0.62662613", "0.6151871", "0.5989886", "0.5989886", "0.5989886", "0.5989886", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5988404", "0.5988404", "0.5949015", "0.5939596", "0.59168774", "0.59168774", "0.58703923", "0.58665824", "0.5855589", "0.5855589", "0.5855589", "0.5799749", "0.5797107", "0.5797107", "0.57807934", "0.5749856", "0.5749856", "0.5749856", "0.5749856", "0.57458705", "0.5741364", "0.571247", "0.5701768", "0.5694139", "0.5680823", "0.5673589", "0.5668696", "0.5640213", "0.5639332", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5626381", "0.56240404", "0.56240404", "0.5610547" ]
0.0
-1
Display a listing of the resource.
public function index() { $employeelists = DB::table('employees')->get(); return view('employees.index')->with('employeelists', $employeelists); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446737", "0.73625076", "0.7300871", "0.72476006", "0.7163127", "0.7149414", "0.7131995", "0.7105663", "0.7102927", "0.7101388", "0.704981", "0.69946545", "0.69897777", "0.6935023", "0.690029", "0.68989694", "0.68925905", "0.68878543", "0.6866467", "0.6849924", "0.6829784", "0.68033314", "0.67971504", "0.6796001", "0.6786942", "0.6760321", "0.6743112", "0.6730776", "0.67266184", "0.67259544", "0.67259544", "0.67259544", "0.671818", "0.670783", "0.670644", "0.6704464", "0.6665842", "0.6663898", "0.6660563", "0.6660198", "0.6657512", "0.6654405", "0.6648237", "0.6620824", "0.6619237", "0.6618058", "0.66072917", "0.660077", "0.6600677", "0.6594786", "0.6587929", "0.65850085", "0.65824693", "0.6581521", "0.6577045", "0.6574634", "0.65729445", "0.65715027", "0.6570646", "0.6565125", "0.6563328", "0.6553843", "0.6553201", "0.6545921", "0.6537198", "0.6534121", "0.6533748", "0.65272135", "0.6526431", "0.6525868", "0.6519198", "0.65185314", "0.6517867", "0.65170157", "0.651509", "0.65070677", "0.6505637", "0.65033627", "0.6494597", "0.6492147", "0.64880013", "0.64871716", "0.6485315", "0.6485215", "0.64790684", "0.64767736", "0.64725083", "0.64709103", "0.64702755", "0.6466392", "0.64618254", "0.646148", "0.64601135", "0.6458744", "0.64543813", "0.64537513", "0.64530194", "0.6450726", "0.64492655", "0.6449169", "0.64466155" ]
0.0
-1
Show the form for creating a new resource.
public function create(Request $request) { $this->validate($request, [ 'fname' => 'required', 'lname' => 'required', ]); $employee = new Employee(); $employee->fname = $request['fname']; $employee->lname = $request['lname']; $employee->email = $request['email']; $employee->phone = $request['phone']; $employee->save(); return redirect('employee'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { return view('employees.store'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Employee $employee) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Employee $employee) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78548634", "0.7693446", "0.72737956", "0.72415876", "0.71732706", "0.7064379", "0.70547634", "0.6985193", "0.6948865", "0.6946892", "0.69416964", "0.6929201", "0.69028485", "0.6899143", "0.6899143", "0.68794435", "0.6864862", "0.6860578", "0.68581015", "0.6845792", "0.6836835", "0.681191", "0.6808133", "0.6806856", "0.68035305", "0.6796193", "0.67936623", "0.67936623", "0.67895305", "0.6785768", "0.678106", "0.67773324", "0.67697626", "0.6762823", "0.6747543", "0.6747543", "0.67463523", "0.67444044", "0.6741766", "0.6737379", "0.6726827", "0.6714104", "0.66950524", "0.66935307", "0.6689272", "0.6689106", "0.66872644", "0.6686648", "0.6684393", "0.6670288", "0.6669616", "0.66668564", "0.66668564", "0.666409", "0.6662514", "0.66599286", "0.66590035", "0.6655965", "0.6653906", "0.6644097", "0.66327673", "0.66314846", "0.6629497", "0.6629497", "0.6620671", "0.66204685", "0.66168797", "0.66163945", "0.66112244", "0.6610172", "0.66072273", "0.65975267", "0.6596347", "0.6595878", "0.65914613", "0.65904135", "0.65880567", "0.658147", "0.6581434", "0.6581035", "0.65780395", "0.65776944", "0.6576013", "0.6570687", "0.6569499", "0.6568776", "0.6567722", "0.6562973", "0.6562973", "0.6561691", "0.655929", "0.6557889", "0.65571314", "0.65565974", "0.65564924", "0.65558827", "0.65556073", "0.6555524", "0.6549151", "0.6548339", "0.65460944" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Employee $employee) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Employee $employee) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Declares the validation rules. The rules state that username and password are required, and password needs to be authenticated.
public function rules() { // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( array('key', 'required'), array('kind', 'safe'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('username, password', 'required'),\n\t\t\t// rememberMe needs to be a boolean\n\t\t\tarray('rememberMe', 'boolean'),\n\t\t\t// password needs to be authenticated\n\t\t\tarray('password', 'authenticate'),\n\t\t);\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('username, password', 'required'),\n\t\t\t// rememberMe needs to be a boolean\n\t\t\tarray('rememberMe', 'boolean'),\n\t\t\t// password needs to be authenticated\n\t\t\tarray('password', 'authenticate'),\n\t\t);\n\t}", "public function rules()\n {\n return [\n 'username' => 'required',\n 'password' => 'required',\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('username, email', 'required'),\n array('username, email', 'length', 'max'=>32),\n\t\t);\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\t//array('username, password', 'required'),\n\t\t\t// password needs to be authenticated\n\t\t\tarray('textEn', 'validateText'),\n\t\t\tarray('verifyCode', 'captcha', 'allowEmpty' => false),\n\t\t);\n\t}", "public function rules() {\n return array(\n // email and password are required\n array('email', 'required'),\n array('email', 'email'),\n array('email', 'authenticate'),\n );\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function initRules()\n {\n $this->rules['email'] = V::email();\n $this->rules['password'] = V::alnum()->noWhitespace()->length(4, 20)->setName('Password');\n $this->rules['first_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('First name');\n $this->rules['last_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('Last name');\n }", "public function rules()\r\n {\r\n return [\r\n //\r\n 'username'=>'required',\r\n 'password'=>'required'\r\n ];\r\n \r\n }", "public function rules() {\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray(\n\t\t\t\t'username, password',\n\t\t\t\t'required'\n\t\t\t),\n\t\t\t//array('username, password, loginType', 'required'),\n\t\t\t// rememberMe needs to be a boolean\n\t\t\tarray(\n\t\t\t\t'rememberMe',\n\t\t\t\t'boolean'\n\t\t\t),\n\t\t\t// password needs to be authenticated\n\t\t\tarray(\n\t\t\t\t'password',\n\t\t\t\t'authenticate'\n\t\t\t),\n\n\t\t\tarray('loginType', 'safe')\n\t\t);\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('firstname, lastname, nick, email, password, password2, lang', 'required'),\n\t\t\t// rememberMe needs to be a boolean\n\t\t\t//array('rememberMe', 'boolean'),\n\t\t\t//array('email', 'email'),\n\t\t\t// password needs to be authenticated\n\t\t\t//array('password2', 'compare'),\n\t\t);\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// email and password are required\n\t\t\t['email, password', 'required'],\n\t\t\t// rememberMe needs to be a boolean\n\t\t\t['rememberMe', 'boolean'],\n\t\t\t// password needs to be authenticated\n\t\t\t['password', 'authenticate'],\n\t\t\t['email', 'checkRole'],\n\t\t);\n\t}", "public function rules()\n {\n $rules['txt_username'] = 'required';\n $rules['txt_password'] = 'required|min:6|max:15';\n\n return $rules;\n }", "public function rules()\n\t{\n\t\treturn [\n 'first_name' => 'required',\n 'username' => 'required|unique:users,username|max:100',\n 'email' => 'required|unique:users,email|email|max:100',\n 'password' => 'required|min:8|same:verifiedpassword',\n 'verifiedpassword'=> 'required'\n\t\t];\n\t}", "public function rules()\n {\n $validations = [\n 'username' => 'required|string',\n 'password' => 'required|string',\n ];\n\n return $validations;\n }", "public function rules()\n {\n $this->setModel(User::class);\n $rules = parent::rules();\n $is_two_factor_auth_enabled = \\TwoFactorAuth::isActive();\n\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|max:191',\n 'last_name' => 'required|max:191',\n 'roles' => 'required',\n 'picture' => 'mimes:jpg,jpeg,png|max:' . maxUploadFileSize(),\n ]\n );\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n 'email' => 'required|email|max:191|unique:users,email',\n 'password' => 'required|confirmed|max:191|min:6'\n ]\n );\n }\n\n if ($this->isUpdate()) {\n $user = $this->route('user');\n\n $rules = array_merge($rules, [\n 'email' => 'required|email|max:191|unique:users,email,' . $user->id,\n 'password' => 'nullable|confirmed|max:191|min:6'\n ]\n );\n if ($is_two_factor_auth_enabled) {\n $rules = array_merge($rules, TwoFactorAuth::registrationValidation($this->all()));\n }\n }\n return $rules;\n }", "public function rules()\n {\n return array(\n // username and password are required\n array('email', 'required'),\n array('email', 'email')\n );\n }", "public function rules() {\n return [\n 'email' => 'required|email',\n 'password' => 'required'\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('username, password, passwordConfirm, email, acceptRules', 'required'),\n\t\t\tarray('password, passwordConfirm', 'length', 'min' => self::PASSWORD_MIN_LENGTH),\n\t\t\tarray('password, passwordConfirm', 'match', 'pattern' => '/[а-яё]/ui', 'not' => true),\n\t\t\tarray('passwordConfirm', 'compare', 'compareAttribute' => 'password'),\n\t\t\tarray('email', 'email'),\n\t\t\tarray('username', 'unique', 'className' => 'User'),\n\t\t\tarray('email', 'unique', 'className' => 'User'),\n\t\t\tarray('acceptRules', 'boolean')\n\t\t);\n\t}", "public function rules() {\n\t\treturn [\n\t\t\t'username' => 'required|between:6,32',\n\t\t\t'email' => 'email|required|between:6,32',\n\t\t\t'password' => 'required|between:6,32',\n\t\t\t'confirm_pass' => 'required|same:password'\n\t\t];\n\t}", "public function rules()\n {\n return [\n 'email' => ['required', 'email'],\n 'password' => 'required'\n ];\n }", "public function rules()\n {\n return [\n\n 'email' => 'required|email',\n 'password' => 'required'\n\n ];\n }", "public function rules()\n {\n return [\n 'id' => 'required',\n 'password' => 'required',\n\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('username, password, password2, name, email', 'required',\n\t\t\t\t'message'=>'Поле \"{attribute}\" должно быть заполнено.'),\n\t\t\tarray('username', 'checkUser'),\n\t\t\tarray('password', 'checkPassword'),\n\t\t\tarray('email', 'email'),\n\t\t\tarray('email', 'checkEmail'),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [\n 'username' => ['required', 'alpha_num', 'min:3', 'max:30', Rule::unique('users')->ignore(optional($this->user)->id)],\n 'email' => ['required', 'email', Rule::unique('users')->ignore(optional($this->user)->id)],\n 'password' => ['required', 'min:5', 'max:20', 'confirmed'],\n ];\n\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $rules['password'] = ['sometimes', 'min:5', 'max:20', 'confirmed'];\n }\n\n return $rules;\n }", "public function rules()\n {\n return [\n 'password' => 'required', //requerimos el password\n 'email' => 'required|email', //requerimos el email y que sea correcto\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n array('cargo_elaborado_por, aprobado_por, cargo_aprobado_por, rector', 'required'),\n \n\t\t\t// username and password are required\n\t\t\t//array('password, password_new, password_new_repeat', 'required'),\n\n //array('password_new', 'compare'),\n\t\t\t// password needs to be authenticated\n\t\t\t//array('password', 'authenticate'),\n\t\t);\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('email, login, password, confirm_password, phone_number', 'required'),\n\n\t\t\tarray('email', 'email'),\n\n\t\t\t// password needs to be authenticated\n\t\t\tarray('password', 'authenticate'),\n\n\t\t\tarray('email, login', 'unique', 'className' => 'UsuarioIps'),\n\t\t);\n\t}", "public function rules()\n {\n return [\n\t 'username' => 'required|max:16|min:6',\n\t 'password' => 'required|min:6'\n ];\n }", "public function rules()\n {\n return [\n 'username' => ['required',\n 'min:3',\n 'max:255',\n 'regex:/^(\\w)+$/i',\n ],\n 'password' => ['required',\n 'min:3',\n 'max:35',\n ],\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('oldpass, newpass, newpass2', 'required'),\n\t\t\tarray('oldpass','sameoldpass'),\n\t\t\tarray('newpass2','samenewpass'),\n\t\t);\n\t}", "public function rules() {\n return array(\n array('username', 'required', 'message' => 'Вы не ввели эл. почту'),\n array('username', 'emailValidate'),\n array('username', 'email'),\n array('password', 'required', 'message' => 'Вы не ввели пароль'),\n array('password', 'authenticate'),\n );\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('type, fromDate, thruDate', 'required'),\n\t\t);\n\t}", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n\t{\n\t\treturn [\n 'email' => 'required|email|max:255|exists:users,email',\n 'password' => 'required|min:6|max:45',\n\t\t];\n\t}", "public function rules()\n {\n return [\n 'username' => 'required|string|between:6,20',\n 'password' => 'required|between:6,16',\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t//array('email,username', 'required'),\n\t\t\tarray('email', 'checkEmail'),\n array('username', 'check_username'),\n\t\t\tarray('username', 'checkEmptyValue'),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function validation()\n {\n $data = [\n 'username' => null,\n 'password' => 'password',\n ];\n $rules = new Rules( $data );\n\n /* Add source */\n $rules->addSource( 'phone', '081234' );\n $rules->addSource( 'address', 'Lorem ipsum dolor sit.' );\n\n /* Add validation rule */\n $rules->addRule(\n 'username',\n 'Username',\n 'minLength[2]',\n [ 'minLength' => ':attribute Should Be More Than :params', 'required' => ':attribute Required' ]\n );\n $rules->addRule( 'password', 'Password', 'maxLength[2]', ':attribute should be less than :params' );\n\n /* Add multiple rules */\n $rules->addRules(\n [\n [\n 'field' => 'phone',\n 'label' => 'Phone',\n 'rules' => 'required',\n 'messages' => 'Phone Required',\n ],\n [\n 'field' => 'address',\n 'label' => 'Address',\n 'rules' => 'required',\n 'messages' => 'Address Required',\n ],\n ]\n );\n\n /* Validate rules */\n $validate = $rules->validate();\n\n print_out(\n [\n 'validate' => ( $validate == true ? 1 : 0 ),\n 'errors' => $rules->getErrors(),\n ]\n );\n }", "public function rules()\n {\n return [\n 'username' => ['required', 'string', 'min:6', 'max:255', 'unique:users'],\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n 'roles' => ['required'],\n 'first_name' => ['required', 'string', 'max:255'],\n 'last_name' => ['required', 'string', 'max:255'],\n 'address' => ['required', 'string', 'max:255'],\n 'contact_number' => ['required', 'regex:/^(01)[0-46-9]*[0-9]{7,8}$/'],\n 'password' => $this->passwordRules()\n ];\n }", "public function rules()\n {\n return array(\n // username and password are required\n array('email', 'required'),\n // rememberMe needs to be a boolean\n array('email','email'),\n );\n }", "public function rules()\n {\n $id = Auth::user()->id;\n\n $rules = [\n 'username' => 'required|string',\n 'phone' => 'required|digits:9|starts_with:5|unique:users,phone,'.$id,\n 'email' => 'required|email|unique:users,email,'.$id,\n ];\n\n if($this->password){\n $rules['password'] = 'required|string|min:8';\n }\n\n return $rules;\n\n }", "public function rules()\n\t{\n\t\tif(!isset($this->scenario))\n\t\t\t$this->scenario = 'login';\n\n\t\t$rules = array(\n\t\t\tarray('username', 'required', 'on' => 'login', 'message' => Yii::t('site', 'Login (email) is required')),\n array('username', 'CEmailValidator', 'message' => Yii::t('site', 'Wrong email')),\n\t\t\tarray('password', 'required', 'on' => 'login', 'message' => Yii::t('site', 'Password is required')),\n array('username' , 'loginByUsername', 'on' => 'login', 'message' => Yii::t('site', 'Имя пользователя или неверный пароль')),\n\t\t\tarray('username', 'required', 'on' => 'openid'),\n\t\t\tarray('rememberMe', 'boolean'),\n array('username', 'required', 'on' => 'login_admin', 'message' => Yii::t('site', 'Login (email) is required')),\n array('username', 'CEmailValidator', 'message' => Yii::t('site', 'Wrong email')),\n array('password', 'required', 'on' => 'login_admin', 'message' => Yii::t('site', 'Password is required')),\n array('username' , 'loginByUsernameAdmin', 'on' => 'login_admin', 'message' => Yii::t('site', 'Имя пользователя или неверный пароль')),\n\t\t);\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n return [\n 'username' => 'required',\n 'email' => 'required|email',\n 'type' => 'required',\n 'cpassword' => 'required',\n 'npassword' => 'required',\n 'confirm_password' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'username' => 'unique:users',\n 'company' => 'required',\n 'email' => 'required|email|unique:users',\n 'password' => 'required|min:8',\n 'confirm_password' => 'required|min:8|same:password'\n ];\n }", "public function rules()\r\n {\r\n return [\r\n 'email' => 'required|email',\r\n 'password' => 'required|min:6'\r\n ];\r\n }", "public function rules()\n {\n $routeName = $this->route()->getName();\n switch ($routeName) {\n case \"api.user.store\":\n $rule = [\n 'username' => 'required|between:3,25|regex:/^[A-Za-z0-9\\-\\_\\x7f-\\xff]+$/|unique:users,name',\n 'password' => 'required|string|min:5'\n ];\n break;\n case \"api.user.update\":\n $userId = \\Auth::guard('api')->id();\n $rule = [\n 'username' => 'between:3,25|regex:/^[A-Za-z0-9\\-\\_\\x7f-\\xff]+$/|unique:users,name,' .$userId,\n 'avatar_image_id' => 'exists:images,id,type,avatar,user_id,'.$userId,\n ];\n break;\n case \"api.user.delete\":\n $rule = [\n 'username' => 'required'\n ];\n break;\n case \"api.user.password\":\n $rule = [\n 'username' => 'required|between:3,25|regex:/^[A-Za-z0-9\\-\\_\\x7f-\\xff]+$/|exists:users,name',\n// 'old_password' => 'required|string|min:5',\n 'password' => 'required|string|min:5',\n ];\n break;\n default:\n $rule = [];\n };\n\n return $rule;\n }", "protected function rules()\n\t{\n\t\treturn [\n\t\t\t'resetToken' => 'required',\n\t\t\t'email' => 'required|email',\n\t\t\t'password' => 'required|min:10',\n\t\t];\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('email, password, knight_name', 'required'),\n\t\t\t// check email format\n\t\t\tarray('email', 'email'),\n\t\t\t// check max length\n\t\t\tarray('email', 'length', 'max'=>255),\n\t\t\tarray('password', 'length', 'max'=>60),\n\t\t\t//Check min length knight name\n\t\t\tarray( 'knight_name', 'length', 'min'=>4)\n\t\t);\n\t}", "public function rules()\n {\n return [\n 'name' => 'required|max:50',\n 'email' => 'required|string|email|max:255|unique:users',\n 'username' => 'required|unique:users,username|max:50|alpha',\n 'password' => 'required|min:3|max:50',\n 'cpassword' => 'required|same:password',\n ];\n }", "public function rules(): array\n {\n return [\n 'email' => 'email|required',\n 'password' => 'required'\n ];\n }", "public function rules()\n {\n $passwordRules = 'min:8|max:100';\n $rules = [\n 'name' => 'bail|required|max:50|min:2',\n 'email' => '',\n 'image' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n 'active'=>'integer',\n 'password'=>''\n ];\n\n if ($this->method() == 'POST') {\n $rules['password'] = $passwordRules . \"|required|confirmed\";\n $rules['email'] = \"required|email|min:2|max:100|unique:users\";\n\n }\n\n if ($this->method() == 'PUT') {\n $rules['email'] = Rule::unique('users')->ignore($this->id);\n }\n\n return $rules;\n }", "public static function rules()\n {\n return [\n 'password' => 'required|confirmed|min:6|max:50',\n 'user_name' => 'required|string',\n 'email' => 'required|email',\n ];\n }", "function __construct ($params=array())\n {\n /**\n * Define Rules\n * Key is rule identifier\n * Value is rule parameter\n * false is disabled (default)\n * Type is type of parameter data\n * permitted values are 'integer' or 'boolean'\n * Test is php code condition returning true if rule is passed\n * password string is $p\n * rule value is $v\n * Error is rule string definition\n * use #VALUE# to insert value\n */\n $this->rules['min_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return strlen($p)>=$v;',\n 'error' => 'Password must be more than #VALUE# characters long');\n\n $this->rules['max_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return (strlen($p)<=$v);',\n 'error' => 'Password must be less than #VALUE# characters long');\n\n $this->rules['min_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# lowercase characters');\n\n $this->rules['max_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# lowercase characters');\n\n $this->rules['min_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# uppercase characters');\n\n $this->rules['max_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# uppercase characters');\n\n $this->rules['disallow_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)==0;',\n 'error' => 'Password may not contain numbers');\n\n $this->rules['disallow_numeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[0-9]/\",$p,$x)==0;',\n 'error' => 'First character cannot be numeric');\n\n $this->rules['disallow_numeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be numeric');\n\n $this->rules['min_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# numbers');\n\n $this->rules['max_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# numbers');\n\n $this->rules['disallow_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)==0;',\n 'error' => 'Password may not contain non-alphanumeric characters');\n\n $this->rules['disallow_nonalphanumeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[\\W]/\",$p,$x)==0;',\n 'error' => 'First character cannot be non-alphanumeric');\n\n $this->rules['disallow_nonalphanumeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be non-alphanumeric');\n\n $this->rules['min_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# non-aplhanumeric characters');\n\n $this->rules['max_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# non-alphanumeric characters');\n\n // Apply params from constructor array\n foreach( $params as $k=>$v ) { $this->$k = $v; }\n\n // Errors defaults empty\n $this->errors = array();\n\n return 1;\n }", "public function rules(): array\n {\n return [\n 'email' => 'required|email',\n 'password' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'firstname' => 'required',\n 'lastname' => 'required',\n 'username' => 'required|unique:users|string',\n 'email' => 'required|email|unique:users',\n 'roles' => 'required',\n 'photo_id' => 'required|max:10000',\n 'password' => 'required|min:8',\n ];\n }", "public function rules()\n {\n return [\n 'username' => 'required|filled|alpha_num|max:30',\n 'password' => 'required|filled|between:6,20|',\n 'telephone' => 'string|max:11',\n 'jobnumber' => 'string|max:6',\n ];\n }", "public function rules()\n {\n return [\n 'fullname' => 'required|between:6,64',\n 'username' => 'required|between:6,64',\n 'email' => 'required|email|between:6,64',\n 'password' => 'required|between:6,32',\n 'repassword' => 'required|same:password|between:6,32',\n ];\n }", "public function rules()\n {\n /** @var \\App\\User */\n $user = $this->route('user');\n\n return [\n 'first_name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'username' => 'required|string|max:255|unique:users,username,' . $user->id,\n 'email' => 'required|string|email|max:255|unique:users,email,' . $user->id,\n 'password' => 'required|string|min:6|confirmed',\n ];\n }", "function validation_rules()\n\t{\n\t\t// validation rules for create\n\t\t$this->create_validation_rules = array(\n\t\t\tarray(\n\t \t'field' => 'product_id',\n\t \t'rules' => 'required'\n\t ),\n\t array(\n\t \t'field' => 'user_id',\n\t \t'rules' => 'required'\n\t )\n );\n\n\t}", "public function rules()\n {\n return [\n 'username' => 'required|string|max:255',\n 'email' => ['required', 'string', 'email', 'max:255', Rule::unique('users')->ignore($this->segment(3), 'id')],\n 'password' => 'nullable|string|min:6|confirmed',\n 'active' => 'required|boolean',\n ];\n }", "public function rules()\n {\n return [\n 'name' => 'required',\n 'login' => 'required',\n 'email' => 'required',\n 'password1' => 'required|min:6',\n ];\n }", "public function rules() {\n\n $rules = [\n 'username' => 'required',\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'email' => 'required|email',\n\n ];\n\n if (Input::filled('password')) {\n $rules['password'] = 'confirmed|min:6';\n }\n\n return $rules;\n\n }", "public function rules()\n {\n return [\n 'name' => 'required',\n 'username' => 'required|max:20|unique:users',\n 'email' => 'required|email|max:255|unique:users',\n 'mobile' => 'required|numeric|unique:users',\n 'status' => 'required',\n 'password' => 'required|min:8',\n ];\n }", "public function rules()\n {\n return [\n 'name' => ['required', 'string', 'max:255', new UserName],\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users,email'],\n 'password' => ['required', 'string', 'min:8'],\n 'password_confirm' => ['required', 'string', 'same:password'],\n ];\n }", "public function rules()\n {\n $rules = [];\n\n // $rules['first_name'] = [ 'required' ];\n // if(\\Request::get('id') != NULL) {\n // if(\\Request::get('password') != '') {\n // $rules['password'] = [ 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,16}$/' ];\n // // $rules['confirm_password'] = [ 'same:password' ];\n // }\n // } else {\n // $rules['password'] = [ 'required', 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,16}$/' ];\n // // $rules['confirm_password'] = [ 'required', 'same:password' ];\n // }\n // $rules['email'] = [ 'required', \n // 'email', \n // Rule::unique('users')->where(function ($query) {\n // $query = $query->where('id', '!=', \\Request::get('id'));\n // return $query;\n // }) \n // ];\n\n return $rules;\n }", "public function rules() {\n\n return [\n 'email' => 'required|email|exists:users,email',\n 'password' => 'required|max:255',\n ];\n }", "public function rules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('username, old_password, password, confirm_password', 'required'),\r\n\t\t\tarray('password','valid'),\r\n\t\t\tarray('confirm_password','compare','compareAttribute'=>'password'),\r\n\t\t);\r\n\t}", "public function rules()\n {\n //自定义验证规则,用来判断原密码是否相等\n $this->checkPassword();\n return [\n 'old_password' => 'required|check_password',\n 'password' => 'required|confirmed',\n 'password_confirmation' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'name'=> 'required|string',\n 'username' => 'required|string|unique:users',\n 'email' => 'required|string|unique:users',\n 'password' => 'required|string'\n ];\n }", "public function rules() {\n return array(\n // username and password are required\n array('email', 'required'),\n array('email', 'userExists'),\n // rememberMe needs to be a boolean\n array('email', 'email'),\n // password needs to be authenticated\n array('verifyCode', 'captcha', 'allowEmpty' => !CCaptcha::checkRequirements()),\n );\n }", "public function rules()\n {\n return [\n 'email' => [\n 'required',\n new UserExistCheck(new User())\n ],\n 'password' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'email' => 'required|string|email|max:100',\n 'password' => 'required|string|min:6',\n //\n ];\n }", "public function rules()\n {\n return [\n 'name' => 'required',\n 'username' => 'required|min:4|max:25',\n 'email' => 'required|email'\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'user_type' => 'required|string',\n ];\n if ($this->method() == 'PUT') {\n $rules['email'] = 'required|string|email|max:255|unique:users,email,' . $this->route()->parameter('user');\n $rules['password'] = 'sometimes|string|' .config('rules.password');\n } else {\n $rules['email'] = 'required|string|email|max:255|unique:users';\n $rules['password'] = 'required|string|' .config('rules.password');\n }\n\n return $rules;\n }", "public function rules()\n {\n return [\n // username and password are both required\n [['username', 'password',/*'confirmPassword','email', 'verifyCode'*/], 'required'],\n\t\t\t//['username', 'unique'],\n\t\t\t//['confirmPassword', 'compare', 'compareAttribute' => 'password'],\n\t\t\t//[['confirmPassword'], 'safe'],\n\t\t\t//['email', 'email'],\n\t\t\t//['verifyCode', 'captcha'],\n ];\n }", "public function rules(): array\n {\n return [\n 'email' => 'required|email|exists:users',\n 'password' => 'required'\n ];\n }", "public function createRules(){\n return [\n 'email' => 'required|string|max:50',\n 'password' => 'required|string',\n ];\n }", "public function rules()\n {\n return [\n 'username' => ['required','min:6','max:12',new IsUsernameExist()],\n 'password'=> 'required|string|min:8|max:20|confirmed|regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/',\n 'password_confirmation' => 'required',\n ];\n }", "public function __construct()\n\t{\n\t\t$this->form_rules = array(\n\t\t\t'email' => 'required|email',\n\t\t\t'password' => 'required',\n\t\t);\n\t}", "public function rules()\n {\n return [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'username' => 'required|unique:users,username,' . $this->id,\n 'email' => 'required|email|unique:users,email,'. $this->id,\n 'active' => 'required',\n 'password' => 'sometimes|required',\n 'retype_password' => 'required_with:password|same:password',\n 'role_id' => 'required',\n 'client_id' => 'exists:clients,id',\n ];\n }", "public function rules()\r\n {\r\n $route = \\Route::currentRouteName();\r\n switch ($route) {\r\n case 'api.v1.user.changePassword':\r\n $rules = [\r\n 'password' => 'required|min:3',\r\n 'new_password' => 'required|min:3',\r\n ];\r\n break;\r\n default:\r\n $rules = User::$rulesLogin;\r\n break;\r\n }\r\n\r\n return $rules;\r\n }", "public function rules()\n\t{\n\t\treturn [\n 'firstname' \t\t=> 'required|string',\n 'lastname' \t\t\t=> 'required|string',\n 'email' \t\t\t=> 'required|email|unique:users',\n 'password' \t\t\t=> 'required|min:8',\n\t\t];\n\t}", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|min:6|confirmed',\n ];\n\n //no need for name in instagram\n if($this->getPathInfo() == '/instagram/connect') {\n $rules['password'] = str_replace('|confirmed', '', $rules['password']);\n $rules['username'] = 'required';\n unset($rules['name']);\n unset($rules['email']);\n }\n\n return $rules;\n }", "public function rules()\n {\n return [\n 'email' => ['required', 'email'],\n 'password' => ['required', Password::min(8)->symbols(true)->mixedCase(true)],\n ];\n }", "public function rules() {\n return array(\n 'Username' => array('string' => array('min' => 4, 'max' => 15), 'required'),\n 'Password' => array('match' => array('ConfirmPassword'), 'string' => array('min' => 8, 'max' => 20), 'required'),\n 'FirstName' => array('string', 'required'),\n 'LastName' => array('string', 'required'),\n 'Email' => array('email'),\n// 'WebUrl' => array('url' => array('required' => 0)),\n// 'Template' => array('required'),\n// 'ProfileImage' => array('file' => array('type' => array('image/jpeg', 'image/pjpeg', 'image/png', 'image/gif'), 'size' => 200000))\n );\n }", "public function rules()\n {\n return [\n 'name' => 'required',\n 'username' => 'required|unique:users',\n 'password' => 'required|gt:4',\n 'email' => 'unique:users'\n ];\n }", "public function rules()\n {\n return [\n 'email' => 'required|email|exists:users,email',\n 'password' => 'required|min:8|max:32'\n ];\n }", "public function rules()\n {\n return [\n 'name' => 'required',\n 'email' => 'required|email|unique:users|max:255',\n 'password' => 'required|min:8',\n 'password_confirmation' => 'required|same:password'\n ];\n }", "public function rules()\n {\n return [\n 'email' => 'required|email|exists:users,email',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n return [\n 'username' => ['required', 'min:3', 'unique:users,name', 'alpha_num'],\n 'email' => ['required', 'email', 'unique:users'], // unique:table_name\n 'password' => ['required', 'confirmed', 'min:6'],\n 'role' => ['required', 'integer'],\n ];\n }", "public function rules()\n {\n if($this->method()=='GET') return [];\n return [\n 'username'=>'required|alpha_dash|between:3,64|unique:users,username',\n 'email'=>'required|email|unique:users,email|max:64',\n 'password'=>'required|confirmed|between:6,128',\n 'nickname'=>'max:128',\n ];\n }", "public function rules()\n {\n\t\t$id = $this->route('admin_user');\n\t\t$rules = [\n\t\t\t'password' => 'nullable|between:6,20',\n\t\t\t'name' => 'required|between:2,20|allow_letter|unique:admin_users,name,'.$id\n\t\t];\n\n\t\tif (!$id) {\n\t\t\t$rules['password'] = 'required';\n\t\t}\n\t\treturn $rules;\n }", "public function rules()\n {\n return [\n 'username' => 'required|min:3|unique:users,username',\n 'password' => 'required|min:3',\n 'name' => 'required|min:3',\n ];\n }", "protected function _set_rules($params)\n\t{\n\t\t$password_lenght = model('user')->_password_lenght;\n\t\t$rules = array();\n\t\t$rules['method'] = array('security_method', 'required|trim|callback__check_method');\n\t\t$rules['password_old'] = array('password_old', 'required|trim|callback__check_password_old');\n\t\t$rules['password'] = array('password', 'required|trim|xss_clean|min_length[' . $password_lenght . ']');\n\t\t$rules['password_confirm'] = array('password_confirm', 'required|trim|xss_clean|matches[password]');\n\t\t$rules['pin_old'] = array('pin_old', 'required|trim|callback__check_pin_old');\n\t\t$rules['pin'] = array('pin', 'required|trim|xss_clean|min_length[' . $password_lenght . ']');\n\t\t$rules['pin_confirm'] = array('pin_confirm', 'required|trim|xss_clean|matches[pin]');\n\t\t$rules[$this->_mod()->param()] = array('security_value', 'required|callback__check_user_security');\n\t\t$this->form_validation->set_rules_params($params, $rules);\n\t}", "public function rules()\n {\n return [\n 'name' => 'required|max:255',\n 'email' => 'required|unique:users',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n return [\n 'name'=>'required', \n 'email'=>'required|email|unique:users',\n 'rol_id'=>'required|exists:rols,id',\n 'password'=>array('required'),\n ];\n }", "public function rules()\n {\n return [\n 'username' => 'required|regex:/^1[345789][0-9]{9}$/|unique:user,username',\n 'password' => 'required|min:8',\n 'repassword' => 'required|same:password',\n 'head_url' => 'required|url',\n ];\n }", "public function rules()\n {\n $this->sanitize();\n\n return [\n 'name' => 'required|max:255',\n 'address' => 'max:150',\n 'email' => ['required', 'email', 'max:255', Rule::unique('users')],\n 'username' => ['required', 'max:20', Rule::unique('users')],\n 'password' => 'required|min:2|confirmed',\n 'role_id' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'name' => 'required|between:0,10',\n 'email' => 'required|email|between:0,255|unique:users',\n 'password' => 'required|alpha_num_check|size:8|confirmed'\n ];\n }", "public function rules()\n\t{\n\t\treturn [\n\t\t\t\"txtUser\" => \"required|unique:users,username\",\n\t\t\t\"txtPass\" => \"required\",\n\t\t\t\"txtRePass\" => \"required|same:txtPass\",\n\t\t\t\"txtEmail\" => \"required\"\n\t\t];\n\t}" ]
[ "0.7668877", "0.7668877", "0.7487751", "0.7358184", "0.72875595", "0.7267254", "0.72525185", "0.72485185", "0.7214912", "0.7184532", "0.7146287", "0.71018624", "0.7060977", "0.7038148", "0.70349085", "0.70002043", "0.6995445", "0.6982238", "0.6912777", "0.6901249", "0.6887298", "0.6867561", "0.686518", "0.6852469", "0.6847598", "0.6845494", "0.6843835", "0.6837111", "0.68325484", "0.67847276", "0.6772874", "0.67589694", "0.67496234", "0.6748784", "0.6745964", "0.6735405", "0.67033863", "0.6701196", "0.66996944", "0.66965157", "0.66955805", "0.6692719", "0.6686733", "0.6685631", "0.6682194", "0.66818255", "0.6671211", "0.66672635", "0.6664989", "0.66546863", "0.66536015", "0.6652578", "0.66399056", "0.66351354", "0.66291386", "0.66264445", "0.6622896", "0.6620526", "0.66155565", "0.66154295", "0.66045827", "0.65970683", "0.6592848", "0.6587307", "0.6585953", "0.65851444", "0.65833604", "0.6581198", "0.6578898", "0.6574174", "0.6573836", "0.6562381", "0.65615445", "0.6553457", "0.6547831", "0.654317", "0.6540576", "0.6536943", "0.6524986", "0.65225", "0.6516904", "0.6514575", "0.6513915", "0.6508513", "0.6493859", "0.64927286", "0.6491876", "0.64869666", "0.6480301", "0.6477701", "0.64644897", "0.645737", "0.6456749", "0.6450124", "0.64470017", "0.6429679", "0.64289856", "0.6421637", "0.64208776", "0.6416609", "0.6415195" ]
0.0
-1
Declares customized attribute labels. If not declared here, an attribute would have a label that is the same as its name with the first letter in upper case.
public function attributeLabels() { return array( 'key' => Yii::t('form', 'Search'), //Yii::t('form', 'key'), 'kind' => Yii::t('form', 'kind'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function attributeLabels()\n\t{\n\t}", "public static function label()\n {\n return __('Attributes');\n }", "public function attributeLabels()\n {\n return [\n 'name' => 'Name',\n 'type' => 'Type',\n 'description' => 'Description',\n 'ruleName' => 'Rule Name',\n 'data' => 'Data',\n ];\n }", "public function attributeLabels() {\r\n\t\treturn array(\r\n\t\t\t'id' => '#',\r\n\t\t\t'name' => 'Название',\r\n\t\t);\r\n\t}", "public function attributeLabels(){\n return array(\n 'coverletter'=>'Cover Letter',\n\t\t\t'fullname'=>'Fullname',\n\t\t\t'dob'=>'Date of Birth',\n\t\t\t'edu'=>'Education',\n\t\t\t'national'=>'Nationality',\n\t\t\t'verifyCode'=>'',\n );\n }", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'description'=>Yii::t('code','Description'),\n\t\t\t'rpt_cat'=>Yii::t('code','Report Category'),\n\t\t\t'name'=>Yii::t('code','Description'),\n\t\t\t'rpt_u'=>Yii::t('code','rpt u'),\n\t\t\t'score_bool'=>Yii::t('code','score bool'),\n\t\t);\n\t}", "public function attributeLabels()\n {\n return array(\n 'asictype'=>'Asic Type',\n\t\t\t'asicno'=>'Asic Number',\n\t\t\t'asicexpiry'=>'Asic expiry',\n\t\t\t'radiobutton'=>'Radio button',\n\t\t\t'accno'=>'Account Number',\n\t\t\t'bsb'=>'BSB',\n\t\t\t'accname'=>'Account Name',\n\t\t\t'radiobutton2'=>'Paid By',\n\t\t\t'renewal'=>'Renewal'\n );\n }", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'pricetype' => 'Тип прайс-листа',\n 'filename' => 'Файл для загрузки',\n\t\t);\n\t}", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t 'file' => tt('Файл'),\n 'zrst5' => tt('Вид'),\n\t\t\t'verifyCode'=>tt('Проверочный код'),\n 'note' => tt('Пояснение'),\n\t\t);\n\t}", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'dtIni'=>'Início',\n\t\t\t'dtFim'=>'Fim',\n\t\t);\n\t}", "public function attrLabel($attr) {\n $lebels = static::attributLabels();\n return isset($lebels[$attr]) ? $lebels[$attr] : ucfirst($attr);\n }", "public function attributeLabels()\n {\n return [\n 'name' => 'Имя',\n 'email' => 'Email',\n 'text' => 'Текст сообщения',\n// 'login' => 'Логин',\n ];\n }", "public function attributeLabels() {\n return array(\n 'image_path' => 'Image Path',\n );\n }", "public function attributeLabels()\n {\n return [];\n }", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'title'=>'عنوان',\n\t\t\t'key' => 'کلید',\n\t\t\t'context'=>'محتویات',\n\t\t);\n\t}", "public function getAttributeLabel($attribute);", "public function attributeLabels()\n {\n return [\n 'name' => Yii::t('yiiplus/desktop', '名称'),\n ];\n }", "public function attribetuLabels()\n {\n return array(\n 'id' => 'ID',\n 'businessId' => 'Business ID',\n 'photoId' => 'Photo ID',\n 'photoUrl' => 'Photo URl',\n 'fromOwner' => 'From Owner',\n 'uploaderName' => 'Uploader Name',\n 'uploaderId' => 'Uploader ID',\n 'uploaderProfile' => 'Uploader Profile',\n 'caption' => 'Caption',\n 'actions' => 'Available actions',\n 'createdAt' => 'Created At',\n 'updatedAt' => 'Updated At',\n 'flagged' => 'Is flagged',\n 'uploaded' => 'Is uploaded',\n 'deleted' => 'Is deleted',\n 'saved' => 'Is saved',\n );\n }", "public function attributeLabels()\n {\n return array(\n 'bmFile'=>Yii::t('bm', 'File'),\n );\n }", "public function attributeLabels()\n {\n return array(\n 'email'=>'Email',\n 'obra'=>'Obra',\n 'tamano'=>'Tamano',\n 'montaje'=>'Montaje',\n 'precio'=>'Precio',\n );\n }", "public function attributeLabels()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t'site_name'=>'Site Name',\r\n\t\t);\r\n\t}", "abstract public function attributeNames();", "public function attributeLabels() {\n\t\treturn array(\n\t\t\t'rememberMe' => Yii::t(\"translation\", \"Remember me next time\"),\n\t\t\t'username' => Yii::t(\"translation\", \"Username\"),\n\t\t\t'password' => Yii::t(\"translation\", \"Password\"),\n\t\t\t//'loginType'=>'Login Type',\n\t\t\t\n\t\t);\n\t}", "public function attributeLabels()\n\t{\n\t\treturn array(\n 'email'=>'Email Address',\n 'name'=>'Name',\n 'contact_no'=>'Contact No',\n 'phone'=>'Phone Number',\n 'message'=>'Message',\n 'company_name'=>'Company Name',\n\t\t);\n\t}", "public function generateAttributeLabel($name)\n\t{\n\t\treturn ucwords(trim(strtolower(str_replace(array('-','_'),' ',preg_replace('/(?<![A-Z])[A-Z]/', ' \\0', $name)))));\n\t}", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'id'=>Yii::t('staff','Record ID'),\n\t\t\t'name'=>Yii::t('contract','Word Name'),\n\t\t\t'file'=>Yii::t('contract','Word File'),\n\t\t\t'remark'=>Yii::t('contract','Remark'),\n\t\t);\n\t}", "public function attributeLabels()\n {\n return array(\n 'dummyConfigCheckbox' => Yii::t('DummyModule.base', 'Dummy configurable checkbox.')\n );\n }", "public function attributeLabels() {\nreturn array(\n'category' => 'Category',\n'series' => 'Series',\n'type' => 'Type',\n'model' => 'Model',\n'aliasname' => 'Aliasname',\n'status' => 'Status',\n'serial_number' => 'Serial Number',\n'stock' => 'Stock',\n'history' => 'Description',\n);\n}", "public function attributeLabels()\n\t{\n\t\treturn Array(\n\t\t\t'form_text_31'=>'',\n\t\t\t'form_text_35'=>'',\n\t\t\t'form_text_11'=>'Фамилия',\n\t\t\t'form_text_12'=>'Имя',\n\t\t\t'form_text_13'=>'Отчество',\n\t\t\t'form_text_14'=>'Почтовый индекс',\n\t\t\t'form_text_15'=>'Регион',\n\t\t\t'form_text_16'=>'Населенный пункт',\n\t\t\t'form_text_17'=>'Адрес',\n\t\t\t'form_email_18'=>'Электронная почта',\n\t\t\t'form_text_19'=>'Контактные телефоны',\n\t\t\t'form_dropdown_SUBJECT'=>'Цель обращения',\n\t\t\t'form_textarea_26'=>'Текст обращения',\n\t\t\t'form_file_27'=>'Приложение',\n\t\t\t'form_hidden_40'=>'',\n\t\t\t'captcha_word'=>'Введите символы с картинки',\n\t\t\t'web_form_submit'=>'Направить обращение',\n\t\t\n\t\t);\n\t}", "public function attributeLabels()\n {\n return array(\n 'id' => 'Item Id',\n 'type' => 'Item Type'\n );\n }", "public function attributeLabels()\n {\n\treturn array(\n\t 'name' => Yii::t('wiro', 'Name'),\n\t 'email' => Yii::t('wiro', 'E-mail'),\n\t 'subject' => Yii::t('wiro', 'Subject'),\n\t 'body' => Yii::t('wiro', 'Body'),\n\t 'verifyCode' => Yii::t('wiro', 'Rewrite code'),\n\t);\n }", "public function attributeLabels() {\n return array(\n 'newEmail' => Yii::t(Common::generateMessageCategory(__FILE__,__CLASS__), 'New Email'),\n 'verifyCode' => Yii::t(Common::generateMessageCategory(__FILE__,__CLASS__), 'Verification Code'),\n );\n }", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'from'=> Lang::t('general', 'Your email'),\n\t\t\t'name'=>Lang::t('general', 'Your name'), \n\t\t\t'to'=>Lang::t('general', 'Your friend\\'s email'),\n\t\t\t'subject'=>'Subject',\n\t\t\t'message'=>'Message',\n\t\t\t'verifyCode'=>Lang::t('general', 'Verification Code'), \n\t\t);\n\t}", "public function getLabelAttributes()\n {\n return parent::getLabelAttributes();\n }", "public function attributeLabels() {\r\n\t\treturn array(\r\n\t\t\t'id' => '#', // +\r\n\t\t\t'managing_rights' => 'Вид прав на управление', // +\r\n\t\t\t'id_acc' => 'Расчетный счет',\r\n\t\t\t'manager' => 'Физическое лицо',\r\n\t\t\t'user' => '',\r\n\t\t\t'deleted' => 'На удаление'\r\n\t\t);\r\n\t\t/*\r\n\t\t *\r\n\t\t \\\"id\\\":\\\"000000002\\\", \\\"managing_rights\\\":\\\"\\\", \\\"id_acc\\\":\\\"000000020\\\", \\\"manager\\\":\\\"10000000005\\\", \\\"user\\\":\\\"\\\", \\\"deleted\\\":false}]\"\r\n\r\n\t\t ID (уникальный идентификатор, целое число, обязательное);\r\n\t\t\tРасчетный счет (выбор из справочника, обязательное);\r\n\t\t\tВид прав на управление (текст, обязательное);\r\n\t\t\tФизическое лицо (выбор из справочника физ.лиц, обязательное).\r\n\r\n\t\t */\r\n\t}", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'email' => Yii::t('app', 'Email'),\n\t\t\t'firstname' => Yii::t('app', 'Firstname'),\n\t\t\t'lastname' => Yii::t('app', 'Lastname'),\n\t\t\t'password' => Yii::t('app', 'Password'),\n\t\t\t'passwordc' => Yii::t('app', 'Confirm Password'),\n\t\t\t//'nickname' => Yii::t('app','Nick Name'),\n\t\t\t//'toc' => Yii::t('app','Terms &amp; Conditions'),\n\t\t\t//'agreetoc' => Yii::t('app','I have read and agree to terms and conditions'),\n\t\t);\n\t}", "private function attrNames()\n {\n $dimAttr = [\n 'length' => 'length',\n 'width' => 'width',\n 'height' => 'height',\n ];\n $dsAttr = [\n 'dropship' => 'dropship',\n 'dropship_location' => 'dropship_location'\n ];\n\n $this->attrNames = ($this->mageVersion >= '2.2.5') ? $dsAttr : array_merge($dsAttr, $dimAttr);\n }", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'verifyCode'=>'驗證碼',\n\t\t\t'email' => '郵箱',\n\t\t\t'name' => '姓名',\n\t\t\t'subject' => '簡介',\n\t\t\t'body' => '內容'\n\t\t);\n\t}", "protected function addNamesLabelsValues() {\n foreach ($this->__fields() as $field) {\n $this->$field->__name = $field;\n if (!$this->$field->label && $this->$field->label !== '') $this->$field->label = strtoupper($field[0]) . substr ($field, 1);\n $this->setFieldValue($field);\n $this->$field->setForm($this);\n }\n }", "public function attributeLabels() {\n return array(\n 'archivo' => 'Archivo Excel',\n );\n }", "public function attributeLabels()\n {\n return [\n 'nombre' => 'Nombre',\n 'password' => 'Contraseña',\n 'passwordConfirm' => 'Confirmar contraseña',\n ];\n }", "public function attributeLabels()\n\t{\n\t\treturn \n\t\t[\n\t\t\t'startDate'=>'Start Date',\n\t\t\t'endDate'=>'End Date',\n\t\t\t'market'=>'Market',\n\t\t\t'dateRange'=>'Date Range'\n\t\t];\n\t}", "public static function singularLabel()\n {\n return __('Attribute');\n }", "public function attributeLabels(){\n\t\treturn array(\n\t\t\t'id' => 'ID',\n\t\t\t'id_project_phase' => 'Id Project Phase',\n\t\t\t'man_days_budgeted' => 'Man Days Budgeted',\n\t\t\t'days_spent' => 'Days Spent',\n\t\t\t'billable' => 'Billable',\n\t\t\t'description' => 'Description',\n\t\t\t'fbr' => 'FBR#',\n\t\t\t'title' => 'Title',\n\t\t\t'module' => 'Module',\n\t\t\t'keywords' => 'Keywords',\n\t\t\t'existsfbr' => 'Previously Done?',\n\t\t\t'notes' => 'Short description',\n\t\t\t'parent_fbr' => 'Parent FBR',\n\t\t\t'type' => 'Type',\n 'author_id' => 'Author'\n\t\t);\n\t}", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'searchInput'=>'Search Text',\n\t\t);\n\t}", "public function attributeLabels()\n\t{\n\t\t$labels = array();\n\t\tforeach($this->searchFields as $field=>$data)\n\t\t\t$labels[$field] = isset($data['label']) ? $data['label'] : parent::generateAttributeLabel($field);\n\t\treturn $labels;\n\t}", "public function attributeLabels() {\n\t\treturn array(\n\t\t\t'month' => 'Select Month',\n\t\t\t'year' => 'Select Year',\n\t\t\t'is_all_child' => 'Regenerate For all Children',\n\t\t\t'child_id' => 'Select Child',\n\t\t\t'invoice_date' => 'Invoice Date',\n\t\t\t'invoice_due_date' => 'Invoice Due Date'\n\t\t);\n\t}", "public function attributeNames()\n {\n return array_merge_recursive(parent::attributeNames(), array(\n 'markup',\n 'name',\n 'plaintext_markup',\n 'subject_markup',\n 'base',\n ));\n }", "public function attributeLabels()\n {\n return array_merge(parent::attributeLabels(), array(\n 'state' => \\yii::t('app', 'Code of state'),\n 'stateName' => \\yii::t('app', 'Name of state'),\n 'isApprovedCoach' => \\yii::t('app', 'Is approved coach'),\n ));\n }", "public function attributeLabels()\n {\n return [\n 'id' => 'ID',\n 'username' => '账 号',\n 'auth_key' => 'Auth Key',\n 'password_hash' => '密 码',\n 'password_reset_token' => 'Password Reset Token',\n 'email' => '邮 箱',\n 'role' => 'Role',\n 'status' => '状态',\n 'created_at' => '创建时间',\n 'updated_at' => '修改时间',\n ];\n }", "public function attributeLabels()\n {\n return [\n 'cardHolderName' => Yii::t('eshop', 'Card Holder Name')\n ];\n }", "public function attributeLabels()\n {\n return [\n 'money_max' => 'Maximum money prise for person',\n 'money_min' => 'Minimum money prise for person',\n 'money_limit' => 'Available money for game',\n 'mana_max' => 'Maximum mana prise for person',\n 'mana_min' => 'Minimum mana prise for person',\n 'mana_to_money_coef' => 'Mana to money conversion coeficient'\n ];\n }", "public function attributeLabels()\n {\n return array(\n 'klantnaam' => 'Naam',\n 'klantemail' => 'E-mail adres',\n 'klantnr' => 'Klantnr',\n 'subject' => 'Onderwerp',\n 'body' => 'Bericht-tekst'\n );\n }", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'subject'=>'Asunto',\n\t\t\t'body'=>'Texto e-mail'\t\t\t\n\t\t);\n\t}", "public function attributeLabels()\n {\n return [\n 'id' => Yii::t('app', 'ID'),\n 'name' => Yii::t('app', 'Name'),\n 'value' => Yii::t('app', 'Value'),\n 'created_at' => Yii::t('app', 'Created At'),\n 'updated_at' => Yii::t('app', 'Updated At'),\n ];\n }", "public function setNameAttribute($value){\n $this->attributes['name'] = ucwords($value);\n }", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'pdf_file'=>__('PDF dosyası')\n\t\t);\n\t}", "public function attributeLabels()\n {\n\n return [\n 'id' => 'id',\n 'region_id' => 'region_id',\n 'work_country_id' => 'work_country_id',\n 'last_change' => 'last_change',\n ];\n }", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'id'=>Yii::t('integral','Record ID'),\n 'employee_id'=>Yii::t('integral','Employee Name'),\n 'employee_name'=>Yii::t('integral','Employee Name'),\n 'prize_type'=>Yii::t('integral','Prize Name'),\n 'prize_point'=>Yii::t('integral','Prize Point'),\n\t\t\t'remark'=>Yii::t('integral','Remark'),\n 'reject_note'=>Yii::t('integral','Reject Note'),\n 'city'=>Yii::t('integral','City'),\n 'apply_date'=>Yii::t('integral','apply for time'),\n\t\t);\n\t}", "public function attributeLabels()\n\t{\n\t\treturn ModelHelper::getAttributeLabels($this);\n\t}", "public function attributeLabels()\n {\n return [\n 'code'=>'代码',\n 'state'=>'状态',\n ];\n\n }", "public function attributes()\n {\n return [\n 'name' => __('main.name'),\n ];\n }", "function init()\n {\n $this->defineAttribute('label', true, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('routeUrl', false, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('add', false, 'Nuova scheda', COMPONENT_TYPE_STRING);\n $this->defineAttribute('cssClass', false, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('buttonId', false, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('noLink', false, false, COMPONENT_TYPE_STRING);\n $this->defineAttribute('iconClass', false, 'fa-plus', COMPONENT_TYPE_STRING);\n\n parent::init();\n }", "public function attributeLabels()\n {\n return [\n 'id' => Yii::t('app', 'ID'),\n 'title' => Yii::t('app', 'Title'),\n 'description' => Yii::t('app', 'Description'),\n 'url' => Yii::t('app', 'Url'),\n 'canonicalUrl' => Yii::t('app', 'Canonical Url'),\n 'image' => Yii::t('app', 'Image'),\n 'createdAt' => Yii::t('app', 'Created At'),\n 'updatedAt' => Yii::t('app', 'Updated At'),\n ];\n }", "public function attributeLabels()\n\t{\n\t\treturn array(\n 'city'=>Yii::t('contract','City'),\n 'city_name'=>Yii::t('contract','City'),\n 'audit_index'=>Yii::t('fete','Audit index'),\n\t\t);\n\t}", "public function attributeLabels()\n {\n return [\n 'userId' => Yii::t('user', 'User ID'),\n ];\n }", "public function attributeLabels()\n {\n return [\n 'password' => 'Пароль',\n 'password2' => 'Повторите пароль',\n ];\n }", "public function setAttributes();", "public function attributeLabels()\n\t{\n return array(\n 'id'=>Yii::t('study','ID'),\n 'chapter_name'=>Yii::t('study','chapter name'),\n 'title_code'=>Yii::t('study','question code'),\n 'title_type'=>Yii::t('study','question type'),\n 'name'=>Yii::t('study','question name'),\n 'display'=>Yii::t('study','display'),\n 'remark'=>Yii::t('study','Interpretation'),\n\n 'answer'=>Yii::t('study','correct answer'),\n 'answer_a'=>Yii::t('study','wrong answer A'),\n 'answer_b'=>Yii::t('study','wrong answer B'),\n 'answer_c'=>Yii::t('study','wrong answer C'),\n );\n\t}", "abstract function add_label();", "public function setLabel($name, $label);", "public function attributeLabels()\r\n\t{\r\n\t\treturn array(\r\n 'tgl_awal'=>'Mulai tanggal',\r\n 'tgl_akhir'=>'Hingga tanggal'\r\n\t\t);\r\n\t}", "public function defineAttributes()\n\t{\n\t\treturn array();\n\t}", "public function attributeLabels()\n {\n return [\n 'active' => Yii::t('TermsboxModule.models_forms_EditForm', 'Active'),\n 'title' => Yii::t('TermsboxModule.models_forms_EditForm', 'Title'),\n 'statement' => Yii::t('TermsboxModule.models_forms_EditForm', 'Statement'),\n 'content' => Yii::t('TermsboxModule.models_forms_EditForm', 'Content'),\n 'reset' => Yii::t('TermsboxModule.models_forms_EditForm', 'Mark as unseen for all users'),\n 'showAsModal' => Yii::t('TermsboxModule.models_forms_EditForm', 'Show terms as modal'),\n 'hideUnaccepted' => Yii::t('TermsboxModule.models_forms_EditForm', 'Hide users which not accepted the terms (Note: May require search index rebuild)'),\n ];\n }", "public function setAttribute( $name, $value ) {\r\n if( $name == 'label' ) {\r\n $this->setLabel( (string)$value );\r\n } else {\r\n parent::setAttribute( $name, $value );\r\n }\r\n }", "public function attributeLabels() {\n return array(\n 'out_summ' => Yii::t('credits', 'Sum'),\n 'in_curr' => Yii::t('credits', 'Payment method'),\n );\n }", "function addAttribute($k, $v = null, $ns = null):void {parent::addAttribute($this->k($k), $v, $ns);}", "public function attributeLabels()\n\t{\n\t\treturn array(\n\t\t\t'competition'=>Yii::t('vote', 'Tävling'),\n\t\t);\n\t}", "public function getAttributeName()\n {\n return 'AgriculturalInsuranceDiscountFactor';\n }", "private function setLabels(){\n\t\t$this->labels = array(\n\t\t\t'name' => $this->name,\n\t\t\t'singular_name' => $this->nameMenuSingular,\n\t\t\t'menu_name' => $this->nameMenu,\n\t\t\t'all_items' => $this->nameAll,\n\t\t\t'add_new' => $this->nameAddNew,\n\t\t\t'add_new_item' => $this->nameNewItem,\n\t\t\t'edit_item' => $this->nameEdit,\n\t\t\t'new_item' => $this->nameNewItem,\n\t\t\t'view_item' => $this->nameView,\n\t\t\t'search_items' => $this->nameSearch,\n\t\t\t'not_found' => $this->msgNotFound,\n\t\t\t'not_found_in_trash' => $this->msgNotFoundTash,\n\t\t\t'parent_item_colon' => $this->msgParentItemColon\n\t\t);\n\t}", "public function attributeLabels()\r\n\t {\r\n\t return [\r\n\t \t'recibo' => Yii::t('frontend', 'Nro. Recibo'),\r\n\t \t'fecha_desde' => Yii::t('frontend', 'Fecha Desde'),\r\n\t \t'fecha_hasta' => Yii::t('frontend', 'Fecha Hasta'),\r\n\t \t'codigo_banco' => Yii::t('frontend', 'Banco'),\r\n\t \t'cuenta_deposito' => Yii::t('frontend', 'Cuenta Recaudadora'),\r\n\t ];\r\n\t }", "public function getAttributeLabel($attribute)\n\t{\n\t\t$baseLabel = parent::getAttributeLabel($attribute);\n\t\treturn Yii::t('waterrequest', $baseLabel);\n\t}", "public function attributeLabels()\n\t{\n return array(\n 'treaty_code'=>Yii::t('treaty','treaty code'),\n 'treaty_name'=>Yii::t('treaty','treaty name'),\n 'month_num'=>Yii::t('treaty','month num'),\n 'treaty_num'=>Yii::t('treaty','treaty num'),\n 'city'=>Yii::t('treaty','city'),\n 'city_name'=>Yii::t('treaty','city'),\n 'apply_date'=>Yii::t('treaty','apply date'),\n 'start_date'=>Yii::t('treaty','start date'),\n 'end_date'=>Yii::t('treaty','end date'),\n 'email_hint'=>Yii::t('treaty','email hint'),\n 'remark'=>Yii::t('treaty','remark'),\n 'contract_code'=>Yii::t('treaty','history code'),\n 'lcu'=>Yii::t('treaty','treaty lcu'),\n );\n\t}", "public function attributeLabels()\n\t{\n return array(\n 'year'=>Yii::t('recruit','year'),\n 'city'=>Yii::t('recruit','city'),\n 'dept_id'=>Yii::t('recruit','dept name'),\n 'leader_id'=>Yii::t('recruit','leader name'),\n 'recruit_num'=>Yii::t('recruit','recruit num'),\n 'now_num'=>Yii::t('recruit','now num'),\n 'leave_num'=>Yii::t('recruit','leave num'),\n 'lack_num'=>Yii::t('recruit','lack num'),\n 'completion_rate'=>Yii::t('recruit','completion rate'),\n );\n\t}", "public function attributes()\n {\n $rules_labels = User::$labels;\n return $rules_labels;\n }", "public function getLabel($name);", "public function setNameAttribute($value){//\n $this->attributes['name'] = strtolower($value);\n }", "public function setLabel() {\n }", "function initialize () {\n $this->set_openingtag(\"<LABEL[attributes]>\");\n\t$this->set_closingtag(\"</LABEL>\");\n }", "public function setAttributeLabels(array $labels = [])\n {\n $this->_attributeLabels = $labels;\n\n return $this;\n }", "public function getLabelableAttributeName(): string\n {\n return 'for';\n }", "public function attributeNames()\n\t{\n\t\treturn array('frequency','priority','route','params','baseModel','scopeName');\n\t}", "public function attributeLabels()\r\n\t {\r\n\t return [\r\n\t \t'nro_solicitud' => Yii::t('backend', 'Nro. Request'),\r\n\t \t'impuesto' => Yii::t('backend', 'Tax'),\r\n\t 'tipo_solicitud' => Yii::t('backend', 'Request'),\r\n\t 'fecha_desde' => Yii::t('backend', 'Start date'),\r\n\t 'fecha_hasta' => Yii::t('backend', 'End date'),\r\n\t ];\r\n\t }", "public function attributeLabels()\n {\n return array_merge(parent::attributeLabels(), array(\n 'userId' => \\yii::t('app', 'Related user ID'),\n ));\n }", "function addLabelFor($forID, $text, $attr_ar = array() ) { \n $str = \"<label for=\\\"$forID\\\"\"; \n if ($attr_ar) { \n $str .= addAttributes( $attr_ar ); \n } \n $str .= \">$text</label>\"; \n return $str; \n }", "public function setNameAttribute($value){\n $this->attributes['name'] = strtoupper(($value));\n }", "public function attributeLabels()\n\t{\n\t\treturn array_merge(parent::attributeLabels(), array(\n\t\t\t'question_1'=>'1. Ronquido fuerte',\n 'question_2'=>'2. ¿Siente las piernas inquietas, como si saltaran, o que se sacuden??',\n 'question_3'=>'3. Dificultad para conciliar el sueño',\n 'question_4'=>'4. Despertares frecuentes',\n 'question_5'=>'5. ¿Tiene dificultad para respirar? ¿Respiración entrecortada? ¿Respiración ruidosa?',\n 'question_6'=>'6. ¿Se siente adormecido en el trabajo?',\n 'question_7'=>'7. ¿Con frecuencia da vueltas o se sacude en la cama?',\n 'question_8'=>'8. ¿En algún momento siente que se queda sin aire?',\n 'question_9'=>'9. ¿Tiene excesiva somnolencia (le da mucho sueño) durante el día?',\n 'question_10'=>'10. ¿Tiene dolores de cabeza por la mañana?',\n 'question_11'=>'11. ¿Se sintió adormecido al conducir?',\n 'question_12'=>'12. Se siente paralizado, incapaz de moverse por períodos cortos al dormirse o al despertar',\n 'question_13'=>'13. ¿Tiene sueños vívidos al quedarse dormido o en el momento de despertarse?',\n 'question_14'=>'14. Ronquido (Cualquiera: fuerte o débil)',\n\t\t));\n\t}", "public function setLabel();", "public function createLabels()\n {\n // default labels\n $labels = [\n 'name' => $this->plural,\n 'singular_name' => $this->singular,\n 'menu_name' => $this->plural,\n 'all_items' => \"All {$this->plural}\",\n 'edit_item' => \"Edit {$this->singular}\",\n 'view_item' => \"View {$this->singular}\",\n 'update_item' => \"Update {$this->singular}\",\n 'add_new_item' => \"Add New {$this->singular}\",\n 'new_item_name' => \"New {$this->singular} Name\",\n 'parent_item' => \"Parent {$this->plural}\",\n 'parent_item_colon' => \"Parent {$this->plural}:\",\n 'search_items' => \"Search {$this->plural}\",\n 'popular_items' => \"Popular {$this->plural}\",\n 'separate_items_with_commas' => \"Seperate {$this->plural} with commas\",\n 'add_or_remove_items' => \"Add or remove {$this->plural}\",\n 'choose_from_most_used' => \"Choose from most used {$this->plural}\",\n 'not_found' => \"No {$this->plural} found\",\n ];\n\n return array_replace($labels, $this->labels);\n }", "public function getAttributeName()\n\t{\n\t\treturn 'Indicator';\n\t}" ]
[ "0.740033", "0.6952993", "0.6751836", "0.673617", "0.6688154", "0.66121286", "0.6590494", "0.65450895", "0.6523876", "0.6521726", "0.6491478", "0.6434854", "0.6384268", "0.6373291", "0.63622457", "0.6321261", "0.63204753", "0.62992", "0.62745917", "0.6263183", "0.6257995", "0.62532777", "0.6208385", "0.6204855", "0.62017626", "0.6193348", "0.61671257", "0.6162241", "0.6158805", "0.61496687", "0.6144629", "0.61432534", "0.6116259", "0.6110775", "0.6086041", "0.60823286", "0.60818946", "0.6078014", "0.60701746", "0.6016237", "0.6010891", "0.60062927", "0.5995533", "0.5988521", "0.5982644", "0.596896", "0.59638435", "0.595062", "0.5935746", "0.5923612", "0.5919881", "0.5911844", "0.58917767", "0.5886849", "0.58743715", "0.5861156", "0.5861036", "0.5812298", "0.5809883", "0.58090764", "0.5803875", "0.5788854", "0.5780094", "0.5771615", "0.57671404", "0.5758195", "0.5757497", "0.5756385", "0.5752639", "0.573902", "0.5720551", "0.57194906", "0.570579", "0.57036936", "0.56999826", "0.5691805", "0.5688903", "0.56842536", "0.568056", "0.5680052", "0.56672585", "0.56670725", "0.56579804", "0.56536806", "0.5646366", "0.5630773", "0.5627187", "0.561958", "0.55983937", "0.55934083", "0.55910057", "0.5581629", "0.5580651", "0.5580467", "0.55776346", "0.556786", "0.55479276", "0.55446327", "0.5537438", "0.5532724" ]
0.5717195
72
If location exists, it gets updated by IP address. Otherwise new row is inserted
private function storeLocation(GeoLocationItem $location) { try { $row = DB::table(IpInfoLocation::TABLE) ->where('ip', $location->ipAddress) ->first(); // Dunno why, but updateOrInsert call just throws an undefined method error. // Probably something October specific if ($row) { return DB::table(IpInfoLocation::TABLE) ->where('ip', $location->ipAddress) ->update([ 'ip' => $location->ipAddress, 'country_code' => $location->countryCode, 'country' => $location->countryName, 'state' => $location->regionName, 'city' => $location->cityName, 'zip' => $location->zipCode, 'latitude' => (float)$location->latitude, 'longitude' => (float)$location->longitude, 'timezone' => $location->timeZone, 'updated_at' => Carbon::now(), ]); } return DB::table(IpInfoLocation::TABLE) ->insert([ 'ip' => $location->ipAddress, 'country_code' => $location->countryCode, 'country' => $location->countryName, 'state' => $location->regionName, 'city' => $location->cityName, 'zip' => $location->zipCode, 'latitude' => (float)$location->latitude, 'longitude' => (float)$location->longitude, 'timezone' => $location->timeZone, 'updated_at' => Carbon::now(), ]); } catch (PDOException $e) { // Concurrency problem, two requests at the same time try to insert the same value // Can just be ignored return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateLocation()\n {\n $core = Core::dbOpen();\n $sql = \"UPDATE program_locations SET city = :city, state = :state, zip = :zip\n WHERE locationID = :id\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':city', $this->city);\n $stmt->bindParam(':state', $this->state);\n $stmt->bindParam(':zip', $this->zip);\n $stmt->bindParam(':id', $this->locationID);\n \n Core::dbClose();\n \n try {\n if($stmt->execute()) {\n return true;\n }\n } catch (PDOException $e) {\n return false;\n }\n }", "protected function updateLocations()\n {\n $this->execute(<<<SQL\nUPDATE jl_loc_location jll \n INNER JOIN jl_loc_region jlr ON jlr.id = jll.region_id\n SET jll.state_id = jlr.state_id;\nSQL\n );\n }", "public function testUpdateValidLocation() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"location\");\n\n\t\t// create a new Location and insert to into mySQL\n\t\t$location = new Location(null, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->insert($this->getPDO());\n\n\t\t// edit the Location and update it in mySQL\n\t\t$location->setLocationStreetOne($this->warZone2);\n\t\t$location->update($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoLocation = Location::getLocationByLocationId($this->getPDO(), $location->getLocationId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"location\"));\n\t\t$this->assertEquals($pdoLocation->getLocationProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoLocation->getLocationAttention(), $this->payAttention);\n\t\t$this->assertEquals($pdoLocation->getLocationCity(), $this->sinCity);\n\t\t$this->assertEquals($pdoLocation->getLocationName(), $this->granjalada);\n\t\t$this->assertEquals($pdoLocation->getLocationState(), $this->stateOfMind);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetOne(), $this->warZone2);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetTwo(), $this->aptTwo);\n\t\t$this->assertEquals($pdoLocation->getLocationZipCode(), $this->whatHood);\n\t}", "protected function _updateIpData()\n {\n if (!empty($this->_extraData['ipAddress']))\n {\n $ipAddress = $this->_extraData['ipAddress'];\n }\n else\n {\n $ipAddress = null;\n }\n\n $ipId = XenForo_Model_Ip::log(\n $this->get('user_id'), $this->getContentType(), $this->getContestId(), 'insert', $ipAddress\n );\n $this->set('ip_id', $ipId, '', array('setAfterPreSave' => true));\n\n $this->_db->update($this->getContestTableName(), array(\n 'ip_id' => $ipId\n ), 'photo_contest_id = ' . $this->_db->quote($this->getContestId()));\n }", "public function updateWorkshopLocation()\n\t{\n\t\t\n\t\t$core = Core::dbOpen();\n\t\t\n\t\t// get workshopLocationID if exists\n\t\t$sql = \"SELECT workshopLocationID, locationID FROM workshop_location \n\t\t\t\t\t\tWHERE programID\t= :programID AND name\t= :name AND address = :address\";\n\t\t$stmt = $core->dbh->prepare($sql);\n\t\t$stmt->bindParam(':programID', $this->programID);\n\t\t$stmt->bindParam(':name', $this->name);\n\t\t$stmt->bindParam(':address', $this->address);\n\t\t\n\t\ttry {\n\t\t\tif ( $stmt->execute() && $stmt->RowCount() > 0 ) // location exists\n\t\t\t{\n\t\t\t\t$row = $stmt->fetch();\n\t\t\t\t$this->workshopLocationID = $row[\"workshopLocationID\"];\n\t\t\t\t\n\t\t\t\t// if the current location ID differs than what is in the location, update it\n\t\t\t\tif( $this->locationID != $row[\"locationID\"] ) {\t\t\t\t\n\t\t\t\t\t\t$sql = \"UPDATE workshop_location SET locationID = :locationID WHERE workshopLocationID = :id\";\n\t\t\t\t\t\t$stmt = $core->dbh->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':locationID', $this->locationID);\n\t\t\t\t\t\t$stmt->bindParam(':id', $this->workshopLocationID);\n\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse // add it\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO workshop_location (programID,name,address,locationID)\n\t\t \t \t VALUES (:programID, :name, :address, :locationID)\";\n\t\t\t\t$stmt = $core->dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(':programID', $this->programID);\n\t\t\t\t$stmt->bindParam(':locationID', $this->locationID);\n\t\t\t\t$stmt->bindParam(':name', $this->name);\n\t\t\t\t$stmt->bindParam(':address', $this->address);\n\t\t\t\tCore::dbClose();\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif ( $stmt->execute() )\n\t\t\t\t\t\t$this->workshopLocationID = $core->dbh->lastInsertId(); \t\t\n\t\t\t\t\treturn true;\t\t\t\t\n\t\t\t\t} catch ( PDOException $e ) {\n\t\t\t\t\techo \"Add Workshop Location Failed\";\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( PDOException $e ) {\n\t\t\techo \"Get Workshop Location ID Failed\";\n\t\t}\n\t\treturn false;\n\t}", "public function updatelocationAction()\n {\n $userInfo = new UserInfo($_POST);\n if ($userInfo->hasIPUpdated())\n {\n $userInfo->saveIP();\n $userInfo->findLocationFromIP();\n $userInfo->saveLocation();\n }\n }", "public function updateLocation(){\n $location = location::where('id','=','')->first();\n if (!$location){\n dump(\"location could not be updated\");\n }\n else{\n $location->location_name='';\n $location->country='';\n $location->external_code='';\n }\n }", "function update_location($user_id,$location,$connection) \n {\n if(!empty($location))\n {\n $salt_string=\"@!\";\n $username.=$salt_string;\n $query=\"UPDATE user_details SET location='$location' WHERE user_id='$user_id' LIMIT 1\";\n $result = mysqli_query($connection,$query);\n if($result)\n return true;\n else\n return false;\n }\n else\n return true;\n }", "function addLocation($location_details){\n\t if ($this->db->insert('pofloc',$location_details))\n\t\t\t{ \n\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\treturn FALSE;\n\t\t\t}\n }", "public function testUpdateInvalidLocation() {\n\t\t// create a Location, try to update it without actually updating it and watch it fail\n\t\t$location = new Location(null, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->update($this->getPDO());\n\t}", "function saveIp()\n{\n global $db_lnk;\n $qry_val_arr = array(\n $_SERVER['REMOTE_ADDR']\n );\n $ip_row = executeQuery('SELECT id FROM ips WHERE ip = $1', $qry_val_arr);\n if (!$ip_row) {\n $country_id = 0;\n $_geo = array();\n if (function_exists('geoip_record_by_name')) {\n $_geo = @geoip_record_by_name($_SERVER['REMOTE_ADDR']);\n }\n if (!empty($_geo)) {\n $qry_val_arr = array(\n $_geo['country_code']\n );\n $country_row = executeQuery('SELECT id FROM countries WHERE iso_alpha2 = $1', $qry_val_arr);\n if ($country_row) {\n $country_id = $country_row['id'];\n }\n $qry_val_arr = array(\n $_geo['region']\n );\n $state_row = executeQuery('SELECT id FROM states WHERE name = $1', $qry_val_arr);\n if (!$state_row) {\n $qry_val_arr = array(\n $_geo['region'],\n $country_id\n );\n $result = pg_query_params($db_lnk, 'INSERT INTO states (created, modified, name, country_id) VALUES (now(), now(), $1, $2) RETURNING id', $qry_val_arr);\n $state_row = pg_fetch_assoc($result);\n }\n $qry_val_arr = array(\n $_geo['city']\n );\n $city_row = executeQuery('SELECT id FROM cities WHERE name = $1', $qry_val_arr);\n if (!$city_row) {\n $qry_val_arr = array(\n $_geo['city'],\n $state_row['id'],\n $country_id,\n $_geo['latitude'],\n $_geo['longitude']\n );\n $result = pg_query_params($db_lnk, 'INSERT INTO cities (created, modified, name, state_id, country_id, latitude, longitude) VALUES (now(), now(), $1, $2, $3, $4, $5) RETURNING id ', $qry_val_arr);\n $city_row = pg_fetch_assoc($result);\n }\n }\n $user_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';\n $state_id = (!empty($state_row['id'])) ? $state_row['id'] : 0;\n $city_id = (!empty($city_row['id'])) ? $city_row['id'] : 0;\n $lat = (!empty($_geo['latitude'])) ? $_geo['latitude'] : 0.00;\n $lng = (!empty($_geo['longitude'])) ? $_geo['longitude'] : 0.00;\n $qry_val_arr = array(\n $_SERVER['REMOTE_ADDR'],\n gethostbyaddr($_SERVER['REMOTE_ADDR']) ,\n $city_id,\n $state_id,\n $country_id,\n $lat,\n $lng,\n $user_agent\n );\n $result = pg_query_params($db_lnk, 'INSERT INTO ips (created, modified, ip, host, city_id, state_id, country_id, latitude, longitude, user_agent) VALUES (now(), now(), $1, $2, $3, $4, $5, $6, $7, $8) RETURNING id', $qry_val_arr);\n $ip_row = pg_fetch_assoc($result);\n }\n return $ip_row['id'];\n}", "public function updateEntryLocation() {\n\t\t\n\t\t//NOTE: Replace sample data with get/post/session/db\n\t\t$user_entry_id=1;\n\t\t$current_location=37;\n\t\t$prev_location=113;\n\t\t\n\t\tif($user_entry_id != ''\n\t\t\t&& $current_location != '' \n\t\t\t&& $prev_location != '' \n\t\t\t&& $prev_location != $current_location)\n\t\t{\n\t\t\t$params['location_id'] = $current_location;\n\t\t\t$where = \" user_entry_id = \".$user_entry_id;\n\t\t\t$where .= \" AND location_id = \".$prev_location;\n\t\t\treturn $this->Poc->update($params,$table_name='user_entry',$where);\t\t\t\t\n\t\t}\n\t\treturn false;\n\t}", "public function upsert($table, $insertFieldValues, $updateFieldValues = [], $primaryKey = null);", "function updateLocation($UserID, $LastPointX, $LastPointY,$LastUpdateTime){\n $conn = connectDB();\n $updateLocationSQL = \"UPDATE Task SET Task.LastPointX =\".$LastPointX.\", Task.LastPointY =\".$LastPointY.\", Task.LastUpdateTime = \".$LastUpdateTime.\" WHERE Task.UserID = \".$UserID.\" AND Task.Canceled = 'N';\";\n $conn->query($updateLocationSQL);\n $conn->close();\n}", "public static function updateUserLocation() {\r\n $debug = \\Drupal::config('smart_ip.settings')->get('debug_mode');\r\n if (!$debug) {\r\n $ip = \\Drupal::request()->getClientIp();\r\n $smartIpSession = self::getSession('smart_ip');\r\n if (!isset($smartIpSession['location']['ipAddress']) || $smartIpSession['location']['ipAddress'] != $ip) {\r\n $result = self::query();\r\n self::userLocationFallback($result);\r\n /** @var \\Drupal\\smart_ip\\SmartIpLocation $location */\r\n $location = \\Drupal::service('smart_ip.smart_ip_location');\r\n $location->setData($result);\r\n $location->save();\r\n }\r\n }\r\n }", "public function testInsertValidLocation() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"location\");\n\n\t\t// create a new Location and insert to into mySQL\n\t\t$location = new Location(null, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->insert($this->getPDO());\n\n// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoLocation = Location::getLocationByLocationId($this->getPDO(), $location->getLocationId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"location\"));\n\t\t$this->assertEquals($pdoLocation->getLocationProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoLocation->getLocationAttention(), $this->payAttention);\n\t\t$this->assertEquals($pdoLocation->getLocationCity(), $this->sinCity);\n\t\t$this->assertEquals($pdoLocation->getLocationName(), $this->granjalada);\n\t\t$this->assertEquals($pdoLocation->getLocationState(), $this->stateOfMind);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetOne(), $this->warZone);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetTwo(), $this->aptTwo);\n\t\t$this->assertEquals($pdoLocation->getLocationZipCode(), $this->whatHood);\n\t}", "public function testFindByIpSuccess()\n {\n $this->location->save();\n\n $location = Location::find_by_ip('111.111.111.111');\n\n $this->assertNotNull($location);\n $this->assertInstanceOf(Location::class, $location);\n $this->assertEquals($this->location->ip, $location->ip);\n $this->assertEquals($this->location->country, $location->country);\n $this->assertEquals($this->location->city, $location->city);\n }", "function addLocation($data) {\r\n\r\n\r\n\t\t$this->query('INSERT INTO locations (`id`, `created`, `modified`, `name`) \r\n\t\t\t\t\t\t\t VALUES (NULL, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), \"'. $data['name'] .'\");');\r\n\r\n\t}", "public function createOrUpdate(StoreLocationRequest $request)\r\n {\r\n if ($request->has('id') && $request->has('update')) {\r\n return $this->update($request);\r\n }\r\n\r\n return $this->create($request);\r\n }", "function update_location($longitude, $latitude, $info_id) {\r\n $query = \"Update mw_info set longitude = $longitude, \r\n latitude = $latitude\r\n , date_modified = now()\r\n where info_id = $info_id\";\r\n// print $query;\r\n// print mysql_error();\r\n return $this->query($query);\r\n }", "public function testInsertInvalidLocation() {\n\t\t// create a Location with a non null location id and watch it fail\n\t\t$location = new Location(RootsTableTest::INVALID_KEY, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->insert($this->getPDO());\n\t}", "function updateLocation($data) {\r\n\r\n\t\t$this->query('UPDATE locations SET `modified` = CURRENT_TIMESTAMP(), `name` = \"'. $data['name'] .'\" WHERE id = '. $data['id'] .';');\r\n\r\n\t}", "public function insert($location){\n $fields = array(\"location_name\");\n $values = array($location);\n $lastid = $this->db->insert(\"location_tabel\", $fields, $values);\n return $lastid;\n }", "public function updateExistingLocation($request, $id)\n {\n $location = $this->deliveryLocation->where('id', $id)->first();\n if ($location) {\n $location->name = $request->name;\n $location->description = $request->description;\n $location->price = $request->price;\n $location->status = $request->status;\n if ($location->save()) {\n return 'updated';\n }\n return 'can\\'t be updated';\n }\n\n }", "function updateLocationStatus($IDLocation)\n{\n\n $strSeparator = '\\'';\n $locUpdatedStatus = 0;\n //count how much Order in that Location\n $queryCountLoc = 'SELECT COUNT(FK_IDLoc) FROM orderedsnow WHERE FK_IDLoc =' . $strSeparator . $IDLocation . $strSeparator;\n require_once 'model/dbConnector.php';\n $locTotalOrder = executeQuerySelect($queryCountLoc);\n if ($locTotalOrder === null) {\n throw new SiteUnderMaintenanceExeption;\n }\n //Count how much OrderStatus is at 1 in that location\n $queryCountOrder = 'SELECT COUNT(FK_IDLoc) FROM orderedsnow WHERE OrderStatus = 1 AND FK_IDLoc =' . $strSeparator . $IDLocation . $strSeparator;\n require_once 'model/dbConnector.php';\n $locRendu = executeQuerySelect($queryCountOrder);\n if ($locRendu === null) {\n throw new SiteUnderMaintenanceExeption;\n }\n //if the 2 number are equal set the Location to 2\n\n\n if ($locTotalOrder == $locRendu) {\n $locUpdatedStatus = 2;\n } elseif ($locRendu > 0 && $locRendu < $locTotalOrder) {\n $locUpdatedStatus = 1;\n }\n\n //replace actual locStatus if needed\n if ($locUpdatedStatus != 0) {\n $queryUpdate = 'UPDATE locations SET LocStatus=' . $strSeparator . $locUpdatedStatus . $strSeparator . ' WHERE IDLoc =' . $strSeparator . $IDLocation . $strSeparator;\n $queryResult = executeQueryUpdate($queryUpdate);\n if ($queryResult === null) {\n throw new SiteUnderMaintenanceExeption;\n }\n }\n}", "public static function add($ip)\n {\n //SELECT * FROM `ip2location_db11` WHERE INET_ATON('116.109.245.204') <= ip_to LIMIT 1\n\n $location = self::where('ip_address', '=', $ip)->first();\n if (!is_object($location)) {\n $location = new self();\n }\n $location->ip_address = $ip;\n\n // Get info\n try {\n if (!(strpos($ip, \":\") > -1))\n {\n // Code for IPv4 address $ip_address...\n $location_table = table('ip2location_db11');\n }\n else\n {\n // Code for IPv6 address $ip_address...ip2location_db11_ipv6\n $location_table = table('ip2location_db11_ipv6');\n }\n\n $location_tables = \\DB::select('SHOW TABLES LIKE \"'.$location_table.'\"');\n // Local service\n if (count($location_tables)) {\n // Check for ipv4 or ipv6\n if (!(strpos($ip, \":\") > -1)) {\n $aton = $ip;\n $records = \\DB::select(\"SELECT * FROM `\".$location_table.\"` WHERE INET_ATON(?) <= ip_to LIMIT 1\", [$aton]);\n } else {\n $aton = Dot2LongIPv6($ip);\n $records = \\DB::select(\"SELECT * FROM `\".$location_table.\"` WHERE ? <= ip_to LIMIT 1\", [$aton]);\n }\n\n if (count($records)) {\n $record = $records[0];\n $location->country_code = $record->country_code;\n $location->country_name = $record->country_name;\n $location->region_name = $record->region_name;\n $location->city = $record->city_name;\n $location->zipcode = $record->zip_code;\n $location->latitude = $record->latitude;\n $location->longitude = $record->longitude;\n } else {\n throw new \\Exception(\"IP address [$ip] can not be found in local database: \");\n }\n // Remote service\n } else {\n $result = file_get_contents('http://freegeoip.net/json/'.$ip);\n $values = json_decode($result, true);\n\n $location->fill($values);\n }\n } catch (\\Exception $e) {\n echo $e->getMessage();\n // Note log\n LaravelLog::warning('Cannot get IP location info: ' . $e->getMessage());\n }\n\n $location->save();\n\n return $location;\n }", "public function insertLocation($file, &$locationArr) {\n $fileStream = fopen($file, 'r');\n ini_set('auto_detect_line_endings', TRUE);\n //Skip the header\n fgetcsv($fileStream);\n //Gets the parent folder of passed in $file\n $verifiedFile = dirname($file) . '\\LocationVerified.csv';\n $fileErrors = array();\n $count = 1;\n $insertedRows = 0;\n while(($data = fgetcsv($fileStream)) !== FALSE) {\n $count++;\n $errors = Validator::validateLocation($data);\n if(empty($errors)) {\n //No error write to verified file\n $locationArr[] = $data[0];\n $newFile = fopen($verifiedFile, 'a');\n fputcsv($newFile, $data);\n fclose($newFile);\n $insertedRows++;\n } else {\n $fileErrors[] = new FileRowError($count, $errors);\n }\n }\n fclose($fileStream);\n $_SESSION['location-lookup.csv'] = $insertedRows;\n\n $dbConnectorInstance = DatabaseConnector::getInstance();\n $dbConnector = $dbConnectorInstance->getConnection();\n $sql = 'LOAD DATA LOCAL INFILE ? INTO TABLE location FIELDS TERMINATED BY \\',\\' LINES TERMINATED BY \\'\\n\\'';\n\n\n try {\n $stmt = $dbConnector->prepare($sql);\n $stmt->bindParam(1, $verifiedFile);\n $stmt->execute();\n } catch (PDOException $pdoEx) {\n $this->logger->error('Error loading data from local file. ', $pdoEx);\n $fileErrors = NULL;\n }\n\n //Delete verified file upon completion of uploading\n unlink($verifiedFile);\n\n return $fileErrors;\n }", "function save_user_loc($db, $user_id, $user_loc)\n{\n\ttry\n\t{\n\t\t$user_loc_tab = explode(',', $user_loc);\n\t\t$stmt = $db->conn->prepare(\"SELECT user_true_long, user_true_lat FROM profils WHERE user_id = :user_id\");\n\t\t$stmt->execute(array(':user_id'=>$user_id));\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\tif ($row['user_true_long'] != $user_loc_tab[1] || $row['user_true_lat'] != $user_loc_tab[0])\n\t\t{\n\t\t\t$stmt = $db->conn->prepare(\"UPDATE profils SET user_true_long = :user_long, user_true_lat = :user_lat, user_true_city = :user_city, user_true_city_code = :user_city_code, user_true_country = :user_country WHERE user_id = :user_id\");\n\t\t\t$stmt->execute(array(':user_id'=>$user_id, ':user_long'=>$user_loc_tab[1], ':user_lat'=>$user_loc_tab[0], ':user_city'=>$user_loc_tab[2], ':user_city_code'=>$user_loc_tab[3], ':user_country'=>$user_loc_tab[4]));\n\t\t}\n\t}\n\tcatch(PDOExeption $e)\n\t{\n\t\techo $e->getMessage();\n\t}\n}", "function test_deport_import_location()\n\t{\n\t\t$r = Item::get_by_slug(LOC_SLUG);\n\t\t// the pre condition ensures this will not be null\n\t\t$this->assertNotEqual($r, null);\n\t\t// delete it from the data base\n\t\t$r->sql_delete();\n\t\t// load it from the database and get NULL to verify its gone\n\t\t$r = Item::get_by_slug(LOC_SLUG);\n\t\t$this->assertEqual($r, null);\n\t\t// // now put it back in database - load from file and then insert\n\t\t$new_r = Item::get_by_trip_slug('rtw', LOC_SLUG);\n\t\t$new_r->sql_insert();\n\t\t// finally test it is in database\n\t\t$r = Item::get_by_slug(LOC_SLUG);\n\t\t$this->assertNotEqual($r, null);\n\t}", "public function insertLocation($data){\n\t\t$result = $this->db->insert('event_location', $data);\t// insert data into `users` table\n\t\treturn $result;\n }", "public function upsert($table, $data, $where, $bindWhereParams = array(), $seq_name = null) {\n $insertString = $this->_prepareInsertString($data);\n $updateString = $this->_prepareUpdateString($data);\n\n $insert = \"INSERT INTO {$table} ({$insertString['names']}) SELECT {$insertString['values']}\";\n $upsert = \"UPDATE {$table} SET $updateString WHERE $where\";\n\n $this->_sql = \"WITH upsert AS ({$upsert} RETURNING *) {$insert} WHERE NOT EXISTS (SELECT * FROM upsert)\";\n //die($this->_sql);\n\n $sth = $this->_prepareAndBind($data);\n $sth = $this->_prepareAndBind($bindWhereParams, $sth);\n $result = $sth->execute();\n\n $this->_handleError($result, __FUNCTION__);\n return ($this->_driver === \"mysql\") ? $this->lastInsertId() : $this->lastInsertId($seq_name);\n\n }", "function updateLocation($mysqli) {\r\n\t\t$sql = sprintf(\"UPDATE `Locations` SET \r\n\t\t\t\t\t\t`StreetAddress` = '%s',\r\n\t\t\t\t\t\t`PostalCode` = '%s',\r\n\t\t\t\t\t\t`City` = '%s',\r\n\t\t\t\t\t\t`StateProvince` = '%s'\r\n\t\t\t\t\t\tWHERE `LocationID` = %d\",\r\n\t\t\t\t\t\t$mysqli->real_escape_string($_POST['StreetAddress']),\r\n\t\t\t\t\t\t$mysqli->real_escape_string($_POST['PostalCode']),\r\n\t\t\t\t\t\t$mysqli->real_escape_string($_POST['City']),\r\n\t\t\t\t\t\t$mysqli->real_escape_string($_POST['StateProvince']),\r\n\t\t\t\t\t\t$mysqli->real_escape_string($_POST['LocationID']) );\r\n\r\n\t\tif (!$result = $mysqli->query($sql)) {\r\n\t\t\thttp_response_code(503);\r\n\t\t\techo '<h1>Database Error</h1>';\r\n\t\t\texit(1);\r\n\t\t}\r\n\r\n\t\theader('location: /?action=locations'); // terugkeren naar locations\r\n\t\texit();\r\n\t}", "public function postUpdate(\\Propel\\Runtime\\Connection\\ConnectionInterface $con = null) {\n parent::postUpdate($con);\n SearchLocation::prepareForLocation($this, SearchLocationQuery::create()->findPk($this->getId()))\n ->save($con);\n }", "function updateAddress($existingAddressID, $newAddressGroup_id, $fullname, $address, $email, $phone, $website, $birthday, $image)\n{ \n $db = dbconnect();\n \n $stmt = $db->prepare(\"UPDATE address SET address_group_id = :newAddressGroup_id, fullname = :fullname, address = :address, email = :email, phone = :phone, website = :website, birthday = :birthday, image = :image WHERE address_id = :existingAddressID\");\n\n $binds = array(\n \n \":existingAddressID\" => $existingAddressID,\n \":newAddressGroup_id\" => $newAddressGroup_id,\n \":fullname\" => $fullname,\n \":address\" => $address,\n \":email\" => $email, \n \":phone\" => $phone, \n \":website\" => $website, \n \":birthday\" => $birthday, \n \":image\" => $image \n );\n\n if ($stmt->execute($binds) && $stmt->rowCount() > 0) \n {\n return true;\n }\n else \n {\n return false;\n } \n}", "public function addUserLocation ($location)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET location = ? WHERE id = ?\");\n\t\t$Statement->execute(array($location, $this->id));\n\t}", "function phpTrafficA_addUniqueIP($table, $connection, $ip, $datefirst, $datelast) {\n$long = ip2long($ip);\n$sql3 = \"UPDATE ${table}_iplist SET count=count+1,last='$datelast' WHERE ip=$long\";\n$res3 = mysql_query($sql3);\nif (mysql_affected_rows() < 1) {\n\t$req4 =\"INSERT INTO ${table}_iplist SET ip=$long, first='$datefirst', last='$datelast', count='1'\";\n\t$res4 = mysql_query($req4);\n}\nreturn 1;\n}", "public function add_to_database( $locationData, $duplicates_handling = 'none', $skipGeocode = false ) {\n\n\t\t\t/**\n\t\t\t * FILTER: slp_add_location_init_code\n\t\t\t */\n\t\t\t$return_code = apply_filters( 'slp_add_location_init_code' , '' );\n\t\t\tif ( ! empty( $return_code ) ) {\n\t\t\t\treturn $return_code;\n\t\t\t}\n\t\t\t\n\t\t\t$add_mode = ( $duplicates_handling === 'add' );\n\n\t\t\t// Add Mode : skip lots of duplication checking stuff\n\t\t\t//\n\t\t\tif ( $add_mode ) {\n\t\t\t\t$locationData['sl_id'] = null;\n\t\t\t\t$return_code = 'added';\n\n\t\t\t\t// Update, skip, etc. modes need to check for duplicates\n\t\t\t\t//\n\t\t\t} else {\n\n\t\t\t\t// Make sure locationData['sl_id'] is set to SOMETHING.\n\t\t\t\t//\n\t\t\t\tif ( ! isset( $locationData['sl_id'] ) ) {\n\t\t\t\t\t$locationData['sl_id'] = null;\n\t\t\t\t}\n\n\t\t\t\t// If the incoming location ID is of a valid format...\n\t\t\t\t// Go fetch that location record.\n\t\t\t\t// This also ensures that ID actually exists in the database.\n\t\t\t\t//\n\t\t\t\tif ( $this->slplus->currentLocation->isvalid_ID( $locationData['sl_id'] ) ) {\n\t\t\t\t\t$this->slplus->currentLocation->set_PropertiesViaDB( $locationData['sl_id'] );\n\t\t\t\t\t$locationData['sl_id'] = $this->slplus->currentLocation->id;\n\n\t\t\t\t\t// Not a valid incoming ID, reset current location.\n\t\t\t\t\t//\n\t\t\t\t} else {\n\t\t\t\t\t$this->slplus->currentLocation->reset();\n\t\t\t\t}\n\n\t\t\t\t// If the location ID is not valid either because it does not exist\n\t\t\t\t// in the database or because it was not provided in a valid format,\n\t\t\t\t// Go see if the location can be found by name + address\n\t\t\t\t//\n\t\t\t\tif ( ! $this->slplus->currentLocation->isvalid_ID() ) {\n\t\t\t\t\t$locationData['sl_id'] = $this->slplus->db->get_var(\n\t\t\t\t\t\t$this->slplus->db->prepare(\n\t\t\t\t\t\t\t$this->slplus->database->get_SQL( 'selectslid' ) .\n\t\t\t\t\t\t\t'WHERE ' .\n\t\t\t\t\t\t\t'sl_store = %s AND ' .\n\t\t\t\t\t\t\t'sl_address = %s AND ' .\n\t\t\t\t\t\t\t'sl_address2= %s AND ' .\n\t\t\t\t\t\t\t'sl_city = %s AND ' .\n\t\t\t\t\t\t\t'sl_state = %s AND ' .\n\t\t\t\t\t\t\t'sl_zip = %s AND ' .\n\t\t\t\t\t\t\t'sl_country = %s '\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t$this->val_or_blank( $locationData, 'sl_store' ),\n\t\t\t\t\t\t\t$this->val_or_blank( $locationData, 'sl_address' ),\n\t\t\t\t\t\t\t$this->val_or_blank( $locationData, 'sl_address2' ),\n\t\t\t\t\t\t\t$this->val_or_blank( $locationData, 'sl_city' ),\n\t\t\t\t\t\t\t$this->val_or_blank( $locationData, 'sl_state' ),\n\t\t\t\t\t\t\t$this->val_or_blank( $locationData, 'sl_zip' ),\n\t\t\t\t\t\t\t$this->val_or_blank( $locationData, 'sl_country' )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Location ID exists, we have a duplicate entry...\n\t\t\t\t//\n\t\t\t\tif ( $this->slplus->currentLocation->isvalid_ID( $locationData['sl_id'] ) ) {\n\t\t\t\t\tif ( $duplicates_handling === 'skip' ) {\n\t\t\t\t\t\treturn 'skipped';\n\t\t\t\t\t}\n\n\t\t\t\t\t// array ID and currentLocation ID do not match,\n\t\t\t\t\t// must have found ID via address lookup, go load up the currentLocation record\n\t\t\t\t\t//\n\t\t\t\t\tif ( $locationData['sl_id'] != $this->slplus->currentLocation->id ) {\n\t\t\t\t\t\t$this->slplus->currentLocation->set_PropertiesViaDB( $locationData['sl_id'] );\n\t\t\t\t\t}\n\n\t\t\t\t\t$return_code = 'updated';\n\n\t\t\t\t\t// Location ID does not exist, we are adding a new record.\n\t\t\t\t\t//\n\t\t\t\t} else {\n\t\t\t\t\t$duplicates_handling = 'add';\n\t\t\t\t\t$return_code = 'added';\n\t\t\t\t}\n\n\t\t\t\t// Update mode and we are NOT skipping the geocode process,\n\t\t\t\t// check that the address has changed first.\n\t\t\t\t//\n\t\t\t\tif ( ! $skipGeocode && ( $duplicates_handling === 'update' ) ) {\n\t\t\t\t\t$skipGeocode =\n\t\t\t\t\t\t( $this->val_or_blank( $locationData, 'sl_address' ) == $this->slplus->currentLocation->address ) &&\n\t\t\t\t\t\t( $this->val_or_blank( $locationData, 'sl_address2' ) == $this->slplus->currentLocation->address2 ) &&\n\t\t\t\t\t\t( $this->val_or_blank( $locationData, 'sl_city' ) == $this->slplus->currentLocation->city ) &&\n\t\t\t\t\t\t( $this->val_or_blank( $locationData, 'sl_state' ) == $this->slplus->currentLocation->state ) &&\n\t\t\t\t\t\t( $this->val_or_blank( $locationData, 'sl_zip' ) == $this->slplus->currentLocation->zip ) &&\n\t\t\t\t\t\t( $this->val_or_blank( $locationData, 'sl_country' ) == $this->slplus->currentLocation->country );\n\t\t\t\t}\n\n\t\t\t\t// If the address matches, make sure we retain the existing lat/long.\n\t\t\t\t//\n\t\t\t\tif ( $skipGeocode ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! isset( $locationData['sl_latitude'] ) ||\n\t\t\t\t\t\t! $this->slplus->currentLocation->is_valid_lat( $locationData['sl_latitude'] )\n\t\t\t\t\t) {\n\t\t\t\t\t\t$locationData['sl_latitude'] = $this->slplus->currentLocation->latitude;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\t! isset( $locationData['sl_longitude'] ) ||\n\t\t\t\t\t\t! $this->slplus->currentLocation->is_valid_lng( $locationData['sl_longitude'] )\n\t\t\t\t\t) {\n\t\t\t\t\t\t$locationData['sl_longitude'] = $this->slplus->currentLocation->longitude;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set the current location data\n\t\t\t//\n\t\t\t// In update duplicates mode this will not obliterate existing settings\n\t\t\t// it will augment them. To set a value to blank for an existing record\n\t\t\t// it must exist in the column data and be set to blank.\n\t\t\t//\n\t\t\t// Non-update mode, it starts from a blank slate.\n\t\t\t//\n\t\t\t$this->slplus->currentLocation->set_PropertiesViaArray( $locationData, $duplicates_handling );\n\n\t\t\t// HOOK: slp_location_add\n\t\t\t//\n\t\t\tdo_action( 'slp_location_add' );\n\n\t\t\t// Geocode the location\n\t\t\t//\n\t\t\tif ( ! $skipGeocode ) {\n\t\t\t\t$this->do_geocoding();\n\t\t\t}\n\n\t\t\t// Write to disk\n\t\t\t//\n\t\t\tif ( $this->dataChanged ) {\n\t\t\t\t$this->MakePersistent();\n\n\t\t\t\t// Set not updated return code.\n\t\t\t\t//\n\t\t\t} else {\n\t\t\t\t$return_code = 'not_updated';\n\t\t\t}\n\n\t\t\t// HOOK: slp_location_added\n\t\t\t//\n\t\t\tdo_action( 'slp_location_added' );\n\n\t\t\treturn $return_code;\n\t\t}", "protected function update()\n {\n $database = cbSQLConnect::connect('object');\n if (isset($database))\n {\n $fields = self::$db_fields;\n foreach($fields as $key)\n {\n $flag = $database->SQLUpdate(\"place\", $key, $this->{$key}, \"id\", $this->id);\n if ($flag == \"fail\")\n {\n break;\n }\n }\n if ($flag == \"fail\")\n {\n return false;\n }\n else\n return $this->id;\n }\n }", "function update($table, $sql, $location) {\n global $conn;\n\n $query = \"update {$table} \" . $sql;\n\n try {\n if($conn->query($query))\n echo '<META HTTP-EQUIV=REFRESH CONTENT=\"1; ' . $location . '\">';\n else {\n throw new Exception(\"updating data failed\");\n }\n } catch(Exception $e) {\n echo \"Error: {$e->getMessage()}\";\n }\n }", "private function insertTOlocationTable($LocationID,$geolocationComponent,$EventID){\n try{\n\n if($stmt=$this->DataBaseCon->prepare(\"INSERT INTO LocationDataSet (LocationID,Address,City,State,Country,EventID) VALUE (?,?,?,?,?,?)\")){\n $stmt->bind_param('ssssss',$LocationID,$geolocationComponent['completeAddress'],$geolocationComponent['city'],$geolocationComponent['state'],$geolocationComponent['country'],$EventID);\n $stmt->execute();\n $stmt->close();\n return true;\n }\n else{\n return false;\n }\n\n }catch(Expection $e){\n return false;\n }\n }", "public function testSaveIpFailed()\n {\n $this->location->ip = 'This is not valid IP address';\n $this->expectException(DatabaseException::class);\n $this->location->save();\n }", "public function update(Location $location, array $input)\n {\n \tif ($location->update($input))\n return true;\n\n throw new GeneralException(trans('exceptions.backend.locations.update_error'));\n }", "public function add_or_update()\n {\n $this->on_duplicate_key('foo = foo + 1');\n $this->insert('table', array('foo' => 'bar'));\n }", "public function testReturnsLocationByIpFromLocationModel()\n {\n $ip = '123';\n $locationData = ['region_name' => 'test1'];\n\n $location = new Varien_Object;\n $location->setData($locationData);\n\n $this->_mockLocationModelForLoadingLocationByIp($ip, $location);\n\n $modelRelationMock = $this->getModelMock(\n 'oggetto_geodetection/location_relation_fetcher', ['isRegionConnected']\n );\n\n $modelRelationMock->expects($this->once())\n ->method('isRegionConnected')\n ->with($locationData['region_name'])\n ->willReturn(true);\n\n $this->replaceByMock('model', 'oggetto_geodetection/location_relation_fetcher', $modelRelationMock);\n\n\n $this->assertEquals($locationData, $this->_model->getLocationByIp($ip));\n }", "public function insert_location() {\n $location_id = $this->auth->generator(15);\n\n $data = array(\n 'location_id' => $location_id,\n 'location_name' => $this->input->post('location_name'),\n 'status' => 1\n );\n\n $result = $this->Locations->location_entry($data);\n\n if ($result == TRUE) {\n $this->session->set_userdata(array('message' => display('successfully_added')));\n if (isset($_POST['add-customer'])) {\n redirect(base_url('Clocation/manage_location'));\n } elseif (isset($_POST['add-customer-another'])) {\n redirect(base_url('Clocation'));\n }\n } else {\n $this->session->set_userdata(array('error_message' => display('already_inserted')));\n redirect(base_url('Clocation'));\n }\n }", "public function writeToDatabase( $latitude, $longitude, $forecast ){\n\n // check for existing location\n try {\n $query = $this->pdo->prepare(\"\n SELECT\n id,\n latitude,\n longitude\n FROM\n $this->dbname.locations\n WHERE\n latitude = ? AND longitude = ?\n \");\n\n $query->execute([ $latitude, $longitude ]);\n $result = $query->fetch(\\PDO::FETCH_ASSOC);\n }\n catch(PDOException $error) {\n echo $error->getMessage() . \"\\n\";\n }\n\n // get id or insert if not exists\n if( !empty($result) ){\n $location_id = $result['id'];\n }\n else{\n try {\n $query = $this->pdo->prepare(\"\n INSERT INTO\n $this->dbname.locations (latitude, longitude, last_forecast_update)\n VALUES\n (?, ?, ?)\n \");\n $query->execute( [$latitude, $longitude, $forecast['time']] );\n $location_id = $this->pdo->lastInsertId();\n }\n catch(PDOException $error) {\n echo $error->getMessage() . \"\\n\";\n }\n }\n\n // save latest forecast\n try {\n $query = $this->pdo->prepare(\"\n INSERT INTO\n $this->dbname.forecasts (location_id, time, temperature, precipitation_intensity, precipitation_probability)\n VALUES (?, ?, ?, ?, ?)\n \");\n $query->execute([\n $location_id,\n $forecast['time'],\n $forecast['temperature'],\n $forecast['precipIntensity'],\n $forecast['precipProbability']\n ]);\n }\n catch(PDOException $error) {\n echo $error->getMessage() . \"\\n\";\n }\n $query = null;\n }", "function update_main( $table, $objGeoIP ) {\n\t\t\t\tglobal $wpdb;\n\n\t\t\t\t//Modify each record to include country based on IP\n\t\t\t\t$q2 = \"SELECT id, user_id FROM `\" . $table . \"` WHERE country_code IS NULL LIMIT 1000\";\n\t\t\t\t$r2 = $wpdb->query( $q2 );\n\n\t\t\t\t$changed = false;\n\t\t\t\twhile ( $a2 = $wpdb->fetchNextAssoc( $r2 ) ) {\n\t\t\t\t\t$changed = true;\n\t\t\t\t\t$country = \"not found\";\n\t\t\t\t\t$country_code = null;\n\t\t\t\t\t$ip = explode( \"~\", $a2['user_id'], 2 );\n\n\t\t\t\t\t$objGeoIP->search_ip( $ip[0] );\n\t\t\t\t\tif ( $objGeoIP->found() ) {\n\t\t\t\t\t\t$country = $objGeoIP->getCountryName();\n\t\t\t\t\t\t$country_code = $objGeoIP->getCountryCode();\n\t\t\t\t\t\t$objGeoIP->clear();\n\t\t\t\t\t}\n\n\t\t\t\t\t$country = HMTrackerFN::hmtracker_secure( $country );\n\t\t\t\t\t$country_code = HMTrackerFN::hmtracker_secure( $country_code );\n\t\t\t\t\t$q3 = \"UPDATE $table SET country = '$country', country_code = '$country_code' WHERE id = {$a2['id']}\";\n\t\t\t\t\t$wpdb->query( $q3 );\n\t\t\t\t\tif ( $error = $wpdb->last_error() ) {\n\t\t\t\t\t\tdie( $error );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $changed;\n\t\t\t}", "function insertLocation($uid,$tid,$latitude,$long,$area,$continent,$country,$pcode)\n {\n $sql = sprintf(\"INSERT INTO `location` (\n `uid` ,\n `tid` ,\n `latitude` ,\n `longitude`,\n `area`,\n `continent`,\n `country`,\n `pcode`\n )\n VALUES (\n '%d','%d','%s','%s','%s','%s','%s','%s'\n );\",\n $uid,$tid, $latitude, $long, $this->db->escape($area), $this->db->escape($continent), $this->db->escape($country), $this->db->escape($pcode)\n );\n $this->db->query($sql);\n }", "function update () {\n\t\t\t$update = $this->db->prepare(\n\t\t\t\t\"UPDATE LOCATED SET\n\t\t\t\t\tnameLocation = ?, \n\t\t\t\t\tidArt = ?\n\t\t\t\tWHERE nameLocation = ? AND idArt = ?\");\n\t\t\treturn $update->execute(array($this->nameLocation, $this->idArt, \n\t\t\t\t$this->nameLocation, $this->idArt));\n\t\t}", "public function update($location): void\n {\n $sql = \"UPDATE {$this->table} SET \";\n $sql .= \"description = :description \";\n $sql .= \"WHERE id = :id;\";\n\n DBConnection::getInstance()\n ->prepare($sql)\n ->execute([\n \"description\" => $location->getDescription(),\n \"id\" => $location->getId()\n ]);\n }", "function update_event($event_data, $location_data, $tag_data, $group_data) {\n\t\t//Check if location is in database\n\t\t$this->db->start_cache();\n\t\t$this->db->where('address_one', $location_data['address_one']);\n\t\t$this->db->where('address_two', $location_data['address_two']);\n\t\t$this->db->where('zipcode', $location_data['zipcode']);\n\t\t$loc_query = $this->db->get('location');\n\t\t$this->db->stop_cache();\n\t\t$this->db->flush_cache();\n\n\t\t//If location isnt in database yet\n\t\tif ($loc_query->num_rows() == 0){\n\t\t\t//get geocode from google if not in db\n\t\t\t$geocode = $this->getGeo(\n\t\t\t\t$location_data['address_one'] . \" \" .\n\t\t\t\t$location_data['address_two'] . \" \".\n\t\t\t\t$location_data['zipcode']\n\t\t\t\t);\n\t\t\tif (isset($geocode) && $geocode) {\n\t\t\t\t//add geocodes to address before insert\n\t\t\t\t$location_data['geolat'] = $geocode['lat'];\n\t\t\t\t$location_data['geolng'] = $geocode['lng'];\n\t\t\t\t$location_data['city'] = $geocode['city'];\n\t\t\t\t$location_data['state'] = $geocode['state'];\n\t\t\t\t//new location in db\n\t\t\t\t$location_success = $this->db->insert('location', $location_data);\n\t\t\t\t$location_id = $this->db->insert_id();\n\t\t\t} \n\t\t} else { //old location\n\t\t\t$locResult = $loc_query->result();\n\t\t\t$location_id = $locResult[0]->location_id;\n\t\t\t$location_success = true;\n\t\t}\n\t\t// Check that we have a valid location before updating db\n\t\tif ($location_success) {\n\t\t\t// Get the event ID for this event\n\t\t\t$event_id = $event_data['event_id'];\n\n\t\t\t// update the event table with current data\n\t\t\t$this->db->where('event_id',$event_id);\n\t\t\t$event_success = $this->db->update('event',$event_data);\n\n\t\t\t//event_location\n\t\t\t$event_location_success = $this->db->query('UPDATE event_location\n\t\t\t\t\t\t\t\tSET location_id = '.$location_id.'\n\t\t\t\t\t\t\t\tWHERE event_id = \"'.$event_id.'\"');\n\n\t\t\t// Get the tag ID\n\t\t\t$this->db->like('tag_title', $tag_data['tag_title']);\n\t\t\t$query = $this->db->get('tag');\n\t\t\t$tag_id_array = $query->result();\n\t\t\t$tag_id = $tag_id_array[0]->tag_id;\n\t\t\t$event_tag_success = $this->db->query('UPDATE event_tag\n\t\t\t\t\t\t\t\tSET tag_id = '.$tag_id.'\n\t\t\t\t\t\t\t\tWHERE event_id = \"'.$event_id.'\"');\n\t\t\t\n\t\t\t// organization_event\n\t\t\t$this->db->where('event_id', $event_id);\n\t\t\t$org_event_query = $this->db->get('organization_event');\n\t\t\tif ($org_event_query->num_rows() == 0 && is_numeric($group_data['org_id'])) {\n\t\t\t\t$group_success = $this->db->insert('organization_event', $group_data);\n\t\t\t} else {\n\t\t\t\tif (is_numeric($group_data['org_id'])) {\n\t\t\t\t\t$group_success = $this->db->query('UPDATE organization_event\n\t\t\t\t\t\t\t\t\tSET org_id = '.$group_data['org_id'].'\n\t\t\t\t\t\t\t\t\tWHERE event_id = \"'.$event_id.'\"');\n\t\t\t\t} else {\n\t\t\t\t\t$this->db->where('event_id', $event_id);\n\t\t\t\t\t$this->db->delete('organization_event');\n\t\t\t\t\t$group_success = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// return true only if all updates were successful\n\t\t\treturn ($event_success &&\n\t\t\t\t$event_location_success &&\n\t\t\t\t$event_tag_success &&\n\t\t\t\t$group_success);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function update(Request $request,$id)\n {\n //\n $this->validate($request,[\n 'location' => 'required|unique:tbllocation'. ',id,' . $id,\n 'address' => 'required'\n ]);\n $loc = Location::find($id);\n\n $loc ->location = $request->input('location');\n $loc->address=$request->input('address');\n $loc->save();\n return redirect('/loc')->with('success','Location Updated');\n\n }", "abstract public function update(Request $request, Location $location): JsonResponse;", "public function prepareUpdate() {\n $this->connection->update($this->mapTable)\n ->fields(array('needs_update' => MigrateMap::STATUS_NEEDS_UPDATE))\n ->execute();\n }", "public function save()\n {\n return $this->address_srl ? $this->repo->update($this) : $this->repo->insert($this);\n }", "public function setGeolocation($user_id, $latitude, $longitude, $height)\n {\n $query = \"INSERT INTO geolocation(user_id, latitude, longitude, height, updated_at)\n VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP)\n ON DUPLICATE KEY\n UPDATE latitude=VALUES(latitude), longitude=VALUES(longitude),\n height=VALUES(height), updated_at=CURRENT_TIMESTAMP\";\n $stmt = $this->conn->prepare($query);\n $stmt->bind_param(\"iddd\", $user_id, $latitude, $longitude, $height);\n $result = $stmt->execute();\n $stmt->close();\n\n return $result;\n }", "public function create_location($location_name)\n {\n $location=array('location_id'=>NULL,\n 'name'=>$location_name);\n\n if( !$this->db->insert('Location',$location))\n {\n return FALSE;\n }\n\n return $this->db->insert_id();\n }", "public function postInsert(\\Propel\\Runtime\\Connection\\ConnectionInterface $con = null) {\n parent::postInsert($con);\n SearchLocation::prepareForLocation($this, new SearchLocation())\n ->save($con);\n }", "public function getLocationId($location) {\r\n\t\tglobal $xname, $languages;\r\n\t\t$exists\t\t= false;\r\n\t\t\r\n\t\t// Check to see if exists in localidades table\r\n\t\t$localidadesQuery\t= \"SELECT id FROM {$xname}_localidades WHERE nombre = '{$location}'\";\r\n\t\t$localidadesSql\t\t= $this->db->query($localidadesQuery);\r\n\t\t\r\n\t\tif (is_object($localidadesSql) && $localidadesSql!='') {\r\n\t\t\t$localidadesRow\t\t= $localidadesSql->fetch_object();\r\n\t\t\tif (is_object($localidadesRow)) {\r\n\t\t\t\t$currentId \t\t\t= $localidadesRow->id;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// Check to see if in new_entries table\r\n\t\t\t$entriesQuery\t= \"SELECT converted_id FROM {$xname}_new_entries WHERE entry = '{$location}'\";\r\n\t\t\t$entriesSql\t\t= $this->db->query($entriesQuery);\r\n\t\t\t\r\n\t\t\tif ($entriesSql) {\r\n\t\t\t\t$entriesRow\t\t= $entriesSql->fetch_object();\t\t\t\r\n\t\t\t\t$currentId \t\t= $entriesRow->converted_id;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// If it already exists in either localidades or new_entries, we return it, otherwise we enter it into both tables\r\n\t\tif (!empty($currentId)) {\r\n\t\t\t// Exists, so return id\r\n\t\t\treturn $currentId;\r\n\t\t} else {\r\n\t\t\t// Add it to table\r\n\t\t\t$insert\t= array();\r\n\t\t\tforeach ($languages as $l) {\r\n\t\t\t\t$insert['nombre'] = $location;\r\n\t\t\t}\r\n\t\t\t$newId = $this->db->insertQuery($insert, $xname . '_localidades');\r\n\t\t\t$this->log->write(Logger::INFO, 'New location: ' . $location);\r\n\t\t\t\r\n\t\t\t// Now add to new_entries table\r\n\t\t\t$insert\t\t\t\t\t= array();\r\n\t\t\t$insert['tabla']\t\t= $xname.'_localidades';\r\n\t\t\t$insert['entry']\t\t= $location;\r\n\t\t\t$insert['new_id']\t\t= $newId;\r\n\t\t\t$this->db->insertQuery($insert, $xname.'_new_entries');\r\n\t\t\treturn $insert['new_id'];\r\n\t\t}\r\n\t\t \r\n\t }", "function create_location($connection , $organization_id , $primary , $address , $city , $state , $zip , $latitude , $longitude , $email1 = \"\", $email2 = \"\", $phone1 = \"\", $phone2 = \"\")\n{\n\t$sql = \"insert into organization_location set organization_id ={$organization_id}, primary ={$primary}, address ='{$address}', city ='{$city}', state ='{$state}', zip ='{$zip}', latitude = {$latitude}, longitude = {$longitude}, modified_time = now()\";\n\tif($email1 != \"\")\n\t\t$sql = $sql.\", email1 = '{$email1}'\";\n\tif($email2 != \"\")\n\t\t$sql = $sql.\", email2 = '{$email2}'\";\n\tif($phone1 != \"\")\n\t\t$sql = $sql.\", phone1 = '{$phone1}'\";\n\tif($phone2 != \"\")\n\t\t$sql = $sql.\", phone2 = '{$phone2}'\";\n\t$db_selected = mysql_select_db(Secure::DB_DATABASE, $connection);\n\n\tif(!($resource = @ mysql_query($sql, $connection)))\n\t\tshowerror();\n\t\t//echo $sql;\n\telse\n\t{\n\t\tif(!($return_values = @ mysql_query(\"select location_id from organization_location order by location_id DESC limit 1\", $connection)))\n\t\t\tshowerror();\n\t\telse\n\t\t{\n\t\t\t$return = mysql_fetch_array($return_values);\n\t\t\treturn $return[0];\n\t\t}\n\t}\n}", "function update_r1097() {\n\n\t$r = q(\"select hubloc_id, hubloc_addr from hubloc where hubloc_addr like '%%/%%'\");\n\tif($r) {\n\t\tforeach($r as $rr) {\n\t\t\tq(\"update hubloc set hubloc_addr = '%s' where hubloc_id = %d limit 1\",\n\t\t\t\tdbesc(substr($rr['hubloc_addr'],0,strpos($rr['hubloc_addr'],'/'))),\n\t\t\t\tintval($rr['hubloc_id'])\n\t\t\t);\n\t\t}\n\t}\n\treturn UPDATE_SUCCESS;\n\t\n}", "public function insertPoi($instance_id, $poi_id, $lon, $lat)\n {\n $poi_id = (int) $poi_id;\n $q = \"\n\t\tINSERT INTO poi(instance_id,poi_id, geom)\n\t\tVALUES('$instance_id','$poi_id', ST_GeomFromText('POINT($lon $lat )', 4326))\n\t\tON CONFLICT (instance_id,poi_id) DO\n\t\t UPDATE SET geom=ST_GeomFromText('POINT($lon $lat )', 4326)\n\t\t;\";\n $this->execute($q);\n }", "function createInsertToDatabase($uniqueid, $url) {\n $db = connect_to_database();\n $sql = <<<EOD\n UPDATE shortenerLogs SET ip=?, link=?, views=0 WHERE id=?\nEOD;\n\n $stmt = $db->prepare($sql);\n $params = [$_SERVER['REMOTE_ADDR'], $url, $uniqueid];\n $stmt->execute($params);\n $res = $stmt->rowCount();\n\n if ($res == 0) {\n $sql = <<<EOD\n INSERT INTO shortenerLogs (id, ip, link, views) VALUES (?, ?, ?, 0);\nEOD;\n\n $stmt = $db->prepare($sql);\n $params = [$uniqueid, $_SERVER['REMOTE_ADDR'], $url];\n $stmt->execute($params);\n }\n}", "public function saveShippingRule($shipping_method ,$row, $locations, $shippingZoneId){\n $row['min'] = str_replace(',', '.', $row['min']);\n $row['max'] = str_replace(',', '.', $row['max']);\n $row['cost'] = str_replace(',', '.', $row['cost']);\n $rule = array(\n 'id' => $row['id'],\n 'countryId' => 'PT',\n 'minPostCode' => null,\n 'maxPostCode' => null,\n 'min' => doubleval($row['min']),\n 'max' => doubleval($row['max']),\n 'ruleCriteria' => $row['ruleCriteria'],\n 'cost' => $row['cost'],\n 'shippingMethod' => $shipping_method,\n 'shippingZoneId' => $shippingZoneId,\n );\n $row_id= $this->insert_into_shipping_prices($rule);\n\n return $row_id;\n }", "public function saveInformationAction() {\r\n $photo_id = $this->_getParam('photo_id');\r\n $title = $this->_getParam('title', null);\r\n $description = $this->_getParam('description', null);\r\n $location = $this->_getParam('location', null);\r\n if (($this->_getParam('lat')) && ($this->_getParam('lng')) && $this->_getParam('lat', '') != '' && $this->_getParam('lng', '') != '') {\r\n $dbGetInsert = Engine_Db_Table::getDefaultAdapter();\r\n $dbGetInsert->query('INSERT INTO engine4_sesbasic_locations (resource_id, lat, lng , resource_type) VALUES (\"' . $photo_id . '\", \"' . $this->_getParam('lat') . '\",\"' . $this->_getParam('lng') . '\",\"sesvideo_chanelphoto\")\tON DUPLICATE KEY UPDATE\tlat = \"' . $this->_getParam('lat') . '\" , lng = \"' . $this->_getParam('lng') . '\"');\r\n }\r\n Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->update(array('title' => $title, 'description' => $description, 'location' => $location), array('chanelphoto_id = ?' => $photo_id));\r\n }", "public function save () {\n\t\t\t$insert = $this->db->prepare(\"INSERT INTO LOCATED(nameLocation, idArt) \n\t\t\t\tVALUES (?, ?)\");\n\t\t\treturn $insert->execute(array($this->nameLocation, $this->idArt));\n\t\t}", "function insert_slash_update($tbl, $data, $field, $id,$where){\n $this->db->where($where);\n $q = $this->db->get($tbl);\n if ( $q->num_rows() > 0 )\n {\n $this->db->where($field,$id);\n $this->db->update($tbl,$data);\n $affectedRows = $this->db->affected_rows();\n if($affectedRows){\n return TRUE;\n }else{\n return FALSE;\n }\n } else {\n $this->db->set($field, $id);\n $this->db->insert($tbl,$data);\n $insertedID = $this->db->insert_id();\n if($insertedID > 0){\n return TRUE;\n }else{\n return FALSE;\n }\n }\n }", "function store()\n {\n $db =& eZDB::globalDatabase();\n $db->begin();\n \n $ret = false;\n if ( $this->CountryID <= 0 )\n $country_id = \"NULL\";\n else\n $country_id = \"$this->CountryID\";\n\n $street1 = $db->escapeString( $this->Street1 );\n $street2 = $db->escapeString( $this->Street2 );\n $name = $db->escapeString( $this->Name );\n $place = $db->escapeString( $this->Place );\n if ( !isSet( $this->ID ) )\n {\n $db->lock( \"eZAddress_Address\" );\n\t\t\t$this->ID = $db->nextID( \"eZAddress_Address\", \"ID\" );\n $res[] = $db->query( \"INSERT INTO eZAddress_Address\n (ID, Street1, Street2, Zip, Place, CountryID, AddressTypeID, Name)\n VALUES\n ('$this->ID',\n '$street1',\n '$street2',\n '$this->Zip',\n '$place',\n '$country_id',\n '$this->AddressTypeID',\n '$name')\" );\n $db->unlock();\n $ret = true;\n }\n else\n {\n $res[] = $db->query( \"UPDATE eZAddress_Address\n SET Street1='$street1',\n Street2='$street2',\n Zip='$this->Zip',\n Place='$place',\n AddressTypeID='$this->AddressTypeID',\n Name='$name',\n CountryID=$country_id\n WHERE ID='$this->ID'\" ); \n $ret = true; \n }\n\n eZDB::finish( $res, $db );\n return $ret;\n }", "function edit_organization_location($connection , $location_id ,$organization_id =\"\", $primary =\"\", $address =\"\", $city =\"\", $state =\"\", $zip =\"\", $latitude = \"\", $longitude = \"\", $email1 = \"\", $email2 = \"\", $phone1 =\"\", $phone2 = \"\", $modified_by = \"\")\n{\n\t$sql = \"update organization_location set modified_time = now()\";\n\tif($organization_id != \"\")\n\t\t$sql .= \", organization_id ={$organization_id}\";\n\tif($primary != \"\")\n\t\t$sql .= \", primary ={$primary}\";\n\tif($address != \"\")\n\t\t$sql .= \", address ='{$address}'\";\n\tif($city != \"\")\n\t\t$sql .= \", city ='{$city}'\";\n\tif($state != \"\")\n\t\t$sql .= \", state ='{$state}'\";\n\tif($zip != \"\")\n\t\t$sql .= \", zip ='{$zip}'\";\n\tif($phone_1 != \"\")\n\t\t$sql .= \", phone1 =='{$phone1}'\";\n\tif($latitude != \"\" && $longitude != \"\")\n\t\t$sql = $sql.\", latitude = {$latitude}, longitude = {$longitude}\";\n\tif($email1 != \"\")\n\t\t$sql = $sql.\", email1 = '{$email1}'\";\n\tif($email2 != \"\")\n\t\t$sql = $sql.\", email2 = '{$email2}'\";\n\tif($phone2 != \"\")\n\t\t$sql = $sql.\", phone2 = '{$phone2}'\";\n\tif($modified_by != \"\")\n\t\t$sql = $sql.\", modified_by = {$modified_by}\";\n\t$sql .= \" where location_id = {$location_id}\";\n\t$db_selected = mysql_select_db(Secure::DB_DATABASE, $connection);\n\n\tif(!($resource = @ mysql_query($sql, $connection)))\n\t\tshowerror();\n\t\t//echo $sql;\n\telse\n\t\treturn $resource;\n}", "public function MakePersistent() {\n\t\t\t$dataWritten = true;\n\t\t\t$dataToWrite = array_reduce( $this->dbFields, array( $this, 'mapPropertyToField' ) );\n\n\t\t\t// sl_id int field blank, unset it we will insert a new auto-int record\n\t\t\t//\n\t\t\tif ( empty( $dataToWrite['sl_id'] ) ) {\n\t\t\t\tunset( $dataToWrite['sl_id'] );\n\t\t\t}\n\n\t\t\t// sl_last_upated is blank, unset to get auto-date value\n\t\t\t//\n\t\t\tif ( empty( $dataToWrite['sl_lastupdated'] ) ) {\n\t\t\t\tunset( $dataToWrite['sl_lastupdated'] );\n\t\t\t}\n\n\t\t\t// sl_linked_postid is blank, set it to 0\n\t\t\t//\n\t\t\tif ( empty( $dataToWrite['sl_linked_postid'] ) ) {\n\t\t\t\t$dataToWrite['sl_linked_postid'] = 0;\n\t\t\t}\n\n\t\t\t// Location is set, update it.\n\t\t\t//\n\t\t\tif ( $this->id > 0 ) {\n\t\t\t\tif ( ! $this->slplus->db->update( $this->slplus->database->info['table'], $dataToWrite, array( 'sl_id' => $this->id ) ) ) {\n\t\t\t\t\t$dataWritten = false;\n\t\t\t\t}\n\n\t\t\t\t// No location, add it.\n\t\t\t\t//\n\t\t\t} else {\n\t\t\t\tif ( ! $this->slplus->db->insert( $this->slplus->database->info['table'], $dataToWrite ) ) {\n\t\t\t\t\t$this->slplus->notifications->add_notice(\n\t\t\t\t\t\t'warning',\n\t\t\t\t\t\tsprintf( __( 'Could not add %s as a new location', 'store-locator-le' ), $this->store )\n\t\t\t\t\t);\n\t\t\t\t\t$dataWritten = false;\n\t\t\t\t\t$this->id = '';\n\n\t\t\t\t\t// Set our location ID to be the newly inserted record!\n\t\t\t\t\t//\n\t\t\t\t} else {\n\t\t\t\t\t$this->id = $this->slplus->db->insert_id;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$dataWritten = $this->make_extended_data_persistent() || $dataWritten;\n\n\t\t\t// Reset the data changed flag, used to manage MakePersistent calls.\n\t\t\t// Stops MakePersistent from writing data to disk if it has not changed.\n\t\t\t//\n\t\t\t$this->dataChanged = false;\n\n\t\t\treturn $dataWritten;\n\t\t}", "function insert_or_update($table, $idcol, $idnum = NULL /*, trios of column,template(%d,%i,%n,%s),substitute can follow here*/) {\r\n \t$num_args = func_num_args()-3;\r\n \tif ($num_args % 3 != 0)\r\n \t\tthrow new Exception('Number of arguments to insert_or_update must be a multiple of three.');\r\n \tif ($num_args < 3)\r\n \t\tthrow new Exception('Must pass at least one column name,type,value trio to insert_or_update');\r\n \t$set_str = '';\r\n \t$set_args = array();\r\n \t$update_str = '';\r\n \tfor ($i = 0; $i < $num_args; $i += 3) {\r\n \t\t$key = func_get_arg(3+$i);\r\n \t\t$template = func_get_arg(3+$i+1);\r\n \t\t$value = func_get_arg(3+$i+2);\r\n \t\t\r\n \t\tif ($template == '%s')\r\n \t\t\tthrow new Exception('Dangerous template %s is not allowed. Use %n or \"%s\" (in quotes).');\r\n \t\t\r\n \t\t$set_str .= ($i == 0 ? '':', ').\"`$key`=$template \";\r\n \t\t$update_str .= ($i == 0 ? '':', ').\"`$key`=VALUES(`$key`)\"; // for ON DUPLICATE KEY UPDATE\r\n \t\t$n_count = substr_count($template, '%');\r\n \t\tif ($n_count == 1)\r\n \t\t\t$set_args[] = $value;\r\n \t\telse if ($n_count > 1 || $value !== NULL)\r\n \t\t\tthrow new Exception('Invalid use of % or data passed unexpectedly for colum \"'.$key.'\"');\r\n \t}\r\n \t$set_str = self::parse_args($set_str, $set_args);\r\n \tif ($idnum)\r\n \t\treturn $this->run('INSERT INTO `'.$table.'` SET `'.$idcol.'`=%d, '.$set_str.' ON DUPLICATE KEY UPDATE '.$update_str, $idnum);\r\n \telse\r\n \t\treturn $this->run('INSERT INTO `'.$table.'` SET '.$set_str);\r\n }", "public function addLocation(string $location);", "public function editLocation($editLocation) {\n\n if (isset($editLocation)) {\n $data = array('name' => $editLocation['locationname'],\n 'site_id' => $editLocation['sitename'],\n 'barcode' => $editLocation['qrcode']);\n\n $this->db->where('id', $editLocation['adminuser_id']);\n $this->db->update('locations', $data);\n if ($this->input->post('edit_owner_id')) {\n $this->db->set('location_id', '')->where('id', $this->input->post('editownerid'))->update('owner');\n $arr = array('location_id' => $editLocation['adminuser_id']);\n $this->db->where('id', $this->input->post('edit_owner_id'));\n $this->db->update('owner', $arr);\n }\n $this->db->set('site',$editLocation['sitename']);\n $this->db->where('location_now', $editLocation['adminuser_id']);\n $this->db->update('items');\n return 1;\n } else {\n return False;\n }\n }", "public function update_estate_location( $value, $post_id, $field ) {\r\n global $wpdb;\r\n $table_name = $wpdb->prefix . 'myhome_locations';\r\n\r\n $wpdb->delete(\r\n $table_name,\r\n array(\r\n 'post_id' => $post_id\r\n ),\r\n array(\r\n '%d'\r\n )\r\n );\r\n\r\n $wpdb->insert(\r\n $table_name,\r\n array(\r\n 'post_id' => $post_id,\r\n 'lat' => $value['lat'],\r\n 'lng' => $value['lng']\r\n ),\r\n array(\r\n '%s',\r\n '%f',\r\n '%f'\r\n )\r\n );\r\n\r\n return $value;\r\n }", "function addUpdate() {\n\t\tif ($this->id) $this->update();\n\t\telse $this->insert();\n\t}", "function updatedb($lat, $lng, $address)\r\n\t{\r\n\t\t$query = \"UPDATE \" . $this->table . \" SET latitude = '\". $lat .\"', longitude = '\". $lng .\"' WHERE address = '\". $address .\"'\";\r\n\t\t$result = mysql_query($query);\r\n\t\t$status = \"\";\r\n\t\tif($lat==0 && $lng==0){\r\n\t\t $status = \"<font color=red><b>FAILED</b></font>\";\r\n\t\t} else {\r\n\t\t $status = \"<font color=green><b>SUCCESS</b></font>\";\r\n\t\t}\r\n\t\t\r\n\t\techo \"<tr>\r\n\t\t\t\t\t<td>$address</td>\r\n\t\t\t\t\t<td>$lat\".\",\".\"$lng</td>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<td>\".$status.\"</td>\r\n\t\t\t\t</tr>\";\r\n\t}", "protected function saveSpots()\n {\n if(!empty($this->spotsRows))\n {\n $existingSpots = DB::table('spots')->select(['id', 'remote_id'])->whereIn('remote_id', array_keys($this->spotsRows))->get();\n if(!empty($existingSpots))\n {\n foreach($existingSpots as $value)\n {\n if($this->mode !== 'insert')\n {\n $this->existingIds[$value->remote_id] = $value->id;\n $this->spotsToUpdate[$value->remote_id] = $this->spotsRows[$value->remote_id];\n }\n unset($this->spotsRows[$value->remote_id]);\n }\n }\n if(!empty($this->spotsToUpdate) && $this->mode !== 'insert' )\n {\n $this->updateSpots();\n }\n elseif($this->mode === 'insert')\n {\n $this->existingIds = [];\n }\n if(!empty($this->spotsRows) && $this->mode !== 'update' && $this->result['success'])\n {\n $this->insertSpots();\n }\n }\n }", "public function postLocation($newLocation): object\n {\n try {\n $db = $this->dbConnect();\n $req = $db->prepare('INSERT INTO `location`(location_name, latitude, longitude, title, content, cover_img, creation_date) \n VALUES( :location_name, :latitude, :longitude, :title, :content, :cover_img, NOW())');\n\n $req->execute(array(\n 'location_name' => $newLocation->__toString(),\n 'latitude' => $newLocation->getLatitude(),\n 'longitude' => $newLocation->getLongitude(),\n 'title' => $newLocation->getTitle(),\n 'content' => $newLocation->getContent(),\n 'cover_img' => $newLocation->getCoverImg()\n ));\n\n /* Récupérer la valeur ID pour les lignes insérées sur l'objet $pdo*/\n $id_nouveau = $db->lastInsertId();\n $newLocation->setId($id_nouveau);\n\n $sql = 'INSERT INTO `location_urls` (location_id, location_url) VALUES ';\n\n $insertQuery = array();/* Insérer requête [] */\n $insertData = array(); /* Insérer données [] */\n $n = 0;\n foreach ($newLocation->getImages() as $image) {\n $insertQuery[] = '(:location_id' . $n . ', :location_url' . $n . ')';\n $insertData['location_id' . $n] = $newLocation->getId();\n $insertData['location_url' . $n] = $image; /*ce que je récupère en html*/\n $n++;\n }\n\n if (!empty($insertQuery)) {\n $sql .= implode(', ', $insertQuery); /* On insère la requête dans la méthode implode()*/\n $stmt = $db->prepare($sql);\n $stmt->execute($insertData);\n }\n return $req;\n } catch (\\PDOException $exception) {\n var_dump($db->errorInfo());\n die('Erreur : ' . $exception->getMessage());\n }\n }", "public function updateLocation($loc_id, $loc_name, $addr)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \"UPDATE location \r\n\t\t\t\t\t\t\tset loc_name = '\" .$loc_name. \"',\r\n\t\t\t\t\t\t\t\taddress = '\" .$addr. \"'\r\n\t\t\t\t\t\tWHERE loc_id = '\" . $loc_id. \"'\";\r\n\t\t\t\t$result = mysqli_query($link, $query);\r\n\r\n\t\t}", "private function insertStatement() {\n $altitude = empty($_POST['alt']) ? null : $_POST['alt'];\n $latitude = empty($_POST['lat']) ? null : $_POST['lat'];\n $longitude = empty($_POST['lon']) ? null : $_POST['lon'];\n\n $date_fallback = empty($_SERVER[\"REQUEST_TIME\"]) ? time() : $_SERVER[\"REQUEST_TIME\"];\n\n $date = empty($_POST['date']) ? $date_fallback : $_POST['date'];\n\n\n $status_table = TABLE_PREFIX.\"status\";\n $insert_stmt = $this->db_connection->prepare(\"INSERT INTO \"\n\t\t\t\t\t\t . $status_table\n\t\t\t\t\t\t . \" (message,ip,date,lon,lat,alt) VALUES (?,?,?,?,?,?)\");\n\n $insert_stmt->bind_param(\"ssiddd\",\n\t\t\t $_POST[\"message\"], \n\t\t\t $_SERVER['REMOTE_ADDR'], \n\t\t\t $date,\n\t\t\t $longitude,\n\t\t\t $latitude,\n\t\t\t $altitude );\n $insert_stmt->execute();\n\n $rows_inserted = $insert_stmt->affected_rows;\n\n if ( $rows_inserted ) {\n $this->log($rows_inserted.\" rows inserted\");\n return true;\n }\n else{\n $this->log(\"Insert error, 0 rows inserted\");\n return false;\n }\n \n }", "function fn_warehouses_store_locator_update_store_location_before_update(&$store_location_data, $store_location_id, $lang_code)\n{\n if ($store_location_data['store_type'] === Manager::STORE_LOCATOR_TYPE_WAREHOUSE) {\n $store_location_data['pickup_destinations_ids'] = '0';\n } elseif ($store_location_data['store_type'] === Manager::STORE_LOCATOR_TYPE_PICKUP) {\n $store_location_data['shipping_destinations_ids'] = '0';\n }\n\n if (isset($store_location_data['shipping_destinations'])) {\n $store_location_data['shipping_destinations_ids'] = [];\n\n $destinations = $store_location_data['shipping_destinations'] ?: [];\n\n foreach ($destinations as $destination) {\n $destination_id = $destination['destination_id'];\n $store_location_data['shipping_destinations_ids'][] = $destination_id;\n\n $destination['store_location_id'] = $store_location_id;\n if (empty($destination['position'])) {\n $destination['position'] = 1 + (int) db_get_field(\n 'SELECT MAX(position)'\n . ' FROM ?:store_location_destination_links'\n . ' WHERE destination_id = ?i',\n $destination['destination_id']\n );\n }\n db_replace_into('store_location_destination_links', $destination);\n\n $shipping_delay_exists = (bool) db_get_field(\n 'SELECT COUNT(*) FROM ?:store_location_shipping_delays'\n . ' WHERE destination_id = ?i'\n . ' AND store_location_id = ?i',\n $destination_id,\n $store_location_id\n );\n\n $language_codes_list = [$lang_code];\n if (!$shipping_delay_exists) {\n $language_codes_list = array_keys(Languages::getAll());\n }\n\n foreach ($language_codes_list as $language_code) {\n $destination['lang_code'] = $language_code;\n db_replace_into('store_location_shipping_delays', $destination);\n }\n }\n\n $store_location_data['shipping_destinations_ids'] = $store_location_data['shipping_destinations_ids'] ?: [0];\n\n db_query(\n 'DELETE FROM ?:store_location_destination_links WHERE store_location_id = ?i AND destination_id NOT IN (?n)',\n $store_location_id,\n $store_location_data['shipping_destinations_ids']\n );\n\n db_query(\n 'DELETE FROM ?:store_location_shipping_delays WHERE store_location_id = ?i AND destination_id NOT IN (?n)',\n $store_location_id,\n $store_location_data['shipping_destinations_ids']\n );\n\n $store_location_data['shipping_destinations_ids'] = implode(',', $store_location_data['shipping_destinations_ids']);\n }\n}", "public function insert_location($data)\n\t{\n\t\t$sql='SELECT location_id FROM location WHERE abs(`lat` - ?) <= 0.002 AND abs(`lon` - ?) <=0.002';\n\t\t$query=$this->db->query($sql,array($data['lat'],$data['lon']));\n\t\t\n\t\t$loc = array();\n\t\t\n\t\tif($query->num_rows() == 0)\n\t\t{\n\t\t\t$s='INSERT INTO location (`lat`, `lon`, `street_number`, `route`, `neighbourhood`, `sublocality`, `locality`) VALUES (?,?,?,?,?,?,?)';\n\t\t\t$q=$this->db->query($s,array($data['lat'],$data['lon'],$data['street_number'],\n\t\t\t$data['route'],$data['neighbourhood'],$data['sublocality'],$data['locality']));\n\t\t\t\n\t\t\t$s='SELECT location_id FROM location WHERE abs(`lat` - ?) <= 0.002 AND abs(`lon` - ?) <=0.002';\n\t\t\t$q=$this->db->query($s,array($data['lat'],$data['lon']))->row_array();\n\t\t\treturn $q['location_id'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result=$query->row_array();\n\t\t\treturn $result['location_id'];\n\t\t}\n\t}", "function amap_ma_save_object_coords($location, $object, $pluginname, $lat_g = '', $lng_g = '') {\n if ($lat_g && $lng_g) {\n $lat = $lat_g;\n $lng = $lng_g;\n } else if ($location) {\n $prefix = elgg_get_config('dbprefix');\n $coords = amap_ma_geocode_location($location);\n\n if ($coords) {\n $lat = $coords['lat'];\n $lng = $coords['long'];\n }\n }\n\n if ($lat && $lng) {\n $prefix = elgg_get_config('dbprefix');\n $object->setLatLong($lat, $lng);\n $query = \"INSERT INTO {$prefix}entity_geometry (entity_guid, geometry)\n VALUES ({$object->guid}, GeomFromText('POINT({$lat} {$lng})'))\n ON DUPLICATE KEY UPDATE geometry=GeomFromText('POINT({$lat} {$lng})')\";\n\n insert_data($query);\n\n return true;\n }\n\n return false;\n}", "function rh_gmw_fl_update_location() {\n global $wpdb;\n parse_str($_POST['formValues'], $location);\n $usergetid = (!empty($_POST['usergetid'])) ? $_POST['usergetid'] : '';\n $userid = ($usergetid) ? $usergetid : get_current_user_id();\n $location['gmw_map_icon'] = ( isset($location['gmw_map_icon']) ) ? $location['gmw_map_icon'] : '_default.png';\n $location = apply_filters('gmw_fl_location_before_updated', $location, $userid);\n if ( $wpdb->replace('wppl_friends_locator', array(\n 'member_id' => $userid,\n 'street_number' => $location['gmw_street_number'],\n 'street_name' => $location['gmw_street_name'],\n 'street' => $location['gmw_street'],\n 'apt' => $location['gmw_apt'],\n 'city' => $location['gmw_city'],\n 'state' => $location['gmw_state'],\n 'state_long' => $location['gmw_state_long'],\n 'zipcode' => $location['gmw_zipcode'],\n 'country' => $location['gmw_country'],\n 'country_long' => $location['gmw_country_long'],\n 'address' => $location['gmw_address'],\n 'formatted_address' => $location['gmw_formatted_address'],\n 'lat' => $location['gmw_lat'],\n 'long' => $location['gmw_long'],\n 'map_icon' => $location['gmw_map_icon']\n ) ) === FALSE ) :\n echo __( 'There was a problem saving your location.', 'rehub_framework' );\n else :\n echo __( 'Location successfully saved!', 'rehub_framework' );\n do_action( 'gmw_fl_after_location_saved', $userid, $location );\n endif;\n die();\n}", "public function update(){\n\t//\tprint_r($this->country);\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",description=\\\"$this->description\\\",tags=\\\"$this->tags\\\",area_id=\".$this->area_id.\",image=\\\"$this->image\\\",created_at=$this->created_at,is_public=$this->is_public,price=$this->price where id=\".$this->id;\n\t\tExecutor::doit($sql);\n\t}", "public function set_location($data = FALSE, $id = FALSE)\n {\n if (!empty($data)) {\n //filter out\n $data = array('name' => $data['name']);\n\n //check if unique\n $this->db->select('name');\n $this->db->where('name', $data['name']);\n $count = $this->db->count_all_results('locations');\n\n if ($count === 0) {\n if (empty($id)) {\n return $this->db->insert('locations', $data);\n } else {\n $this->db->where('id', $id);\n $this->db->update('locations', $data);\n return array('success' => true);\n }\n } else {\n return array('success' => false, 'errors' => array('Deze locatie bestaat al.'));\n }\n } else {\n return array('success' => false, 'errors' => array('Geen data gegeven.'));\n }\n }", "function setLocationAllow($locid, $allow) {\n global $dbc;\n $query = \"UPDATE `locations` \"\n . \"SET `allownewevents` = ? \"\n . \"WHERE `locationid`= ?\";\n \n $stmt = mysqli_prepare($dbc, $query);\n mysqli_stmt_bind_param($stmt, 'ii', $allow, $locid);\n \n if (mysqli_stmt_execute($stmt)) {\n return true;\n } else {\n echo '<p>' . \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error . '</p>';\n return false;\n }\n}", "function InsertOrUpdateRecord($oDB, $tableName, $whereClause, $values)\n{\n if ($whereClause == \"\")\n {\n // --- Record doesn't exist yet. Build INSERT query to create new record \n $sql=\"INSERT INTO $tableName (\";\n foreach($values as $colname => $value)\n {\n $sql .= \"$colname,\";\n }\n $sql = substr($sql, 0, -1); // trim last \",\" from string\n $sql .= \") VALUES(\";\n foreach($values as $colname => $value)\n {\n $sql .= $value . \",\";\n }\n $sql = substr($sql, 0, -1); // trim last \",\" from string\n $sql .= \")\";\n }\n else\n {\n // --- Record already exists. Build update query to update existing record\n $sql = \"UPDATE $tableName SET \";\n foreach($values as $colname => $value)\n {\n $sql .= \"$colname = $value, \";\n }\n $sql = substr($sql, 0, -2); // trim last \", \" from string\n $sql .= \" WHERE \" . $whereClause;\n }\n// --- execute query\n// exit($sql);\n $oDB->query($sql);\n CheckAndReportSQLError($oDB);\n}", "function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `layer_points` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `layer_points` values('\".addslashes($this->id).\"' , '\".addslashes($this->lid).\"' , '\".addslashes($this->name).\"' , '\".addslashes($this->lat).\"' , '\".addslashes($this->lon).\"' , '\".addslashes($this->alt).\"' , '\".addslashes($this->bf).\"' , '\".addslashes($this->lp_image).\"' , '\".addslashes($this->notes).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}", "function syncUpdate($table, $phone, $email, $id) {\n global $loginloc;\n global $dbTables;\n global $debugFile;\n foreach ($dbTables as $item) { // if npt equal, insert new item\n $loginloc = \"CHECK SYNC UPDATE table -> \" . $item . \" id\" . $id . \"\\n\";\n get_client_ip(1, $debugFile);\n if (strcmp($item, $table) != 0) { // if npt equal, update needed for this table also\n $query = \"UPDATE `\" . $item . \"` SET phone='\" . $phone . \"' ,email='\" . $email . \"' WHERE id='\" . $id . \"'\"; // id is row number \n $data = mysql_query($query) OR die(mysql_error());\n $loginloc = \"SYNC UPDATE table -> \" . $item . \" id\" . $id . \"\\n\";\n get_client_ip(1, $debugFile);\n }\n }\n}", "function saveAddress($formvalues, $prefix){\n\t\n\t\tif(isset($formvalues[$prefix.'addressupdateid'])){\n\t\t\t$query = \"UPDATE places SET name = '\".$formvalues[$prefix.'name'].\"', telephone = '\".$formvalues[$prefix.'tel'].\"', village = '\".$formvalues[$prefix.'village'].\"', subcounty = '\".$formvalues[$prefix.'subcounty'].\"', county = '\".$formvalues[$prefix.'county'].\"', parish = '\".$formvalues[$prefix.'parish'].\"', town = '\".$formvalues[$prefix.'town'].\"', district = '\".$formvalues[$prefix.'district'].\"', plotnumber = '\".$formvalues[$prefix.'plotno'].\"', lc1chairman = '\".$formvalues[$prefix.'lc1cm'].\"', lc1telephone = '\".$formvalues[$prefix.'lc1tel'].\"', lc2chairman = '\".$formvalues[$prefix.'lc2cm'].\"', lc2telephone = '\".$formvalues[$prefix.'lc2tel'].\"', lastupdatedby = \".$_SESSION['userid'].\", lastupdatedate = now() WHERE id = '\".$formvalues[$prefix.'addressupdateid'].\"'\";\n\t\t\t\n\t\t} else {\n\t\t\t$query = \"INSERT INTO places (name, telephone, village, subcounty, county, parish, town, district, plotnumber, lc1chairman, lc1telephone, lc2chairman, lc2telephone, createdby, datecreated) VALUES ('\".$formvalues[$prefix.'name'].\"', '\".$formvalues[$prefix.'tel'].\"', '\".$formvalues[$prefix.'village'].\"', '\".$formvalues[$prefix.'subcounty'].\"', '\".$formvalues[$prefix.'county'].\"', '\".$formvalues[$prefix.'parish'].\"', '\".$formvalues[$prefix.'town'].\"', '\".$formvalues[$prefix.'district'].\"', '\".$formvalues[$prefix.'plotno'].\"', '\".$formvalues[$prefix.'lc1cm'].\"', '\".$formvalues[$prefix.'lc1tel'].\"', '\".$formvalues[$prefix.'lc2cm'].\"', '\".$formvalues[$prefix.'lc2tel'].\"', \".$_SESSION['userid'].\", NOW())\";\n\t\t\n\t\t}\n\t\t\n\t\t$result = mysql_query($query);\n\t\t$addressid = \"\";\n\t\t# check if any errors have occured during the saving the activities to the database\n\t\tif (mysql_error() == \"\") {\n\t\t\t# no errors occured, so return the last inserted id\n\t\t\t$addressid = mysql_insert_id();\n\t\t\t\n\t\t\tif(isset($formvalues[$prefix.'addressupdateid'])){\n\t\t\t\t$addressid = $formvalues[$prefix.'addressupdateid'];\n\t\t\t}\n\t\t} else {\n\t\t\t# add the error message to the string\n\t\t\t$_SESSION['error'] = \"ERROR: Couldnot insert address for \".$formvalues[$prefix.'village'].\". Please try again. DETAILS: \".mysql_error();\n\t\t}\n\t\treturn $addressid;\n\t\n}", "function update_map($id, $coords) {\n\t\t$str = \"UPDATE company SET gmap_coords = '$coords' WHERE Comany_ID = $id\";\n\t\tif($req = mysqli_query($link,$str)) return true;\n\t\telse return false;\t\n\t}", "public function insertUsermap() {\r\n $userMapEntry = $this->dbConn->queryFirstRow(\"SELECT `mapid` FROM `usermap` WHERE `user_id` = \".intval($this->id).\" AND `ip` = \".$this->dbConn->quoteSmart($_SERVER['REMOTE_ADDR']).\" LIMIT 1\");\r\n if (!$userMapEntry) {\r\n $insertMapEntry = $this->dbConn->stdQuery(\"INSERT INTO `usermap` SET `user_id` = \".intval($this->id).\", `ip` = \".$this->dbConn->quoteSmart($_SERVER['REMOTE_ADDR']).\", `last_date` = \".$this->dbConn->quoteSmart(date('Y-m-d H:i:s')));\r\n if (!$insertMapEntry) {\r\n return False;\r\n }\r\n } else {\r\n $updateMapEntry = $this->dbConn->stdQuery(\"UPDATE `usermap` SET `last_date` = \".$this->dbConn->quoteSmart(date('Y-m-d H:i:s')).\" WHERE `user_id` = \".intval($this->id).\" AND `ip` = \".$this->dbConn->quoteSmart($_SERVER['REMOTE_ADDR']).\" LIMIT 1\");\r\n if (!$updateMapEntry) {\r\n return False;\r\n }\r\n }\r\n return True;\r\n }", "public function store(StoreLocationRequest $request, Location $location)\n {\n $imageService = new UploadImageService();\n $validated = $request->all();\n $validated['image'] = $imageService->uploadLocationImage($request->image);\n $validated['image_1'] = $imageService->uploadLocationImage($request->image_1);\n $validated['image_2'] = $imageService->uploadLocationImage($request->image_2);\n $validated['image_3'] = $imageService->uploadLocationImage($request->image_3);\n $validated['image_4'] = $imageService->uploadLocationImage($request->image_4);\n\n Location::create($validated);\n $slug = Location::latest()->first()->slug;\n $slug = $slug.'-repair-service';\n Location::latest()->first()->update([\"slug\" => \"$slug\"]);\n\n return redirect()->route('location.index')->with('success', 'Location added');\n }", "function _upsert($record, $query = null)\n {\n // Check if the record exists already, using the supplied query\n $exists = FALSE;\n if (!is_null($query))\n {\n $existingRecord = $this->db->get_where(self::LOG_TABLE, $query, 1, 0);\n if ($existingRecord->num_rows() > 0)\n {\n $exists = TRUE;\n }\n }\n\n // Set the update/insert date\n $upsertTime = date('Y-m-d H:i:s');\n $record['updated_at'] = $upsertTime; // All inserts/updates set the updated_at time\n\n // If it exists, then update\n $retVal = null;\n if ($exists)\n {\n $this->db->update(self::LOG_TABLE, $record, $query);\n }\n // Otherwise let's insert\n else\n {\n $record['created_at'] = $upsertTime; // All inserts need a created_at time too\n $this->db->insert(self::LOG_TABLE, $record);\n $retVal = $this->db->insert_id();\n }\n\n return $retVal; // Return the ID for an insert or null for an update\n }", "public function update(StoreLocationRequest $request)\r\n {\r\n $opening_hours = $this->formatOpeningHours($request);\r\n $disabled_dates = $this->formatDisabledDates($request);\r\n\r\n $location = $this->location->where('id', $request->get('id'))->first();\r\n\r\n $location->update([\r\n 'name' => $request->get('name'),\r\n 'disabled_weekdays' => $request->get('disabled_weekdays'),\r\n 'disabled_dates' => $disabled_dates,\r\n 'opening_hours' => $opening_hours,\r\n 'order' => (int)$request->get('order'),\r\n 'max_weight' => (int)$request->get('max_weight'),\r\n 'interval' => (int)$request->get('interval'),\r\n 'json' => array()\r\n ]);\r\n\r\n $location->refresh();\r\n\r\n if (is_array($request->get('services'))) {\r\n $location->services()->sync($request->get('services'));\r\n }\r\n\r\n return $location;\r\n }", "public function testGetValidLocationByLocationId() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"location\");\n\n\t\t// create a new Location and insert to into mySQL\n\t\t$location = new Location(null, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Location::getLocationByLocationId($this->getPDO(), $location->getLocationId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"location\"));\n\t\t$this->assertEquals($results->getLocationProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($results->getLocationAttention(), $this->payAttention);\n\t\t$this->assertEquals($results->getLocationCity(), $this->sinCity);\n\t\t$this->assertEquals($results->getLocationName(), $this->granjalada);\n\t\t$this->assertEquals($results->getLocationState(), $this->stateOfMind);\n\t\t$this->assertEquals($results->getLocationStreetOne(), $this->warZone);\n\t\t$this->assertEquals($results->getLocationStreetTwo(), $this->aptTwo);\n\t\t$this->assertEquals($results->getLocationZipCode(), $this->whatHood);\n\n\t}", "public function update(Request $request, Location $location,$id)\n {\n $location = Ho_details::find($id);\n $validator = Validator::make($request->all(), [\n 'gst_number' => 'required',\n 'address_line_1' => 'required',\n 'name' => 'required',\n 'state_id' => 'required',\n 'postal_code' => 'required',\n 'name' => 'required|unique:ho_details,name,'.$id.',id,deleted_at,NULL,gst_number,'.$request->gst_number,\n ])->validate();\n\n \n $location->name = $request->name;\n $location->gst_number = $request->gst_number;\n $location->address_line_1 = $request->address_line_1;\n $location->address_line_2 = $request->address_line_2;\n $location->land_mark = $request->land_mark;\n $location->state_id = $request->state_id;\n $location->district_id = $request->district_id;\n $location->city_id = $request->city_id;\n $location->postal_code = $request->postal_code;\n $location->created_by = 0;\n $location->updated_by = 0;\n\n if ($location->save()) {\n return Redirect::back()->with('success', 'Successfully Updated');\n } else {\n return Redirect::back()->with('failure', 'Something Went Wrong..!');\n }\n }", "function update_thesion($column,$value,$page){\n\tglobal $connection;\n\t$user_id=$_SESSION['user_id']; \n\t$mac_address=get_mac();\n\t$create_thesion= mysqli_query($connection,\"INSERT INTO kp_thesion(user_id,$column,datime,comp_address) VALUES('$user_id','$value',CURRENT_TIMESTAMP,'$mac_address') ON DUPLICATE KEY UPDATE $column='$value',current_page='$page',datime=CURRENT_TIMESTAMP,comp_address='$mac_address' \") or die(mysqli_error($connection));\n\n}", "public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }" ]
[ "0.6711153", "0.632539", "0.6307383", "0.61594105", "0.6054637", "0.6026602", "0.602257", "0.599693", "0.5888941", "0.58303875", "0.57807565", "0.5773717", "0.57388145", "0.5719206", "0.57057923", "0.56735486", "0.56349283", "0.56100094", "0.56093854", "0.56065106", "0.5584523", "0.55764884", "0.5557727", "0.5544493", "0.55393344", "0.55298597", "0.5528437", "0.5520872", "0.5510704", "0.5501776", "0.5498263", "0.5481721", "0.54676354", "0.54587287", "0.5435987", "0.5433543", "0.542594", "0.54129285", "0.5409922", "0.54088014", "0.5405021", "0.5401691", "0.53866774", "0.53585345", "0.5339074", "0.5338902", "0.53365725", "0.53166807", "0.53113997", "0.53002125", "0.5280245", "0.5279337", "0.5275391", "0.5273035", "0.52688843", "0.52663404", "0.52652246", "0.5260145", "0.5255394", "0.5250597", "0.5236918", "0.52306056", "0.5224046", "0.5220741", "0.52169377", "0.5215806", "0.5211522", "0.5205644", "0.52039546", "0.5196323", "0.51760375", "0.51734126", "0.5169143", "0.5165503", "0.51534426", "0.5152919", "0.5133936", "0.5132655", "0.5131726", "0.5127949", "0.5121909", "0.51203173", "0.5118911", "0.5108264", "0.51071316", "0.5106209", "0.51046216", "0.51042247", "0.50970817", "0.50966394", "0.50944066", "0.5091978", "0.50881445", "0.5084553", "0.50792056", "0.5079035", "0.50787175", "0.50776917", "0.50773543", "0.5077151" ]
0.7290895
0
For some IP addreses that could not be resolved a dash as value is randomly returned from API
private function getFilteredValue($value) { if ($value === '-') { return null; } return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function anonymizeIpReturnsCorrectValueDataProvider() {}", "public static function invalidIpDataProvider() {}", "public function ObtenerIp()\n { \n\n return str_replace(\".\",\"\",$this->getIP()); //Funcion que quita los puntos de la IP\n\n }", "public static function validIpDataProvider() {}", "private function sniff_ip() {\n\n\t\tif ( $this->ip_data ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( PHP_SAPI === 'cli' ) {\n\t\t\t$this->ip_data = [ '127.0.0.1', 'CLI' ];\n\n\t\t\treturn;\n\t\t}\n\n\t\t$ip_server_keys = [ 'REMOTE_ADDR' => '', 'HTTP_CLIENT_IP' => '', 'HTTP_X_FORWARDED_FOR' => '', ];\n\t\t$ips = array_intersect_key( $_SERVER, $ip_server_keys );\n\t\t$this->ip_data = $ips ? [ reset( $ips ), key( $ips ) ] : [ '0.0.0.0', 'Hidden IP' ];\n\t}", "public function badUrlProvider() {\n\n $badRedirects[\"ip: 127.0.0.1\"] = array(\"http://127.0.0.1\", false);\n\n // Anything that resolves to zero needs to be tested carefully due to falsiness\n $badRedirects[\"ip: 0\"] = array(\"http://0/data.json\", false);\n\n // Hex is bad\n $badRedirects[\"ip: hex\"] = array(\"http://0x7f000001/data.json\", false);\n\n // So is octal\n $badRedirects[\"ip: octal\"] = array(\"http://0123/data.json\", false);\n\n // We don't like mixed hex and octal either\n $badRedirects[\"ip: mixed hex/octal/decimal\"] = array(\"http://0x7f.0x0.0.0/data.json\", false);\n\n // We don't even like dotted-quads\n $badRedirects[\"ip: dotted-quad\"] = array(\"http://111.22.34.56/data.json\", false);\n\n // Don't you come around here with any of that IPv6 crap\n $badRedirects[\"ipv6: localhost\"] = array(\"http://[::1]\", false);\n\n // Domains that resolve to IPv4 localhost? NFW.\n $badRedirects[\"localhost.ip4\"] = array(\"https://localhost.ip4/\", [['type' => 'A', 'ip' => '127.0.0.1']]);\n\n // Domains that resolve to IPv6 localhost? Get out!\n $badRedirects[\"localhost.ip6\"] = array(\"https://localhost.ip6:443\", [['type' => 'AAAA', 'ipv6' => '::1']]);\n\n // Domains that resolve to IPv6 addresses that represent IPv4 private ranges? Not on our watch!\n $badRedirects[\"localhost2.ip6\"] = array(\"http://localhost2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.1']]);\n $badRedirects[\"private1.ip6\"] = array(\"https://private1.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:192.168.1.18']]);\n $badRedirects[\"private2.ip6\"] = array(\"https://private2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:10.0.0.1']]);\n $badRedirects[\"private3.ip6\"] = array(\"http://private3.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.2']]);\n\n // Domains that resolve to IPv6 link-local adddresses? Hell no!\n $badRedirects[\"linklocal.ip6\"] = array(\"https://linklocal.ip6/\", [['type' => 'AAAA', 'ipv6' => 'fe80::']]);\n\n return $badRedirects;\n }", "static private function filterIP($input) {\n $in_addr = @inet_pton($input);\n if ($in_addr === false) {\n return 'badip-' . self::filterEvilInput($input, self::HEX_EXTENDED);\n }\n return inet_ntop($in_addr);\n }", "public function testIndexActionWithInvalidIP()\n {\n $this->di->get(\"request\")->setGet(\"ip\", \"12001:0db8:85a3:0000:0000:8a2e:0370:7334\");\n\n $res = $this->controller->indexAction();\n $body = $res->getBody();\n\n $exp = \"Adressen är ogiltig!\";\n $this->assertStringContainsString($exp, $body);\n }", "function allow_ip_address()\r\n\t{\r\n\t\t$bad = apply_filters('three_strikes_count', 0, $_SERVER['REMOTE_ADDR']);\r\n\t\treturn ($bad < THREE_STRIKES_LIMIT);\r\n\t}", "public function ip()\n {\n $serverAll = parent::server();\n\n // source: https://stackoverflow.com/a/41769505\n foreach (['HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'] as $key) {\n if (array_key_exists($key, $serverAll) === true) {\n foreach (explode(',', $serverAll[$key]) as $ip) {\n $ip = trim($ip); // just to be safe\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n\n return parent::ip();\n }", "protected function resolveIp(): string\n {\n return Request::ip();\n }", "function forwarded_ip() {\n\n $server=array(\n 'HTTP_X_FORWARDED_FOR'=>'123.123.123.123.',\n );\n\n\n $keys = array(\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'HTTP_CLIENT_IP',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n );\n\n foreach($keys as $key) {\n if(isset($server[$key])) {\n $ip_array = explode(',', $server[$key]);\n foreach($ip_array as $ip) {\n $ip = trim($ip);\n if(validateIp($ip)){\n return $ip;\n }\n\n }\n }\n }\n return '';\n }", "public function getPublicIP() {\r\n // post content and post api url\r\n $data = array(\"type\" => \"ip\");\r\n $url = \"https://api.hooowl.com/getIP.php\";\r\n // post action and then decode json packet to object\r\n $response = $this->post($data, $url);\r\n $response = json_decode($response);\r\n // detect the response code\r\n // var_dump($response); \r\n if (isset($response->post_errno)) {\r\n return $this->post_response(false, $response->post_errno, $response->value);\r\n } elseif ($response->code != 1) {\r\n return $this->post_response(false, $response->code, $response->value);\r\n } else\r\n return $this->post_response(true, $response->code, $response->value);\r\n }", "private function getClientIP ()\n {\n $status_data = file ( $this->config['status'] ) ;\n $i = 0;\n while ( $i < count ( $status_data ) ) { /* Process openvpn-status.log */\n $buffer = explode (\",\" , $status_data [$i] ) ;\n if ( count ( $buffer ) == 4) {\n if ( strstr( $status_data[$i], $this->c ) ) {\n $status_info = explode (\",\" , $status_data[$i] );\n $this->result['data']['id'] = $this->c;\n $this->result['data']['private_ip'] = trim($status_info[0]);\n $this->result['data']['connect_date'] = trim($status_info[3]);\n $this->result['data']['from'] = \"status.log\";\n }\n }\n $i++;\n }\n\n\t\t\t/* Id not found in openvpn-status.log */\n\t\t\t/* Check fixed ip address from database */\t\t\t\n\t\t\tif ( ! isset ( $this->result['data']['private_ip'] ) ) \t{\n\t\t\t\t$dbs = new DB ( $this->config['database'] );\n \t$c = $dbs->query (\"SELECT * FROM tbl_vpn_org where org_id = '\" . $this->c . \"'\");\n \tif ( count ( $c ) ) { /* Check org */\n\t\t\t\t\t$dbfx = new DB ( $this->config['database'] );\t\t\n\t\t\t\t\t$resfx = $dbfx->query (\"SELECT * FROM tbl_custom_ip WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t\t\tif ( count ( $resfx ) ) { /* Check fixed ip by id */\n\t\t\t\t\t\t$this->result['data']['id'] = $this->c;\n\t\t\t\t\t\t$this->result['data']['ip'] = $resfx[0]['fix_ip'];\n\t\t\t\t\t\t$this->result['data']['note'] = \"Fixed ip address\";\n\t\t\t\t\t} else /* Fixed ip address not found, But id founded in main system */\n\t\t\t\t\t\t$this->result['data']['result'] = \"DHCP\";\n\t\t\t\t\t$dbfx->CloseConnection ();\t\n\t\t\t\t} else { \n\t\t\t\t\t/* Main id not found */\n\t\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\t\n\t\t\t\t}\n\t\t\t\t$dbs->CloseConnection ();\n\t\t\t}\n return;\n }", "public static function fetch_alt_ip() {\n $alt_ip = $_SERVER['REMOTE_ADDR'];\n\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $alt_ip = $_SERVER['HTTP_CLIENT_IP'];\n } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND preg_match_all('#\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) {\n // try to avoid using an internal IP address, its probably a proxy\n $ranges = array(\n '10.0.0.0/8' => array(ip2long('10.0.0.0'), ip2long('10.255.255.255')),\n '127.0.0.0/8' => array(ip2long('127.0.0.0'), ip2long('127.255.255.255')),\n '169.254.0.0/16' => array(ip2long('169.254.0.0'), ip2long('169.254.255.255')),\n '172.16.0.0/12' => array(ip2long('172.16.0.0'), ip2long('172.31.255.255')),\n '192.168.0.0/16' => array(ip2long('192.168.0.0'), ip2long('192.168.255.255')),\n );\n foreach ($matches[0] AS $ip) {\n $ip_long = ip2long($ip);\n if ($ip_long === false) {\n continue;\n }\n\n $private_ip = false;\n foreach ($ranges AS $range) {\n if ($ip_long >= $range[0] AND $ip_long <= $range[1]) {\n $private_ip = true;\n break;\n }\n }\n\n if (!$private_ip) {\n $alt_ip = $ip;\n break;\n }\n }\n } else if (isset($_SERVER['HTTP_FROM'])) {\n $alt_ip = $_SERVER['HTTP_FROM'];\n }\n\n return $alt_ip;\n }", "public function ip()\n {\n \n try {\n $ip_arr = Yaml::parseFile($this->config['ip_config_path']);\n } catch (\\Exception $e) {\n // Do something\n $ip_arr = [];\n }\n\n $out = [];\n\n // Compile SQL\n $cnt = 0;\n $sel_arr = array('COUNT(1) as count');\n foreach ($ip_arr as $key => $value) {\n if (is_scalar($value)) {\n $value = array($value);\n }\n $when_str = '';\n foreach ($value as $k => $v) {\n $when_str .= sprintf(\" WHEN remote_ip LIKE '%s%%' THEN 1\", $v);\n }\n $sel_arr[] = \"SUM(CASE $when_str ELSE 0 END) AS r{$cnt}\";\n $cnt++;\n }\n $sql = \"SELECT \" . implode(', ', $sel_arr) . \"\n\t\t\t\tFROM reportdata \"\n .get_machine_group_filter();\n\n $reportdata = Reportdata_model::selectRaw(implode(', ', $sel_arr))\n ->filter()\n ->first();\n // Create Out array\n if ($reportdata) {\n $cnt = $total = 0;\n foreach ($ip_arr as $key => $value) {\n $col = 'r' . $cnt++;\n\n $out[] = array('key' => $key, 'cnt' => intval($reportdata[$col]));\n\n $total += $reportdata[$col];\n }\n\n // Add Remaining IP's as other\n if ($reportdata['count'] - $total) {\n $out[] = array('key' => 'Other', 'cnt' => $reportdata['count'] - $total);\n }\n }\n\n $obj = new View();\n $obj->view('json', array('msg' => $out));\n }", "function get_ip(){?\r\r\t$do_check = 1;\r\r\t$addrs = array();\r\r\r\r\tif( $do_check )\r\r\t{\r\r\t\tif(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\r\t\t foreach( array_reverse(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])) as $x_f )\r\r \t\t{\r\r \t\t\t$x_f = trim($x_f);\r\r \t\t\tif( preg_match('/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/', $x_f) )\r\r \t\t\t{\r\r \t\t\t\t$addrs[] = $x_f;\r\r \t\t\t}\r\r \t\t}\r\r\t\t}\r\r \r\r\r\r\t\tif(isset($_SERVER['HTTP_CLIENT_IP'])) $addrs[] = $_SERVER['HTTP_CLIENT_IP'];\r\r\t\tif(isset($_SERVER['HTTP_PROXY_USER'])) $addrs[] = $_SERVER['HTTP_PROXY_USER'];\r\r\t}\r\r\r\r\t$addrs[] = $_SERVER['REMOTE_ADDR'];\r\r\r\r\tforeach( $addrs as $v )\r\r\t{\r\r\t\tif( $v )\r\r\t\t{\r\r\t\t\tpreg_match(\"/^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$/\", $v, $match);\r\r\t\t\t$ip = $match[1].'.'.$match[2].'.'.$match[3].'.'.$match[4];\r\r\r\r\t\t\tif( $ip && $ip != '...' )\r\r\t\t\t{\r\r\t\t\t\tbreak;\r\r\t\t\t}\r\r\t\t}\r\r\t}\r\r\r\r\tif( ! $ip || $ip == '...' )\r\r\t{\r\r\t\techo \"Không thể xác định địa chỉ IP của bạn.\";\r\r\t}\r\r\r\r\treturn $ip;\r\r}", "private function get_ips() {\n\n\t\t$cache_name = 'proxyflare_cloudflare_ips';\n\n\t\t// Check Cache before making the request\n\t\t$ips = get_transient( $cache_name );\n\t\tif ( false === $ips ) {\n\n\t\t\t// Set the API URL\n\t\t\t$url = 'https://api.cloudflare.com/client/v4/ips';\n\n\t\t\t// Set API Call Details\n\t\t\t$args = array(\n\t\t\t\t'headers' => array(\n\t\t\t\t\t'User-Agent' => 'Proxyflare/' . PROXYFLARE_VERSION,\n\t\t\t\t)\n\t\t\t);\n\t\t\t// Make the request\n\t\t\t$response = wp_safe_remote_get( $url, $args );\n\n\t\t\t// Check Response\n\t\t\tif ( ! is_wp_error( $response ) ) {\n\t\t\t\tproxyflare()->log( ' - Cloudflare IP Get Result (' . wp_remote_retrieve_response_code( $response ) . '): ' . wp_remote_retrieve_body( $response ) );\n\t\t\t\t$response = json_decode( wp_remote_retrieve_body( $response ), true );\n\t\t\t\tif ( isset( $response['success'] ) && true == $response['success'] ) {\n\t\t\t\t\t$ips = array(\n\t\t\t\t\t\t'ipv4' => $response['result']['ipv4_cidrs'] ?? '',\n\t\t\t\t\t\t'ipv6' => $response['result']['ipv6_cidrs'] ?? ''\n\t\t\t\t\t);\n\t\t\t\t\t// Save Cache for 48 hours\n\t\t\t\t\tset_transient( $cache_name, $ips, 2 * DAY_IN_SECONDS );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tproxyflare()->log( ' - API Error (' . wp_remote_retrieve_response_code( $response ) . '): ' . wp_remote_retrieve_body( $response ) );\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn false;\n\n\t\t} else {\n\t\t\treturn $ips;\n\t\t}\n\t}", "function get_ip() {\n\t\tif(!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\t$ip_address = $_SERVER['HTTP_CLIENT_IP'];\n\t\t} else if(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t$ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t} else if(!empty($_SERVER['REMOTE_ADDR'])) {\n\t\t\t$ip_address = $_SERVER['REMOTE_ADDR'];\n\t\t} else {\n\t\t\t$ip_address = '';\n\t\t}\n\t\tif(strpos($ip_address, ',') !== false) {\n\t\t\t$ip_address = explode(',', $ip_address);\n\t\t\t$ip_address = $ip_address[0];\n\t\t}\n\t\treturn esc_attr($ip_address);\n\t}", "public function getIpAddress() {\n return [\n '#markup' => $this->t('Your Ip address is: @ipaddress', array('@ipaddress' => $this->personalizationIpService->getIpAddress()))\n ];\n }", "public function invalidAddresses() {}", "function wp_privacy_anonymize_ip($ip_addr, $ipv6_fallback = \\false)\n {\n }", "function getIp()\n{\n $ip = false;\n\n if(!empty($_SERVER['HTTP_CLIENT_IP']))\n {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n {\n $ips = explode(\",\", \n $_SERVER['HTTP_X_FORWARDED_FOR']);\n for ($i = 0; $i < count($ips); $i++)\n {\n $ips = trim($ips[$i]);\n if (!eregi(\"^(10|172\\.16|192\\.168)\\.\", \n $ips[$i]))\n {\n $ip = $ips[$i];\n break;\n }\n }\n }\n elseif (!empty($_SERVER['HTTP_VIA']))\n {\n $ips = explode(\",\", \n $_SERVER['HTTP_VIA']);\n for ($i = 0; $i < count($ips); $i++)\n {\n $ips = trim($ips[$i]);\n if (!eregi(\"^(10|172\\.16|192\\.168)\\.\", \n $ips[$i]))\n {\n $ip = $ips[$i];\n break;\n }\n }\n }\n elseif (!empty($_SERVER['REMOTE_ADDR']))\n {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n\n if (($longip = ip2long($ip)) !== false)\n {\n if ($ip == long2ip($longip))\n {\n return $ip;\n }\n }\n \n return false;\n}", "function _un_phpbb_ip($ip)\n\t{\n\t\tif (strlen($ip)<8) return '127.0.0.1';\n\n\t\t$_ip=strval(hexdec($ip[0].$ip[1])).'.'.strval(hexdec($ip[2].$ip[3])).'.'.strval(hexdec($ip[4].$ip[5])).'.'.strval(hexdec($ip[6].$ip[7]));\n\t\treturn $_ip;\n\t}", "function get_uk_ip()\n {\n \t\n \t$username = 'lum-customer-hl_db480584-zone-static-route_err-pass_dyn';\n \t$password = 'wa22odw9t60g';\n \t$port = 22225;\n \t$user_agent = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36';\n \t$session = mt_rand();\n \t$super_proxy = 'zproxy.lum-superproxy.io';\n \t$curl = curl_init('http://lumtest.com/myip.json');\n \tcurl_setopt($curl, CURLOPT_USERAGENT, $user_agent);\n \tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n \tcurl_setopt($curl, CURLOPT_PROXY, \"http://$super_proxy:$port\");\n \tcurl_setopt($curl, CURLOPT_PROXYUSERPWD, \"$username-country-gb-session-$session:$password\");\n \t$result = curl_exec($curl);\n \t$curl_error = curl_error($curl);\n \t$curl_info = curl_getinfo($curl);\n \tcurl_close($curl);\n \t\n \t$result_jd=json_decode($result,true);\n \t\n \t$ip=$result_jd['ip'];\n \t\n \tif(empty($ip))\n \t{\n \t\t$ip = get_client_ip();\n \t}\n\n \treturn $ip;\n }", "protected function _checkIpAddressIsAllowed()\n\t{\n\t\t/* Check the IP address is banned */\n\t\tif ( \\IPS\\Request::i()->ipAddressIsBanned() )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'IP_ADDRESS_BANNED', '1S290/A', 403 );\n\t\t}\n\t\t\n\t\t/* If we have tried to access the API with a bad key more than 10 times, ban the IP address */\n\t\tif ( \\IPS\\Db::i()->select( 'COUNT(*)', 'core_api_logs', array( 'ip_address=? AND is_bad_key=1', \\IPS\\Request::i()->ipAddress() ) )->first() > 10 )\n\t\t{\n\t\t\t/* Remove the flag from these logs so that if the admin unbans the IP we aren't immediately banned again */\n\t\t\t\\IPS\\Db::i()->update( 'core_api_logs', array( 'is_bad_key' => 0 ), array( 'ip_address=?', \\IPS\\Request::i()->ipAddress() ) );\n\t\t\t\n\t\t\t/* Then insert the ban... */\n\t\t\t\\IPS\\Db::i()->insert( 'core_banfilters', array(\n\t\t\t\t'ban_type'\t\t=> 'ip',\n\t\t\t\t'ban_content'\t=> \\IPS\\Request::i()->ipAddress(),\n\t\t\t\t'ban_date'\t\t=> time(),\n\t\t\t\t'ban_reason'\t=> 'API',\n\t\t\t) );\n\t\t\tunset( \\IPS\\Data\\Store::i()->bannedIpAddresses );\n\t\t\t\n\t\t\t/* And throw an error */\n\t\t\tthrow new \\IPS\\Api\\Exception( 'IP_ADDRESS_BANNED', '1S290/C', 403 );\n\t\t}\n\t\t\n\t\t/* If we have tried to access the API with a bad key more than once in the last 5 minutes, throw an error to prevent brute-forcing */\n\t\tif ( \\IPS\\Db::i()->select( 'COUNT(*)', 'core_api_logs', array( 'ip_address=? AND is_bad_key=1 AND date>?', \\IPS\\Request::i()->ipAddress(), \\IPS\\DateTime::create()->sub( new \\DateInterval( 'PT5M' ) )->getTimestamp() ) )->first() > 1 )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'TOO_MANY_REQUESTS_WITH_BAD_KEY', '1S290/D', 429 );\n\t\t}\n\t}", "private function formatIp(string $host): string\n {\n $ip = substr($host, 1, -1);\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n return $host;\n }\n\n static $ip_future = '/^\n v(?<version>[A-F0-9])+\\.\n (?:\n (?<unreserved>[a-z0-9_~\\-\\.])|\n (?<sub_delims>[!$&\\'()*+,;=:]) # also include the : character\n )+\n $/ix';\n if (preg_match($ip_future, $ip, $matches) && !in_array($matches['version'], ['4', '6'], true)) {\n return $host;\n }\n\n if (false === ($pos = strpos($ip, '%'))) {\n throw new UriException(sprintf('Host `%s` is invalid : the IP host is malformed', $host));\n }\n\n static $gen_delims = '/[:\\/?#\\[\\]@ ]/'; // Also includes space.\n if (preg_match($gen_delims, rawurldecode(substr($ip, $pos)))) {\n throw new UriException(sprintf('Host `%s` is invalid : the IP host is malformed', $host));\n }\n\n $ip = substr($ip, 0, $pos);\n if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n throw new UriException(sprintf('Host `%s` is invalid : the IP host is malformed', $host));\n }\n\n //Only the address block fe80::/10 can have a Zone ID attach to\n //let's detect the link local significant 10 bits\n static $address_block = \"\\xfe\\x80\";\n\n if (substr(inet_pton($ip) & $address_block, 0, 2) === $address_block) {\n return $host;\n }\n\n throw new UriException(sprintf('Host `%s` is invalid : the IP host is malformed', $host));\n }", "private static function resolveClientIp(): string{\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}", "protected function _make_warning_block_ip()\n\t{\n\t\t$count_max = mod('deposit_card')->setting('fail_count_max');\n\n\t\tif (!$count_max) return;\n\n\t\t$max = mod('deposit_card')->setting('fail_count_max');\n\t\t$minute = mod('deposit_card')->setting('fail_block_timeout');\n\n\t\treturn lang('notice_warning_block_ip', compact('max', 'minute'));\n\t}", "public function getIPAddress(): string;", "public static function real_ip() {\n foreach (array(\n 'HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'\n ) as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n $ip = trim($ip); // just to be safe\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n }", "function ipextract ($str, $remote_ip='')\r\n{\r\n global $ip_private_arr;\r\n\r\n if (empty($ip_private_arr) || !is_array($ip_private_arr)) {\r\n $ip_private_arr = array();\r\n $ip_private_arr[] = array('from' => '0.0.0.0', 'to' => '9.255.255.255');\r\n $ip_private_arr[] = array('from' => '10.0.0.0', 'to' => '10.255.255.255');\r\n $ip_private_arr[] = array('from' => '97.160.0.0', 'to' => '97.255.255.255');\r\n $ip_private_arr[] = array('from' => '100.0.0.0', 'to' => '111.255.255.255');\r\n $ip_private_arr[] = array('from' => '127.0.0.0', 'to' => '127.255.255.255');\r\n $ip_private_arr[] = array('from' => '145.0.0.0', 'to' => '145.0.255.255');\r\n $ip_private_arr[] = array('from' => '163.0.0.0', 'to' => '163.0.255.255');\r\n $ip_private_arr[] = array('from' => '169.254.0.0', 'to' => '169.254.255.255');\r\n $ip_private_arr[] = array('from' => '172.0.0.0', 'to' => '172.127.255.255');\r\n $ip_private_arr[] = array('from' => '175.0.0.0', 'to' => '185.255.255.255');\r\n $ip_private_arr[] = array('from' => '191.0.0.0', 'to' => '192.0.255.255');\r\n $ip_private_arr[] = array('from' => '192.88.0.0', 'to' => '192.88.255.255');\r\n $ip_private_arr[] = array('from' => '192.101.0.0', 'to' => '192.114.255.255');\r\n $ip_private_arr[] = array('from' => '192.140.0.0', 'to' => '192.145.255.255');\r\n $ip_private_arr[] = array('from' => '192.168.0.0', 'to' => '192.178.255.255');\r\n $ip_private_arr[] = array('from' => '194.55.0.0', 'to' => '194.55.255.255');\r\n $ip_private_arr[] = array('from' => '198.17.0.0', 'to' => '198.20.255.255');\r\n $ip_private_arr[] = array('from' => '224.0.0.0', 'to' => '239.255.255.255');\r\n }\r\n\r\n $iplong = ip2long(trim($remote_ip));\r\n $valarr = empty($str) ? array() : preg_split('/[,\\s]+/', trim($str));\r\n foreach ($valarr as $ipval) {\r\n if (preg_match('%(\\d{1,3}(?:[.]\\d{1,3}){3})%', $ipval, $matches)) {\r\n $iptest = ip2long($matches[1]);\r\n if ($iptest) {\r\n if (empty($iplong)) $iplong = $iptest;\r\n if (!empty($ip_private_arr)) {\r\n foreach ($ip_private_arr as $ip_range) {\r\n $ipfrom = ip2long(trim($ip_range['from']));\r\n $ipto = ip2long(trim($ip_range['to']));\r\n if ($ipfrom<=$iptest && $iptest<=$ipto) {\r\n $iptest = 0;\r\n break;\r\n }\r\n }\r\n if ($iptest) $iplong = $iptest;\r\n }\r\n }\r\n }\r\n }\r\n return (!$iplong || $iplong==-1) ? FALSE : long2ip($iplong);\r\n}", "protected function parseRipDetails() {\n\t}", "protected function buscarIp()\n {\n $ip = '';\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_X_FORWARDED'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED'];\n } elseif (isset($_SERVER['HTTP_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_FORWARDED'])) {\n $ip = $_SERVER['HTTP_FORWARDED'];\n } elseif (isset($_SERVER['REMOTE_ADDR'])) {\n $ip = $_SERVER['REMOTE_ADDR'];\n } else {\n $ip = 'DESCONHECIDO';\n }\n\n return $ip;\n }", "public function ip()\n {\n return $this->rule('ip');\n }", "private function _getAnonymizationCodeUniversal() {\n if (!Mage::helper('itserv_analytics')->isIpAnonymizationEnabled()) {\n return '';\n }\n return \"ga('set', 'anonymizeIp', true);\";\n }", "function iploc($ip){\n\t\t/* preg_match(\"/<li>Country : (.*?) <img/\",$html,$data); */\n\t\t$d['pais'] = \"nada\";\n\t\t/* preg_match(\"/<li>State\\/Province : (.*?)<\\/li>/\",$html,$data); */\n\t\t$d['estado'] = \"nada\";\n\t\t/* preg_match(\"/<li>City : (.*?)<\\/li>/\",$html,$data); */\n\t\t$d['ciudad'] = \"nada\";\n\t\treturn ($d);\n\t}", "function bps_get_server_ip_address_sysinfo() {\n\n\tif ( is_admin() && wp_script_is( 'bps-accordion', $list = 'queue' ) && current_user_can('manage_options') ) {\n\t\tif ( isset( $_SERVER['SERVER_ADDR'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['SERVER_ADDR']);\n\t\t\techo __('Server|Website IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t} elseif ( isset( $_SERVER['HTTP_HOST'] ) ) {\n\t\t\t$ip = esc_html( gethostbyname( $_SERVER['HTTP_HOST'] ) );\n\t\t\techo __('Server|Website IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\t\t\n\t\t} else { \n\t\t\t$ip = @dns_get_record( bpsGetDomainRoot(), DNS_ALL );\n\t\t\techo __('Server|Website IP Address: ', 'bulletproof-security').'<strong>'.$ip[0]['ip'].'</strong><br>';\t\n\t\t}\n\t}\n}", "function real_ip_ad () {\n\t\t\n\t\tif (!empty($_SERVER[\"HTTP_CLIENT_IP\"]))\n\t\t{\n\t\t# check for ip from shared internet\n\t\t$ip = $_SERVER[\"HTTP_CLIENT_IP\"];\n\t\t}\n\t\telseif (!empty($_SERVER[\"HTTP_X_FORWARDED_FOR\"]))\n\t\t{\n\t\t// Check for the Proxy User\n\t\t$ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\t\t}\n\t\t// This will print user's real IP Address\n\t\t// does't matter if user using proxy or not.\n\t\treturn $ip;\n\t}", "function getRequestIPAddress()\n{\n $ip = preg_replace('#[^0-9.]#', '', getenv('REMOTE_ADDR'));\n \n return $ip;\n \n \n}", "private function getIPPublic ()\n {\n $dbs = new DB ( $this->config['database'] );\n $search = $dbs->query(\"SELECT * FROM tbl_client_connection_priv WHERE\n priv_client_id LIKE '\". $this->c .\"%' order by private_rec_date desc limit 1\");\n\t\t\tif ( count ( $search ) ) {\n\t\t\t\t$this->result['id'] = $this->c;\n\t\t\t\t$this->result['real_ip_address'] = $search[0]['real_client_ip'];\n\t\t\t} else\n\t\t\t\t$this->result['data']['result'] = $this->c . \":No usage history found\";\n\t\t\t\n\t\t\t$dbs->CloseConnection ();\n\t\t\treturn;\n\t\t}", "public function testIndexActionGetBadIp()\n {\n $request = $this->di->get(\"request\");\n $request->setGet(\"ip\", \"8.8.8.8.8\");\n\n\n $res = $this->controller->indexActionGet();\n\n $body = $res->getBody();\n\n // var_dump($body);\n $this->assertInstanceOf(\"Anax\\Response\\ResponseUtility\", $res);\n $this->assertContains(\"is not a valid IP\", $body);\n }", "function withRange($ip){\n\n\t\t$ipadd = explode(\".\", $ip);\n\t\t$withRange = false;\n\n\t\tfor ($i = 0; $i < sizeof($ipadd); $i++){\n\t\t\tif((strpos(($ipadd[$i]), \"-\") == true) || (strpos($ipadd[$i], \"~\") == true))\n\t\t\t\t$withRange = true; \n\t\t}\n\t\t\n\n\t\treturn $withRange;\n\n\t}", "function forwarded_ip(){\n\n // for testing \n $server = array(\n // 'HTTP_X_FORWARDED_FOR'=> \"0.0.0.0,1sd.1.2.3\",\n // 'HTTP_X_FORWARDED' => \"jlaldjfl,99adf,123.123.123.123,1.2.4.4\",\n \n );\n\n $keys = array(\n 'HTTP_X_FORWARDED_FOR', \n 'HTTP_X_FORWARDED', \n 'HTTP_FORWARDED_FOR', \n 'HTTP_FORWARDED',\n 'HTTP_CLIENT_IP', \n 'HTTP_X_CLUSTER_CLIENT_IP',\n );\n\n foreach($keys as $key){\n if(isset($_SERVER[$key])){\n $ip_array = explode(\",\",$_SERVER[$key]);\n\n foreach($ip_array as $ip){\n $ip = trim($ip);\n if(validate_ip($ip)){\n return $ip;\n }\n }\n }\n }\n\n return \"\";\n\n}", "function vIP( $ip )\r\n\t\t{\r\n\t\t return filter_var( $ip, FILTER_VALIDATE_IP );\r\n\t\t \r\n\t\t}", "function get_public_ip_address()\n{\n\t// TODO: Add a fallback to http://httpbin.org/ip\n\t// TODO: Add a fallback to http://169.254.169.254/latest/meta-data/public-ipv4\n\n\t$url=\"simplesniff.com/ip\";\n\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n\t$data = curl_exec($ch);\n\tcurl_close($ch);\n\n\treturn $data;\n}", "function getIpAddress()\n {\n foreach ([\n 'HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'\n ] as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n $ip = trim($ip);\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n }", "function getIPInfo($IPParagraph='0.0.0.0/32'){\n\tif (!$IPParagraph) {\n\t\treturn '请输入IP段';\n\t}\n\t$isTrue=isIPParagraph($IPParagraph);\n\tif (!$isTrue) {\n\t\treturn '无效IP段';\n\t}\n\t$IPParagraphArray = explode('/', $IPParagraph);\n\t$mark = $IPParagraphArray[1]; // 获取IP段的掩码位\n\t$dilatation = pow(2, 32-$mark); // 最多可以容纳的主机数\n\t$usable = $dilatation-2; // 可供使用的主机数\n\t$subnetMask = long2ip(ip2long('255.255.255.255')-($dilatation-1)); // 子网掩码\n\t$subnetMaskArray = explode('.', $subnetMask);\n\t$ipArray = explode('.', $IPParagraphArray[0]);\n\tif ($subnetMaskArray[2] === '255') { // ip所处子网掩码判断某一位是在哪个类别下\n\t\t$category = 'C类';\n\t\t$flag=array(3); // 标识ip哪位为0的数组\n\t}elseif ($subnetMaskArray[2] < '255' && $subnetMaskArray[1] === '255') {\n\t\t$category = 'B类';\n\t\t$flag=array(2,3);\n\t}elseif ($subnetMaskArray[1] < '255') {\n\t\t$category = 'A类';\n\t\t$flag=array(1,2,3);\n\t}\n\tfor ($i=0; $i < count($flag); $i++) {\n\t\t$subnet = pow(2, 8*($i+1)-(32-$mark)); // 子网个数\n\t\t$count = $subnet===1 ? pow(2, 8*($i+1)) : $subnet; // 当子网等于1,则说明是8,16,24,分别是a,b,c类\n\t\t$ipArray[$flag[$i]] = 0; // 将对等的类别下ipArray数组中的某个下标的值清零\n\t}\n\n\t$ipString = implode('.', $ipArray); // 将原ip转化成x.x.x.0的形式\n\t$iplong = ip2long($ipString); // ip转长整型\n\t$subnetInit = array();\n\tfor ($i=0; $i < $subnet; $i++) {\n\t\t$subnetInit[$i] = long2ip($iplong+($dilatation*$i)); // 循环算出每个子网的第一个ip\n\t}\n\n\t$dilatationIP = array();\n\tfor ($i=0; $i < $count; $i++) {\n\t\tif ($subnet === 1) { // 当子网只有一个时,循环当前类别的总个数\n\t\t\t$dilatationIP[$i] = long2ip(ip2long($subnetInit[0])+$i);\n\t\t}elseif(isset($subnetInit[$i+1])){\n\t\t\tif (ip2long($IPParagraphArray[0]) >= ip2long($subnetInit[$i]) && ip2long($IPParagraphArray[0]) < ip2long($subnetInit[$i+1])) {\n\t\t\t\tfor ($j=0; $j < $dilatation; $j++) {\n\t\t\t\t\t$dilatationIP[$j] = long2ip(ip2long($subnetInit[$i])+$j); // ip在子网里所有的ip数\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}else{\n\t\t\tif (ip2long($IPParagraphArray[0]) >= ip2long($subnetInit[$i])) {\n\t\t\t\tfor ($j=0; $j < $dilatation; $j++) {\n\t\t\t\t\t$dilatationIP[$j] = long2ip(ip2long($subnetInit[$i])+$j); // ip在子网里所有的ip数\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}\n\n\t$rs = array(\n\t\t'ip'\t\t\t=>\t$IPParagraphArray[0],\n\t\t'mark'\t\t\t=>\t$mark,\n\t\t'dilatation'\t=>\t$dilatation,\n\t\t'usable'\t\t=>\t$usable,\n\t\t'dilatationIP'\t=>\t$dilatationIP,\n\t\t'networkAddr'\t=>\t$dilatationIP[0],\n\t\t'roadcastAddr'\t=>\t$dilatationIP[$dilatation-1],\n\t\t'subnet'\t\t=>\t$subnet,\n\t\t'subnetInit'\t=>\t$subnetInit,\n\t\t'subnetMask'\t=>\t$subnetMask,\n\t\t'category'\t\t=>\t$category,\n\t);\n\t// return json_encode($rs, JSON_UNESCAPED_UNICODE);\n\treturn $rs;\n}", "public static function cmpIPv4DataProviderNotMatching() {}", "private static function ip2addr($intIp) {\n $arrUnknown = array(\n \"region\" => \"(unknown)\",\n \"address\" => \"(unknown)\"\n );\n $fileIp = fopen(__DIR__ . self::IPFILE, \"rb\");\n if (!$fileIp) return 1;\n $strBuf = fread($fileIp, 4);\n $intFirstRecord = self::bin2dec($strBuf);\n $strBuf = fread($fileIp, 4);\n $intLastRecord = self::bin2dec($strBuf);\n $intCount = floor(($intLastRecord - $intFirstRecord) / 7);\n if ($intCount < 1) return 2;\n $intStart = 0;\n $intEnd = $intCount;\n while ($intStart < $intEnd - 1) {\n $intMid = floor(($intStart + $intEnd) / 2);\n $intOffset = $intFirstRecord + $intMid * 7;\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intMidStartIp = self::bin2dec($strBuf);\n if ($intIp == $intMidStartIp) {\n $intStart = $intMid;\n break;\n }\n if ($intIp > $intMidStartIp) $intStart = $intMid;\n else $intEnd = $intMid;\n }\n $intOffset = $intFirstRecord + $intStart * 7;\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intStartIp = self::bin2dec($strBuf);\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intEndIp = self::bin2dec($strBuf);\n if ($intIp < $intStartIp || $intIp > $intEndIp) return $arrUnknown;\n $intOffset += 4;\n while (($intFlag = ord(fgetc($fileIp))) == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n }\n switch ($intFlag) {\n case 0:\n return $arrUnknown;\n break;\n case 2:\n $intOffsetAddr = $intOffset + 4;\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) return $arrUnknown;\n $arrAddr = array(\n \"region\" => chr($intFlag)\n );\n while (ord($c = fgetc($fileIp))) $arrAddr[\"region\"] .= $c;\n fseek($fileIp, $intOffsetAddr);\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n $arrAddr[\"address\"] = chr($intFlag);\n while (ord($c = fgetc($fileIp))) $arrAddr[\"address\"] .= $c;\n return $arrAddr;\n break;\n default:\n $arrAddr = array(\"region\" => chr($intFlag));\n while (ord($c = fgetc($fileIp))) $arrAddr[\"region\"] .= $c;\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n $arrAddr[\"address\"] = chr($intFlag);\n while (ord($c = fgetc($fileIp))) $arrAddr[\"address\"] .= $c;\n return $arrAddr;\n }\n }", "public static function ip_info()\r\n {\r\n\r\n $a = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.self::get_client_ip()));\r\n \r\n $a = Input::filter_text($a);\r\n \r\n return $a;\r\n \r\n }", "protected function fetchIp()\n {\n $ip = $this->request->server('REMOTE_ADDR');\n return implode('.', array_slice(explode('.', $ip), 0, 4 -1));\n }", "function bps_get_proxy_real_ip_address() {\n\t\n\tif ( is_admin() && wp_script_is( 'bps-accordion', $list = 'queue' ) && current_user_can('manage_options') ) {\n\t\tif ( isset($_SERVER['HTTP_CLIENT_IP'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['HTTP_CLIENT_IP']);\n\t\t\techo __('HTTP_CLIENT_IP IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\techo __('Proxy X-Forwarded-For IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t} elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['REMOTE_ADDR']);\n\t\t\techo __('Public Internet IP Address (ISP): ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t}\n\t}\n}", "function getCountryFromIp() {\n\n\n //error_log(\"getting country for your IP\");\n\n \n\n $ch = curl_init('http://geoip.nekudo.com/api/' . $_SERVER['REMOTE_ADDR']);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n\n $geoip = json_decode($result);\n \n if ($geoip) {\n $countryCode = $geoip->country->code;\n return $countryCode;\n\n \n }\n else {\n // No results returned from the API\n // return country US\n //error_log(\"no results from API, call getCountyFromURL\");\n \n return \"US\";\n }\n}", "public function filter($value)\n {\n\n\n\n $ip = long2ip(hexdec($value));\n\n return $ip;\n $validate = new Zend_Validate_Ip();\n if ($validate->isValid($ip)) {\n return $ip;\n }\n return false;\n }", "function ip_good($ip)\n{\n\t$bad_ip = true;\n\t\n\t# check the ip to see if it is a private ip\n\t# 192.168.x.x\n\t# 172.16-31.x.x\n\t# 10.x.x.x\n\t# 127.x.x.x\n\t$private_ip = '/^(172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3})|(192\\.168\\.\\d{1,3}.\\d{1,3})|(10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})|(127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})$/';\n\tif(preg_match($private_ip, $ip))\n\t{\n\t\t$bad_ip = true;\n\t} else {\n\t\t$bad_ip = false;\n\t}\n\t\n\t# Checks to see if the ip address is correctly formated\n\t# ie. It is between 0 and 255\n\t# exp. 206.13.28.12 would pass but 268.221.2.58 would fail.\n\t$patter = '/^\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b/';\n\tif(preg_match($patter, $ip) && $bad_ip === false)\n\t{\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function randomIPs_exists()\t{\n\t\treturn $this->recordNumber(self::RNDIPSC_NAME) > 0;\n\t}", "function getisp($ip='') {\n if ($ip=='') $ip = $_SERVER['REMOTE_ADDR'];\n $longisp = @gethostbyaddr($ip);\n $isp = explode('.', $longisp);\n $isp = array_reverse($isp);\n $tmp = $isp[1];\n if (preg_match(\"/\\<(org?|com?|net)\\>/i\", $tmp)) {\n $myisp = $isp[2].'.'.$isp[1].'.'.$isp[0];\n } else {\n $myisp = $isp[1].'.'.$isp[0];\n }\n if (preg_match(\"/[0-9]{1,3}\\.[0-9]{1,3}/\", $myisp))\n return 'ISP lookup failed.';\n return $myisp;\n}", "public function getIp()\r\n\t{\r\n\t\tif($this->getQuality() != FALSE OR $this->getSks() != FALSE)\r\n\t\t{\r\n\t\t\t$ipk = $this->getQuality() / $this->getSks();\r\n\r\n\t\t\t$pembulatan = round($ipk, ceil($ipk));\r\n\t\t} else {\r\n\t\t\t$pembulatan = 0.0000;\r\n\t\t}\r\n\r\n\t\treturn substr($pembulatan, 0, 5);\r\n\t}", "public static function prettifyIP( $ip ) {\n $ip = self::sanitizeIP( $ip ); // normalize (removes '::')\n if ( self::isIPv6( $ip ) ) {\n // Split IP into an address and a CIDR\n if ( strpos( $ip, '/' ) !== false ) {\n list( $ip, $cidr ) = explode( '/', $ip, 2 );\n } else {\n list( $ip, $cidr ) = array( $ip, '' );\n }\n // Get the largest slice of words with multiple zeros\n $offset = 0;\n $longest = $longestPos = false;\n while ( preg_match(\n '!(?:^|:)0(?::0)+(?:$|:)!', $ip, $m, PREG_OFFSET_CAPTURE, $offset\n ) ) {\n list( $match, $pos ) = $m[0]; // full match\n if ( strlen( $match ) > strlen( $longest ) ) {\n $longest = $match;\n $longestPos = $pos;\n }\n $offset += ( $pos + strlen( $match ) ); // advance\n }\n if ( $longest !== false ) {\n // Replace this portion of the string with the '::' abbreviation\n $ip = substr_replace( $ip, '::', $longestPos, strlen( $longest ) );\n }\n // Add any CIDR back on\n if ( $cidr !== '' ) {\n $ip = \"{$ip}/{$cidr}\";\n }\n // Convert to lower case to make it more readable\n $ip = strtolower( $ip );\n }\n return $ip;\n }", "public static function get_unsafe_client_ip()\n {\n }", "private function _getProxyIpAddress() {\n static $forwarded = [\n 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED',\n ];\n $flags = FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE;\n foreach ($forwarded as $key) {\n if (!array_key_exists($key, $_SERVER)) {\n continue;\n }\n sscanf($_SERVER[$key], '%[^,]', $ip);\n if (filter_var($ip, FILTER_VALIDATE_IP, $flags) !== FALSE) {\n return $ip;\n }\n }\n return '';\n }", "function rest_is_ip_address($ip)\n {\n }", "public static function isArvanCloud (string $ip): bool {\n $ar_ips = ['185.143.232.0/22', '92.114.16.80/28', '2.146.0.0/28', '46.224.2.32/29', '89.187.178.96/29', '195.181.173.128/29', '89.187.169.88/29', '188.229.116.16/29', '83.123.255.56/31', '164.138.128.28/31', '94.182.182.28/30', '185.17.115.176/30', '5.213.255.36/31', '138.128.139.144/29', '5.200.14.8/29', '188.122.68.224/29', '188.122.83.176/29', '213.179.217.16/29', '185.179.201.192/29', '43.239.139.192/29', '213.179.197.16/29', '213.179.201.192/29', '109.200.214.248/29', '138.128.141.16/29', '188.122.78.136/29', '213.179.211.32/29', '103.194.164.24/29', '185.50.105.136/29', '213.179.213.16/29', '162.244.52.120/29', '188.122.80.240/29', '109.200.195.64/29', '109.200.199.224/29', '185.228.238.0/28', '94.182.153.24/29', '94.101.182.0/27', '37.152.184.208/28', '78.39.156.192/28', '158.255.77.238/31', '81.12.28.16/29', '176.65.192.202/31', '2.144.3.128/28', '89.45.48.64/28', '37.32.16.0/27', '37.32.17.0/27', '37.32.18.0/27'];\n foreach ($ar_ips as $ar_ip) {\n if (self::ipInRange($ip,$ar_ip)) {\n return true;\n }\n }\n return false;\n }", "function webhost_code ($ip) {\n $webhost=\"\";\n $clients = conf('clients');\n foreach ($clients as $host=> $building) {\n $ip_addr = gethostbyname($host);\n if(! $ip_addr) {\n log_msg(LOG_DEBUG, \"No ip is found for $host\");\n }\n if($ip == $ip_addr) {\n $webhost = explode(\"-\", $building)[0];\n break;\n }\n }\n return $webhost;\n}", "function get_country_by_rdap($query, $real_time_data = false) {\n // Make sure given query is ip address\n if(filter_var($query, FILTER_VALIDATE_IP)) {\n $ip = $query;\n\n // Perform request depending on whether ip address is ipv4 or ipv6\n if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {\n $iana_ipv4 = [\"description\"=>\"RDAP bootstrap file for IPv4 address allocations\",\"publication\"=>\"2019-06-07T19:00:02Z\",\"services\"=>[[[\"41.0.0.0/8\",\"102.0.0.0/8\",\"105.0.0.0/8\",\"154.0.0.0/8\",\"196.0.0.0/8\",\"197.0.0.0/8\"],[\"https://rdap.afrinic.net/rdap/\",\"http://rdap.afrinic.net/rdap/\"]],[[\"1.0.0.0/8\", \"14.0.0.0/8\", \"27.0.0.0/8\", \"36.0.0.0/8\", \"39.0.0.0/8\", \"42.0.0.0/8\", \"43.0.0.0/8\", \"49.0.0.0/8\", \"58.0.0.0/8\", \"59.0.0.0/8\", \"60.0.0.0/8\", \"61.0.0.0/8\", \"101.0.0.0/8\", \"103.0.0.0/8\", \"106.0.0.0/8\", \"110.0.0.0/8\", \"111.0.0.0/8\", \"112.0.0.0/8\", \"113.0.0.0/8\", \"114.0.0.0/8\", \"115.0.0.0/8\", \"116.0.0.0/8\", \"117.0.0.0/8\", \"118.0.0.0/8\", \"119.0.0.0/8\", \"120.0.0.0/8\", \"121.0.0.0/8\", \"122.0.0.0/8\", \"123.0.0.0/8\", \"124.0.0.0/8\", \"125.0.0.0/8\", \"126.0.0.0/8\", \"133.0.0.0/8\", \"150.0.0.0/8\", \"153.0.0.0/8\", \"163.0.0.0/8\", \"171.0.0.0/8\", \"175.0.0.0/8\", \"180.0.0.0/8\", \"182.0.0.0/8\", \"183.0.0.0/8\", \"202.0.0.0/8\", \"203.0.0.0/8\", \"210.0.0.0/8\", \"211.0.0.0/8\", \"218.0.0.0/8\", \"219.0.0.0/8\", \"220.0.0.0/8\", \"221.0.0.0/8\", \"222.0.0.0/8\", \"223.0.0.0/8\"], [\"https://rdap.apnic.net/\"]], [[\"3.0.0.0/8\", \"4.0.0.0/8\", \"6.0.0.0/8\", \"7.0.0.0/8\", \"8.0.0.0/8\", \"9.0.0.0/8\", \"11.0.0.0/8\", \"12.0.0.0/8\", \"13.0.0.0/8\", \"15.0.0.0/8\", \"16.0.0.0/8\", \"17.0.0.0/8\", \"18.0.0.0/8\", \"19.0.0.0/8\", \"20.0.0.0/8\", \"21.0.0.0/8\", \"22.0.0.0/8\", \"23.0.0.0/8\", \"24.0.0.0/8\", \"26.0.0.0/8\", \"28.0.0.0/8\", \"29.0.0.0/8\", \"30.0.0.0/8\", \"32.0.0.0/8\", \"33.0.0.0/8\", \"34.0.0.0/8\", \"35.0.0.0/8\", \"38.0.0.0/8\", \"40.0.0.0/8\", \"44.0.0.0/8\", \"45.0.0.0/8\", \"47.0.0.0/8\", \"48.0.0.0/8\", \"50.0.0.0/8\", \"52.0.0.0/8\", \"54.0.0.0/8\", \"55.0.0.0/8\", \"56.0.0.0/8\", \"63.0.0.0/8\", \"64.0.0.0/8\", \"65.0.0.0/8\", \"66.0.0.0/8\", \"67.0.0.0/8\", \"68.0.0.0/8\", \"69.0.0.0/8\", \"70.0.0.0/8\", \"71.0.0.0/8\", \"72.0.0.0/8\", \"73.0.0.0/8\", \"74.0.0.0/8\", \"75.0.0.0/8\", \"76.0.0.0/8\", \"96.0.0.0/8\", \"97.0.0.0/8\", \"98.0.0.0/8\", \"99.0.0.0/8\", \"100.0.0.0/8\", \"104.0.0.0/8\", \"107.0.0.0/8\", \"108.0.0.0/8\", \"128.0.0.0/8\", \"129.0.0.0/8\", \"130.0.0.0/8\", \"131.0.0.0/8\", \"132.0.0.0/8\", \"134.0.0.0/8\", \"135.0.0.0/8\", \"136.0.0.0/8\", \"137.0.0.0/8\", \"138.0.0.0/8\", \"139.0.0.0/8\", \"140.0.0.0/8\", \"142.0.0.0/8\", \"143.0.0.0/8\", \"144.0.0.0/8\", \"146.0.0.0/8\", \"147.0.0.0/8\", \"148.0.0.0/8\", \"149.0.0.0/8\", \"152.0.0.0/8\", \"155.0.0.0/8\", \"156.0.0.0/8\", \"157.0.0.0/8\", \"158.0.0.0/8\", \"159.0.0.0/8\", \"160.0.0.0/8\", \"161.0.0.0/8\", \"162.0.0.0/8\", \"164.0.0.0/8\", \"165.0.0.0/8\", \"166.0.0.0/8\", \"167.0.0.0/8\", \"168.0.0.0/8\", \"169.0.0.0/8\", \"170.0.0.0/8\", \"172.0.0.0/8\", \"173.0.0.0/8\", \"174.0.0.0/8\", \"184.0.0.0/8\", \"192.0.0.0/8\", \"198.0.0.0/8\", \"199.0.0.0/8\", \"204.0.0.0/8\", \"205.0.0.0/8\", \"206.0.0.0/8\", \"207.0.0.0/8\", \"208.0.0.0/8\", \"209.0.0.0/8\", \"214.0.0.0/8\", \"215.0.0.0/8\", \"216.0.0.0/8\"], [\"https://rdap.arin.net/registry/\", \"http://rdap.arin.net/registry/\"]], [[\"2.0.0.0/8\", \"5.0.0.0/8\", \"25.0.0.0/8\", \"31.0.0.0/8\", \"37.0.0.0/8\", \"46.0.0.0/8\", \"51.0.0.0/8\", \"53.0.0.0/8\", \"57.0.0.0/8\", \"62.0.0.0/8\", \"77.0.0.0/8\", \"78.0.0.0/8\", \"79.0.0.0/8\", \"80.0.0.0/8\", \"81.0.0.0/8\", \"82.0.0.0/8\", \"83.0.0.0/8\", \"84.0.0.0/8\", \"85.0.0.0/8\", \"86.0.0.0/8\", \"87.0.0.0/8\", \"88.0.0.0/8\", \"89.0.0.0/8\", \"90.0.0.0/8\", \"91.0.0.0/8\", \"92.0.0.0/8\", \"93.0.0.0/8\", \"94.0.0.0/8\", \"95.0.0.0/8\", \"109.0.0.0/8\", \"141.0.0.0/8\", \"145.0.0.0/8\", \"151.0.0.0/8\", \"176.0.0.0/8\", \"178.0.0.0/8\", \"185.0.0.0/8\", \"188.0.0.0/8\", \"193.0.0.0/8\", \"194.0.0.0/8\", \"195.0.0.0/8\", \"212.0.0.0/8\", \"213.0.0.0/8\", \"217.0.0.0/8\"], [\"https://rdap.db.ripe.net/\"]], [[\"177.0.0.0/8\", \"179.0.0.0/8\", \"181.0.0.0/8\", \"186.0.0.0/8\", \"187.0.0.0/8\", \"189.0.0.0/8\", \"190.0.0.0/8\", \"191.0.0.0/8\", \"200.0.0.0/8\", \"201.0.0.0/8\"], [\"https://rdap.lacnic.net/rdap/\"]]], \"version\"=> \"1.0\"];\n if($real_time_data) {\n $iana_ipv4 = file_get_contents(\"http://data.iana.org/rdap/ipv4.json\");\n if(is_bool($iana_ipv4)) {\n return null;\n }\n $iana_ipv4 = json_decode($iana_ipv4, true);\n }\n $ip_parts = explode(\".\", $ip);\n foreach ($iana_ipv4[\"services\"] as $service) {\n foreach ($service[0] as $ip_range) {\n if($ip_range == $ip_parts[0].\".0.0.0/8\") {\n $service_rdap = file_get_contents(preg_replace(\"/https/i\", \"http\", $service[1][0]).\"ip/\".$ip);\n if($service_rdap == FALSE) {\n return null;\n }\n $service_rdap = json_decode($service_rdap, true);\n if(isset($service_rdap[\"country\"])) {\n return strtoupper($service_rdap[\"country\"]);\n } else {\n return null;\n }\n }\n }\n }\n } else if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n $iana_ipv6 = [\"description\"=> \"RDAP bootstrap file for IPv6 address allocations\", \"publication\"=> \"2019-11-06T19:00:04Z\", \"services\"=> [[[\"2001:4200::/23\", \"2c00::/12\"], [\"https://rdap.afrinic.net/rdap/\", \"http://rdap.afrinic.net/rdap/\"]], [[\"2001:200::/23\", \"2001:4400::/23\", \"2001:8000::/19\", \"2001:a000::/20\", \"2001:b000::/20\", \"2001:c00::/23\", \"2001:e00::/23\", \"2400::/12\"], [\"https://rdap.apnic.net/\"]], [[\"2001:1800::/23\", \"2001:400::/23\", \"2001:4800::/23\", \"2600::/12\", \"2610::/23\", \"2620::/23\", \"2630::/12\"], [\"https://rdap.arin.net/registry/\", \"http://rdap.arin.net/registry/\"]], [[\"2001:1400::/22\", \"2001:1a00::/23\", \"2001:1c00::/22\", \"2001:2000::/19\", \"2001:4000::/23\", \"2001:4600::/23\", \"2001:4a00::/23\", \"2001:4c00::/23\", \"2001:5000::/20\", \"2001:600::/23\", \"2001:800::/22\", \"2003::/18\", \"2a00::/12\", \"2a10::/12\"], [\"https://rdap.db.ripe.net/\"]], [[\"2001:1200::/23\", \"2800::/12\"], [\"https://rdap.lacnic.net/rdap/\"]]], \"version\"=>\"1.0\"];\n if($real_time_data) {\n $iana_ipv6 = file_get_contents(\"http://data.iana.org/rdap/ipv6.json\");\n if (is_bool($iana_ipv6)) {\n return null;\n }\n $iana_ipv6 = json_decode($iana_ipv6, true);\n }\n $ip_parts = explode(\":\", $ip);\n foreach ($iana_ipv6[\"services\"] as $service) {\n foreach ($service[0] as $ip_range) {\n if(preg_match(\"/\".$ip_parts[0].\":\".$ip_parts[1].\"::\\/\\d[\\d]*/\", $ip_range) || preg_match(\"/\".$ip_parts[0].\"::\\/\\d[\\d]*/\", $ip_range)) {\n $service_rdap = file_get_contents(preg_replace(\"/https/i\", \"http\", $service[1][0]).\"ip/\".$ip);\n if($service_rdap == FALSE) {\n return null;\n }\n $service_rdap = json_decode($service_rdap, true);\n if(isset($service_rdap[\"country\"])) {\n return strtoupper($service_rdap[\"country\"]);\n } else {\n return null;\n }\n }\n }\n }\n }\n }\n return null;\n}", "public function display_option_server_allowed_ip_regex() {\n $allowed_ip_regex = $this->options['server_allowed_ip_regex'];\n $this->display_input_text_field('server_allowed_ip_regex', $allowed_ip_regex);\n?>\nA <a href=\"http://www.php.net/manual/en/reference.pcre.pattern.syntax.php\">regular expression</a> that client IP addresses must match to clear the cache.\n<?php\n }", "function validIP($value)\n {\n return filter_var($value, FILTER_VALIDATE_IP);\n }", "public static function sanitizeIP( $ip ) {\n $ip = trim( $ip );\n if ( $ip === '' ) {\n return null;\n }\n if ( self::isIPv4( $ip ) || !self::isIPv6( $ip ) ) {\n return $ip; // nothing else to do for IPv4 addresses or invalid ones\n }\n // Remove any whitespaces, convert to upper case\n $ip = strtoupper( $ip );\n // Expand zero abbreviations\n $abbrevPos = strpos( $ip, '::' );\n if ( $abbrevPos !== false ) {\n // We know this is valid IPv6. Find the last index of the\n // address before any CIDR number (e.g. \"a:b:c::/24\").\n $CIDRStart = strpos( $ip, \"/\" );\n $addressEnd = ( $CIDRStart !== false )\n ? $CIDRStart - 1\n : strlen( $ip ) - 1;\n // If the '::' is at the beginning...\n if ( $abbrevPos == 0 ) {\n $repeat = '0:';\n $extra = ( $ip == '::' ) ? '0' : ''; // for the address '::'\n $pad = 9; // 7+2 (due to '::')\n // If the '::' is at the end...\n } elseif ( $abbrevPos == ( $addressEnd - 1 ) ) {\n $repeat = ':0';\n $extra = '';\n $pad = 9; // 7+2 (due to '::')\n // If the '::' is in the middle...\n } else {\n $repeat = ':0';\n $extra = ':';\n $pad = 8; // 6+2 (due to '::')\n }\n $ip = str_replace( '::',\n str_repeat( $repeat, $pad - substr_count( $ip, ':' ) ) . $extra,\n $ip\n );\n }\n // Remove leading zereos from each bloc as needed\n $ip = preg_replace( '/(^|:)0+(' . RE_IPV6_WORD . ')/', '$1$2', $ip );\n return $ip;\n }", "private function getIp()\n\t {\n\t \n\t if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&( $_SERVER['HTTP_X_FORWARDED_FOR'] != '' ))\n\t {\n\t $client_ip =\n\t ( !empty($_SERVER['REMOTE_ADDR']) ) ?\n\t $_SERVER['REMOTE_ADDR']\n\t :\n\t ( ( !empty($_ENV['REMOTE_ADDR']) ) ?\n\t $_ENV['REMOTE_ADDR']\n\t :\n\t \"unknown\" );\n\t \n\t // los proxys van añadiendo al final de esta cabecera\n\t // las direcciones ip que van \"ocultando\". Para localizar la ip real\n\t // del usuario se comienza a mirar por el principio hasta encontrar\n\t // una dirección ip que no sea del rango privado. En caso de no\n\t // encontrarse ninguna se toma como valor el REMOTE_ADDR\n\t \n\t $entries = split('[, ]', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t \n\t reset($entries);\n\t while (list(, $entry) = each($entries))\n\t {\n\t $entry = trim($entry);\n\t if ( preg_match(\"/^([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)/\", $entry, $ip_list) )\n\t {\n\t // http://www.faqs.org/rfcs/rfc1918.html\n\t $private_ip = array(\n\t '/^0\\./',\n\t '/^127\\.0\\.0\\.1/',\n\t '/^192\\.168\\..*/',\n\t '/^172\\.((1[6-9])|(2[0-9])|(3[0-1]))\\..*/',\n\t '/^10\\..*/');\n\t \n\t $found_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);\n\t \n\t if ($client_ip != $found_ip)\n\t {\n\t $client_ip = $found_ip;\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t else\n\t {\n\t $client_ip =\n\t ( !empty($_SERVER['REMOTE_ADDR']) ) ?\n\t $_SERVER['REMOTE_ADDR']\n\t :\n\t ( ( !empty($_ENV['REMOTE_ADDR']) ) ?\n\t $_ENV['REMOTE_ADDR']\n\t :\n\t \"unknown\" );\n\t }\n\t \n\t return $client_ip;\n\t \n\t}", "function getIPs() {\r\n $ip = $_SERVER[\"REMOTE_ADDR\"];\r\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n \t$ip .= '_'.$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n }\r\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\r\n \t$ip .= '_'.$_SERVER['HTTP_CLIENT_IP'];\r\n }\r\n return $ip;\r\n}", "function testIpAddressField() {\n // Display creation form.\n $this->drupalGet('entity_test/add');\n $this->assertFieldByName(\"{$this->field_name}[0][value]\", '', \"IP address element found ({$this->field_name}[0][value])\");\n\n // First put in buggy data\n $edit = array(\n \"{$this->field_name}[0][value]\" => 'A255.255.255.255 - 255.255.255.255',\n );\n $this->drupalPostForm(NULL, $edit, t('Save'));\n $this->assertText('Please provide a valid', 'Buggy input has been caught.');\n\n // Second, put in too big span\n $edit = array(\n \"{$this->field_name}[0][value]\" => '1.1.1.1 - 255.255.255.255',\n );\n $this->drupalPostForm(NULL, $edit, t('Save'));\n $this->assertText('Please make sure', 'To big IP range has been caught.');\n\n // Put in some data\n $edit = array(\n \"{$this->field_name}[0][value]\" => '255.255.255.255 - 255.255.255.255',\n );\n $this->drupalPostForm(NULL, $edit, t('Save'));\n\n\n preg_match('|entity_test/manage/(\\d+)|', $this->url, $match);\n $this->assert(isset($match[1]), \"URL matched after entity form submission ({$this->url})\");\n $id = $match[1];\n $this->assertText(t('entity_test @id has been created.', array('@id' => $id)));\n $this->assertText($value, 'Data is present on page after form submission.');\n\n // Make sure we can query the data\n\n $greater_than_value = '255.255.255.254';\n $query = \\Drupal::entityQuery('entity_test')\n ->condition($this->field_name . '.ip_from', $greater_than_value, '>');\n\n $nids = $query->execute();\n $this->assert((count($nids) == 1), 'Entity query matches number of created entities.');\n }", "protected function ip_address()\n\t{\n\t\t//return $this->ip2int(ipaddress::get());\n\t\t//return $this->ip2int(server('REMOTE_ADDR'));\n\t\treturn server('REMOTE_ADDR');\n\t}", "function getIpCustomer(){\n$ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'IP Tidak Dikenali';\n \n return $ipaddress;\n}", "function return_ns_ip($domain) {\n\tglobal $dns_ip_list_c;\n\tif (!@file_exists(\"/usr/bin/dig\")) return;\n\t$msg=array();\n\t//echo $domain.\"\\n\";\n\tfor ($i=0;$i<sizeof($dns_ip_list_c);$i++) {\n\t\t//echo sizeof($dns_ip_list_c[$i]).\"\\n\";\n\t\tfor ($j=0;$j<sizeof($dns_ip_list_c[$i]);$j++) {\n\t\t\t$nip=$dns_ip_list_c[$i][$j][1];\n\t\t\t//echo $nip.\"\\n\";\n\t\t\texec(\"dig @$nip +short +time=1 +tries=1 +retry=1 $domain\",$str,$re);\n\t\t\t//$msg[$nip]=$str[0];\n\t\t\t$msg[]=$str[0];\n\t\t\t$str=\"\";\n\t\t\t//print_r($str);\n\t\t\t//$msg[]=$\n\t\t\t//echo $dns_ip_list_c[$i][$j][1].\"\\n\";\n\t\t}\n\t}\n\t//print_r($msg);\n\treturn $msg;\n}", "function getIP($remoteAddress) {\n if (empty($remoteAddress)) {\n return \"\";\n }\n\n // Capture the first three octects of the IP address and replace the forth\n // with 0, e.g. 124.455.3.123 becomes 124.455.3.0\n $regex = \"/^([^.]+\\.[^.]+\\.[^.]+\\.).*/\";\n if (preg_match($regex, $remoteAddress, $matches)) {\n return $matches[1] . \"0\";\n } else {\n return \"\";\n }\n }", "function ip()\n{\n return \\SumanIon\\CloudFlare::ip();\n}", "function checkCIDRBlacklist($ip)\n{\n $us_backlist = array(\n //'23','24','50','63','64','65','66','67','68','69','70','71','72','73','74','75','76','96','97',\n //'98','99','100','104','107','108','142','162','163','172','173','174','184','192','198','199','204','205','206','207','208','209','216'\n );\n $cidr = substr($ip, 0, strpos($ip, '.')); // xxx\n if(!empty($us_backlist) && in_array($cidr, $us_backlist))\n return true;\n\n $blacklist = array(\n //'27.67',\n //'27.74',\n //'171.253',\n //'171.249',\n //'59.153',\n //'113.185',\n //'113.161',\n //'115.84',\n //'115.73',\n //'117.0',\n //'117.1',\n //'117.2',\n //'117.3',\n //'117.4',\n //'117.5',\n //'125.212',\n //'123.31',\n //'123.24',\n //'101.99',\n //'58.187', // FPT\n //'183.80', // FPT\n //'183.81', // FPT\n //'42.112', // FPT\n //'42.117', // FPT\n //'1.52', // FPT\n //'1.53', // FPT\n );\n //$cidr = substr($ip, 0, strrpos($ip, '.')); // xxx.xxx.xxx\n $cidr = substr($ip, 0, strpos($ip, '.', strpos($ip, '.') + 1)); // xxx.xxx\n if(!empty($blacklist) && in_array($cidr, $blacklist))\n return true;\n else\n return false;\n}", "public function strictIPs() {\n\t\treturn false;\n\t}", "function geoCheckIP($ip)\n{\n\t if(!filter_var($ip, FILTER_VALIDATE_IP))\n\t {\n\t\t\t throw new InvalidArgumentException(\"IP is not valid\");\n\t }\n\n\t //contact ip-server\n\t \n\t //$response=@file_get_contents('http://www.netip.de/search?query='.$ip);\n\t $response=@file_get_contents('http://api.hostip.info/country.php?ip='.$ip);\n\t \n\t if (empty($response))\n\t {\n\t\t\t throw new InvalidArgumentException(\"Error contacting Geo-IP-Server\");\n\t }\n\n\t /*\n\t //Array containing all regex-patterns necessary to extract ip-geoinfo from page\n\t $patterns=array();\n\t $patterns[\"domain\"] = '#Domain: (.*?)&nbsp;#i';\n\t $patterns[\"country\"] = '#Country: (.*?)&nbsp;#i';\n\t $patterns[\"state\"] = '#State/Region: (.*?)<br#i';\n\t $patterns[\"town\"] = '#City: (.*?)<br#i';\n\n\t //Array where results will be stored\n\t $ipInfo=array();\n\n\t //check response from ipserver for above patterns\n\t foreach ($patterns as $key => $pattern)\n\t {\n\t\t\t //store the result in array\n\t\t\t $ipInfo[$key] = preg_match($pattern,$response,$value) && !empty($value[1]) ? $value[1] : 'not found';\n\t }\n\n\t return $ipInfo;\n\t */\n\t return $response;\n}", "public function generate_ip()\n {\n $gameIP1 = rand(0, 255);\n $gameIP2 = rand(0, 255);\n $gameIP3 = rand(0, 255);\n $gameIP4 = rand(0, 255);\n\n return $gameIP1 . '.' . $gameIP2 . '.' . $gameIP3 . '.' . $gameIP4;\n }", "function get_ip_address()\n{\n//\tif( isDev() )\n//\t\treturn \"66.135.205.14\";\t// US (ebay.com)\n//\t\treturn \"46.122.252.60\"; // ljubljana\n//\t\treturn \"190.172.82.24\"; // argentinia?\n//\t\treturn \"84.154.26.132\"; // probably invalid ip from munich\n//\t\treturn \"203.208.37.104\"; // google.cn\n//\t\treturn \"62.215.83.54\";\t// kuwait\n//\t\treturn \"41.250.146.224\";\t// Morocco (rtl!)\n//\t\treturn \"66.135.205.14\";\t// US (ebay.com)\n//\t\treturn \"121.243.179.122\";\t// india\n//\t\treturn \"109.253.21.90\";\t// invalid (user says UK)\n//\t\treturn \"82.53.187.74\";\t// IT\n//\t\treturn \"190.172.82.24\";\t// AR\n//\t\treturn \"99.230.167.125\";\t// CA\n//\t\treturn \"95.220.134.145\";\t// N/A\n//\t\treturn \"194.126.108.2\";\t// Tallinn/Estonia (Skype static IP)\n\n\tstatic $DETECTED_CLIENT_IP = 'undefined';\n\n\tif( $DETECTED_CLIENT_IP !== 'undefined' )\n\t\treturn $DETECTED_CLIENT_IP;\n\n\t$proxy_headers = array(\n\t\t'HTTP_VIA',\n\t\t'HTTP_X_FORWARDED_FOR',\n\t\t'HTTP_FORWARDED_FOR',\n\t\t'HTTP_X_FORWARDED',\n\t\t'HTTP_FORWARDED',\n\t\t'HTTP_CLIENT_IP',\n\t\t'HTTP_FORWARDED_FOR_IP',\n\t\t'VIA',\n\t\t'X_FORWARDED_FOR',\n\t\t'FORWARDED_FOR',\n\t\t'X_FORWARDED',\n\t\t'FORWARDED',\n\t\t'CLIENT_IP',\n\t\t'FORWARDED_FOR_IP',\n\t\t'HTTP_PROXY_CONNECTION',\n\t\t'REMOTE_ADDR' // REMOTE_ADDR must be last -> fallback\n\t);\n\n\tforeach( $proxy_headers as $ph )\n\t{\n\t\tif( !empty($_SERVER) && isset($_SERVER[$ph]) )\n\t\t{\n\t\t\t$DETECTED_CLIENT_IP = $_SERVER[$ph];\n\t\t\tbreak;\n\t\t}\n\t\telseif( !empty($_ENV) && isset($_ENV[$ph]) )\n\t\t{\n\t\t\t$DETECTED_CLIENT_IP = $_ENV[$ph];\n\t\t\tbreak;\n\t\t}\n\t\telseif( @getenv($ph) )\n\t\t{\n\t\t\t$DETECTED_CLIENT_IP = getenv($ph);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif( !isset($DETECTED_CLIENT_IP) )\n\t\treturn false;\n\n\t$is_ip = preg_match('/^(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})/',$DETECTED_CLIENT_IP,$regs);\n\tif( $is_ip && (count($regs) > 0) )\n\t\t$DETECTED_CLIENT_IP = $regs[1];\n\treturn $DETECTED_CLIENT_IP;\n}", "public function getIpAdress(){\n return $this->auth['ip_adress'];\n }", "function ip_info($ip = NULL, $purpose = \"country_code\", $deep_detect = TRUE) {\n $output = NULL;\n if (filter_var($ip, FILTER_VALIDATE_IP) === FALSE) {\n $ip = $_SERVER[\"REMOTE_ADDR\"];\n if ($deep_detect) {\n if (filter_var(@$_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP))\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n if (filter_var(@$_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP))\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }\n }\n $purpose = str_replace(array(\"name\", \"\\n\", \"\\t\", \" \", \"-\", \"_\"), NULL, strtolower(trim($purpose)));\n if (filter_var($ip, FILTER_VALIDATE_IP) && in_array($purpose, $support)) {\n $ipwhois_result = @json_decode(file_get_contents(\"http://ipwhois.app/json/\" . $ip));\n if (@strlen(trim($ipwhois_result->geoplugin_countryCode)) == 2) \n\t\t$cc=@$ipwhois_result->geoplugin_country_code{\n switch ($purpose) {\n case $cc:\n\t\t\t\t$content = @$ipwhois_result->geoplugin_countryName;\n\t\t\t\tbreak;\n }\n }\n }\n echo '<div>'.Weloceme to $content.'</div>';\n}", "public function __toString()\n {\n return long2ip($this->ip);\n }", "function getPais($ip = false){\n $ip = ($ip==false)?getUserIP():$ip;\n $key=\"7b471597a8e15e665536cef21de5b54ffc5a38a7\";\n $data= file_get_contents(\"http://api.db-ip.com/addrinfo?addr=$ip&api_key=$key\");\n $data = json_decode($data,true);\n return ($data['country']);\n}", "public function ip_address()\n {\n\t\tif ( function_exists( 'apache_request_headers' ) ) {\n\t\t\t$headers = apache_request_headers();\n\t\t\tif (array_key_exists('X-Forwarded-For', $headers)) {\n\t\t\t\tif (filter_var( $headers['X-Forwarded-For'],\n\t\t\t\t\tFILTER_VALIDATE_IP,\n\t\t\t\t\tFILTER_FLAG_IPV4 )) {\n\t\t\t\t\treturn $headers['X-Forwarded-For'];\n\t\t\t\t} else {\n\t\t\t\t\t$tokens = explode(\",\", $headers['X-Forwarded-For']);\n\t\t\t\t\tforeach ($tokens as $token) {\n\t\t\t\t\t\t$token = trim($token);\n\t\t\t\t\t\tif (filter_var( $token,\n\t\t\t\t\t\t\tFILTER_VALIDATE_IP,\n\t\t\t\t\t\t\tFILTER_FLAG_IPV4 ) && !isPrivateIp($token)) {\n\t\t\t\t\t\t\treturn $token;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Otherwise, use the SERVER global.\n\t\t$keys = array(\n\t\t\t\t'HTTP_CLIENT_IP',\n\t\t\t\t'HTTP_X_FORWARDED_FOR',\n\t\t\t\t'HTTP_X_FORWARDED',\n\t\t\t\t'HTTP_X_CLUSTER_CLIENT_IP',\n\t\t\t\t'HTTP_FORWARDED_FOR',\n\t\t\t\t'HTTP_FORWARDED',\n\t\t\t\t'REMOTE_ADDR');\n\t\n\t foreach ($keys as $key){\n\t if (array_key_exists($key, $_SERVER)){\n\t foreach (explode(',', $_SERVER[$key]) as $ip){\n\t $ip = trim($ip);\n\t if (filter_var($ip, FILTER_VALIDATE_IP,\n\t FILTER_FLAG_NO_PRIV_RANGE |\n\t FILTER_FLAG_NO_RES_RANGE) !== false){\n\t return $ip;\n\t }\n\t }\n\t }\n\t }\n\t // No valid IP is detected. We are going to return empty string.\n\t return parent::ip_address();\n }", "function getCountry($ip_address){\n $url = \"http://ip-to-country.webhosting.info/node/view/36\";\n $inici = \"src=/flag/?type=2&cc2=\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST,\"POST\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"ip_address=$ip_address\"); \n \n ob_start();\n \n curl_exec($ch);\n curl_close($ch);\n $cache = ob_get_contents();\n ob_end_clean();\n \n $resto = strstr($cache,$inici);\n $pais = substr($resto,strlen($inici),2);\n \n return $pais;\n }", "public function getIp(): string\n {\n return $this->ip;\n }", "public function getIp(): string\n {\n return $this->ip;\n }", "function ip_is_local($ip){\r\n\t\r\n\t $ipv4array = explode('.',$ip); $ipv6array = explode(':',$ip);\r\n\t $lenipv4 = count($ipv4array) ; $lenipv6 = count($ipv6array); \r\n\t $ipint = array(); \r\n\t if($lenipv4 > 0 ){//We have an ipv4 address\r\n\t\t for ($i = 0 ; $i<$lenipv4 ; $i++){\r\n\t\t\t $ipint[$i] = intval($ipv4array[$i]) ; //Generating integera values for the ips\r\n\t\t }\r\n\t\t \r\n\t\t\t//Let's see if our IP is riv ate\r\n\t\t\tif ($ipint[0] == 10) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if ($ipint[0] == 172 && $ipint[1] > 15 && $ipint[1] < 32) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if ($ipint[0] == 192 && $ipint[1] == 168) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else return false ;\r\n\t }else{\r\n\t //Either something went wrong, or we are in IPV6 format.\t \r\n\t\t \r\n\t\t if( $lenipv6 > 0){//We are having a big IPV6 address here !\r\n\t\t\t //We are in IPV4. Haven't implemented IPV6 yet\r\n\t\t\t \r\n\t\t }\r\n\t\t return false ;\r\n\t }\r\n\t \r\n\t \r\n\t return false;\r\n}", "function validate_ip($ip) {\n\t\t\t// Define all IPv6 address types\n\t\t\t$ipv6regexes = array(\n\t\t\t\t\"preferred\" => array(\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i\"\n\t\t\t\t),\n\t\t\t\t\"compressed\" => array(\n\t\t\t\t\t\"/^[a-f0-9]{0,4}::$/i\",\n\t\t\t\t\t\"/^:(?::[a-f0-9]{1,4}){1,6}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){1,6}:$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:)(?::[a-f0-9]{1,4}){1,6}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){2}(?::[a-f0-9]{1,4}){1,5}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){3}(?::[a-f0-9]{1,4}){1,4}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){4}(?::[a-f0-9]{1,4}){1,3}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){5}(?::[a-f0-9]{1,4}){1,2}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){6}(?::[a-f0-9]{1,4})$/i\"\n\t\t\t\t),\n\t\t\t\t\"ipv4\" => array(\n\t\t\t\t\t\"/^::(?:\\d{1,3}\\.){3}\\d{1,3}$/\",\n\t\t\t\t\t\"/^(?:0:){6}(?:\\d{1,3}\\.){3}\\d{1,3}$/i\"\n\t\t\t\t),\n\t\t\t\t\"ipv4_mapped\" => array(\n\t\t\t\t\t\"/^(?:0:){5}ffff:(?:\\d{1,3}\\.){3}\\d{1,3}$/i\",\n\t\t\t\t\t\"/^::ffff:(?:\\d{1,3}\\.){3}\\d{1,3}$/\"\n\t\t\t\t)\n\t\t\t);\n\t\t\t// Search the address types and return the name if it matches\n\t\t\tforeach ($ipv6regexes as $type => $regexes) {\n\t\t\t\tforeach ($regexes as $regex)\n\t\t\t\t\tif (preg_match($regex, $ip)) {\n\t\t\t\t\t\tif (in_array($type, array(\"ipv4\", \"ipv4_mapped\"))) {\n\t\t\t\t\t\t\t$ipparts = explode(\":\", $ip);\n\t\t\t\t\t\t\t$ipv4part = $ipparts[count($ipparts)-1];\n\t\t\t\t\t\t\tif (IPv4::validate_ip($ipv4part))\n\t\t\t\t\t\t\t\treturn $type;\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\treturn $type;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Return false if we didn't match an address type\n\t\t\treturn false;\n\t\t}", "public function checkBackendIpOrDie() {}", "public function getNatIP()\n {\n return isset($this->nat_i_p) ? $this->nat_i_p : '';\n }", "function listNetworkIp($net,$broadcast,$sn) {\n\n $lista=[]; // lista da ritornare \n\n $no = explode('.', $net); // array con gli ottetti dell'indirizzo NET\n $bo = explode('.', $broadcast); // array con gli ottetti dell'indirizzo NET\n\n $nbit = 32-$sn; // numero di bit assegnati agli host\n \n $nhost = pow(2,$nbit); // numero totale degli host\n\n $start = (int) $no[3]+1;\n $end = (int) $bo[3]-1;\n $roots = $no[0].\".\".$no[1].\".\".$no[2].\".\";\n $roote = $bo[0].\".\".$bo[1].\".\".$bo[2].\".\";\n $primo = $roots.$start;\n $ultimo = $roote.$end;\n $hosts = [];\n\n //echo $start.\" - \".$end.\"<br>\";\n\n // verifica che gli IP disponibili non superino le 5000 unità -> stila la lista\n if($nhost > 35000) {\n $lista[0] = $primo;\n $lista[1] = $ultimo;\n }\n else {\n for($i=ip2long($primo); $i<=ip2long($ultimo); $i++) {\n\n $ip2conv = $i;\n $ip2write = long2ip($ip2conv);\n $lista[] = $ip2write;\n \n $host=gethostbyaddr($ip2write); // prelevo il nome del host (se disponibile)\n //echo $host.\" | \";\n\n // se il nome host NON è uguale all'IP -> salvo il nome Host in una lista\n if(!filter_var($host, FILTER_VALIDATE_IP)) {\n $hosts[] = \"IP: $ip2write ==> Nome Host:<b> $host </b><br>\";\n }\n\n }\n }\n\n $ret['hostnames'] = $hosts;\n $ret['primo'] = $primo;\n $ret['ultimo'] = $ultimo;\n $ret['lista'] = $lista;\n $ret['nhost'] = $nhost; \n\n return $ret;\n}", "protected static function _anonymizeIp($ip)\n {\n $strlen = strlen($ip);\n if ($strlen > 6) {\n $divider = (int)floor($strlen / 4) + 1;\n $ip = substr_replace($ip, '…', $divider, $strlen - (2 * $divider));\n }\n\n return $ip;\n }", "function is_ip_banned($ip, $banned_ips)\n {\n foreach($banned_ips as $banned_ip) // go through every $banned_ip\n {\n if(strpos($banned_ip,'*')!==false) // $banned_ip contains \"*\" = > IP range\n {\n $ip_range = substr($banned_ip, 0, strpos($banned_ip, '*')); // fetch part before \"*\"\n if(strpos($ip, $ip_range)===0) // check if IP begins with part before \"*\"\n {\n return true;\n }\n }\n elseif(strpos($banned_ip,'/')!==false && preg_match(\"/(([0-9]{1,3}\\.){3}[0-9]{1,3})\\/([0-9]{1,2})/\", $banned_ip, $regs)) // $banned_ip contains \"/\" => CIDR notation (the regular expression is only used if $banned_ip contains \"/\")\n {\n // convert IP into bit pattern:\n $n_user_leiste = '00000000000000000000000000000000'; // 32 bits\n $n_user_ip = explode('.',trim($ip));\n for ($i = 0; $i <= 3; $i++) // go through every byte\n {\n for ($n_j = 0; $n_j < 8; $n_j++) // ... check every bit\n {\n if($n_user_ip[$i] >= pow(2, 7-$n_j)) // set to 1 if necessary\n {\n $n_user_ip[$i] = $n_user_ip[$i] - pow(2, 7-$n_j);\n $n_user_leiste[$n_j + $i*8] = '1';\n }\n }\n }\n // analyze prefix length:\n $n_byte_array = explode('.',trim($regs[1])); // IP -> 4 Byte\n $n_cidr_bereich = $regs[3]; // prefix length\n // bit pattern:\n $n_bitleiste = '00000000000000000000000000000000';\n for ($i = 0; $i <= 3; $i++) // go through every byte\n {\n if ($n_byte_array[$i] > 255) // invalid\n {\n $n_cidr_bereich = 0;\n }\n for ($n_j = 0; $n_j < 8; $n_j++) // ... check every bit\n {\n if($n_byte_array[$i] >= pow(2, 7-$n_j)) // set to 1 if necessary\n {\n $n_byte_array[$i] = $n_byte_array[$i] - pow(2, 7-$n_j);\n $n_bitleiste[$n_j + $i*8] = '1';\n }\n }\n }\n // check if bit patterns match on the first n chracters:\n if (strncmp($n_bitleiste, $n_user_leiste, $n_cidr_bereich) == 0 && $n_cidr_bereich > 0)\n {\n return true;\n }\n }\n else // neither \"*\" nor \"/\" => simple comparison:\n {\n if($ip == $banned_ip)\n {\n return true;\n }\n }\n }\n return false;\n }", "function get_client_ip_2() {\r\n $ipaddress = '';\r\n if (isset($_SERVER['HTTP_CLIENT_IP']))\r\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\r\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\r\n else if(isset($_SERVER['REMOTE_ADDR']))\r\n $ipaddress = $_SERVER['REMOTE_ADDR'];\r\n else\r\n $ipaddress = 'IP tidak dikenali';\r\n return $ipaddress;\r\n}", "public function set_real_ip() {\r\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\r\n\t\tif ( ! isset( $_SERVER['HTTP_CF_CONNECTING_IP'], $_SERVER['REMOTE_ADDR'] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$cf_ips_values = $this->cloudflare->get_cloudflare_ips();\r\n\t\t$cf_ip_ranges = $cf_ips_values->result->ipv6_cidrs;\r\n\t\t$ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );\r\n\t\t$ipv6 = get_rocket_ipv6_full( $ip );\r\n\t\tif ( false === strpos( $ip, ':' ) ) {\r\n\t\t\t// IPV4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\r\n\t\t\t$cf_ip_ranges = $cf_ips_values->result->ipv4_cidrs;\r\n\t\t}\r\n\r\n\t\tforeach ( $cf_ip_ranges as $range ) {\r\n\t\t\tif (\r\n\t\t\t\t( strpos( $ip, ':' ) && rocket_ipv6_in_range( $ipv6, $range ) )\r\n\t\t\t\t||\r\n\t\t\t\t( false === strpos( $ip, ':' ) && rocket_ipv4_in_range( $ip, $range ) )\r\n\t\t\t) {\r\n\t\t\t\t$_SERVER['REMOTE_ADDR'] = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getClientIpAddress()\n\t{\n\t\tif(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown'))\n\t\t{\n\t\t\t$onlineip = getenv('HTTP_CLIENT_IP');\n\t\t}\n\t\t\n\t\tif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown'))\n\t\t{\n\t\t\t$onlineip = getenv('HTTP_X_FORWARDED_FOR');\n\t\t}\n\t\t\n\t\tif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown'))\n\t\t{\n\t\t\t$onlineip = getenv('REMOTE_ADDR');\n\t\t}\n\t\t\n\t\tif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown'))\n\t\t{\n\t\t\t$onlineip = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\t\t\n\t\tpreg_match(\"/[\\d\\.]{7,15}/\", $onlineip, $onlineipmatches);\n\t\treturn $onlineipmatches[0] ? $onlineipmatches[0] : 'unknown';\n\t}", "function get_ip()\n{\n\t// No IP found (will be overwritten by for\n\t// if any IP is found behind a firewall)\n\t$ip = FALSE;\n\n\t// If HTTP_CLIENT_IP is set, then give it priority\n\tif (!empty($_SERVER[\"HTTP_CLIENT_IP\"])) {\n\t\t$ip = $_SERVER[\"HTTP_CLIENT_IP\"];\n\t}\n\n\t// User is behind a proxy and check that we discard RFC1918 IP addresses\n\t// if they are behind a proxy then only figure out which IP belongs to the\n\t// user. Might not need any more hackin if there is a squid reverse proxy\n\t// infront of apache.\n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\n\t\t// Put the IP's into an array which we shall work with shortly.\n\t\t$ips = explode (\", \", $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\tif ($ip) {\n\t\t\tarray_unshift($ips, $ip);\n\t\t\t$ip = FALSE;\n\t\t}\n\n\t\tfor ($i = 0; $i < count($ips); $i++)\n\t\t{\n\t\t\t// Skip RFC 1918 IP's 10.0.0.0/8, 172.16.0.0/12 and\n\t\t\t// 192.168.0.0/16 -- jim kill me later with my regexp pattern\n\t\t\t// below.\n\t\t\tif (!eregi (\"^(10|172\\.16|192\\.168)\\.\", $ips[$i])) {\n\t\t\t\tif (version_compare(phpversion(), \"5.0.0\", \">=\")) {\n\t\t\t\t\tif (ip2long($ips[$i]) != false) {\n\t\t\t\t\t\t$ip = $ips[$i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (ip2long($ips[$i]) != -1) {\n\t\t\t\t\t\t$ip = $ips[$i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return with the found IP or the remote address\n\treturn ($ip ? $ip : $_SERVER['REMOTE_ADDR']);\n}" ]
[ "0.6714737", "0.64764386", "0.59983623", "0.59508896", "0.5948512", "0.5860382", "0.5858619", "0.58234715", "0.58148885", "0.57203794", "0.5671651", "0.56664664", "0.5653461", "0.5634075", "0.56334496", "0.5614806", "0.5607978", "0.56062055", "0.5586156", "0.5571645", "0.55550915", "0.5540726", "0.5513253", "0.5495267", "0.5477151", "0.54587775", "0.5458734", "0.54472166", "0.5427977", "0.54228264", "0.5415903", "0.54142094", "0.5401143", "0.53990215", "0.53956586", "0.538277", "0.53774554", "0.53706455", "0.5365752", "0.5359292", "0.53571767", "0.53415203", "0.5339859", "0.5335156", "0.532749", "0.5317909", "0.5303853", "0.5294201", "0.5293874", "0.5291933", "0.52912056", "0.5276596", "0.5265099", "0.52649885", "0.5262717", "0.5260632", "0.5259955", "0.52544326", "0.52388465", "0.5238809", "0.5229796", "0.5223227", "0.522077", "0.52116793", "0.52100986", "0.52072793", "0.5205861", "0.5205707", "0.52017474", "0.52015734", "0.51934147", "0.51931363", "0.51850986", "0.51775545", "0.5174194", "0.5173243", "0.5166449", "0.5162898", "0.5160254", "0.5160024", "0.5156661", "0.5134118", "0.513268", "0.5132648", "0.5123314", "0.5116687", "0.5107108", "0.510687", "0.5105721", "0.5105721", "0.5098933", "0.5097323", "0.5093652", "0.5092832", "0.50903064", "0.50839484", "0.50832033", "0.508177", "0.50793576", "0.5077845", "0.50749" ]
0.0
-1
this returns data which contains two array index values:
public function fetch_courses() { $config = array(); $config["base_url"] = base_url() . "Home/Student-Courses/"; $config['total_rows'] = $this->admin_student_courses_mdl->count_courses(); $config['per_page'] = 5; $config['use_page_numbers'] = TRUE; $config['uri_segment'] = 3; $this->pagination->initialize($config); if($this->uri->segment(3) > 0){ $offset = ($this->uri->segment(3) + 0)*$config['per_page'] - $config['per_page']; } else{ $offset = $this->uri->segment(3); } $data['results'] = $this->admin_student_courses_mdl->fetch_courses($config["per_page"], $offset); $data["links"] = $this->pagination->create_links(); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMultipleData();", "public function getData()\n {\n //let's assume that this array is from a database\n return array('persian', 'bob', 'tabby', 'stray');\n }", "public function getDataArray(){\n return array($this->item_id,$this->name,$this->count,$this->price);\n }", "public function getbyindex2($index){\n $condition['index'] = $index;\n $result = $this->where($condition) ->select();\n return $result;\n \n }", "function getData()\n{\n return array(\n array(\"name\"=>\"Bob\",\"age\"=>50),\n array(\"name\"=>\"Jane\",\"age\"=>41),\n array(\"name\"=>\"Sarah\",\"age\"=>30)\n );\n}", "private function _getData():array {\n\n # Set result\n $result = [];\n\n # Return result\n return $result;\n\n }", "public function DataGenerateArray() {\n $data = $this->GenerateArray();\n return $data['data']; \n }", "public function getData($key = '', $index = null);", "public function get_data(): array;", "public function get_data(): array;", "public function getData()\n\t{\n\t\treturn array_merge($this->values, $this->rest, array('id' => $this->getID()));\n\t}", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "protected function data()\n {\n $row = array('id' => 0, 'name' => '', 'age' => 0, 'gender' => '');\n\n $rougin = $angel = $royce = $roilo = $rouine = $row;\n\n $rougin['id'] = 1;\n $rougin['name'] = 'rougin';\n $rougin['age'] = 18;\n $rougin['gender'] = 'male';\n\n $angel['id'] = 2;\n $angel['name'] = 'angel';\n $angel['age'] = 19;\n $angel['gender'] = 'female';\n\n $royce['id'] = 3;\n $royce['name'] = 'royce';\n $royce['age'] = 15;\n $royce['gender'] = 'male';\n\n $roilo['id'] = 4;\n $roilo['name'] = 'roilo';\n $roilo['age'] = 17;\n $roilo['gender'] = 'male';\n\n $rouine['id'] = 5;\n $rouine['name'] = 'rouine';\n $rouine['age'] = 12;\n $rouine['gender'] = 'male';\n\n return array($rougin, $angel, $royce, $roilo, $rouine);\n }", "public function getDatasList(){\n return $this->_get(5);\n }", "public function getData() : array;", "public function getData() : array;", "function get_data_by_index($index) {\n $data_arr = $_SESSION['data_arr'];\n\n $data = \"\";\n $i = 0;\n $length = count($data_arr[$index][0]);\n foreach($data_arr[$index][0] as $num){\n if($i > 0) {\n\t if($i < ($length - 1) ) {\n $data = $data.$num.\", \";\n\t } else {\n\t $data = $data.$num;\n\t }\n\t}\n\t$i++;\n }\n\n //echo \"PHP: \".var_dump($data);\n return $data;\n}", "public function getDataArr(){\n\t\treturn $this->data_arr;\n\t}", "function extractAttendance($dataArray){\n\t$dateArray=(array_keys($dataArray));\n\n\t$attendanceArray = array_column($dataArray, 'total');\n\t//print_r($attendanceArray);\n\n\t$attendanceData = array_combine($dateArray, $attendanceArray);\n\t//print_r($attendanceData);\n\n\treturn $attendanceData;\n}", "public function two($sql) {\n $data_out = array();\n foreach ($this->lines($sql, true) AS $data)\n {\n $data_out[$data[0]] = $data[1];\n }\n return $data_out;\n }", "function doIndex() {\n $ret = array();\n if( $this->statement->rowCount() > 0 ) {\n $data = $this->statement->fetchAll($this->fetch_style);\n } else {\n $data = array();\n }\n\n foreach( $data as $line ) {\n if( !isset($line[$this->index[0]]) ) {\n throw new Exception(\n \"Index '\" . $this->index[0] . \"' does not exist in data.\"\n );\n }\n $key = $line[$this->index[0]];\n\n if( count($this->index) == 1 ) {\n $ret[$key] = $line;\n } else {\n $key2 = $line[$this->index[1]];\n if( !isset($ret[$key]) ) $ret[$key] = array();\n $ret[$key][$key2] = $line;\n }\n }\n if( $this->sticky == false ) $this->setDefaults();\n return( $ret );\n }", "private function getDataArray() {\n\t\treturn $this->dataArray;\n\t}", "public function getData() {\n if ($this->_multiple) {\n return $this->_data;\n }\n return isset($this->_data[0])? $this->_data[0] : [];\n }", "private function getData() {\n $arr = \\Yii::$app->session->get('arr');\n if(isset($arr['pkd']) && $arr['pkd'] !== '0'){\n $pkd = \\app\\models\\Rujukan::find()->where(['kod' => $arr['pkd'], 'kat' => 'pkd'])->one();\n } else {\n $pkd = new \\app\\models\\Rujukan();\n }\n\n if(isset($arr['pks']) && $arr['pks'] !== '0'){\n $klinik = \\app\\models\\Klinik::find()->where(['id' => $arr['pks']])->one();\n } else {\n $klinik = new \\app\\models\\Klinik();\n }\n\n if(isset($arr['sekolah']) && $arr['sekolah'] !== '0'){\n $sekolah = \\app\\models\\Sekolah::find()->where(['id' => $arr['sekolah']])->one();\n } else {\n $sekolah = new \\app\\models\\Sekolah();\n }\n //\\var_dump($arr);exit;\n return ['pkd' => $pkd, 'klinik' => $klinik, 'sekolah' => $sekolah, 'ym_dari' => $arr['ym_dari'], 'ym_hingga' => $arr['ym_hingga']];\n }", "protected function getDatav2(): array\n {\n //prepare labels\n $labels = array('labels' => array(\n 'SESSION ID', 'SEARCH APPLICATION', 'TIMESTAMP', 'SEARCH TERMS', 'SPECIFIC FIELD TYPE', 'NUMBER OF RESULTS',\n 'AGGREGATIONS',\n 'START DATE',\n 'END DATE',\n '1ST SCORE',\n )\n );\n\n //prepare body's data\n $dataArray = array();\n $entityManager = $this->getDoctrine()->getManager();\n //Query\n $queryString = 'SELECT log.creationTimeStamp, log.payLoad from ' .\n LogActionItem::class . ' log where log.actionName = :actionName order by log.creationTimeStamp DESC';\n $query = $entityManager->createQuery($queryString);\n $query->setParameters(['actionName' => 'New Search']);\n $results = $query->getResult();\n\n $griidcArray = $this->getGriidcStaff();\n\n //process result query into an array with organized data\n foreach ($results as $result) {\n //skip the row if the search is done by a Griidc Staff\n if (\n isset($result['payLoad']['clientInfo']['userId']) &&\n in_array($result['payLoad']['clientInfo']['userId'], $griidcArray)\n ) {\n continue;\n }\n\n // Skip the row if the search is parameterless, as is the case for default search\n // page initial loads.\n if (\n empty($result['payLoad']['searchQueryParams']['inputFormTerms']['searchTerms']) &&\n empty($result['payLoad']['searchQueryParams']['inputFormTerms']['specificFieldType']) &&\n empty($result['payLoad']['searchQueryParams']['inputFormTerms']['aggregations']) &&\n empty($result['payLoad']['searchQueryParams']['inputFormTerms']['dataCollectionStartDate']) &&\n empty($result['payLoad']['searchQueryParams']['inputFormTerms']['dataCollectionEndDate'])\n ) {\n continue;\n }\n\n $searchResults = array\n (\n '1stScore' => '',\n );\n\n $numResults = $result['payLoad']['numResults'];\n if ($numResults > 0) {\n $searchResults['1stScore'] = $result['payLoad']['elasticScoreFirstResult'] ?? '';\n }\n\n if (empty($result['payLoad']['subSite'])) {\n $result['payLoad']['subSite'] = 'GRIIDC';\n }\n\n $dataArray[] = array_merge(\n array\n (\n 'sessionID' => $result['payLoad']['clientInfo']['sessionId'],\n 'subSite' => $result['payLoad']['subSite'],\n 'timeStamp' => $result['creationTimeStamp']->format(parent::INREPORT_TIMESTAMPFORMAT),\n 'searchTerms' => $result['payLoad']['searchQueryParams']['inputFormTerms']['searchTerms'],\n 'specificFieldType' => $result['payLoad']['searchQueryParams']['inputFormTerms']['specificFieldType'],\n 'numResults' => $numResults,\n 'aggregations' => $this->getAggregations($result['payLoad']['searchQueryParams']['aggregations']),\n 'startDate' => $result['payLoad']['searchQueryParams']['inputFormTerms']['dataCollectionStartDate'],\n 'endDate' => $result['payLoad']['searchQueryParams']['inputFormTerms']['dataCollectionEndDate']\n ),\n $searchResults,\n );\n }\n return array_merge($labels, $dataArray);\n }", "function GetTheDataArray($keys = array())\n{\n $ReturnData = '';\n $key1 = isset($keys[0]) && !empty($keys[0]) ? $keys[0] :null;\n $key2 = isset($keys[1]) && !empty($keys[1]) ? $keys[1] :null;\n $key3 = isset($keys[2]) && !empty($keys[2]) ? $keys[2] :null;\n $key4 = isset($keys[3]) && !empty($keys[3]) ? $keys[3] :null;\n\n if(!is_null($key1) && is_null($key2))\n {\n $ReturnData = iteraxcontroller::Instance()->it->data[$key1];\n } elseif(!is_null($key1) && !is_null($key2) && is_null($key3)){\n $ReturnData = iteraxcontroller::Instance()->it->data[$key1][$key2];\n } elseif(!is_null($key1) && !is_null($key2) && !is_null($key3) && is_null($key4)){\n $ReturnData = iteraxcontroller::Instance()->it->data[$key1][$key2][$key3];\n\n } elseif(!is_null($key1) && !is_null($key2) && !is_null($key3) && !is_null($key4)){\n $ReturnData = iteraxcontroller::Instance()->it->data[$key1][$key2][$key3][$key4];\n } else {\n $ReturnData = '';\n }\n\n\n return $ReturnData;\n\n\n}", "public function getDataByMultiKey() {\n $val = json_decode($this, true);\n for ($i = 0; $i < func_num_args(); $i++) {\n $valid = false; //assume response is not valid unless the ith argument is found\n if (isset($val[func_get_arg($i)])) {\n $val = $val[func_get_arg($i)];\n $valid = true;\n }\n }\n if ($valid) {\n return $val;\n }\n else {\n return null;\n }\n return null;\n }", "protected abstract function getData(): array;", "function get_imc($dataSet) {\n $index_imc = 2;\n $column_imc = $dataSet[0][$index_imc];\n $imc = array();\n for ($i = 1; $i < count($dataSet); $i++){\n $daily_imc = $dataSet[$i][$column_imc];\n $imc[] = array(\"date\" => $dataSet[$i][\"date\"],\n $dataSet[0][$index_imc] => $daily_imc);\n }\n return $imc;\n}", "public function getValues();", "public function dataProviderVOData(): array\n {\n $data1 = [\n 'name' => '张三',\n 'age' => 30,\n ];\n return [\n [$data1],\n ];\n }", "public function updateData()\n {\n return ([\n [\"2\", \"9898989898\", \"pune\", 302, \"manager-records\"]\n ]);\n }", "public function getValues(): array;", "public function getValues(): array;", "abstract public function getArray();", "public function getPair() : array;", "function getDetailAllDeviceSales($edit_device_sale,$account_id,$DbConnection)\n{\n $query = \"SELECT device_sales_info.device_imei_no,account.superuser, account.user FROM \".\n \"device_sales_info USE INDEX(dslsinfo_imeino_cid_status),account WHERE \".\n \"account.account_id = device_sales_info.user_account_id AND \".\n \"device_sales_info.device_imei_no='$edit_device_sale' AND \".\n \"device_sales_info.create_id='$account_id' AND device_sales_info.status='1'\";\n $result = mysql_query($query,$DbConnection);\n while($row=mysql_fetch_object($result))\n {\t\n $imei_no_2 = $row->device_imei_no;\n $superuser_2 = $row->superuser; \n $user_2 = $row->user; \n $data[]=array('imei_no_2'=>$row->device_imei_no,'superuser_2'=>$row->superuser,'user_2'=>$row->user);\t\n }\n return $data;\n}", "private function range() {\n\n $data = array();\n\n for($i = 1; $i<= 2; $i++) {\n\n array_push($data, $this->id($i));\n\n }\n\n return $data;\n\n }", "function get_data(){\n $data[] = array(\n 'id' => 1,\n 'titulo' => 'Atividade 1', \n 'conteudo' => 'Esta é uma Atividade de 60 minutos', \n 'tempo' => 60\n );\n $data[] = array(\n 'id' => 2,\n 'titulo' => 'Atividade 2', \n 'conteudo' => 'Esta é uma Atividade de 120 minutos', \n 'tempo' => 120\n );\n $data[] = array(\n 'id' => 3,\n 'titulo' => 'Atividade 3', \n 'conteudo' => 'Esta é uma Atividade de 180 minutos', \n 'tempo' => 180\n );\n $data[] = array(\n 'id' => 4,\n 'titulo' => 'Atividade 4', \n 'conteudo' => 'Esta é uma Atividade de 240 minutos', \n 'tempo' => 240\n );\n\n\n return $data;\n }", "abstract public function data2Array($data);", "function getDataValues(){\n\t\t$this->getData();\n\t\treturn $this->_dataValues;\n\t}", "public function get_data_index($any, $mes)\n {\n $ret = array();\n $els = cefire::whereMonth('data', '=', date($mes))->whereYear('data', '=', date($any))->get();\n foreach ($els as $el) {\n $item=array(\"id\"=>$el->id, \"name\"=>$el->user['name'], \"data\"=>$el->data, \"inici\"=>$el->inici->format('H:i:s'), \"fi\"=>$el->fi->format('H:i:s'));\n array_push($ret, $item);\n }\n return $ret;\n }", "private function _getColDataIndex($cols,$filterData) {\n $arr = array();\n foreach ($cols as $col) {\n foreach ($filterData as $key => $value) {\n if($key == $col['mapped']) {\n $dataIndex = $col['dataIndex'];\n $jsonCol = array('property' => $dataIndex,'value' => $value);\n $arr[] = $jsonCol;\n }\n }\n }\n return json_encode($arr); \n }", "public function getMultipleData()\n\t{\n\t\t$calculatedData = $this->getCalculatedData();\n\t\tif (!$calculatedData)\n\t\t{\n\t\t\treturn [];\n\t\t}\n\n\t\t$result = [];\n\t\tforeach ($calculatedData as $row)\n\t\t{\n\t\t\t$currentDate = $row['DATE'];\n\t\t\t$previousDate = $row['PREVIOUS_DATE'];\n\n\t\t\t$currentUrlParams = [];\n\t\t\t$previousUrlParams = [];\n\n\t\t\tif (!is_null($row['DATE']))\n\t\t\t{\n\t\t\t\t$currentDate = $this->getDateForUrl($currentDate);\n\t\t\t\t$currentUrlParams = $this->getUrlParams($currentDate['start'], $currentDate['finish']);\n\t\t\t}\n\n\t\t\tif (!is_null($row['PREVIOUS_DATE']))\n\t\t\t{\n\t\t\t\t$previousDate = $this->getDateForUrl($previousDate);\n\t\t\t\t$previousUrlParams = $this->getUrlParams($previousDate['start'], $previousDate['finish']);\n\t\t\t}\n\n\t\t\t$result[] = [\n\t\t\t\t'value' => [\n\t\t\t\t\t'CURRENT_DATE' => $currentDate['date'],\n\t\t\t\t\t'PREVIOUS_DATE' => $previousDate['date'],\n\t\t\t\t\t'CURRENT_DATE_FORMATTED' => $this->formatDateForGrid($currentDate['date']),\n\t\t\t\t\t'PREVIOUS_DATE_FORMATTED' => $this->formatDateForGrid($previousDate['date']),\n\t\t\t\t\t'CURRENT_VALUE' => $row['CALL_COUNT'],\n\t\t\t\t\t'PREVIOUS_VALUE' => $row['PREVIOUS_CALL_COUNT'],\n\t\t\t\t\t'DYNAMICS' => $this->formatPeriodCompare($row['CALL_COUNT_COMPARE']),\n\t\t\t\t],\n\t\t\t\t'url' => [\n\t\t\t\t\t'CURRENT_DATE' => $this->createUrl(self::TELEPHONY_DETAIL_URI, $currentUrlParams),\n\t\t\t\t\t'PREVIOUS_DATE' => $this->createUrl(self::TELEPHONY_DETAIL_URI, $previousUrlParams),\n\t\t\t\t\t'CURRENT_VALUE' => $this->createUrl(self::TELEPHONY_DETAIL_URI, $currentUrlParams),\n\t\t\t\t\t'PREVIOUS_VALUE' => $this->createUrl(self::TELEPHONY_DETAIL_URI, $previousUrlParams),\n\t\t\t\t]\n\t\t\t];\n\t\t}\n\n\t\treturn $result;\n\t}", "public function get_data_index($any, $mes)\n {\n $ret = array();\n $els = Incidencies::whereMonth('data', '=', date($mes))->whereYear('data', '=', date($any))->get();\n foreach ($els as $el) {\n $item=array(\"id\"=>$el->id, \"name\"=>$el->user['name'], \"data\"=>$el->data, \"inici\"=>$el->inici, \"fi\"=>$el->fi, \"incidencia\"=>$el->incidencia);\n array_push($ret, $item);\n }\n return $ret;\n }", "public function getData()\n {\n return array(\n\n );\n }", "public function results()\n {\n //by default data get as array/stdclasses\n\n // to trunit to arrays of arrays\n // return json_decode(json_encode($this->_results), true);\n return $this->_results;\n // gives array data with column name and itsvalue not index array\n }", "private function return_r ($x , $y)\n\t\t{\n\t\t\t//$x for admin $y for token\n\t\t\treturn [\n\t\t\t\t'admin_id' => $x['id'] ,\n\t\t\t\t'token' => $y['token']\n\t\t\t];\n\n\t\t}", "function getData($result) {\r\n\t\t$data = array();\r\n\t\t$i = 0;\r\n\t\twhile ($row = $result->fetch_assoc()) {\r\n\t\t\tforeach ($row as $key => $value) {\r\n\t\t\t\t$data[$i][$key] = $value;\t\t\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "public static function twoDArrayforCalender()\n {\n $array = [];\n for ($i = 0; $i < 6; $i++) \n {\n $array1 = array();\n for ($j = 0; $j < 7; $j++) \n {\n //initializing array values to '-'\n $array1[$j] = '-';\n }\n //pushing array to each row of 2d array\n array_push($array, $array1);\n }\n return $array;\n }", "protected function getAllData() : array\n {\n if (method_exists($this, 'withOtherData'))\n {\n $this->otherData += $this->withOtherData();\n }\n\n return $this->otherData;\n }", "abstract public function values(): array;", "public function as_array(){\n return isset($this->data[$this->alias])? $this->data[$this->alias] : $this->data;\n }", "public function getDataList(){\n return $this->_get(1);\n }", "public function _getData(): array\n {\n $result = [\n 'traveler' => $this->getTraveler(),\n 'watcher' => $this->getWatcher(),\n 'distance' => $this->getDistance(),\n ];\n\n return parent::normalizeData($result);\n }", "function getSecondFuel($fuel_rows) {\n $num_rows = 0;\n $flag = false;\n $a_details = array();\n foreach ($fuel_rows as $fuel_row) { \n if ($num_rows > 0) {\n $tds = $fuel_row->find(\"td\"); \n if (count($tds) === 3) {\n $key = trim($tds[0]->plaintext);\n $value = trim($tds[2]->plaintext);\n if ($key == 'Combustível') {\n $flag = true;\n } \n if ($flag === true) {\n $a_details[$key] = $value; \n }\n }\n }\n $num_rows++; \n }\n return $a_details;\n}", "function getSecondFuel($fuel_rows) {\n $num_rows = 0;\n $flag = false;\n $a_details = array();\n foreach ($fuel_rows as $fuel_row) { \n if ($num_rows > 0) {\n $tds = $fuel_row->find(\"td\"); \n if (count($tds) === 3) {\n $key = trim($tds[0]->plaintext);\n $value = trim($tds[2]->plaintext);\n if ($key == 'Combustível') {\n $flag = true;\n } \n if ($flag === true) {\n $a_details[$key] = $value; \n }\n }\n }\n $num_rows++; \n }\n return $a_details;\n}", "public function get_arr_maps() {\r\n $arr = $this->app->model('article_indexs')->getList('*');\r\n $tmp = array();\r\n \r\n foreach( (array)$arr as $row ) {\r\n $tmp[] = array(\r\n 'url' => app::get('site')->router()->gen_url(array('app'=>'content', 'ctl'=>'site_article', 'act'=>'index', 'arg0'=>$row['article_id'], 'full'=>true) ),\r\n );\r\n }\r\n \r\n return $tmp;\r\n }", "public function toArray()\n {\n return [\n 'code' => $this->code,\n 'result' => $this->result ? 0 : -1,\n 'data' => $this->data,\n ];\n }", "public function getResult() : array\n {\n $result = [];\n foreach ($this->input as $key => $data) {\n $result[$key] = $data['data'];\n }\n return $result;\n }", "function getIndex() ;", "public function dataProviderForRange(): array\n {\n return [\n [ [ 1, 1, 1 ], 0 ],\n [ [ 1, 1, 2 ], 1 ],\n [ [ 1, 2, 1 ], 1 ],\n [ [ 8, 4, 3 ], 5 ],\n [ [ 9, 7, 8 ], 2 ],\n [ [ 13, 18, 13, 14, 13, 16, 14, 21, 13 ], 8 ],\n [ [ 1, 2, 4, 7 ], 6 ],\n [ [ 8, 9, 10, 10, 10, 11, 11, 11, 12, 13 ], 5 ],\n [ [ 6, 7, 8, 10, 12, 14, 14, 15, 16, 20 ], 14 ],\n [ [ 9, 10, 11, 13, 15, 17, 17, 18, 19, 23 ], 14 ],\n [ [ 12, 14, 16, 20, 24, 28, 28, 30, 32, 40 ], 28 ],\n ];\n }", "abstract public function array2Data($arr);", "public function values() : array;", "public function getData(): array\n\t{\n\t\treturn $this->valueMap;\n\t}", "public function getIndex();", "public function getIndex();", "public function getIndex();", "public function _getData(): array\n {\n $result = [\n ];\n\n return parent::normalizeData($result);\n }", "abstract public static function getValues(): array;", "public function getValues() {}", "public function getValues() {}", "function getDetailAllVisitArea($common_id1,$DbConnection)\n {\n $query=\"select visit_area_id,visit_area_name FROM visit_area USE INDEX(visar_uaid_status) WHERE user_account_id='$common_id1' and status='1'\";\t\n $result=mysql_query($query,$DbConnection); \t\t\t\t\t\t\t\n while($row=mysql_fetch_object($result))\n {\n /*$geo_id=$row->visit_area_id; \n $geo_name=$row->visit_area_name;*/\n $data[]=array('geo_id'=>$row->visit_area_id,'geo_name'=>$row->visit_area_name);\n }\n return $data;\n }", "public function Individualgetdata();", "public function getDataForGetMethods(): array\n {\n return [\n 0 => [\n 0 => [\n 'UUID' => [\n 'toNative' => '60835374-8f18-360a-9074-b22b1e86a20c',\n 'getUuid' => [\n 'toString' => '1cb931bd-7b4b-39fd-8374-db5e213ccff3',\n ],\n 'sameValueAs' => false,\n 'isEmpty' => false,\n ],\n 'Uuid' => [\n 'toNative' => '796316c3-4174-3e97-bd60-557b4ea87a64',\n 'getUuid' => [\n 'toString' => 'ce9cac0b-566b-3df6-8efa-56ed84220398',\n ],\n 'sameValueAs' => true,\n 'isEmpty' => true,\n ],\n 'Item' => [\n 'toArray' => [\n 'id' => 7,\n 'parentId' => 3,\n 'name' => 'Bertrand Stracke',\n 'status' => 1,\n 'url' => 'http://www.pouros.com/cum-sit-reiciendis-fugiat-fugit-qui-voluptas-quisquam.html',\n 'createdAt' => '2020-03-16T10:44:21+00:00',\n 'updatedAt' => '2020-03-16T09:09:05+00:00',\n ],\n 'sameValueAs' => true,\n 'toNative' => [\n 'id' => 7,\n 'parentId' => 3,\n 'name' => 'Bertrand Stracke',\n 'status' => 1,\n 'url' => 'http://www.pouros.com/cum-sit-reiciendis-fugiat-fugit-qui-voluptas-quisquam.html',\n 'createdAt' => '2020-03-16T10:44:21+00:00',\n 'updatedAt' => '2020-03-16T09:09:05+00:00',\n ],\n 'getId' => [\n 'sameValueAs' => true,\n 'toNative' => 7,\n 'inc' => [\n 'sameValueAs' => true,\n 'toNative' => 2,\n ],\n 'decr' => [\n 'sameValueAs' => true,\n 'toNative' => 2,\n ],\n ],\n\n 'getParentId' => [\n 'sameValueAs' => false,\n 'toNative' => 3,\n 'inc' => [\n 'sameValueAs' => true,\n 'toNative' => 2,\n ],\n 'decr' => [\n 'sameValueAs' => true,\n 'toNative' => 3,\n ],\n ],\n 'getName' => [\n 'toNative' => 'Bertrand Stracke',\n 'sameValueAs' => false,\n 'isEmpty' => false,\n ],\n 'getStatus' => [\n 'isActive' => true,\n 'sameValueAs' => true,\n 'toNative' => 5,\n 'inc' => [\n 'sameValueAs' => true,\n 'toNative' => 6,\n ],\n 'decr' => [\n 'sameValueAs' => true,\n 'toNative' => 4,\n ],\n ],\n 'getUrl' => [\n 'toNative' => 'http://www.pouros.com/cum-sit-reiciendis-fugiat-fugit-qui-voluptas-quisquam.html',\n 'sameValueAs' => false,\n 'isEmpty' => false,\n ],\n 'getCreatedAt' => [\n 'toNative' => [\n 'getTimestamp' => '2020-03-16T10:44:21+00:00',\n ],\n ],\n 'getUpdatedAt' => [\n 'toNative' => [\n 'getTimestamp' => '2020-03-16T09:09:05+00:00',\n ],\n 'sameValueAs' => true,\n 'getDate' => [\n 'toNative' => [\n 'getTimestamp' => '08:05:09',\n ],\n ],\n 'getTime' => [\n 'toNative' => [\n 'getTimestamp' => '21:16:27',\n ],\n ],\n 'toNativeDateTime' => [\n 'getTimestamp' => '13:19:08',\n ],\n ],\n 'serialize' => [\n 0 => 'voluptatum',\n 1 => 'maiores',\n 2 => 'dolorum',\n ],\n ],\n ],\n 1 => [\n 'UUID' => [\n 'times' => 0,\n 'toNative' => 1,\n 'getUuid' => [\n 'times' => 0,\n 'toString' => 0,\n ],\n 'sameValueAs' => 0,\n 'isEmpty' => 0,\n ],\n 'Uuid' => [\n 'times' => 0,\n 'toNative' => 1,\n 'getUuid' => [\n 'times' => 0,\n 'toString' => 0,\n ],\n 'sameValueAs' => 0,\n 'isEmpty' => 0,\n ],\n 'Item' => [\n 'times' => 0,\n 'toArray' => 0,\n 'sameValueAs' => 0,\n 'toNative' => 1,\n 'getId' => [\n 'times' => 0,\n 'sameValueAs' => 0,\n 'toNative' => 0,\n 'inc' => [\n 'times' => 0,\n 'sameValueAs' => 0,\n 'toNative' => 0,\n ],\n 'decr' => [\n 'times' => 0,\n 'sameValueAs' => 0,\n 'toNative' => 0,\n ],\n ],\n 'setId' => 0,\n 'getParentId' => [\n 'times' => 0,\n 'sameValueAs' => 0,\n 'toNative' => 0,\n 'inc' => [\n 'times' => 0,\n 'sameValueAs' => 0,\n 'toNative' => 0,\n ],\n 'decr' => [\n 'times' => 0,\n 'sameValueAs' => 0,\n 'toNative' => 0,\n ],\n ],\n 'getName' => [\n 'times' => 0,\n 'toNative' => 0,\n 'sameValueAs' => 0,\n 'isEmpty' => 0,\n ],\n 'getStatus' => [\n 'times' => 0,\n 'isActive' => 0,\n 'sameValueAs' => 0,\n 'toNative' => 0,\n 'inc' => [\n 'times' => 0,\n 'sameValueAs' => 0,\n 'toNative' => 0,\n ],\n 'decr' => [\n 'times' => 0,\n 'sameValueAs' => 0,\n 'toNative' => 0,\n ],\n ],\n 'getUrl' => [\n 'times' => 0,\n 'toNative' => 0,\n 'sameValueAs' => 0,\n 'isEmpty' => 0,\n ],\n 'getCreatedAt' => [\n 'times' => 0,\n 'toNative' => [\n 'times' => 0,\n 'getTimestamp' => 0,\n ],\n ],\n 'getUpdatedAt' => [\n 'times' => 0,\n 'toNative' => [\n 'times' => 0,\n 'getTimestamp' => 0,\n ],\n 'sameValueAs' => 0,\n 'getDate' => [\n 'times' => 0,\n 'toNative' => [\n 'times' => 0,\n 'getTimestamp' => 0,\n ],\n ],\n 'getTime' => [\n 'times' => 0,\n 'toNative' => [\n 'times' => 0,\n 'getTimestamp' => 0,\n ],\n ],\n 'toNativeDateTime' => [\n 'times' => 0,\n 'getTimestamp' => 0,\n ],\n ],\n 'serialize' => 0,\n ],\n ],\n ],\n ];\n }", "public function get_data();", "function getDetailAllPolyline($common_id1,$DbConnection)\n {\n $query=\"select * FROM polyline USE INDEX(polyline_uaid_status) WHERE user_account_id='$common_id1' and status='1'\";\t\n $result=mysql_query($query,$DbConnection); \t\t\t\t\t\t\t\n while($row=mysql_fetch_object($result))\n {\n /*$polyline_id=$row->polyline_id; \n $polyline_name=$row->polyline_name;*/\n $data[]=array('polyline_id'=>$row->polyline_id,'polyline_name'=>$row->polyline_name);\n }\n return $data;\n }", "function get_operator1()\n \t{\n\t\t$sql=$this->db2->query(\"select travel_id,operator_title from registered_operators \");\n $data=array(); \n foreach ($sql->result() as $rows)\n {\n \t$data[$rows->travel_id]=$rows->operator_title;\n }\n\t\treturn $data;\n }", "public function dataProviderForMidrange(): array\n {\n return [\n [ [ 1, 1, 1 ], 1 ],\n [ [ 1, 1, 2 ], 1.5 ],\n [ [ 1, 2, 1 ], 1.5 ],\n [ [ 8, 4, 3 ], 5.5 ],\n [ [ 9, 7, 8 ], 8 ],\n [ [ 13, 18, 13, 14, 13, 16, 14, 21, 13 ], 17 ],\n [ [ 1, 2, 4, 7 ], 4 ],\n [ [ 8, 9, 10, 10, 10, 11, 11, 11, 12, 13 ], 10.5 ],\n [ [ 6, 7, 8, 10, 12, 14, 14, 15, 16, 20 ], 13 ],\n [ [ 9, 10, 11, 13, 15, 17, 17, 18, 19, 23 ], 16 ],\n [ [ 12, 14, 16, 20, 24, 28, 28, 30, 32, 40 ], 26 ],\n ];\n }", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "private function getColumnValues()\n {\n return array_slice($this->_args, 2);\n }", "function getAdditionalValuesAsArray() {\n\t\t$values = parent::getAdditionalValuesAsArray ();\n\t\t$tables = array_keys ($this->owner);\n\t\t$values ['owner'] = Array ();\n\t\tforeach ($tables as $table) {\n\t\t\tforeach ($this->owner [$table] as $id) {\n\t\t\t\t$values ['owner'] [$table] [$id] = $id;\n\t\t\t}\n\t\t}\n\t\t$values ['headerstyle'] = $this->row ['headerstyle'];\n\t\t$values ['bodystyle'] = $this->row ['bodystyle'];\n\t\treturn $values;\n\t}", "public function toArray() {\n return [\n 'dataId' => $this->dataId,\n 'voucher' => $this->voucher,\n 'nextTime' => $this->nextTime,\n 'simNumber' => $this->simNumber\n ];\n }", "public function exibir(){\n\t\treturn array(\n\t\t\t\"modelo\" => $this->getModelo(),\n\t\t\t\"motor\" => $this->getMotor(), \n\t\t\t\"ano\" => $this->getAno()\n\t\t);\n\t}", "public function array_load_with_two_values($table_name,$identifier,$value1,$value2) {\n\t\t$array = array();\n\t\t$result = mysqli_query($this->link, \"SELECT * FROM \".$this->db_prefix.$table_name.\" WHERE \".$identifier.\"='\".$value1.\"' OR \".$identifier.\"='\".$value2.\"'\");\n\t\tif ($result) {\n\t\t\twhile($row = mysqli_fetch_assoc($result)) {\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}", "abstract protected function report_to_array_mapping();", "public function getFiltred(array &$data);", "function get_store_data()\n\t{\n\t\t// fetch data from db\n\t\t$_data = index_array($this->db_fetch('client_data', array('where' => array('key' => 'product'))), 'type', TRUE);\n\t\t// split data\n\t\tforeach($_data as $type => $vals)\n\t\t{\n\t\t\t$pos = array();\n\t\t\tforeach($vals as $id => $val)\n\t\t\t{\n\t\t\t\tif( !isset($tags) || !in_array($val['tag'], $tags) )\n\t\t\t\t{\n\t\t\t\t\t// check for position taken\n\t\t\t\t\twhile(in_array($val['position'], $pos))\n\t\t\t\t\t{\n\t\t\t\t\t\t++$val['position'];\n\t\t\t\t\t}\n\t\t\t\t\t// save pos to array\n\t\t\t\t\t$pos[] = $val['position'];\n\t\t\t\t\t//\n\t\t\t\t\t$output[$type][$val['position']] = $val;\n\t\t\t\t\t//\n\t\t\t\t\t$tags[] = $val['tag'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// sort array\n\t\t\tksort($output[$type]);\n\t\t}\n\t\t// return output\n\t\treturn $output;\n\t}", "public function getValues()\n {\n return array_values($this->data);\n }", "protected function _processData() {\n $result = $this->getSelect()->query()->fetchAll();\n if ($mainReportResults = $this->getMainReportResults()) {\n $toReturn = array();\n $list = $this->_helper()->getList($mainReportResults, $this->_compareAttribute);\n foreach ($result as $row) {\n $toReturn[array_search($row[$this->_compareAttribute], $list)] = $row;\n }\n $result = $toReturn;\n }\n return $result;\n }", "abstract public function getTestData(): array;", "public function toArray()\n {\n\n\n return $this->data;\n }", "public function getData() : array{\n $this->collection->rewind();\n $data = [];\n while($this->collection->valid()){\n $data[] = $this->collection->current()->getData();\n $this->collection->next();\n }\n return $data;\n }", "public function testGetpointsShouldReturnArray(): void\n { \n $ma = [\"Bee A\", \"Bee B\"];\n $maa = [101, 102];\n list($b, $b1) = $ma;\n list($i, $i1) = $maa;\n \n $obj = new Points();\n $obj->setPoints($b, $i);\n $obj->setPoints($b1, $i1);\n \n $this->assertEquals($i, $obj->getPoints($b));\n $this->assertEquals($i1, $obj->getPoints($b1));\n }", "public function getData();", "public function getData();", "public function getData();", "public function getData();" ]
[ "0.63939077", "0.5941163", "0.5903289", "0.5862932", "0.5727017", "0.57239527", "0.5684484", "0.567461", "0.56649685", "0.56649685", "0.56339586", "0.5628998", "0.5628998", "0.5628998", "0.5628998", "0.5624204", "0.5595634", "0.55923384", "0.55923384", "0.55901456", "0.55833876", "0.556176", "0.5548572", "0.55365026", "0.55282426", "0.55261874", "0.5522729", "0.5475441", "0.54698724", "0.5465251", "0.5458167", "0.54474556", "0.5396672", "0.53912175", "0.53867227", "0.5381108", "0.5381108", "0.5380523", "0.5372942", "0.5372502", "0.5365068", "0.5355743", "0.53452533", "0.5337005", "0.53367925", "0.53357726", "0.53344357", "0.5325283", "0.5323683", "0.53224856", "0.531453", "0.5310726", "0.52982754", "0.52959865", "0.5287579", "0.5270826", "0.5256462", "0.5255405", "0.5237609", "0.5237609", "0.5237473", "0.52285475", "0.5200211", "0.51906806", "0.5188521", "0.5185751", "0.5183619", "0.51834726", "0.5180355", "0.5180355", "0.5180355", "0.5174302", "0.516986", "0.5168761", "0.5168761", "0.516778", "0.5165542", "0.5160441", "0.51486576", "0.5145447", "0.51393795", "0.51392174", "0.5135613", "0.5126479", "0.5126102", "0.5112592", "0.51117533", "0.51041746", "0.5101079", "0.5096302", "0.5077691", "0.50758016", "0.5073526", "0.50718415", "0.5068989", "0.5060531", "0.50604737", "0.5059481", "0.5059481", "0.5059481", "0.5059481" ]
0.0
-1
this is an ajax function that adds new courses
public function add_course() { $course_name = $this->input->post("course_name"); if($course_name==""){ echo "please course/subject section is empty"; }else{ $courses = $data = $this->security->xss_clean($course_name); $courses = $this->authadmin->sanitize_string($course_name); $total = $this->admin_student_courses_mdl->check_course($course_name); if($total==0){ $data = array( 'course_name' => $course_name, ); $this->admin_student_courses_mdl->add_course($data); echo "new course/subject successfully added"; }else{ echo "this course/subject already exist"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_courses()\n {\n if ($this->input->is_ajax_request()) {\n\n $process = $this->M_Courses->add_courses();\n $courses = 'courses';\n if ($process) {\n echo json_encode([\n 'status' => true,\n 'message' => $this->lang->line('success_add_courses')\n ]);\n } else {\n echo json_encode([\n 'status' => false,\n 'message' => $this->lang->line('failed_add_courses')\n ]);\n }\n } else {\n redirect(base_url());\n }\n }", "public function addCourse()\n {\n Logger::Log(\n 'starts POST AddCourse',\n LogLevel::DEBUG\n );\n\n $body = $this->app->request->getBody();\n\n $course = Course::decodeCourse($body);\n\n foreach ( $this->_createCourse as $_link ){\n $result = Request::routeRequest(\n 'POST',\n '/course',\n array(),\n Course::encodeCourse($course),\n $_link,\n 'course'\n );\n\n // checks the correctness of the query\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $this->app->response->setStatus( 201 );\n if ( isset( $result['headers']['Content-Type'] ) )\n $this->app->response->headers->set(\n 'Content-Type',\n $result['headers']['Content-Type']\n );\n\n } else {\n\n /* if ($course->getId()!==null){\n $this->deleteCourse($course->getId());\n }*/\n\n Logger::Log(\n 'POST AddCourse failed',\n LogLevel::ERROR\n );\n $this->app->response->setStatus( isset( $result['status'] ) ? $result['status'] : 409 );\n $this->app->response->setBody( Course::encodeCourse( $course ) );\n $this->app->stop( );\n }\n }\n\n $this->app->response->setBody( Course::encodeCourse( $course ) );\n }", "function add_course(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "function add_course(){\n\n\t\t$course_title =$this->input->post('course_title');\n\n\t\t$courses = array(\n\t\t\t'course_title' => $this->input->post('course_title'),\n\t\t\t'course_duration' => $this->input->post('duration'),\n\t\t\t'course_fees'=> $this->input->post('fees'),\n\t\t\t'course_description'=> $this->input->post('course_description'),\n\t\t);\n\n\t\t//================= Activity Log Monitoring==========================//\n $activity_log_activity = \"Add new Courses \".$course_title ; \n\n $activitylogs = array( \n 'activity_log_activity' =>$activity_log_activity, \n 'activity_date'=> date('Y-m-d h:i:s:a') ,\n 'user_id'=> $this->session->userdata('user_id')\n ); \n\n $this->setting_model->insert($activitylogs , 'activity_log');\n\n //==================== Activity Log Monitoring End=====================//\n\n\t\t$this->setting_model->insert($courses,'course');\n\n\t\t$this->session->set_flashdata('msg',\"<div class='alert alert-success'><strong>\". $course_title .\"</strong> Added Successfully!</div><style>.table>tbody>tr:nth-child(2){ background:#d9ff66; }</style>\");\n\n\t\tredirect('admin/add_course_view');\n\t\t\n\t}", "public static function addCourse()\n {\n global $cont;\n if(!empty($_POST['script']))\n {\n session_start();\n $_SESSION['message'] = \"you are script\";\n header(\"location:../admin/pages/forms/add-course.php\");\n die();\n }\n $title = $_POST['title'];\n $price = $_POST['price'];\n $body = $_POST['body'];\n $categoryId = $_POST['cat_id'];\n \n $imageName = $_FILES['image']['name'];\n $imageType = $_FILES['image']['type'];\n $imageTmp = $_FILES['image']['tmp_name'];\n \n\n $imageExt = Courses::checkImageExt($imageType); \n\n if($imageExt == 0 )\n {\n session_start();\n $_SESSION['error'] = \"U Must Upload Correct File\";\n header(\"location:../admin/pages/forms/add-course.php\");\n die();\n }\n\n \n $imageLink = dirname(__FILE__) . \"/../admin/pages/upload/courses/\";\n\n $avatarName = Courses::chekImageExist(time() . \"_\" . $imageName);\n\n move_uploaded_file($imageTmp , $imageLink.$avatarName);\n\n\n $courses = $cont->prepare(\"INSERT INTO courses(title , price , `image` , body , catagory_id) VALUES (? , ? , ? , ? , ?) \");\n $courses->execute([$title , $price , $avatarName , $body , $categoryId]);\n session_start();\n $_SESSION['message'] = \"course was created\";\n header(\"location:../admin/pages/tables/Courses.php\");\n \n }", "public function create_course() {\n\n $data['get_all_courses'] = $this->courses_model->getCourses();\n\n \n //user access\n $data['view_access'] = $this->user_permission->has_permission('view_course' , 'access');\n $data['create_access'] = $this->user_permission->has_permission('create_course' , 'access');\n $data['edit_access'] = $this->user_permission->has_permission('edit_course' , 'access');\n \n \n // validate form input\n $this->form_validation->set_rules('course', \"Course\", 'required');\n $this->form_validation->set_rules('duration', \"Duration\", 'required');\n $this->form_validation->set_rules('fee', \"Fee\", 'required');\n\n\n if ($this->form_validation->run() == TRUE) {\n\n $status = $this->input->post('status');\n if ($status == 1) {\n $status = 1;\n } else {\n $status = 0;\n }\n\n $posted_data = array(\n 'name' => $this->input->post('course'),\n 'duration' => $this->input->post('duration'),\n 'fee' => $this->input->post('fee'),\n 'description' => $this->input->post('description'),\n 'status' => $status,\n );\n\n $new_course_id = $this->courses_model->create_course($posted_data);\n if ($new_course_id) {\n $data['message'] = $this->session->set_flashdata('message', \"Successfully added\");\n $this->load->template('index', $data);\n }\n } else {\n\n if (validation_errors()) {\n $data['message'] = validation_errors();\n $this->load->template('index', $data);\n }\n }\n }", "function addcourse($id = NULL) {\n\t\t\n\t\t\n\t/*\techo '<pre>';\n\t\t\n\t\tprint_r($this->data['TutCourse']['course_id']);*/\n\t\t\n\t\t$uniquecourse = array_unique($this->data['TutCourse']['course_id']);\n\t\t\n\t\t$cntcourse = count($this->data['TutCourse']['course_id']);\n\t\t$cntunqcourse = count($uniquecourse);\n\t\t\n\t\t\n\t\tif($cntunqcourse < $cntcourse)\n\t\t{\n\t\t\t$this->Session->setFlash('There are duplicate courses.');\n\t\t\t$this->redirect($this->referer());\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$this->layout = '';\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t//pr($this->data);\n\t\t//echo $id;\n\t\tif ($id != \"\") {\n\t\t\t$this->TutCourse->deleteAll(array(\n\t\t\t\t'TutCourse.member_id' => $this->Session->read('Member.memberid')\n\t\t\t));\n\t\t}\n\t\t//die;\n\t\t$i = 0;\n\t\tforeach ($this->data['TutCourse']['course_id'] as $data) {\n\t\t\t$mySaving['TutCourse']['school_id'] = $this->data['TutCourse']['school_id'];\n\t\t\t$mySaving['TutCourse']['course_id'] = $this->data['TutCourse']['course_id'][$i];\n\t\t\t$mySaving['TutCourse']['rate'] = $this->data['TutCourse']['rate'][$i];\n\t\t\t$mySaving['TutCourse']['member_id'] = $this->Session->read('Member.memberid');\n\t\t\t$db = $this->TutCourse->getDataSource();\n\t\t\t$mySaving['TutCourse']['created'] = $db->expression(\"NOW()\");\n\t\t\tif ($mySaving['TutCourse']['course_id']) {\n\t\t\t\t$this->TutCourse->create();\n\t\t\t\t$saved = $this->TutCourse->save($mySaving['TutCourse']);\n\t\t\t}\n\t\t\t$i++;\n\t\t\t\n\t\t}\n\t\tif ($saved) {\n\t\t\t$this->Session->setFlash('Your courses has been saved successfully');\n\t\t\t\n\t\t\t$this->Member->updateAll(array(\n\t\t\t\t'Member.school_id' => \"'\" . $this->data['TutCourse']['school_id'] . \"'\"\n\t\t\t), array(\n\t\t\t\t'Member.id' => $this->Session->read('Member.memberid')\n\t\t\t));\n\t\t\t\n\t\t\t\n\t\t\t$this->redirect(array(\n\t\t\t\t'controller' => 'members',\n\t\t\t\t'action' => 'tutor_dashboard'\n\t\t\t));\n\t\t} else {\n\t\t\t$this->redirect(array(\n\t\t\t\t'controller' => 'members',\n\t\t\t\t'action' => 'tutor_dashboard'\n\t\t\t));\n\t\t}\n\t\t\n\t}", "public function add_course_view(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_course';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add course',\n\t\t\t'course_list'=> $this->setting_model->Get_All('course'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function courseAction(){\n\t\t\n\t\t$action = $this->input->post(\"action\");\n\t\tswitch($action){\n\t\t\tcase \"add\":\n\t\t\t\t#===========================================================================================================\n\t\t\t\t$this->form_validation->set_error_delimiters('', '');\n\t\t\t\t$this->form_validation->set_rules(\"title\", \"Course Title\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"departmentID\", \"Department\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"description\", \"Description\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"duration\", \"Duration In Hrs.\", \"trim|required|numeric|greater_than[14]\");\n\t\t\t\t$this->form_validation->set_rules(\"maxDays\", \"Max Days\", \"trim|required|numeric\");\n\t\t\t\tif($this->form_validation->run() == FALSE){\n\t\t\t\t\t\n\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'message' => \"<p class='text-danger'>\".implode('!</br>',explode('.', validation_errors())).\"</p>\"\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\t$duration = decimalToTime($this->input->post(\"duration\"));\n\t\t\t\t\t$inputs = array(\n\t\t\t\t\t\t'title' => $this->input->post(\"title\"),\n\t\t\t\t\t\t'departmentID' => $this->input->post(\"departmentID\"),\n\t\t\t\t\t\t'description' => $this->input->post(\"description\"),\n\t\t\t\t\t\t'duration' => $duration,\n\t\t\t\t\t\t'maxDays' => $this->input->post(\"maxDays\")\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif($this->course->add($inputs)){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'message' => \"New Course Added Successfully!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to save\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#===========================================================================================================\n\t\t\tbreak;\n\t\t\tcase \"get\":\n\t\t\t\t#===========================================================================================================\n\t\t\t\t$this->form_validation->set_error_delimiters('', '');\n\t\t\t\t$this->form_validation->set_rules(\"courseID\", \"Course ID\", \"trim|required\");\n\t\t\t\t\n\t\t\t\tif($this->form_validation->run() == FALSE){\n\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'message' => \"<p class='text-danger'>\".implode('!</br>',explode('.', validation_errors())).\"</p>\"\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\t$id = $this->input->post(\"courseID\");\n\t\t\t\t\t$data['courseInfo'] = $this->course->get($id);\n\t\t\t\t\tif(!empty($data['courseInfo'])){\n\t\t\t\t\t\t$data['courseInfo']->duration = timeToDecimal($data['courseInfo']->duration);\n\t\t\t\t\t}\n\t\t\t\t\t$data['departments'] = $this->department->getAll();\n\t\t\t\t\tif($data){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'data' => $data\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to Load!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#======================================================================================\n\t\t\tbreak;\n\t\t\tcase \"update\":\n\t\t\t\t#======================================================================================\n\t\t\t\t$this->form_validation->set_error_delimiters('', '');\n\t\t\t\t$this->form_validation->set_rules(\"title\", \"Course Title\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"departmentID\", \"Department\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"description\", \"Description\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"duration\", \"Duration In Hrs.\", \"trim|required|numeric|greater_than[14]\");\n\t\t\t\t$this->form_validation->set_rules(\"maxDays\", \"Max Days\", \"trim|required|numeric|greater_than[29]\");\n\t\t\t\tif($this->form_validation->run() == FALSE){\n\t\t\t\t\t\n\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'message' => \"<p class='text-danger'>\".implode('!</br>',explode('.', validation_errors())).\"</p>\"\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\t$duration = decimalToTime($this->input->post(\"duration\"));\n\t\t\t\t\t$courseID = $this->input->post(\"courseID\");\n\t\t\t\t\t$inputs = array(\n\t\t\t\t\t\t'title' => $this->input->post(\"title\"),\n\t\t\t\t\t\t'departmentID' => $this->input->post(\"departmentID\"),\n\t\t\t\t\t\t'description' => $this->input->post(\"description\"),\n\t\t\t\t\t\t'duration' => $duration,\n\t\t\t\t\t\t'maxDays' => $this->input->post(\"maxDays\")\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif($this->course->update($courseID, $inputs)){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'message' => \"Course Updated Successfully!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to update!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t#=======================================================================================\n\t\t\tbreak;\n\t\t\tcase \"delete\": \n\t\t\t\t$courseID = $this->input->post(\"courseID\");\n\t\t\t\t\n\t\t\t\tif($this->course->delete($courseID)){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'message' => \"Course Deleted Successfully!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to delete\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t}\n\t}", "public function course()\n\t{ \n//echo \"<pre>\";print_r($_POST);die;\t\n\t\t$data=$_POST;\n\t\t//$data['action']='get_module';\n\t\t//$data['action']='delete_module';\n\t\t//$data['action']='course';\n\t\t//$data['action']='delete_lession';\n\t\t$action='';\n\t\tif(isset($data['action'])){\n\t\t\t$action=$data['action'];\n\t\t}\n\t\tswitch ($action) {\n\t\tcase 'course':\n\t\t\t$this->add_update_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_module':\n\t\t\t$this->delete_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_lession':\n\t\t\t$this->delete_lession($data);\n\t\t\tbreak;\n\t\tcase 'get_module':\n\t\t\t$this->getMOduleDetailsByModuleId($data);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$result['msg']='Bad request!';\n\t\t\t$returnData['response']=$result;\n\t\t\tdie(json_encode($returnData));\n\t\t}\n\t\t\n\t}", "function add_course($course_details)\n\t{\n\t\t$query = 'INSERT INTO courses (name, description, created_at, updated_at) \n\t\tVALUES (?,?,?,?)';\n\t\t$values = array($course_details['name'], $course_details['description'],\n\t\t\tdate(\"Y-m-d, H:i:s\"),date(\"Y-m-d, H:i:s\"));\n\t\treturn $this->db->query($query, $values);\n\t}", "public function add()\n {\n $course_description = new CourseDescription();\n $session_id = api_get_session_id();\n $course_description->set_session_id($session_id);\n\n $data = array();\n if (strtoupper($_SERVER['REQUEST_METHOD']) == \"POST\") {\n if (!empty($_POST['title']) && !empty($_POST['contentDescription'])) {\n if (1) {\n $title = $_POST['title'];\n $content = $_POST['contentDescription'];\n $description_type = $_POST['description_type'];\n if ($description_type >= ADD_BLOCK) {\n $course_description->set_description_type($description_type);\n $course_description->set_title($title);\n $course_description->set_content($content);\n $course_description->insert(api_get_course_int_id());\n }\n\n Display::addFlash(\n Display::return_message(\n get_lang('CourseDescriptionUpdated')\n )\n );\n }\n $this->listing(false);\n } else {\n $data['error'] = 1;\n $data['default_description_titles'] = $course_description->get_default_description_title();\n $data['default_description_title_editable'] = $course_description->get_default_description_title_editable();\n $data['default_description_icon'] = $course_description->get_default_description_icon();\n $data['question'] = $course_description->get_default_question();\n $data['information'] = $course_description->get_default_information();\n $data['description_title'] = $_POST['title'];\n $data['description_content'] = $_POST['contentDescription'];\n $data['description_type'] = $_POST['description_type'];\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('add');\n $this->view->render();\n }\n } else {\n $data['default_description_titles'] = $course_description->get_default_description_title();\n $data['default_description_title_editable'] = $course_description->get_default_description_title_editable();\n $data['default_description_icon'] = $course_description->get_default_description_icon();\n $data['question'] = $course_description->get_default_question();\n $data['information'] = $course_description->get_default_information();\n $data['description_type'] = $course_description->get_max_description_type();\n // render to the view\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('add');\n $this->view->render();\n }\n }", "public function addCoursesPage(){\n return View('admin.addcourse');\n }", "public function store()\n {\n Permissions::getInstaince()->allow('course_store');\n\n\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n $validate = \\Validation::validate([\n 'course_title' => array(['required' => 'required']),\n 'course_description' => array(['required' => 'required']),\n 'courses_image' => array(['imageRequired' => 'imageRequired']),\n 'course_price' => array(['required' => 'required']),\n 'course_price_afterDiscount' => array(['required' => 'required']),\n 'course_students_target' => array(['required' => 'required']),\n 'course_goals' => array(['required' => 'required']),\n 'categories_ids' => array(['hasElements' => 'hasElements']),\n 'course_owner' => array(['hasElements' => 'hasElements']),\n ]);\n if (count($validate) == 0) {\n if (isset($_FILES['courses_image']['name']))\n $image = Helper::saveImage('courses_image', 'images/courses/');\n $course = array(\n ':course_owner' => htmlentities($_REQUEST['course_owner']),\n ':course_title' => htmlentities($_REQUEST['course_title']),\n ':course_description' => htmlentities($_REQUEST['course_description']),\n ':courses_image' => $image,\n ':course_price' => htmlentities($_REQUEST['course_price']),\n ':course_price_afterDiscount' => htmlentities($_REQUEST['course_price_afterDiscount']),\n ':course_students_target' => htmlentities($_REQUEST['course_students_target']),\n ':course_goals' => htmlentities($_REQUEST['course_goals']),\n ':categories_ids' => json_encode($_REQUEST['categories_ids']),\n );\n $this->model('Course');\n $id = $this->model->add($course);\n if ($id) {\n Helper::back('/admin/courses/index', 'add successfully', 'success');\n return;\n }\n } else {\n Helper::back('/admin/courses/create', 'error in required input', 'danger');\n return;\n }\n }\n\n\n }", "public function store(CoursesRequest $request)\n {\n \n $course = new Courses($request->validated());\n $course->course_name = $request->course_name;\n $course->course_description = $request->course_description;\n $course->is_active = $request->is_active;\n $course->type = $request->type == 1 ? '1' : '0';\n $course->save();\n if($course){\n $course->getCategory()->attach($request->cat_id);\n } \n return response()->json($course, 201);\n }", "function create_course_subject(){\n\n\t\t$Input_course_id =$this->input->post('course');\n\n\t\t$course_data =$this->setting_model->Get_All('course');\n\n\t\tforeach ($course_data as $data) {\n\t\t\tif($data['course_id'] == $Input_course_id){\n\t\t\t\t$course_title =$data['course_title'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$courses_modules= array(\n\t\t\t'module_subjects' => implode(\" \", $this->input->post('myInputs')),\n\t\t\t'course_id' => $this->input->post('course'),\n\t\t);\t\n\n\t\t//================= Activity Log Monitoring==========================//\n $activity_log_activity = \"Add new Courses subjects for\".$course_title; \n\n $activitylogs = array( \n 'activity_log_activity' =>$activity_log_activity, \n 'activity_date'=> date('Y-m-d h:i:s:a') ,\n 'user_id'=> $this->session->userdata('user_id')\n ); \n\n $this->setting_model->insert($activitylogs , 'activity_log');\n\n //==================== Activity Log Monitoring End=====================//\n\n\n\t\t$this->setting_model->insert($courses_modules,'course_module_subject');\n\n\t\t$this->session->set_flashdata('msg',\"<div class='alert alert-success'><strong>\". $course_title .\"</strong> Course Subjects Added Successfully!</div><style>.table>tbody>tr:nth-child(2){ background:#d9ff66; }</style>\");\n\n\t\tredirect('admin/add_course_subject');\n\t}", "public function postCreate()\n\t{\n\n\t\tif( Input::get('title') == '' ):\n\n\t\t\tself::setWarning('coordinators_courses_title_err', 'Error al agregar curso', 'por favor ingrese un Título, no puede dejar este campo vacío.');\n\n\t\t\treturn self::go( 'create' );\n\n\t\telseif( Input::get('author_id') == null ):\n\n\t\t\tself::setWarning('coordinators_courses_author_id_err', 'Error al agregar curso', 'Debe seleccionar un profesor encargado del Curso.');\n\n\t\t\treturn self::go( 'create' );\n\n\t\telse:\n\n\t\t\t$name = Course::setPermalink(Input::get('title'));\n\n\t\t\t$directory = Course::makeFullDirectory( $name );\n\n\t\t\t$course = new Course();\n\t\t\t$course->author_id = Input::get('author_id');\n\t\t\t$course->title = Input::get('title');\n\t\t\t$course->name = $name;\n\t\t\t$course->description = Input::get('description');\n\t\t\t$course->status = 'inactive';\n\t\t\t$course->main_picture = Input::file('main_picture') != null ? Course::uploadMainPicture( Input::file('main_picture'), $name ) : '';\n\t\t\t$course->cover_picture = Input::file('cover_picture') != null ? Course::uploadCoverPicture( Input::file('cover_picture'), $name ) : '';\n\t\t\t$course->thumbnail_picture = Input::file('thumbnail_picture') != null ? Course::uploadThumbnailPicture( Input::file('thumbnail_picture'), $name ) : '';\n\n\t\t\t$teacher = User::find(Input::get('author_id'));\n\n\t\t\t\n\t\t\tif( $course->save() ):\n\t\n\t\t\t\t\\Event::fire('notification.course_assigned', array($teacher, $course));\n\t\t\t\tself::setSuccess('coordinators_courses_create', 'Curso Agregado', 'El curso ' . $course->title . ' fue agregado exitósamente');\n\n\t\t\t\treturn self::go( 'inactive' );\n\n\t\t\telse:\n\n\t\t\t\tself::setDanger('coordinators_courses_create_err', 'Error al agregar curso', 'Hubo un error al agregar el curso ' . $course->title);\n\n\t\t\t\treturn self::go( 'create' );\n\n\t\t\tendif;\n\n\t\tendif;\n\n\t}", "function create_course($cshort,$cfull,$cdate)\n {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n $query = \"INSERT into courses(cshort,cfull,cdate) values (?,?,?)\";\n $stmt = $mysqli->prepare($query);\n\n\t\tif($stmt = $mysqli->prepare($query))\n {\n $stmt->bind_param('sss',$cshort,$cfull,$cdate);\n $stmt->execute();\n echo \"<script>alert('Course Added Successfully')</script>\";\n }\n else\n {\n $error = $mysqli->errno . ' ' . $mysqli->error;\n \t\techo $error;\n } \n }", "function add_course($course, $school, $title, $description, $exam_date, $exam_start, $exam_end){\n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n\n $stmt = $conn->prepare(\"INSERT INTO course VALUES(:course, :school, :title, :description, :exam_date, :exam_start, :exam_end)\");\n \n $stmt->bindParam(\":course\", $course);\n $stmt->bindParam(\":school\", $school);\n $stmt->bindParam(\":title\", $title);\n $stmt->bindParam(\":description\", $description);\n $stmt->bindParam(\":exam_date\", $exam_date);\n $stmt->bindParam(\":exam_start\", $exam_start);\n $stmt->bindParam(\":exam_end\", $exam_end);\n\n $success = $stmt->execute();\n\n $stmt = null;\n $conn = null;\n\n return $success;\n }", "public function save_course_request(){\n\t\t\n\t\t\t$user_id = get_current_user_id();\n\t\t\t$course_id = (int)$_REQUEST['course_id'];\n\t\t\t$group_leader_id = (int)$_REQUEST['group_leader_id'];\n\t\t\t$request_text = $_REQUEST['request_text'];\n\t\t\t$status = $_REQUEST['request_status'];\n\t\t\t \n\t\t\t$data \t = array();\n\t\t\t$data['user_id'] \t = $user_id;\n\t\t\t$data['course_id']\t = $course_id;\n\t\t\t$data['request_text'] = $request_text;\n\t\t\t$data['request_status']= $status;\n\t\t\t$load = new Load();\n\t\t\t$typeModel = $load->model('course_request_model');\n\t\t\t$success_insert = $typeModel->save_course_request('course_request' , $data);\n\t\t\t$msg = array();\n\t\t\tif($success_insert){\n\t\t\t\t$msg['success_msg'] = \"Data has been added\";\n\t\t\t\t$course_link = get_permalink($course_id);\n\t\t\t\twp_redirect($course_link.'?msg='.$msg['success_msg']);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$msg['error_msg'] = \"Cannot added data to server\";\n\t\t\t\t$course_link = get_permalink($course_id);\n\t\t\t\twp_redirect($course_link.'?msg='.$msg['error_msg']);\n\t\t\t}\n\t\t}", "public function registerCourseClick ()\n {\n $objCourse = new Course();\n $result = $objCourse->fetchCoursename();\n if (! empty($result)) {\n $this->showSubViews(\"registerCourse\", $result);\n } else {\n $message = \"You cannnot register<br> No courses exist yet\";\n $this->setCustomMessage(\"ErrorMessage\", $message);\n }\n }", "public function addCourse (Request $request)\n {\n $this->validate($request, [\n 'courseCode' => 'required|unique:courses',\n 'courseName' => 'required',\n ]);\n\n $course = [\n 'courseCode' => $request['courseCode'],\n 'dCode' => $request['dCode'],\n 'courseName' => $request['courseName'],\n ];\n\n // Save the course\n Course::create($course);\n\n return redirect()->back()\n ->with('status', 'success');\n }", "public function create()\n {\n //$categories = ['' => 'دسته بندی ها'] + CategoryModel::orderby('id', 'desc');\n $contents = CourseModel::orderby('id', 'desc')->get();\n\n\n return View('web.admin.course.add', ['contents' => $contents]);\n }", "function recommends_req_crstut_9_add_course($form, &$form_state) {\n // Everything in $form_state is persistent, so we'll just use\n // $form_state['add_course']\n $form_state['num_courses']++;\n\n // Setting $form_state['rebuild'] = TRUE causes the form to be rebuilt again.\n $form_state['rebuild'] = TRUE;\n}", "public function actionUpdateCourses()\n\t{\n\t\t$courses = Course::model()->findAll('faculty_id=:X', array(':X' => (int) $_POST['faculty_id']));\n\n\t\techo CHtml::dropDownList('Note[course_id]', '',\n\t\t\tCHtml::listData($courses, 'id', 'name'),\n\t\t\t array('prompt' => 'Pilih mata kuliah'));\n\t}", "public function add_new_enrol() { \n $data['sideMenuData'] = fetch_non_main_page_content();\n $data['page_title'] = 'Class Trainee';\n $tenant_id = $this->tenant_id;\n $data['privilage'] = $this->manage_tenant->get_privilage();//added by shubhranshu\n $data['companies'] = $this->classtraineemodel->get_company_list($tenant_id);\n $data['main_content'] = 'classtrainee/addnewenroll';\n $this->load->view('layout', $data);\n }", "public function add() {\n\n\t\tif (!isset($this->currentUser)) {\n\n\t\t\tthrow new Exception(\"Not in session. Adding courts requires login\");\n\t\t}\n\n\t\tif($this->userMapper->isAdmin()){\n\n\t\t\tif (isset($_POST[\"submit\"])) { // reaching via HTTP Post...\n\n\t\t\t\t$courtType = $_POST[\"courtType\"];\n\t\t\t\t$timeStart = $_POST[\"timeStart\"];\n\t\t\t\t$timeEnd = $_POST[\"timeEnd\"];\n\t\n\t\t\t\ttry {\n\t\t\t\t\t// save the Court object into the database\n\t\t\t\t\t$this->courtMapper->add($courtType, $timeStart, $timeEnd);\n\t\n\t\t\t\t\t// POST-REDIRECT-GET\n\t\t\t\t\t// Everything OK, we will redirect the user to the list of posts\n\t\t\t\t\t// We want to see a message after redirection, so we establish\n\t\t\t\t\t// a \"flash\" message (which is simply a Session variable) to be\n\t\t\t\t\t// get in the view after redirection.\n\t\t\t\t\t$this->view->setFlash(sprintf(i18n(\"Court \\\"%s\\\" successfully added.\")));\n\t\n\t\t\t\t\t// perform the redirection. More or less:\n\t\t\t\t\t// header(\"Location: index.php?controller=posts&action=index\")\n\t\t\t\t\t// die();\n\t\t\t\t\t$this->view->redirect(\"courts\", \"index\");\n\t\n\t\t\t\t}\n\t\t\t\tcatch(ValidationException $ex) {\n\t\n\t\t\t\t\t// Get the errors array inside the exepction...\n\t\t\t\t\t$errors = $ex->getErrors();\n\t\t\t\t\t// And put it to the view as \"errors\" variable\n\t\t\t\t\t$this->view->setVariable(\"errors\", $errors);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// render the view (/view/courts/add.php)\n\t\t\t$this->view->render(\"courts\", \"add\");\n\t\t}\n\t\telse{\n\t\t\t$errors[\"addingCourt\"] = i18n(\"You are not an Administrator. You can not add a new court\");\n $this->view->setVariable(\"errors\", $errors);\n $this->index();\n\t\t}\t\n\t}", "public function AddCourses(){\n\t\theader('Access-Control-Allow-Origin:*');\n\t\t//\tdie(print_r($_REQUEST));\n\t\t$this->load->library(\"form_validation\");\n\t\t$this->form_validation->set_error_delimiters();\n\t\t$this->form_validation->set_rules('course_name', 'Course Name', 'required');\n\t\t$this->form_validation->set_rules('course_desc', 'Description', 'required');\n\t\t//$this->form_validation->set_rules('category', 'category', 'required');\n\t\t$this->form_validation->set_rules('course_price', 'Price', 'required');\n\t\t\n\t\t\n\n\t\t\t$_FILES[\"course_image\"];\n\t\t\t$config['upload_path'] = 'uploads/';\n\t\t\t$config['allowed_types'] = 'jpg|png|jpeg';\n\t\t\t$config['max_size']\t= '500';\n\t\t\t$config['max_width']= '870';\n\t\t\t$config['max_height']= '300';\n\t\t\t$config['encrypt_name']= TRUE;\n\t\t\t$this->load->library('upload', $config);\n\t\t\tif ( ! $this->upload->do_upload('course_image'))\n\t\t\t\t{\n\t\t\t\t\t$error = array('error' => $this->upload->display_errors());\n\t\t\t\t\tdie($error['error']);\n\t\t\t\t}\n\n\t\t\t$image = array('upload_data' => $this->upload->data());\n\t\t \n\n\t\t\tif($this->form_validation->run())\n\t\t\t{\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\"course_name\"=>$this->input->post(\"course_name\"),\n\t\t\t\t\t\"course_desc\"=>$this->input->post(\"course_desc\"),\n\t\t\t\t\t\"category_id\"=>1,\n\t\t\t\t\t\"course_price\"=>$this->input->post(\"course_price\"),\n\t\t\t\t\t\"course_image\"=>$image['upload_data']['file_name']\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//die(print_r($data));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($res=$this->PostModel->NewCourse($data))\n\t\t\t\t\t{\n\t\t\t\t\t\tdie ('Submit Successfully');\t\t\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\tdie ('Please ReSubmit');\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\techo validation_errors();\n\t\t\t}\n\t}", "public function actionCourses()\n\t{\n\t\t//echo \"In Courses\";\n\t\tif (!isset($_REQUEST['username'])){\n\t\t\t$_REQUEST['username'] = Yii::app()->user->name;\n\t\t}\n\t\t//if (!Yii::app()->user->checkAccess('admin')){\n\t\t//\t$this->model=User::model()->findByPk(Yii::app()->user->name);\n\t\t//} else {\n\t\t\t$this->model = DrcUser::loadModel();\n\t\t\t//}\n\t\t//$title = \"Title\";\n\t\t//$contentTitle = \"Courses: title\";\n\t\t$title = \"({$this->model->username}) {$this->model->first_name} {$this->model->last_name}\";\n\t\t$contentTitle = \"Courses: {$this->model->term->description}\";\n\t\tif (!Yii::app()->user->checkAccess('admin') && !Yii::app()->user->checkAccess('staff')){\n\t\t\t$title = $this->model->term->description;\n\t\t\t$contentTitle = \"Courses\";\n\t\t}\n\t\t$this->renderView(array(\n\t\t\t'title' => $title,\n\t\t\t'contentView' => '../course/_list',\n\t\t\t'contentTitle' => $contentTitle,\n\t\t\t'menuView' => 'base.views.layouts._termMenu',\n\t\t\t'menuRoute' => 'drcUser/courses',\n\t\t\t'titleNavRight' => '<a href=\"' . $this->createUrl('drcUser/update', array('term_code'=> $this->model->term_code, 'username'=>$this->model->username)) . '\"><i class=\"icon-plus\"></i> User Profile</a>',\n\t\t));\n\t}", "public function add_course_subject(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_course_module';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add courses Modules (Subjects)',\n\t\t\t'courses_lists'=> $this->setting_model->Get_All('course'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "function createCourse ($id, $name, $description) {\n\t\t\t\n\t\t}", "public function add_course($id = null)\n {\n if (!$id) {\n throw new MethodNotAllowedException();\n }\n\n if ($this->request->is('post')) {\n $data = $this->ClassesCourse->find('first',\n array(\"conditions\" => \"ClassesCourse.class_id = \" . $this->request->data['ClassesCourse']['class_id'] . \"\n and ClassesCourse.course_id = \" . $this->request->data['ClassesCourse']['course_id']));\n if (!$data) {\n $this->ClassesCourse->create();\n if ($this->ClassesCourse->save($this->request->data)) {\n $this->Session->setFlash(__('New course has been successfully added.'), 'flash_success');\n return $this->redirect(array('action' => 'view', $id));\n } else {\n $this->Session->setFlash(__('The course could not be added. Please, try again.'), 'flash_fail');\n }\n }\n else {\n $this->Session->setFlash(__('Oops! Selected course is already added to this class.'), 'flash_fail');\n }\n }\n $this->set(array('courses' => $this->Course->find('list'),\n 'class' => $this->StudentClass->findById($id)));\n }", "public function store(Request $request)\n {\n $courses=new \\App\\Course;\n \n $courses->course_name=$request->get('name');\n $courses->course_duration=$request->get('duration');\n $courses->course_fee=$request->get('fee');\n $courses->intake=$request->get('intake');\n $courses->requirement=$request->get('requirement');\n $courses->field=$request->get('field');\n $courses->university_id=$request->get('university_id');\n $courses->program_id=$request->get('program_id');\n $user_id = Auth::user()->id;\n $courses->users()->associate($user_id);\n $courses->save();\n \n return redirect('coursesmanage')->withsuccess('A Course has been added');\n\n\n //$schs = $request->input('scholarship_id');\n // foreach ($schs as $s) \n //{ $scholarships = Scholarship::find([$s]);\n // $courses->scholarships()->attach($scholarships); }\n \n \n //$cats = $request->input('category_id');\n // foreach($cats as $c) \n //{ $categories = Category::find([$c]); \n // $posts->categories()->attach($categories);\n // }\n }", "public function actionCreate() {\n $model = new Course();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function insertcourses ($id_course ,$description , $lecture_id ){\n $sqlQuery = \" INSERT INTO courses (id_course , description , lecture_id ) \";\n $sqlQuery .= \" VALUES (’ $id_course ’, ’$description' , 'lecture_id')\";\n $result = $this -> getDbManager () -> executeInsertQuery ( $sqlQuery );\n return $result ;\n }", "public function ajax_add_existing_question() {\n\t\t$challengeId = $this->input->post('challenge_id');\n $questionId = $this->input->post('question_id');\n\n\t\t$this->challenge_question_model->update_challenge_question_table($questionId, $challengeId, 0);\n $out = array('success' => true);\n $this->output->set_output(json_encode($out));\n\t}", "public function showPrepareAddCourse( $courses, $subjects )\n {\n // y Mostrar todos los cursos ya existentes.\n $this->smarty->assign( 'title_s', 'Admin: Add a course' );\n $this->smarty->assign( 'courses_s', $courses );\n $this->smarty->assign( 'subjects_s', $subjects );\n $this->smarty->display( 'templates/prepare_add_course.tpl' );\n }", "function store(CreateCourseRequest $request)\n {\n // Crea una instanacia del modelo Professional para poder insertar en el modelo course.\n $professional = Professional::getInstance($request->input('professional.id'));\n\n // Crea una instanacia del modelo Catalogue para poder insertar en el modelo course.\n $type = Catalogue::getInstance($request->input('type.id'));\n\n // Crea una instanacia del modelo Catalogue para poder insertar en el modelo course.\n $institution = Catalogue::getInstance($request->input('institution.id'));\n\n // Crea una instanacia del modelo Catalogue para poder insertar en el modelo course.\n $certificationType = Catalogue::getInstance($request->input('certificationType.id'));\n\n // Crea una instanacia del modelo Catalogue para poder insertar en el modelo course.\n $area = Catalogue::getInstance($request->input('area.id'));\n\n $course = new Course();\n $course->name = $request->input('course.name');\n $course->description = $request->input('course.description');\n $course->start_date = $request->input('course.start_date');\n $course->end_date = $request->input('course.end_date');\n $course->hours = $request->input('course.hours');\n $course->professional()->associate($professional);\n $course->institution()->associate($institution);\n $course->type()->associate($type);\n $course->certificationType()->associate($certificationType);\n $course->area()->associate($area);\n $course->save();\n\n return response()->json([\n 'data' => $course,\n 'msg' => [\n 'summary' => 'Curso creado',\n 'detail' => 'El registro fue creado',\n 'code' => '201'\n ]], 201);\n }", "function CoursesConstructFunctions()\n\t{\tif ($this->can_resources)\n\t\t{\tif (isset($_POST[\"crlabel\"]))\n\t\t\t{\t$saved = $this->resource->Save($this->course->id, $_POST, $_FILES[\"crfile\"]);\n\t\t\t\t$this->successmessage = $saved[\"successmessage\"];\n\t\t\t\t$this->failmessage = $saved[\"failmessage\"];\n\t\t\t\tif ($this->successmessage && !$this->failmessage)\n\t\t\t\t{\t$this->Redirect(\"courseresources.php?cid=\" . $this->course->id);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->resource->id && $_GET[\"delete\"] && $_GET[\"confirm\"])\n\t\t\t{\t$courseid = $this->resource->details[\"cid\"];\n\t\t\t\tif ($this->resource->Delete())\n\t\t\t\t{\t$this->Redirect(\"courseresources.php?cid=\" . $this->course->id);\n\t\t\t\t} else\n\t\t\t\t{\t$this->failmessage = \"Delete failed\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function actionCreate()\n {\n $model = new Course();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect('index');\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "function getAllCourses(){\n $resultGetCourses = getCourses();\n // On vérifie si tout se passe bien\n if(!$resultGetCourses){\n $message = 'La récupération des cours n\\'a pas aboutit !';\n }else{\n // Methode qui permet de compter combien entrer il y a dans cours\n $nbCourses = $resultGetCourses->rowCount();\n if($nbCourses == 0){\n $message = \"Il n'y a aucun cours pour le moment!\";\n addOneCourse();\n }else{\n require_once ('views/viewAllCourses.php');\n }\n }\n // Methode qui libère la connexion au serveur permet donc à d'autres requete sql d'être executé\n $resultGetCourses->closeCursor();\n}", "function addAjax() {\n header('Content-Type: application/json');\n if (isset($_POST) && count($_POST) > 0) {\n $jobLineItemsWorkName = $this->input->post('jobLineItemsWorkName');\n $jobLineItemsDescription = $this->input->post('jobLineItemsDescription');\n $descCount = 0;\n\n $this->Jcline_model->delete_all_jcline_by_jcid($this->input->post('jobcardid'));\n foreach ($jobLineItemsWorkName as $workname) {\n $params = array(\n 'workname' => $workname,\n 'description' => $jobLineItemsDescription[$descCount],\n 'jobcardid' => $this->input->post('jobcardid')\n );\n\n $jcline_id = $this->Jcline_model->add_jcline($params);\n $descCount++;\n }\n echo json_encode([\"success\" => true]);\n } else {\n echo json_encode([\"success\" => false]);\n }\n }", "public function RegisterCourses(Request $req)\n {\n $courses = $req->courses; //get all courses\n foreach ($courses as $key) {\n //get each course\n $current_date_time = Carbon::now()->toDateTimeString(); //get the current date\n $res = DB::table(\"enroll\")->insert([\n //insert into table enroll\n [\n \"StudentId\" => session(\"student\"),\n \"Code\" => $key,\n \"date\" => $current_date_time,\n ],\n ]);\n }\n if ($res == null) {\n $good = \"error\";\n } else {\n $good = \"success\";\n }\n\n $courses1 = implode(\",\", $courses); //add , to list of courses\n return response()->json([\n \"res\" => \"$good\",\n \"courses\" => $courses1,\n ]);\n }", "public function actionAddLesson()\n {\n if (Yii::$app->request->isAjax) {\n $row = Yii::$app->request->post('Lesson');\n if ((Yii::$app->request->post('isNewRecord') && Yii::$app->request->post('_action') == 'load' && empty($row)) || Yii::$app->request->post('_action') == 'add')\n $row[] = [];\n return $this->renderAjax('_formLesson', ['row' => $row]);\n } else {\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n }", "function course_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'course_add';\n $page_data['page_title'] = get_phrase('add_course');\n $this->load->view('backend/index', $page_data);\n }", "public static function func_ajax_add_category() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $self = self::sanitize($_POST['name']);\n $day = self::sanitize($_POST['day']);\n $desc = self::sanitize($_POST['description']);\n $wpdb->query($wpdb->prepare( \"INSERT INTO \".$wpdb->prefix.self::$table_name .\" VALUES (%d, %s, %s, %s)\", null, $self,$day,$desc ));\n die();\n\t\t\t\t}\n\t\t\n\t\t}", "function frmext_createcourse($data){\n\t$return = false;\n\t\n\treturn $return;\n}", "public function index()\n {\n return view('pages.courses.add_course');\n }", "public function actionRecommend()\r\n {\r\n $course_resource = new CourseResource();\r\n if(isset($_POST['class_id'])&&!empty($_POST['class_id'])){\r\n $class=ActualClass::model()->with('course')->findByPk($_POST['class_id']);\r\n if(!empty($class)){\r\n $_POST['course_id']=$class->course->id;\r\n }else{\r\n unset($_POST['class_id']);\r\n }\r\n }\r\n $course_resource->attributes = array_merge($_POST, array(\r\n 'user_id' => Yii::app()->user->id,\r\n ));\r\n if ($course_resource->save()) {\r\n AjaxResponse::success($this->smarty->fetchString('item', array('resource' => $course_resource)));\r\n } else {\r\n AjaxResponse::success($course_resource->errors);\r\n }\r\n }", "function addsubjectajaxAction(){\r\n \tif($this->getRequest()->isPost()){\r\n \t\t$data = $this->getRequest()->getPost();\r\n \t\t$_dbmodel = new Global_Model_DbTable_DbSubjectExam();\r\n \t\t$option=$_dbmodel->addSubjectajax($data);\r\n \t\t$result = array(\"id\"=>$option);\r\n \t\tprint_r(Zend_Json::encode($result));\r\n \t\texit();\r\n \t}\r\n }", "function AssignCourse()\n\t{\t$this->resource = new AdminCourseResource($_GET[\"id\"]);\n\t\tif ($this->resource->id)\n\t\t{\t$this->course = new AdminCourse($this->resource->details[\"cid\"]);\n\t\t} else\n\t\t{\t$this->course = new AdminCourse($_GET[\"cid\"]);\n\t\t}\n\t}", "public function store(CourseRequest $request)\n {\n $lastId = Course::all()->last()->id ?? 0;\n $request['code'] = 'CUR - ' . ($lastId + 1);\n $request['slug'] = $request->root() . \"/beneficiary/courses_lists/\" . ($lastId + 1) . \"/application_course\";\n return parent::storeBase($request, false);\n }", "protected function create(){\n \t$courseCategories = CourseCategory::getCourseCategoriesForAdmin();\n\t\t$courseSubCategories = [];\n\t\t$course= new CourseCourse;\n\t\treturn view('courseCourse.create', compact('courseCategories','courseSubCategories','course'));\n }", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('coursedoc')) {\n\n try {\n $data = $this->_filterDates($data, array('doc_date'));\n $coursedoc = $this->_initCoursedoc();\n $coursedoc->addData($data);\n $courseDocFileName = $this->_uploadAndGetName(\n 'course_doc_file',\n Mage::helper('bs_coursedoc/coursedoc')->getFileBaseDir(),\n $data\n );\n\n $coursedoc->setData('course_doc_file', $courseDocFileName);\n $products = $this->getRequest()->getPost('products', -1);\n if ($products != -1) {\n $coursedoc->setProductsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($products));\n }else {\n if(isset($data['hidden_course_id']) && $data['hidden_course_id'] > 0){\n $coursedoc->setProductsData(\n array(\n $data['hidden_course_id'] => array(\n 'position' => \"\"\n )\n )\n );\n\n\n }\n }\n $coursedoc->save();\n\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.document.location.href = \\''.$this->getUrl('*/catalog_product/edit', array('id'=>$data['hidden_course_id'], 'back'=>'edit', 'tab'=>'product_info_tabs_coursedocs')).'\\'; window.close()</script>';\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_coursedoc')->__('Course Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n if($add != ''){\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId(), 'tab' => 'product_info_tabs_coursedocs'));\n }else {\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId()));\n }\n\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('There was a problem saving the course doc.')\n );\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('Unable to find course doc to save.')\n );\n $this->_redirect('*/*/');\n }", "function addCourse(Course $course){\n\n\t $course_id = $course->getCourseID();\n\t $course_code = $course->getCourseCode();\n\t $course_name = $course->getCourseName();\n\t $syllabus = $course->getSyllabus();\n\t $duration = $course->getDuration();\n\t $fees = $course->getFees();\n\t\t\n\n\t $sql = \"insert into course_details(course_id,course_code,course_name,syllabus,duration,fees) values('$course_id','$course_code','$course_name','$syllabus','$duration','$fees')\";\n\t echo \"$sql\";\n\t$output = DBConnection::execNonQery($sql);\n\treturn $output;\n\n}", "public function create()\n {\n $universities = University::all();\n return view('admin.courses.addCourse')->with(\"universities\",$universities);\n }", "public function addCourse(Request $request)\n {\n $validatedData = $request->validate([\n 'course_id' => 'required',\n 'start_date' => 'required'\n ]);\n\n $enrollment_exists = CourseEnrollment::where('course_id', $request->input('course_id'))\n ->where('student_id', $request->input('student_id'))\n ->first();\n $student = Student::find($request->input('student_id'));\n if ($enrollment_exists) {\n return redirect()->route('admin.students.show', $student)->with('warning', 'Course already exists');\n }\n\n $enrollment = new CourseEnrollment;\n $enrollment->student_id = $request->input('student_id');\n $enrollment->course_id = $request->input('course_id');\n $enrollment->start_date = Carbon::parse($request->input('start_date'))->format('Y-m-d');\n $enrollment->save();\n\n return redirect()->route('admin.students.show', $student)->with('save', 'Course saved successfully');\n }", "public function addCompletedCourses(){\n\t\t$courses = Courses::getOneProgramCoursesList();\n\t\treturn view('courses.completedCourses', compact('courses'));\n\t}", "function update_course(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function actionAdd_educa() {\n\n if (Yii::app()->request->isAjaxRequest) {\n $model = new ResumeEducation;\n\n $data = json_decode($_POST['data']);\n\n $model->user_id = Yii::app()->user->id;\n $model->resume_id = $_POST['reid'];\n $model->school_name = $data->school_name;\n $model->grade_year = $data->grade_year;\n $model->gpa = $data->gpa;\n $model->class_rank = $data->class_rank;\n\n if ($model->save()) {\n echo $model->id;\n } else {\n echo 0;\n }\n } else {\n echo 0;\n }\n }", "function AssignCourse()\n\t{\t$this->date = new AdminCourseDate($_GET['id']);\n\t\tif ($this->date->id)\n\t\t{\t$this->course = new AdminCourse($this->date->details['cid']);\n\t\t} else\n\t\t{\t$this->course = new AdminCourse($_GET['cid']);\n\t\t}\n\t}", "public function add_cat() { \n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\tdie();\n\t\t}\n\t\t$main_cat_id = $this->input->post('main_cat_id');\n\t\t$title = $this->input->post('title'); \n\n\n\t\t$array_data['main_cat_id'] = $main_cat_id ; \n\t\t$array_data['title'] = $title ; \n\t\t$this->db->insert(\"categories\" , $array_data); \n\t\t$result = array('statu' => 'ok');\n\t\techo json_encode($result);\n\n\t}", "public function create()\n { \n \t$courses = DB::table('courses')->get();\n\n return view('admin.pages.coupons.add',compact('courses'));\n }", "public function create()\n {\n return view(\"guardian.pages.courses.create\");\n }", "function add_exam(){\n\t\t\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$act_mode \t= mysqli_real_escape_string($con,$_POST['act_mode']);\n\t\t$cmbcourse \t= mysqli_real_escape_string($con,$_POST['cmbcourse']);\n\t\t$cmbetype = mysqli_real_escape_string($con,$_POST['cmbetype']);\n\t\t$paper = mysqli_real_escape_string($con,$_POST['paper']);\n\t\t$txtmarks = mysqli_real_escape_string($con,$_POST['txtmarks']);\n\t\t$cmbduration = mysqli_real_escape_string($con,$_POST['cmbduration']);\n\t\t//alert($cid);\n\t\t\n\t\t$sth = $dbh->prepare('INSERT INTO exam (examtype,paper,examduration,exammarks,couID) VALUES(?,?,?,?,?);');\n\t\t$sth->execute(Array($cmbetype,$paper,$cmbduration,$txtmarks,$cmbcourse));\n\t\t\n\t\tif(count($sth)<0){\n\t\t\t\t\t \n\t\t\t\t\t $status =\"false\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\n\t\t\t\t\t$status =\"true\";\n\t\t\t\t}\n\t\n\t\t\t\techo json_encode($status);\n\t}", "public function create()\n\t{\n\t\tif(Auth::check()){\n if(Auth::user()->rol=='Coordinador') {\n \t$id = Auth::user()->Coordinador->id_university;\n \t$facultades = Faculty::where('id_university','=',$id)->lists('nombre_facultad', 'id');\n\n }\n }\n else{\n $facultades = Faculty::lists('nombre_facultad', 'id');}\n $coursealls = $this->courseallRepository->paginate(1800);\n\t\treturn view('courses.create')\n\t\t->with('facultades',$facultades)\n\t\t->with('coursealls', $coursealls);\n\t}", "public function create()\n {\n if (Gate::allows('isCoordinator')){ \n $universities = University::orderBy('university_name')->get();\n $programs = Program::orderBy('program_name')->get();\n $scholarships = Scholarship::orderBy('scholarship_name')->get();\n $courses=\\App\\Course::all();\n return view ('course.create', compact('programs','universities','courses','scholarships'));\n }\n else{\n abort(403,\"Sorry , this is for category auth\");\n }\n }", "function addCourse($name, $major, $institution){\n\n\t\t$this->connection->query(\"INSERT INTO courses (cour_name, cour_major, cour_inst) VALUES ('$name', '$major', '$institution',)\",true);\n\t\tif($_SESSION['query']){\n\t\t\treturn \"Course Successfully Added\";\n\t\t}else{\n\t\t\treturn \"Failed to add course!\";\t\t\n\t\t}\t\n\t\n\t}", "public function create()\n {\n //\n return view(\"course.create\");\n }", "public function testAjaxAddFavoriteNotExistingCourse() {\n $id = $this->getNotExistingID('Course');\n\n $post_data = array(\n 'id' => $id,\n 'type' => 'course'\n );\n $response = $this->ajax_post('favorites/add', $post_data);\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $content = $response->content;\n $this->assertContains('\"status\":\"Error\"', $content);\n $this->assertContains('errors', $content);\n }", "public function store(Request $request)\n {\n //Validation\n $this->validate($request,[\n 'name'=>\"required\",\n 'cluster'=>\"required | integer | max:70\",\n 'program'=>\"required\",\n 'subjects'=>\"required\",\n 'universities'=>\"required\",\n ]);\n $course = new Course;\n $course->name = $request->name;\n $course->cluster = $request->cluster;\n $course->program = $request->program;\n $course ->subjects = $request->subjects;\n $course->universities = $request->input('universities');\n $status = $course->save();\n if($status){\n return redirect()->back()->with(\"success\",\"Course added successifully !!!\");\n }\n \n }", "public function store(CourseRequest $request)\n {\n $request['user_id'] = Auth::user()->id;\n return response()->json(Course::create($request->all()),201);\n }", "function addCategory($data){\n\t\t\t\n\t\t\t$token = '847895ee848fdb5fb2d43b275705470c';\n\t\t\t$domainname = 'https://elearning.inaba.ac.id';\n\t\t\t$functionname = 'core_course_create_categories';\n\t\t\t$restformat = 'json';\n\t\t\t\t$category = new stdClass();\n\t\t\t\t$category->name=$data['nama'];\t\n\t\t\t\t$category->parent=$data['parent'];\t\t\t\t\t\n\t\t\t\t$category->description='<p>'.$data['nama'].'</p>';\n\t\t\t\t$category->idnumber=$data['idnumber'];\t\t\t\t\t\n\t\t\t\t$category->descriptionformat=1;\t\t\t\t\t\t\t\t\t\n\t\t\t\t$categories = array($category);\n\t\t\t\t$params = array('categories' => $categories);\n\t\t\t\t/// REST CALL\n\t\t\t\t//header('Content-Type: text/plain');\n\t\t\t\t$serverurl = $domainname . '/webservice/rest/server.php'. '?wstoken=' . $token . '&wsfunction='.$functionname;\n\t\t\t\trequire_once($conf['model_dir'].'m_curl.php');\n\t\t\t\t$curl = new curl;\n\t\t\t\t//if rest format == 'xml', then we do not add the param for backward compatibility with Moodle < 2.2\n\t\t\t\t$restformat = ($restformat == 'json')?'&moodlewsrestformat=' . $restformat:'';\n\t\t\t\t$resp = $curl->post($serverurl . $restformat, $params);\n\t\t\t\t$data = json_decode($resp, true);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\n\n\t\t}", "public function testCanCreateCourse()\n {\n \n $response = $this->call('POST', '/course', [\n 'name' => 'Kursur PHP Advance',\n 'level' => 'Beginner',\n 'benefit' => 'Bisa membuat website sendiri'\n ]);\n $this->assertEquals(201, $response->status());\n }", "public static function take_course() {\r\n\t\t\t$payment_method = !empty( $_POST['payment_method'] ) ? $_POST['payment_method'] : '';\r\n\t\t\t$course_id = !empty( $_POST['course_id'] ) ? intval( $_POST['course_id'] ) : false;\r\n\t\t\tdo_action( 'learn_press_take_course', $course_id, $payment_method );\r\n\t\t}", "public function store(StoreCoursesRequest $request)\n {\n // dd($request->all());\n if (!Gate::allows('course_create')) {\n return abort(401);\n }\n $request = $this->saveFiles($request);\n $slug = str_slug($request->title);\n\n $slug_lesson = Course::where('slug', '=', $slug)->first();\n if ($slug_lesson != null) {\n return back()->withFlashDanger(__('alerts.backend.general.slug_exist'));\n }\n\n $seats = 0;\n // if ($request->offlineData) {\n // foreach (json_decode($request->offlineData) as $key => $item) {\n // $item = json_decode(json_encode($item), true);\n // $seats += $item['seats-' . $key];\n // }\n // }\n // dd($request->all());\n\n\n\n foreach ($request->eduStatge as $i => $statge) {\n foreach($request->semesters as $j => $semester) {\n $ids[] = EduStageSemester::where('edu_stage_id',$request->eduStatge [$i])->where('semester_id',$request->semesters [$j])->pluck('id');\n }\n\n }\n $statgeSemestersIDS = Arr::collapse($ids);\n \n $course = Course::create($request->except(['offlineData', 'duration', 'learned', 'learned_ar', 'opt_courses', 'mand_courses', 'seats']));\n $course->slug = $slug;\n $course->optional_courses = $request->opt_courses ? json_encode($request->opt_courses) : null;\n $course->mandatory_courses = $request->mand_courses ? json_encode($request->mand_courses) : null;\n $course->learned = $request->learned ? json_encode($request->learned) : json_encode([]);\n $course->learned_ar = $request->learned_ar ? json_encode($request->learned_ar) : json_encode([]);\n $course->date = $request->offlineData ? json_encode($request->offlineData) : null;\n $course->seats = $seats;\n $course->published = 1;\n $course->online = 1;\n\n\n $course->save();\nforeach($statgeSemestersIDS as $i=>$semID){\n\n $courseSemester = new CourseEduStatgeSem();\n $courseSemester->course_id = $course->id;\n $courseSemester->edu_statge_sem_id = $statgeSemestersIDS[$i];\n $courseSemester->save();\n}\n\n\n //Saving videos\n if ($request->media_type != \"\") {\n $model_type = Course::class;\n $model_id = $course->id;\n $size = 0;\n $media = '';\n $url = '';\n $video_id = '';\n $name = $course->title . ' - video';\n $media = $course->mediavideo;\n if ($media == \"\") {\n $media = new Media();\n }\n if ($request->media_type != 'upload') {\n if (($request->media_type == 'youtube') || ($request->media_type == 'vimeo')) {\n $video = $request->video;\n $url = $video;\n $video_id = array_last(explode('/', $request->video));\n $size = 0;\n\n } else if ($request->media_type == 'embed') {\n $url = $request->video;\n }\n $media->model_type = $model_type;\n $media->model_id = $model_id;\n $media->name = $name;\n $media->url = $url;\n $media->type = $request->media_type;\n $media->file_name = $video_id;\n $media->size = 0;\n $media->user_id = auth()->user()->id;\n $media->duration = $request->duration;\n $media->save();\n }\n\n if ($request->media_type == 'upload') {\n\n if ($request->video_file) {\n $media = Media::findOrFail($request->video_file)->first();\n\n $media->model_type = $model_type;\n $media->model_id = $model_id;\n $media->name = $name;\n $media->save();\n } else {\n redirect()->back()->withFlashDanger('Please select a video from the list');\n }\n\n }\n }\n\n\n if ((int)$request->price == 0) {\n $course->price = NULL;\n $course->free = 1;\n $course->save();\n }\n\n\n $teachers = (auth()->user()->isAdmin() || auth()->user()->hasRole('academy')) ? array_filter((array)$request->input('teachers')) : [\\Auth::user()->id];\n $course->teachers()->sync($teachers);\n\n return redirect()->route('admin.courses.edit', ['course' => $course->id])->withFlashSuccess(trans('alerts.backend.general.created'));\n }", "public function store(CourseRequest $request)\n {\n if(Gate::denies('dashboard-view')) {\n abort(403);\n }\n\n $course = new Course;\n $course->account_id = Auth::user()->account_id;\n $course->category_id = $request->category;\n $course->level_id = $request->level;\n $course->name = $request->name;\n $course->description = $request->description;\n $course->objective = $request->objective;\n $course->requisites = $request->requisites;\n $course->audience = $request->audience;\n $course->type_sale = $request->type_sale;\n $course->price = $request->price;\n $course->certificate = $request->certificate;\n $course->video_presentation = $request->video;\n $course->image_presentation = $request->image;\n $course->status = $request->status;\n $course->save();\n return response()->json(['data'=>'Curso salvo com sucesso!','id' => $course->id]);\n }", "function addsubjectAction(){\r\n\t\tif($this->getRequest()->isPost()){\r\n\t\t\t$data = $this->getRequest()->getPost();\r\n\t\t\t$_dbmodel = new Global_Model_DbTable_DbSubjectExam();\r\n\t\t\t$data['status']=1;\t\r\n\t\t\t$id=$_dbmodel->addNewSubjectExam($data);\r\n\t\t\tprint_r(Zend_Json::encode($id));\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "public function insert() {\n\n // Does the Course object already have an ID?\n if ( !is_null( $this->courseId ) ) trigger_error ( \"Course::insert(): Attempt to insert course object that already has its ID property set (to $this->courseId).\", E_USER_ERROR );\n\n // Insert the course\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"INSERT INTO course ( courseCode, courseName, description, headTeacher )\n VALUES (:courseCode,:courseName,:description,:headTeacher)\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":courseCode\", $this->courseCode, PDO::PARAM_STR );\n $st->bindValue( \":courseName\", $this->courseName, PDO::PARAM_STR );\n $st->bindValue( \":description\", $this->description, PDO::PARAM_STR );\n $st->bindValue( \":headTeacher\", $this->headTeacher, PDO::PARAM_STR );\n\n $st->execute();\n $this->courseId = $conn->lastInsertId();\n $conn = null;\n }", "public function insert_course($code,$title,$cr_hr,$lab,$type) {\n $course_code =mysqli_real_escape_string($GLOBALS['con'],$code);\n $course_title =mysqli_real_escape_string($GLOBALS['con'],$title);\n $course_cr_hr =mysqli_real_escape_string($GLOBALS['con'],$cr_hr);\n $course_lab =mysqli_real_escape_string($GLOBALS['con'],$lab);\n $course_type =mysqli_real_escape_string($GLOBALS['con'],$type);\n $insrt_query =\"INSERT INTO courses(course_code, course_title, course_credit_hours, course_lab, course_type)\n VALUES ('$course_code','$course_title','$course_cr_hr','$course_lab ','$course_type')\";\n $insrt_exe =mysqli_query($GLOBALS['con'],$insrt_query);\n if ($insrt_exe) {\n // echo \"<script> alert('successfuly Deleted record')</script>\";\n header('Location:..\\courses_page.php?msg=successfuly Inserted record');//redirecting to main page of courses\n }else {\n // echo \"<script> alert(\".mysqli_error($GLOBALS['con']).\")</script>\";\n header('Location:..\\courses_page.php?msg=Error Inserting record');//redirecting to main page of courses\n }\n }", "public function create()\n {\n return view('Backend.Institute.TrainingCentre.Courses.create');\n }", "function listallcourse(){\n\t$unregisteredList = new ManageCourses;\n\t$queryResult = $unregisteredList->allcourses();\n\tif($queryResult){\n\t\techo \"<table>\";\n\t\techo \"<tr> <th> Course Code </th> <th> Course Name </th> <th> Course Year </th><th> Action </th></tr>\";\n\t\twhile ($row = $unregisteredList->fetch()) {\n\t\t\t$id = $row['courseid'];\n\t\t\techo \"<tr><td>\";\n\t\t\techo $row['coursecode'];\n\t\t\techo \"</td><td>\";\n\t\t\techo $row['coursename'];\n\t\t\techo \"</td><td>\";\n\t\t\techo $row['courseyear'];\n\t\t\techo \"</td><td>\";\n\t\t\techo '<form action=\"\" method=\"POST\" style=\"background-color: transparent;\">';\n\t\t echo '<input type=\"hidden\" name=\"courseid\" value=\"'.$row['courseid'].'\">';\n\t\t echo '<input type=\"hidden\" name=\"coursename\" value=\"'.$row['coursename'].'\">';\n\t echo '<button type=\"submit\" class=\"btn btn-danger\" name=\"delcourse\" value=\"'.$row['courseid'].'\">Delete</button>'. ' ';\n\t echo '<button type=\"submit\" class=\"btn btn-primary\" name=\"editcourse\" value=\"'.$row['courseid'].'\">Edit</button></form>';\n\t\t\techo \"</td></tr>\";\n\t\t\t//echo '<input type=\"checkbox\" name=\"username\" value=\"'.$row[\"courseid\"].'\">'. $row[\"coursename\"].' <br>';\n\t\t}\n\t\techo \"</table>\";\n\t}\n}", "public static function add_course($course_name, $course_number, $association)\n\t{\n\t\t$email = $_SESSION['email'];\n\t\t$dbhandle=DataAccessHelper::getConnection();\n\n\t\t$sql = \"select * from course WHERE email = ? AND courseName =? AND courseNumber = ? AND association=?;\";\n\t\t$stmt = \tmysqli_stmt_init($dbhandle);\n\n\t\tif(!mysqli_stmt_prepare($stmt, $sql)){\n\n\t\t\techo \"SQL statement failed\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmysqli_stmt_bind_param($stmt, \"ssss\",$email, $course_name, $course_number, $association);\n\t\t\tmysqli_stmt_execute($stmt);\n\t\t\t$result = mysqli_stmt_get_result($stmt);\n\t\t\tif($result->num_rows > 0){\n\t\t\t\t\treturn \"Record already exists!\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$sql = \"INSERT INTO course (email,courseName,courseNumber,association) VALUES (?, ? , ?, ?)\";\n\t\t\t\t\t$stmt = mysqli_stmt_init($dbhandle);\n\t\t\t\t\tif(!mysqli_stmt_prepare($stmt, $sql)){\n\t\t\t\t\t\t\n\t\t\t\t\t\techo \"SQL error\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\n\t\t\t\t\t\tmysqli_stmt_bind_param($stmt, \"ssss\",$email, $course_name, $course_number, $association);\n\t\t\t\t\t\tmysqli_stmt_execute($stmt);\n\t\t\t\t\t\treturn \"course added successfully\";\n\n\t\t\t\t\t}\n\t\t\t}\n\n\n\n\n\t\t\t// $result = mysqli_query($dbhandle,\"select * from course WHERE email = '$email' AND courseName ='$course_name' AND courseNumber ='$course_number' AND association='$association';\") or die(\"Failed to query database\".mysqli_error($dbhandle));\n\t\t\t// //echo $result->num_rows;\n\t\t\t// if ($result->num_rows > 0) {\n\t\t\t// \treturn \"Record already exists!\";\n\t\t\t// }\n\t\t\t// else{\n\t\t\t// \tmysqli_query($dbhandle,\"INSERT INTO course(email,courseName,courseNumber,association) VALUES ('$email', '$course_name' , '$course_number','$association')\");\n\n\t\t\t// \treturn \"course added successfully\";\n\t\t\t }\n\t\t\n\t}", "public function create()\n {\n $courses = Courses::all();\n return view('courses.create')->with('courses', $courses);\n }", "public function createAction()\n {\n if ($this->request->isPost()) {\n\t $concours = new Concours();\n\t\t\t$concours->label = $this->request->getPost(\"label\");\n\t\t\t$concours->date = $this->request->getPost(\"date\");\n\n\t if (!$concours->save()) {\n\t foreach ($concours->getMessages() as $message) {\n\t $this->flashSession->error($message);\n\t }\n\t } else {\n\t \t$this->flashSession->success('Concours ajouté');\n\t }\n\t $this->response->redirect('concours/edit/'.$concours->id);\n\t\t\t$this->view->disable();\n\t\t\treturn;\n } else {\n\t $this->response->redirect('concours/new');\n\t\t\t$this->view->disable();\n return;\n }\n }", "public function create()\n\t{\n\t\tif (!User::isAdmin()) {\n\t\t\t\treturn Redirect::to('dashboard');\n\t\t}\n\n\t\t$data['pagetitle'] = \"Create new Course.\";\n return Response::view('courses.create', $data)->header('Cache-Control', 'no-store, no-cache, must-revalidate');\n\t}", "public function add()\n {\n $update_data = $this->insert_global_model->globalinsert($this->tbl_exam_users_activity,array('user_id'=>$this->logged_in_user->id,\n 'activity_time'=>date('Y-m-d H:i:s'),'activity'=>'Create New Survey View'));\n // set page specific variables\n $page_info['title'] = 'Create New Survey'. $this->site_name;\n $page_info['view_page'] = 'administrator/survey_form_view';\n $page_info['message_error'] = '';\n $page_info['message_success'] = '';\n $page_info['message_info'] = '';\n $page_info['is_edit'] = false;\n //$page_info['cat_survey_lists'] = $this->cat_survey_lists;\n //echo \"<pre>\";\n ///print_r($this->cat_survey_lists); die();\n\n $this->_set_fields();\n $this->_set_rules();\n $page_info['catList'] = $this->select_global_model->Select_array('exm_survey_categories');\n //$page_info['catList'] = $this->question_list;\n\n //print_r_pre($page_info['catList']);\n // determine messages\n if ($this->session->flashdata('message_error')) {\n $page_info['message_error'] = $this->session->flashdata('message_error');\n }\n\n if ($this->session->flashdata('message_success')) {\n $page_info['message_success'] = $this->session->flashdata('message_success');\n }\n\n // load view\n\t$this->load->view('administrator/layouts/default', $page_info);\n }", "private function addSection() {\n // courseid, secNo, daysMet, startTime, endTime, totalReleasedSeats, building, room\n\n $courseID = $_POST['courseID'];\n $secNo = $_POST['secNo'];\n $daysMet = $_POST['daysMet'];\n $startTime = $_POST['startTime'];\n $endTime = $_POST['endTime'];\n $totalReleasedSeats = $_POST['totalReleasedSeats'];\n $building = $_POST['building'];\n $room = $_POST['room'];\n\n $this->openConn();\n\n $sql = \"SELECT DISTINCT term, secStartDate, secEndDate, sessionYear, sessionCode FROM Section WHERE courseID = :courseID\";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute(array(':courseID'=> $courseID));\n\n while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $term = $row['term'];\n $secStartDate = $row['secStartDate'];\n $secEndDate = $row['secEndDate'];\n $sessionYear = $row['sessionYear'];\n $sessionCode = $row['sessionCode'];\n }\n\n $totalEnrolment = 0;\n $isOptimized = 0;\n $secType = \"LAB\";\n\n // if($row){\n //\n // }\n\n $sql2 = \"INSERT INTO Section (courseID, secNo, daysMet, startTime, endTime, totalReleasedSeats, totalEnrolment, building, room,\n term, isOptimized, secStartDate, secEndDate, sessionYear, sessionCode, secType)\n VALUES (:courseID, :secNo, :daysMet, :startTime, :endTime, :totalReleasedSeats, :totalEnrolment, :building, :room,\n :term, :isOptimized, :secStartDate, :secEndDate, :sessionYear, :sessionCode, :secType)\";\n $stmt2 = $this->conn->prepare($sql2);\n $stmt2->execute(array(':courseID'=> $courseID, ':secNo'=> $secNo, ':daysMet'=> $daysMet, ':startTime'=> $startTime, ':endTime'=> $endTime, ':totalReleasedSeats'=> $totalReleasedSeats, ':totalEnrolment'=> $totalEnrolment, ':building'=> $building, ':room'=> $room,\n ':term'=> $term, ':isOptimized'=> $isOptimized, ':secStartDate'=> $secStartDate, ':secEndDate'=> $secEndDate, ':sessionYear'=> $sessionYear, ':sessionCode'=> $sessionCode, ':secType'=> $secType));\n\n $this->closeConn();\n\n }", "public function store()\n\t{\n\t\t$input = Request::only('internal_number', 'external_number', 'name', 'category', 'partner_id', 'description', 'duration', 'format', 'visible', 'cancelled', 'image', 'start_at', 'tags');\n\n\t\t$input['tags'] = Request::has('hidden-tags') ? explode(',', Request::get('hidden-tags')) : [];\n\n\t\t$course = $this->execute(CreateCommand::class, $input);\n\n\t\tFlash::success(sprintf('El curso %s fue creada con éxito!', $course->name));\n\n\t\treturn Redirect::action('Admin\\CoursesController@index');\n\t}", "public function search_courses()\n {\n\n //run thi url to add courses again\n\n $values = array(\n 'course_id' => 1, 'course_name' => 'DSA', 'course_fee' => '$100', 'course_teacher' => 'Praveen Kumar',\n 'course_review' => '4/5 star rating', 'course_details' => 'Interview prepration course fo beginner',\n 'sign_up'=>'Go TO COURSE'\n );\n DB::table('search_courses')->insert($values);\n\n \n \n $values = array(\n 'course_id' => 2, 'course_name' => 'Anatomy', 'course_fee' => '$100', 'course_teacher' => 'kuldeep Singh',\n 'course_review' => '4 star rating', 'course_details' => 'Anatomy Structured course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 3, 'course_name' => 'Economy', 'course_fee' => '$100', 'course_teacher' => 'Rajat Singh',\n 'course_review' => '5 star rating', 'course_details' => 'Economy Booster course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 4, 'course_name' => 'History', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Learn History through Dates',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 5, 'course_name' => 'mathematics', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Learn about Higher mathematics',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n\n\n \n $values = array(\n 'course_id' => 6, 'course_name' => 'Interior Design', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Booster Course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 7, 'course_name' => 'Graphic Design', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Booster Course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n $searchData = SearchCourses::all();\n return view('search_courses')->with('data', $searchData);\n }", "public function course() {\n $this->data['page_title'] = lang('courses');\n $data['returnedData'] = '';\n\n $packageId = (int) $this->uri->segment(4);\n if(!empty($packageId)) {\n $data['packageId'] = $packageId;\n $id = (int) $this->uri->segment(5);\n if (!empty($id)) {\n $returnedData = $this->package_course_model->get($id);\n $data['returnedData'] = $returnedData;\n }\n\n $validation_rules = array(\n array('field' => 'titleAR', 'label' => lang('arabic_title'), 'rules' => 'trim|required'),\n array('field' => 'titleGE', 'label' => lang('title').' ('.lang('german').')', 'rules' => 'trim|required')\n );\n $this->form_validation->set_rules($validation_rules);\n\n if ($this->form_validation->run() == false) {\n $this->form_validation->set_error_delimiters('<div class=\"alert alert-danger\" >', '</div>');\n //set the flash data error message if there is one\n $data['message'] = (validation_errors() ? validation_errors() : $this->session->flashdata('msg'));\n }else {\n if($_POST) {\n $postedArray = $this->input->post( NULL, TRUE );\n $postedArray['userId'] = $this->admin_ion_auth->user()->row()->id;\n $postedArray['packageId'] = $packageId;\n\n if (!empty($id)) { //update\n $postedArray['lastModifiedDate'] = date(\"Y-m-d H:i:s\");\n\n if ($this->package_course_model->update($postedArray, $id)) {\n $this->session->set_flashdata('msg', \"<div class='alert alert-success'>\".lang('update_success_message').\"</div>\");\n redirect('admin/packages/packageData/'.$packageId , 'location');\n } else {\n $this->session->set_flashdata('msg', \"<div class='alert alert-danger'>\".lang('update_error').\"</div>\");\n redirect('admin/packages/course/'.$packageId.'/'. $id, 'location');\n }\n }//end id\n else{//insert\n $postedArray['addingDate'] = date(\"Y-m-d H:i:s\");\n\n if ($this->package_course_model->insert($postedArray)) {\n $this->session->set_flashdata('msg', \"<div class='alert alert-success'>\".lang('insert_success_message').\"</div>\");\n } else {\n $this->session->set_flashdata('msg', \"<div class='alert alert-danger'>\".lang('insert_error').\"</div>\");\n }\n redirect('admin/packages/packageData/'.$packageId , 'location');\n }\n }//post\n }//else\n $this->load->vars($data);\n $this->render('admin/packages/course');\n } else {\n redirect('admin/packages', 'location');\n }\n }", "function get_course($id = ''){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function individualCourse($universityName,$universityId,$courseName,$courseId) {\n\t\t\n\t\t/*\n\t\t$courseDetail = $this->coursemodel->getCounterValue($courseId);\n\t\t$pageCount = $courseDetail[0]['page_count'];\n\t\tif(!empty($courseId)){\n\t\t\t$count = $pageCount + 1;\n\t\t\t$this->coursemodel->countCourses($count,$courseId);\n\t\t}\n\t\t*/\n\t\t\n\t\t$this->db_campaign = $this->ci->load->database('db_campaign', True);\n\t\t$data['totalLeads'] = $this->collegemodel->getCampaignData();\n\t\t$this->db = $this->ci->load->database('default', True);\n\t\t\n\t\t$spclCharUniv = array(\"(\", \")\",\",\",\"'\");\n\t\t\n\t\t//$university_name = str_replace('-',' ',$universityName);\n\t\t$university_name = str_replace($spclCharUniv,'',$universityName);\n\t\t\n\t\t$spclCharCourse = array(\"$\",\"!\",\"_\",\":\");\n\t\t\n\t\t$course_name = str_replace($spclCharCourse,'',$courseName);\n\t\t\n\t\t$course_name = str_replace('&','and',$course_name);\n\t\t\n\t\t$data['active']=\"\";\n\t\t$data['title'] = \"$university_name - $course_name\";\n\t\t$data['keywords'] = \"\";\n\t\t$data['description'] = \"\";\n\t\t$data['universityName'] = $universityName;\n\t\t$data['universityId'] = $universityId;\n\t\t$data['courseName'] = $courseName;\n\t\t$data[\"accreditationData\"] = $this->coursemodel->getAccreditationData($courseId);\n\t\t$data[\"stagesData\"] = $this->coursemodel->getStagesData($courseId);\n\t\t$data[\"degreeClassesData\"] = $this->coursemodel->getDegreeClassesData($courseId);\n\t\t$data[\"continuationData\"] = $this->coursemodel->getContinuationData($courseId);\n\t\t$data[\"employmentData\"] = $this->coursemodel->getEmploymentData($courseId);\n\t\t$data[\"jobData\"] = $this->coursemodel->getJobData($courseId);\n\t\t$data[\"entryData\"] = $this->coursemodel->getEntryData($courseId);\n\t\t$data[\"salaryData\"] = $this->coursemodel->getSalaryData($courseId);\n\t\t$data[\"commonData\"] = $this->coursemodel->getCommonData($courseId);\n\t\t$data[\"tariffData\"] = $this->coursemodel->getTariffData($courseId);\n\t\t$data[\"nssData\"] = $this->coursemodel->getNssData($courseId);\n\t\t///$data[\"countryId\"] = $this->coursemodel->getountryId($universityId);\n\t\t//echo $course_id;exit;\n\t\t//echo \"<pre>\";print_r($data);exit;\n\t\t\n $this->layout->view('course/individualCourse.php', $data);\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n \n 'code' => 'required',\n 'name'=>'required',\n 'department_id'=>'required',\n 'year'=>'required',\n 'term'=>'required',\n 'credit'=>'required',\n ]);\n \n $course = new Course();\n \n $course->code = $request->code;\n $course->name = $request->name;\n $course->department_id = $request->department_id;\n $course->year = $request->year;\n $course->term = $request->term;\n $course->credit = $request->credit;\n \n $course->save();\n return redirect()->route('admin.course.index')->with('successMsg','Course added Successfully');\n \n }", "public function store(Request $request)\n {\n //to know if the course has been register\n\n $studentID = session()->get('st_id');\n $cours =DB::table('course_student')->where('student_id','=',$studentID)->where('course_id','=', $request->cou_reg[0])->first();\n if(!$cours){\n $student = Student::find($studentID);\n $student->courses()->attach($request->cou_reg);\n $notification = Alert::alertMe('Course Registered!!!', 'success');\n return redirect()->back()->with($notification);\n }else {\n $notification = Alert::alertMe('Course already registered!!!', 'info');\n return redirect()->back()->with($notification);\n }\n\n }", "function addstudent(){\n include('../../config.php'); \n $classid = $_GET['classid'];\n $studid = $_GET['studid'];\n $verify = $this->verifystudent($studid,$classid);\n if($verify){\n echo $q = \"INSERT INTO studentsubject (studid,classid) VALUES ('$studid', '$classid');\";\n mysql_query($q);\n header('location:../classstudent.php?r=success&classid='.$classid.'');\n }else{\n header('location:../classstudent.php?r=duplicate&classid='.$classid.'');\n }\n \n $tmp = mysql_query(\"select * from class where id=$classid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_subject = $tmp_row['subject'];\n $tmp_class = $tmp_row['course'].' '.$tmp_row['year'].'-'.$tmp_row['section'];\n \n $tmp = mysql_query(\"select * from student where id=$studid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_student = $tmp_row['fname'].' '.$tmp_row['lname'];\n \n $act = \"add student $tmp_student to class $tmp_class with the subject of $tmp_subject\";\n $this->logs($act);\n }", "public function create()\n {\n return view('Addcourse');\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function company_addLicense() {\n $this->layout = \"ajax\";\n $this->loadModel('State');\n $this->loadModel('StateLicense');\n $findState = $this->StateLicense->find('list', array(\n 'fields' => array('state_id'),\n 'conditions' => array(\n 'StateLicense.comp_id' => $this->Auth->user('id'),\n 'StateLicense.active_status' => 1\n )));\n $state = $this->State->find('list', array('fields' => array('id', 'state'), 'conditions' => array('State.id' => $findState)));\n $this->set('state', $state);\n if (!empty($_POST)) {\n $this->set('child', $_POST['child']);\n }\n }" ]
[ "0.8569919", "0.77904826", "0.71145254", "0.69645417", "0.69444114", "0.683064", "0.6824", "0.6817754", "0.674902", "0.67293876", "0.6644141", "0.65975547", "0.65848136", "0.65543056", "0.65479153", "0.6540499", "0.6500271", "0.64734054", "0.6461691", "0.6457712", "0.6442643", "0.64158446", "0.63413405", "0.62843007", "0.6250321", "0.6249159", "0.62405545", "0.6239966", "0.6233741", "0.6230887", "0.62248266", "0.62241894", "0.622", "0.6215542", "0.62148154", "0.6175014", "0.61693156", "0.6165461", "0.61441106", "0.6136438", "0.6121819", "0.6121319", "0.61178684", "0.6109756", "0.6104686", "0.60951483", "0.60934794", "0.6086666", "0.6074765", "0.6072608", "0.60578287", "0.60574335", "0.6047498", "0.6047215", "0.60464305", "0.60464054", "0.6043709", "0.6041835", "0.6034786", "0.60098827", "0.6000145", "0.5994434", "0.5985486", "0.5983127", "0.5982709", "0.59795344", "0.5979241", "0.5977897", "0.5971037", "0.5956806", "0.59334195", "0.5918964", "0.59078", "0.59060884", "0.58987856", "0.5897931", "0.58955365", "0.58731794", "0.5865831", "0.5850888", "0.5849609", "0.5843867", "0.5842723", "0.5841573", "0.5841322", "0.5838961", "0.583621", "0.5820138", "0.5818965", "0.58184254", "0.58182764", "0.58175915", "0.581712", "0.5814332", "0.5812454", "0.5811677", "0.58097994", "0.58044696", "0.5803815", "0.57965744" ]
0.7055584
3
Delete A course including the data existing in the merge_course table that contains course data
public function delete_course() { $id = $this->input->get("id"); if($id==""){ echo "there seems to be a problem"; }else{ $id = $this->security->xss_clean($id); $id = htmlspecialchars($id); $course_from_id = $this->admin_student_courses_mdl->course_from_id($id); $deleted_class = $this->admin_student_courses_mdl->delete_course($id); if($deleted_class){ $this->admin_student_courses_mdl->delete_course_everywhere($course_from_id); echo "content was successfully deleted"; }else{ echo"there seeems to be a problem"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deletecourses ($id_course) {\n $sqlQuery = \" DELETE FROM courses \";\n $sqlQuery .= \" WHERE id_course= $id_course\";\n $result = $this -> getDbManager () -> executeQuery ( $sqlQuery );\n return $result ;\n }", "public static function deleteCourse()\n {\n global $cont;\n $script = $_POST['script'];\n $courseId = $_POST['delete_id'];\n $request = $cont->prepare(\"SELECT FROM requests WHERE courses_id = ?\");\n $request->execute([$courseId]);\n if(!empty($request->fetchColumn()))\n {\n session_start();\n $_SESSION['error'] = \"Not Allowed\";\n header(\"location:../admin/pages/tables/Courses.php\");\n die(); \n }\n if(!empty($script))\n {\n session_start();\n $_SESSION['error'] = \"Not Allowed\";\n header(\"location:../admin/pages/tables/Courses.php\");\n die();\n }\n $courses = $cont->prepare(\"DELETE FROM courses WHERE id = ?\");\n $courses->execute([$courseId]);\n session_start();\n $_SESSION['message'] = \"course was deleted\";\n header(\"location:../admin/pages/tables/Courses.php\");\n \n \n \n }", "function cerify_delete($course) {\r\n\tglobal $db;\r\n\r\n/*\r\n\t// delete hello_world course table entries\r\n\t$sql = \"DELETE FROM \".TABLE_PREFIX.\"certify, \".TABLE_PREFIX.\"certify_members, \".TABLE_PREFIX.\"certify_tests \";\r\n\t$sql .= \"USING \".TABLE_PREFIX.\"certify INNER JOIN \".TABLE_PREFIX.\"certify_members INNER JOIN \".TABLE_PREFIX.\"certify_tests \";\r\n\t$sql .= \"WHERE \".TABLE_PREFIX.\"certify.course = $course \";\r\n\t$sql .= \"AND \".TABLE_PREFIX.\"certify.certify_id = \".TABLE_PREFIX.\"certify_members.certify_id \";\r\n\t$sql .= \"AND \".TABLE_PREFIX.\"certify.certify_id = \".TABLE_PREFIX.\"certify_tests.certify_id\";\r\n\tmysql_query($sql, $db);\r\n*/\r\n\r\n//\t$sql = 'DELETE members FROM '.TABLE_PREFIX.'certify AS certify INNER JOIN '.TABLE_PREFIX.'certify_members AS members WHERE certify.course='.$course.' AND certify.certify_id=members.certify_id';\r\n//\tmysql_query($sql, $db);\r\n\t$sql = 'DELETE tests FROM '.TABLE_PREFIX.'certify AS certify INNER JOIN '.TABLE_PREFIX.'certify_tests AS tests WHERE certify.course='.$course.' AND certify.certify_id=tests.certify_id';\r\n\tmysql_query($sql, $db);\r\n\t$sql = 'DELETE FROM '.TABLE_PREFIX.'certify AS certify WHERE certify.course='.$course;\r\n\tmysql_query($sql, $db);\r\n\r\n\r\n}", "public function delete() {\n\n // Does the course object have an ID?\n if ( is_null( $this->courseId ) ) trigger_error ( \"Course::delete(): Attempt to delete course object that does not have its ID property set.\", E_USER_ERROR );\n\n // Delete the Student\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $st = $conn->prepare ( \"DELETE FROM course WHERE courseId = :courseId LIMIT 1\" );\n $st->bindValue( \":courseId\", $this->courseId, PDO::PARAM_INT );\n $st->execute();\n $conn = null;\n }", "function rem_stud_course($username, $course_name){\n $sql_conn = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASSWD, DATABASE);\n if(!$sql_conn){\n return 1;\n }\n\n $query = \"DELETE enrolled FROM enrolled NATURAL JOIN courses WHERE username=? AND course_name=?\";\n $stmt = mysqli_prepare($sql_conn, $query);\n if(!$stmt){\n mysqli_close($sql_conn);\n return 1;\n }\n mysqli_stmt_bind_param($stmt, \"ss\", $username, $course_name);\n if(!mysqli_stmt_execute($stmt)){\n mysqli_stmt_close($stmt);\n mysqli_close($sql_conn);\n return 1;\n }\n\n mysqli_stmt_close($stmt);\n mysqli_close($sql_conn);\n return 0;\n}", "public function delete_course($id) {\n $del_query=\"DELETE FROM `courses` WHERE course_id='$id'\";\n $del_exe=mysqli_query($GLOBALS['con'],$del_query);\n if ($del_exe) {\n header('Location:..\\courses_page.php?msg=successfuly Deleted record');//redirecting to main page of courses\n }else {\n header('Location:..\\courses_page.php?msg=Error Deleting record');//redirecting to main page of courses\n }\n }", "function course_delete(){\n\n\t\t$id = $this->input->post('id');\n\t\t$field = $this->input->post('field');\n\t\t$table = $this->input->post('table');\n\t\n\t\tif($this->setting_model->deleteData($table, $field, $id)) {\n\t\t\t$this->setting_model->delete('course_module_subject','course_id',$id);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function deleteuniversitycourse($id){\n\n\t\t$this->db->WHERE('uni_courseid',$id);\n\t\t$this->db->DELETE('tbl_university_course_eligibility');\n\n\t\t$this->db->WHERE('uni_courseid',$id);\n\t\t$this->db->DELETE('tbl_university_course_process');\n\n\t\t$this->db->WHERE('uni_courseid',$id);\n\t\t$this->db->DELETE('tbl_university_course_subjects');\n\n\t\t$this->db->WHERE('courseid',$id);\n\t\t$this->db->DELETE('tbl_course_intakes');\n\n\t\t$data = array();\n\t\t$Q = $this->db->QUERY('SELECT id FROM tbl_university_courses_fees_title WHERE uni_courseid=\"'.$id.'\"');\n\t\tif ($Q->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($Q->result_array() as $row)\n\t\t\t{\n\t\t\t\tif($row['id']!=\"\" || $row['id']!=NULL)\n\t\t\t\t{\n\t\t\t\t\t$this->db->WHERE('feestitleid',$row['id']);\n\t\t\t\t\t$this->db->DELETE('tbl_university_course_fees');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->db->WHERE('uni_courseid',$id);\n\t\t$this->db->DELETE('tbl_university_courses_fees_title');\n\n\t\t$this->db->WHERE('id',$id);\n\t\t$this->db->DELETE('tbl_university_courses');\n\t}", "public function deletecourse($id){\n $course = $this->courseModel->getCourseById($id);\n $recomended = $this->courseModel->getrecomendedCourse($id);\n\n $data = [\n 'course' => $course,\n 'recomended' => $recomended\n ];\n \n // Check for POST\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n\n\n if($this->courseModel->deletecourse($id)){\n flash('delete_message', 'Course Deleted');\n redirect('admin/index');\n\n } else {\n die('Something went wrong');\n } \n\n } \n \n $this->view('courses/deletecourse', $data);\n\n \n }", "public function removeAll() {\n $sql = 'SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE course';\n \n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n \n $stmt = $conn->prepare($sql);\n \n $stmt->execute();\n $count = $stmt->rowCount();\n }", "function deleteuniversitylocation($id){\n\n\t\t// Delete University course all data start.....\n \n\t\t$datacourse = array();\n $Qcourse = $this->db->QUERY('SELECT id FROM tbl_university_courses WHERE locationid=\"'.$id.'\"');\n\t\tif ($Qcourse->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($Qcourse->result_array() as $rowcourse)\n\t\t\t{\n\t\t\t\tif($rowcourse['id']!=\"\" || $rowcourse['id']!=NULL)\n\t\t\t\t{\n\t\t\t\t\t$this->db->WHERE('uni_courseid',$rowcourse['id']);\n\t\t\t\t\t$this->db->DELETE('tbl_university_course_eligibility');\n\n\t\t\t\t\t$this->db->WHERE('uni_courseid',$rowcourse['id']);\n\t\t\t\t\t$this->db->DELETE('tbl_university_course_process');\n\n\t\t\t\t\t$this->db->WHERE('uni_courseid',$rowcourse['id']);\n\t\t $this->db->DELETE('tbl_university_course_subjects');\n\n\t\t\t\t\t$this->db->WHERE('courseid',$rowcourse['id']);\n\t\t $this->db->DELETE('tbl_course_intakes');\n\n\t\t\t\t\t$datacourses_fees = array();\n\t\t\t\t\t$Qcourses_fees = $this->db->QUERY('SELECT id FROM tbl_university_courses_fees_title WHERE uni_courseid=\"'.$rowcourse['id'].'\"');\n\t\t\t\t\tif ($Qcourses_fees->num_rows() > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($Qcourses_fees->result_array() as $rowcourses_fees)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($rowcourses_fees['id']!=\"\" || $rowcourses_fees['id']!=NULL)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->db->WHERE('feestitleid',$rowcourses_fees['id']);\n\t\t\t\t\t\t\t\t$this->db->DELETE('tbl_university_course_fees');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->WHERE('uni_courseid',$rowcourse['id']);\n\t\t\t\t\t$this->db->DELETE('tbl_university_courses_fees_title');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->db->WHERE('locationid',$id);\n\t\t$this->db->DELETE('tbl_university_courses');\n\n\n\t\t$this->db->WHERE('id',$id);\n\t\t$this->db->DELETE('tbl_university_location');\t\n\t}", "public function deleteCourse($courseid){\n Logger::Log(\n 'starts DELETE DeleteCourse',\n LogLevel::DEBUG\n );\n\n $courseid = DBJson::mysql_real_escape_string( $courseid );\n\n foreach ( $this->_createCourse as $_link ){\n $result = Request::routeRequest(\n 'DELETE',\n '/course/course/'.$courseid,\n array(),\n '',\n $_link,\n 'course'\n );\n\n // checks the correctness of the query\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $this->app->response->setStatus( 201 );\n if ( isset( $result['headers']['Content-Type'] ) )\n $this->app->response->headers->set(\n 'Content-Type',\n $result['headers']['Content-Type']\n );\n\n } else {\n Logger::Log(\n 'POST DeleteCourse failed',\n LogLevel::ERROR\n );\n $this->app->response->setStatus( isset( $result['status'] ) ? $result['status'] : 409 );\n $this->app->stop( );\n }\n }\n }", "function del_course($course_name){\n $sql_conn = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASSWD, DATABASE);\n if(!$sql_conn){\n return 1;\n }\n\n $query = \"DELETE FROM courses WHERE course_name=?\";\n $stmt = mysqli_prepare($sql_conn, $query);\n if(!$stmt){\n mysqli_close($sql_conn);\n return 1;\n }\n mysqli_stmt_bind_param($stmt, \"s\",$course_name);\n if(!mysqli_stmt_execute($stmt)){\n mysqli_stmt_close($stmt);\n mysqli_close($sql_conn);\n return 1;\n }\n\n mysqli_stmt_close($stmt);\n mysqli_close($sql_conn);\n return 0;\n}", "private function course_content_deleted($event) {\n global $DB;\n $courseid = $event->courseid;\n $DB->delete_records('repository_gdrive_references', array('courseid' => $courseid));\n }", "public function destroy($id)\n {\n \n\n $courses= \\App\\Course::findOrFail($id);\n $courses->universities()->dissociate();\n $courses->programs()->dissociate();\n //$courses->scholarships()->detach(); // drop all existing relationship \n $courses->delete(); \n return redirect('coursesmanage')->withdanger('A Course has been deleted');\n\n\n }", "public function destroy(course $course)\n {\n //\n }", "public function deleteAction()\n {\n if ( $this->getRequest()->getParam('id') > 0) {\n try {\n $coursedoc = Mage::getModel('bs_coursedoc/coursedoc');\n $coursedoc->setId($this->getRequest()->getParam('id'))->delete();\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_coursedoc')->__('Course Document was successfully deleted.')\n );\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('There was an error deleting course doc.')\n );\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n Mage::logException($e);\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('Could not find course doc to delete.')\n );\n $this->_redirect('*/*/');\n }", "public function deleteAllCourseInfo($id_course = false) {\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t\t= false;\n\t\t\t$question_ids\t\t= false;\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t\t= $GLOBALS['db'];\n\t\t\t// If Course ID was sent\n\t\t\tif ($id_course) {\n\t\t\t\t// Delete all related Questions\n\t\t\t\t$ids\t\t\t\t\t= $this->getQuestionsIdByCourseId($id_course);\n\t\t\t\tif ($ids) {\n\t\t\t\t\tforeach ($ids as $id) {\n\t\t\t\t\t\tif ($question_ids) {\n\t\t\t\t\t\t\t$question_ids\t.= ', '.$id['id_question'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$question_ids\t= $id['id_question'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$db->deleteRow('tb_question', 'id IN ('.$question_ids.')');\n\t\t\t\t}\n\t\t\t\t// Delete Course\n\t\t\t\t$db->deleteRow('tb_course', 'id = '.$id_course);\n\t\t\t\t// Prepare return\n\t\t\t\t$return\t\t= 'ok';\n\t\t\t}\n\t\t\treturn $return;\n\t\t}", "function delete_course($id){\n\t\t\tprint_r($this->input->post());\n\t\t}", "private function deleteSection() {\n $courseID = $_POST['courseID'];\n $sectionID = $_POST['sectionID'];\n\n $this->openConn();\n\n $sql = \"DELETE FROM Section WHERE courseID= :courseID and sectionID = :sectionID\";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute(array(':courseID'=> $courseID, ':sectionID'=> $sectionID));\n\n if($stmt === TRUE) {\n $this->closeConn();\n return true;\n }\n else {\n $this->closeConn();\n return false;\n }\n\n }", "public function destroy(Course $course)\n {\n $user = Auth::user();\n //check if user has the priviledge to delete course record.\n $isAuthorized = app('App\\Http\\Controllers\\UserPrivilegeController')->checkPrivileges($user->id, Config::get('settings.course_management'), 'delete_priv');\n if($isAuthorized){\n try {\n $course->delete();\n //record in activity log\n $activityLog = ActivityLog::create([\n 'user_id' => $user->id,\n 'activity' => 'Deleted the course ' . $course->course_desc . '.',\n 'time' => Carbon::now()\n ]);\n return response()->json(['message' => 'Course record successfully deleted.'], 200);\n } catch (Exception $e) {\n report($e);\n return false;\n }\n }else{\n //record in activity log\n $activityLog = ActivityLog::create([\n 'user_id' => $user->id,\n 'activity' => 'Attempted to delete the course ' . $course->course_desc . '.',\n 'time' => Carbon::now()\n ]);\n return response()->json([\n 'message' => 'You are not authorized to delete course records.'\n ],401); //401: Unauthorized\n }\n\n }", "public function deleteCourse($id, $tablename){\n if($tablename == \"users\"){\n $queryString = \"matric_no\";\n }\n else if($tablename == \"courses\"){\n $queryString = \"course_id\";\n }\n else if($tablename == \"staff\"){\n $queryString = \"staff_id\";\n }\n else if($tablename == \"subscribe\"){\n $queryString = \"subscriber_id\";\n }\n else if($tablename == \"replythread\"){\n $queryString = \"reply_id\";\n }\n\n $con = new data();\n $sql = \"DELETE FROM \" .$tablename. \" WHERE \".$queryString .\" =:id\";\n $statement = $con->prepare($sql);\n if($statement){\n $statement->execute(array(':id' => $id));\n if($statement->rowCount() == 1){\n echo \"<br><p style='color: green;'>\".$statement->rowCount().\" Record Deleted Successfully</p>\";\n }else{\n $error = $statement->errorInfo();\n echo \"<br><p style='color: red;'>Query failed with message: \" . $error[2].\"</p>\";\n }\n }\n }", "public function destroy($id)\n {\n \n $course_student = course_student::where('course_id', $id)->get();\n if( !empty($course_student)){\n $course_student = course_student::where('course_id', $id)->delete();\n }\n $road_schedule = road_schedule::where('course_id', $course->id)->get();\n if( !empty($road_schedule)){\n road_schedule::where('course_id', $course->id)->delete();\n }\n $course=course::findOrFail($id);\n $result=$course->delete();\n if($result){\n return redirect('/course')->with('success','Course Successfully Deleted.');\n }\n else{\n return redirect('/course')->with('error','Record Not Deleted.');\n }\n }", "function delete_by_id($id)\n\t{\n\t\t$delete = \"DELETE FROM courses WHERE id = $id\";\n\t\t// echo $query;\n\t\t$this->db->query($delete);\n\t}", "final public function delete() {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n\t\n $sql_query = 'DELETE FROM fresco_costing_component_array WHERE component_id ='.$this->_component_id;\n \n $result = $mysqli->query($sql_query);\n if (!$result) {\n trigger_error('Unable to delete from database : SQL query : ' . $sql_query);\n }\n\treturn;\n }", "public function destroy($course)\n {\n $course = Course::find($course);\n // dd($course);\n $course->delete();\n return redirect('/profile/'.auth()->user()->id)->with('success','Course deleted successfully');\n }", "public function massDeleteAction()\n {\n $coursedocIds = $this->getRequest()->getParam('coursedoc');\n if (!is_array($coursedocIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('Please select course docs to delete.')\n );\n } else {\n try {\n foreach ($coursedocIds as $coursedocId) {\n $coursedoc = Mage::getModel('bs_coursedoc/coursedoc');\n $coursedoc->setId($coursedocId)->delete();\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_coursedoc')->__('Total of %d course docs were successfully deleted.', count($coursedocIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('There was an error deleting course docs.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public static function course_deleted(\\core\\event\\base $event) {\n global $DB;\n \n\t\t$courseid = $event->courseid; \n\t\t\t\n\t\t$sql = \t\"SELECT msg.id\n\t\t\t\t\t\tFROM {block_alerts_generator_msg} AS msg\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tWHERE msg.courseid = :course_id \";\n\t\t\t\t\t\t\t\n\t\t$params = array('course_id' => $courseid );\t\t\n\t\t$result = $DB ->get_recordset_sql($sql, $params);\n\t\t\n\t\tforeach ($result as $rs) {\t\t\t\t\t\n\t\t\t\t$DB->delete_records('block_alerts_generator_abs', array('messageid' => $rs->id ));\t\n\t\t\t\t$DB->delete_records('block_alerts_generator_abs_s', array('messageid' => $rs->id ));\t\n\t\t\t\t$DB->delete_records('block_alerts_generator_ans', array('messageid' => $rs->id ));\n\t\t\t\t$DB->delete_records('block_alerts_generator_ans_s', array('messageid' => $rs->id ));\n\t\t\t\t$DB->delete_records('block_alerts_generator_assig', array('messageid' => $rs->id ));\t\n\t\t\t\t$DB->delete_records('block_alerts_generator_dest', array('messageid' => $rs->id ));\n\t\t\t\t$DB->delete_records('block_alerts_generator_sch_a', array('messageid' => $rs->id ));\t\t\t\n\t\t}\t\t\t\t\n\t\t\t\n\t\t$DB->delete_records('block_alerts_generator_abs_u', array('courseid' => $courseid));\n\t\t$DB->delete_records('block_alerts_generator_abs_z', array('courseid' => $courseid));\n\t\t$DB->delete_records('block_alerts_generator_msg', array('courseid' => $courseid));\n\t\t\t\n }", "public function drop(Course $course){\n $this->authorize('drop', $course);\n\n $registered_course = CourseUser::select('id')\n ->where('user_id', Auth::user()->id)\n ->where('course_id', $course->id);\n\n $registered_course->delete();\n\n return redirect('/coursemanager');\n }", "public function delete(&$pks)\n\t{\n\t\t\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t\n\t\t//delete all relations student;\n\t\t$conditions = array(\n\t\t\t$db->quoteName('course_id') . ' IN ('.implode(',',$pks).')'\n\t\t);\n\t\t$query->delete($db->quoteName('#__cooltouraman_course_student_relations'));\n\t\t$query->where($conditions);\n\t\t$db->setQuery($query);\n\t\t\n\t\tif(!$db->execute())\n\t\t{\n\t\t\t$this->setError($db->getError());\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$query->clear();\n\t\t//delete all relations teacher;\n\t\t$query->delete($db->quoteName('#__cooltouraman_course_teacher_relations'));\n\t\t$query->where($conditions);\n\t\t$db->setQuery($query);\n\t\t\n\t\tif(!$db->execute())\n\t\t{\n\t\t\t$this->setError($db->getError());\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tparent::delete($pks);\n\t}", "public function destroy(Year $year)\n {\n $courses = Course::where('year',$year->year)->get();\n foreach($courses as $course){\n if($course->first_suggest1 ) $course->first_suggest1->delete();\n if($course->first_suggest2 ) $course->first_suggest2->delete();\n if($course->first_suggest3 ) $course->first_suggest3->delete();\n if($course->second_suggest ) $course->second_suggest->delete();\n if($course->special_suggest13 ) $course->special_suggest13->delete();\n if($course->special_suggest13_1 ) $course->special_suggest13_1->delete();\n if($course->special_suggest13_2 ) $course->special_suggest13_2->delete();\n if($course->special_suggest13_3 ) $course->special_suggest13_3->delete();\n }\n\n C31Table::where('year',$year->year)->delete();\n C81Table::where('year',$year->year)->delete();\n Course::where('year',$year->year)->delete();\n $year->delete();\n\n $p = storage_path('app/public/upload/'.$year->year);\n delete_dir($p);\n return redirect()->route('years.index');\n }", "public function destroy(Course $course)\n {\n //\n }", "public function destroy(Course $course)\n {\n //\n }", "public function del_mycourses($id_courses, $id_students)\n\t{\n $data = array(\n 'id_students' => $id_students,\n 'id_courses'\t\t => $id_courses\n );\n $this->MyModel->deleteData2('students_courses', $data);\n \n\t\tredirect('SiropCont/mycourses');\n\t}", "public function destroy(Course $course)\n {\n if(Session::get('accountID') === null){\n return view('authHN.extends.login');\n }else if(Account::where('id',Session::get('accountID'))->first()->level !== 1){\n return Redirect::to(route('home'));\n }else{\n if($course->joinAccount->count() !== 0){\n Session::put('message', 'Không thể xoá Khoá học đã có người đăng ký!');\n }\n else{\n $course->delete();\n Session::put('message', 'Xoá thành công!');\n }\n return Redirect::to(route('course.index'));\n } \n }", "public function destroy($course_id,$id)\n {\n Lessons::where('id',$id)->delete();\n return redirect()->back();\n }", "public function DropCourse($code)//drop the course\n {\n $drop = DB::table(\"enroll\")\n ->where(\"Code\", \"=\", $code)\n ->delete();\n if ($drop) {\n return redirect(\"/student/dropcourse\")->with(\n \"status\",\n \"Course is successfully dropped\"\n );\n } else {\n return redirect(\"/student/dropcourse\")->with(\n \"error\",\n \"Error in dropping course\"\n );\n }\n }", "public function test_delete() {\n global $DB;\n\n $startcount = $DB->count_records('course_modules');\n\n // Delete the course module.\n course_delete_module($this->quiz->cmid);\n\n // Now, run the course module deletion adhoc task.\n phpunit_util::run_all_adhoc_tasks();\n\n // Try purging.\n $recyclebin = new \\tool_recyclebin\\course_bin($this->course->id);\n foreach ($recyclebin->get_items() as $item) {\n $recyclebin->delete_item($item);\n }\n\n // Item was deleted, so no course module was restored.\n $this->assertEquals($startcount - 1, $DB->count_records('course_modules'));\n $this->assertEquals(0, count($recyclebin->get_items()));\n }", "public function DetachCourse(Course $course)\n\t\t{\n\t\t\t$params = [\n\t\t\t\t'course_id' => $course->GetAttribute(Course::$primary_key),\n\t\t\t\t'student_id' => $this->GetAttribute(static::$primary_key) \n\t\t\t];\n\n\t\t\t$course_student = CourseStudent::GetAll($params);\n\n\t\t\tforeach($course->GetActivities() as $activity) {\n\t\t\t\t$activity_students = ActivityStudent::GetAll([\n\t\t\t\t\t'student_id' => $this->GetAttribute(static::$primary_key)\n\t\t\t\t]);\n\n\t\t\t\tforeacH($activity_students as $activity_student) {\n\t\t\t\t\t$activity_student->Delete();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (count($course_student) == 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn $course_student[0]->Delete();\n\t\t}", "public function delete() {\n\t\t$this->assignment->delete();\n\t}", "function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}", "function deletecouse_subjects(){\n\n\t\t$course_Module_id = $this->input->post('id'); // this input post came on custom js\n\n\t\t$this->setting_model->delete('course_module_subject','module_id',$course_Module_id);\n\n\t\t//================= Activity Log Monitoring==========================//\n $activity_log_activity = \"One of course deleted\"; \n\n $activitylogs = array( \n 'activity_log_activity' =>$activity_log_activity, \n 'activity_date'=> date('Y-m-d h:i:s:a') ,\n 'user_id'=> $this->session->userdata('user_id')\n ); \n\n $this->setting_model->insert($activitylogs , 'activity_log');\n\n //==================== Activity Log Monitoring End=====================//\n\t}", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function delete() {\n global $CFG, $DB;\n require_once($CFG->libdir.'/gradelib.php');\n require_once($CFG->dirroot.'/calendar/lib.php');\n\n $DB->delete_records(\"languagelesson\", array(\"id\"=>$this->properties->id));;\n $DB->delete_records(\"languagelesson_pages\", array(\"lessonid\"=>$this->properties->id));\n $DB->delete_records(\"languagelesson_answers\", array(\"lessonid\"=>$this->properties->id));\n $DB->delete_records(\"languagelesson_attempts\", array(\"lessonid\"=>$this->properties->id));\n $DB->delete_records(\"languagelesson_grades\", array(\"lessonid\"=>$this->properties->id));\n $DB->delete_records(\"languagelesson_timer\", array(\"lessonid\"=>$this->properties->id));\n $DB->delete_records(\"languagelesson_branch\", array(\"lessonid\"=>$this->properties->id));\n $DB->delete_records(\"languagelesson_high_scores\", array(\"lessonid\"=>$this->properties->id));\n if ($events = $DB->get_records('event', array(\"modulename\"=>'lesson', \"instance\"=>$this->properties->id))) {\n foreach ($events as $event) {\n $event = calendar_event::load($event);\n $event->delete();\n }\n }\n\n grade_update('mod/languagelesson', $this->properties->course, 'mod', 'languagelesson', $this->properties->id, 0, NULL, array('deleted'=>1));\n return true;\n }", "public function testDeleteStudentTakesCourse()\n {\n $response = $this->loginAsRole(Role::ADMIN)\n ->delete($this->url('student-courses/1'));\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'message'\n ]);\n }", "private function course_module_deleted($event) {\n global $DB;\n $courseid = $event->courseid;\n $coursecontext = context_course::instance($courseid);\n $cmid = $event->contextinstanceid;\n \n $users = $this->get_google_authenticated_users($courseid);\n $filerecs = $DB->get_records('repository_gdrive_references', array('cmid' => $cmid), '', 'id, reference');\n $deletecalls = array();\n\n foreach ($filerecs as $filerec) {\n foreach ($users as $user) {\n if (has_capability('moodle/course:view', $coursecontext, $user->userid)) {\n // Manager; do nothing (don't delete permission so they can restore if necessary).\n } elseif (is_enrolled($coursecontext, $user->userid, null, true) && has_capability('moodle/course:manageactivities', $coursecontext, $user->userid)) {\n // Teacher (enrolled) (active); do nothing (don't delete permission so they can restore if necessary).\n } else {\n // Student (enrolled) or unenrolled user; delete permission.\n try {\n $permissionid = $this->service->permissions->getIdForEmail($user->gmail);\n $permission = $this->service->permissions->get($filerec->reference, $permissionid->id);\n if ($permission->role != 'owner') {\n $call = new stdClass();\n $call->fileid = $filerec->reference;\n $call->permissionid = $permissionid->id;\n $deletecalls[] = $call;\n if (count($deletecalls) == 1000) {\n $this->batch_delete_permissions($deletecalls);\n $deletecalls = array();\n }\n }\n } catch (Exception $e) {\n debugging($e);\n }\n } \n }\n }\n\n // Call any remaining batch requests.\n if (count($deletecalls) > 0) {\n $this->batch_delete_permissions($deletecalls);\n }\n $DB->delete_records('repository_gdrive_references', array('cmid' => $cmid));\n }", "function courseprefs_cleanup($file='cleanup.php', $semester=0, $logger=null, $web_report=false) {\n global $CFG;\n\n if (!$logger) {\n $logger = new Logger(true);\n }\n\n $clean_children = array(\"block_courseprefs_teamteach\",\n \"block_courseprefs_crosslist\",\n \"block_courseprefs_split\",\n \"block_courseprefs_logs\",\n \"block_courseprefs_teachers\",\n \"block_courseprefs_students\");\n\n if ($semester == 0) {\n $sql = \"SELECT * FROM {$CFG->prefix}block_courseprefs_semesters \n WHERE grades_due < \" . time();\n } else {\n $sql = \"SELECT * FROM {$CFG->prefix}block_courseprefs_semesters\n WHERE id = {$semester}\";\n }\n\n require_once($CFG->dirroot . '/blocks/courseprefs/classes/CoursePrefsHook.php');\n\n $hooks = CoursePrefsHook::allHooks($logger);\n\n // Parent semesters to remove\n $semesters = get_records_sql($sql);\n\n // If the result from query is not null, iterate\n if ($semesters) {\n\n foreach ($semesters as $semester) {\n $hooks->execute('cleanup', $semester->id);\n \n // For processing time's sake, we remove enroll here\n delete_records('block_courseprefs_enroll', 'semestersid', $semester->id);\n \n $str = \"Removing {$semester->campus} {$semester->name} {$semester->year}\" . \n \" and all associated data.\";\n $logger->log($str);\n if ($web_report) {\n mtrace($str);\n }\n }\n $semesterids = implode(',', array_keys($semesters));\n $sql = \"SELECT * FROM {$CFG->prefix}block_courseprefs_sections\n WHERE semestersid IN ({$semesterids})\";\n\n $sections = get_records_sql($sql);\n \n foreach ($sections as $section) {\n\n // Blow away the 'normal' cases first\n foreach ($clean_children as $table) {\n delete_records($table, 'sectionsid', $section->id);\n }\n\n // Remove the section entry\n delete_records('block_courseprefs_sections', 'id', $section->id);\n $str = \"Removing section {$section->id} {$section->idnumber}\";\n $logger->log($str);\n }\n // Remove the semesters\n delete_records_select('block_courseprefs_semesters', \n 'id IN ('. $semesterids .')');\n } else {\n $str = \"There are no semesters to remove.\";\n $logger->log($str);\n if ($web_report) {\n mtrace($str);\n }\n }\n\n $header = get_string('cleanup_header', 'block_courseprefs'); \n $logger->reportErrors($file, $header, $header);\n}", "function deleteCourseCategoryByCourseId($CourseId){\n return $this->delete(\"CourseId=$CourseId \");\n }", "public function deleteCourse( $callName, $input, $params = array() )\n {\n return $this->_component->callSqlTemplate('deleteCourse',dirname(__FILE__).'/Sql/DeleteCourse.sql',$params,201,'Model::isCreated',array(new Course()),'Model::isProblem',array(new Course()),false);\n }", "public function deleteShareCourseMaterial() {\n $incomingFormData = $this->readHttpRequest();\n $formData = json_decode($incomingFormData);\n\n $deleteResult = $this->Coursematerial_model->deleteShareCourseMaterial($formData);\n\n if ($deleteResult == true) {\n $data['status'] = 'ok';\n } else {\n $data['status'] = 'fail';\n }\n// $shareCourseMaterialList = $this->index($shareCrsListFlag); // call department List\n// $data['shareCourseMaterialList'] = $shareCourseMaterialList;\n echo json_encode($data);\n }", "public function DeleteCourse($clusterID, $courseID){\n\t\t$clusterUpdates['editedUser'] = $user;\n\t\t$clusterUpdates['editedDate'] = date('Y-m-d H:i:s', time());\n\t\t$clusterResult = $this->Update('[STAGE CLUSTERS TABLE]', $clusterID, $clusterUpdates);\n\n\t\t$curCourses = $this->Read('[STAGE COURSES TABLE]', array('recordID' => $courseID));\n\t\t$curGroupID = $curCourses[0]['groupID'];\n\t\t$curCourseOrder = (int)$curCourses[0]['courseOrder'];\n\n\t\t$courseResult = $this->Delete('[STAGE COURSES TABLE]', $courseID);\n\n\t\t$courses = $this->Read('[STAGE COURSES TABLE]', array('groupID' => $curGroupID));\n\t\tforeach($courses as $course){\n\t\t\tif((int)$course['courseOrder'] > $curCourseOrder){\n\t\t\t\t$update = array('courseorder' => (int)$course['courseOrder'] - 1);\n\t\t\t\t$courseResult &= $this->Update('[STAGE COURSES TABLE]', $course['recordID'], $update);\n\t\t\t}\n\t\t}\n\n\t\treturn array(\"results\" => $clusterResult && $courseResult);\n }", "function local_mediacore_course_delete_event_handler($course) {\n global $DB;\n $DB->delete_records('config_plugins',\n array(\n 'plugin' => MEDIACORE_LOCAL_COURSELTI_SETTING_NAME,\n 'name' => (string)$course->id,\n )\n );\n return TRUE;\n}", "public function deleteCommission(){\n\t\t$id = $this->input->post('id');\n\n\t\t//get deleted user info\n\t\t$userInfo = singleDbTableRow($id,'commissions');\n\t\t$categoryName = $userInfo->user_id;\n\t\t// add a activity\n\t\tcreate_activity(\"Deleted {$id} commissions\");\n\t\t//Now delete permanently\n\t\t$this->db->where('id', $id)->delete('commissions');\n\t\treturn true;\n\t}", "public function destroy(Course $course, $id)\n {\n if(Auth::user()->role != 1){\n return redirect()->route('home');\n }\n $courseToDelete = $course->find($id);\n $deleteStatus = $courseToDelete->delete();\n if($deleteStatus){\n return redirect()->back()->with(\"success\",\"Course deleted successifully !!!\");\n }\n }", "public function destroy(Courses_students $courses_students)\n {\n //\n }", "public function destroy($id)\n {\n if (!Gate::allows('course_delete')) {\n return abort(401);\n }\n\n\n $course = Course::findOrFail($id);\n if ($course->students->count() >= 1) {\n foreach ($course->students as $student) {\n $student->pivot->delete();\n }\n// return redirect()->route('admin.courses.index')->withFlashDanger(trans('alerts.backend.general.delete_warning'));\n }\n $course->delete();\n\n\n return redirect()->route('admin.courses.index')->withFlashSuccess(trans('alerts.backend.general.deleted'));\n }", "public function delete_category(){\n $query = \"DELETE FROM {$this->table} WHERE {$this->table}.cat_id = (:cat_id)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_id', $this->cat_id);\n $stmt->execute();\n return $stmt;\n \n }", "public function Delete_Assessor($group_num,$teacher_name,$department_id)\n {\n $teacher_id = $this->Get_Teacher_Id($teacher_name);\n if($teacher_id != false)\n {\n if($department_id != false)\n {\n if($department_id == '1202')\n {\n $group_num = '1'.$group_num;\n }\n else if($department_id == '1203')\n {\n $group_num = '2'.$group_num;\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่สามารถลบข้อมูลได้';\n $this->LOG->Write(\"delete assessor failed : teacher is in department \".$department_id );\n return $return;\n }\n $this->DB->Change_DB($this->DEFAULT_DB);\n $sql = \"DELETE FROM `group_assessor` WHERE `teacher_id` = '\".$teacher_id.\"' AND `group_num` = '\".$group_num.\"'\";\n $result = $this->DB->Insert_Update_Delete($sql);\n if($result)\n {\n $sql = \"SELECT `course_id` FROM `subject_assessor`\n WHERE `assessor_group_num` = '\".$group_num.\"'\n AND `semester_id` = '\".$this->DEADLINE['id'].\"'\";\n $result = $this->DB->Query($sql);\n if($result || $result == null)\n {\n $count = count($result);\n for($i=0;$i<$count;$i++)\n {\n $sql = \"DELETE FROM `approval_course`\n WHERE `course_id` = '\".$result[$i]['course_id'].\"' AND teacher_id = '\".$teacher_id.\"'\n AND `semester_id` = \".$this->DEADLINE['id'];\n $result_remove_approval = $this->DB->Insert_Update_Delete($sql);\n if($result_remove_approval)\n {\n $sql = \"DELETE FROM `approval_special`\n WHERE `course_id` = '\".$result[$i]['course_id'].\"' AND teacher_id = '\".$teacher_id.\"'\n AND `semester_id` = \".$this->DEADLINE['id'];\n $result_remove_approval = $this->DB->Insert_Update_Delete($sql);\n if($result_remove_approval)\n {\n $return['status'] = 'success';\n $return['msg'] = 'ลบข้อมูลสำเร็จ';\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่สามารถลบข้อมูลได้';\n $this->LOG->Write(\"delete assessor failed : cannot delete approval_special table\" );\n return $return;\n }\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่สามารถลบข้อมูลได้';\n $this->LOG->Write(\"delete assessor failed : cannot delete approval_course table\" );\n return $return;\n }\n }\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่สามารถลบข้อมูลได้';\n $this->LOG->Write(\"delete assessor failed : cannot search course_id in subject_assessor table\" );\n return $return;\n }\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่สามารถลบข้อมูลได้ กรุณาติดต่อผู้ดูแลระบบ';\n $this->LOG->Write(\"delete assessor failed : cannot delete group_assessor table\" );\n return $return;\n }\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ภาควิชาผิดพลาด กรุณาติดต่อผู้ดูแลระบบ';\n $this->LOG->Write(\"delete assessor failed : not found department id\" );\n return $return;\n }\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูลอาจารย์ท่านนี้ในฐานข้อมูล กรุณาติดต่อผู้ดูแลระบบ';\n $this->LOG->Write(\"delete assessor failed : not found teacher id\" );\n return $return;\n }\n $return['status'] = 'success';\n $return['msg'] = 'ลบข้อมูลสำเร็จ';\n return $return;\n }", "public function delete(){\n \n global $DB;\n \n // Mark the structure as deleted\n $obj = new \\stdClass();\n $obj->id = $this->id;\n $obj->deleted = 1;\n $obj->assessments = 0;\n $DB->update_record(\"bcgt_crit_award_structures\", $obj);\n \n // BCTODO - Also need to then reset award of any criteria that were using this structure\n $criterias = $DB->get_records(\"bcgt_criteria\", array(\"gradingstructureid\" => $this->id));\n foreach ($criterias as $criteria) {\n $criteria->gradingstructureid = 0;\n $DB->update_record(\"bcgt_criteria\", $criteria);\n }\n \n return true;\n \n }", "public function delete($id){\n\t\t$sql = 'DELETE FROM course_modes_coursemode WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function delete()\n {\n\n //If no log in is performed redirect to login page\n if (!$this->loggedIn()) {\n header('Location: index.php?c=login&m=login');\n }\n\n //If no game id is provided redirect to login page\n if (!isset($_GET['id'])) {\n header('Location: index.php?c=game&m=index');\n }\n\n $clean = $this->cleanInput($_GET['id']);\n\n //Select row to be deleted from games table\n $gamesCollection = new GamesCollection();\n $game = $gamesCollection->getGameById($clean);\n\n //Check for result query in main table 'games'\n //If no records are fetched for a game redirect\n if (is_null($game)) {\n header('Location: index.php?c=game&m=index');\n }\n\n //Select rows to be deleted from tables games_names , games_description and games_year\n $gamesNamesCollection = new GamesNamesCollection();\n $gameName = $gamesNamesCollection->getGameName($game->getNameId());\n\n $gamesDescriptionCollection = new GamesDescriptionCollection();\n $gameDescription = $gamesDescriptionCollection->getGameDescription($game->getDescriptionId());\n\n $gamesYearCollection = new GamesYearCollection();\n $gameYear = $gamesYearCollection->getGameYear($game->getYearId());\n\n\n // Use name , id , description , year from result query stored in '$game'\n // and delete records in tables games_names , games_description , games_year\n $gamesNamesCollection->delete($gameName->getId());\n $gamesDescriptionCollection->delete($gameDescription->getId());\n $gamesYearCollection->delete($gameYear->getId());\n\n //Delete game column from games table and delete image from folder\n unlink('../images/'.$game->getImage());\n $gamesCollection->delete($game->getId());\n\n //Assign a value to a variable containing the video id of the selected video_id column and later use this value to\n //delete records from table games_videos\n $gamesAdditionalCollection = new GamesAdditionalCollection();\n $gameVideo = $gamesAdditionalCollection->getGameVideoById($clean);\n\n //Assign a value to a variable containing the image id of the selected image_id column and later use this value to\n //delete records from table games_gallery_images\n $gameImage = $gamesAdditionalCollection->getGameImageById(array('games_id' => $clean));\n\n //Delete records from table games_additional_info\n $gamesAdditionalCollection->delete($clean);\n\n //Delete records from table games_videos\n $gamesVideosCollection = new GamesVideosCollection();\n $gamesVideosCollection->delete($gameVideo->getVideoId());\n\n //First select image_id from table games_additional_info and use it to delete records\n //from table games_gallery_images and image files from folder small_images\n $imageCollection = new GamesGalleryImagesCollection();\n\n //Fill an array with an image_id for an image or images\n $imagesIdArray = array();\n $imagesNamesArray = array();\n foreach($gameImage as $img) {\n $imagesIdArray[] = $img->getImageId();\n }\n //End\n\n //$imagesIdArray contains ids and they are used to fetch the images names from\n // table games_gallery_images and store them in $imageNamesArray array\n foreach($imagesIdArray as $imageId) {\n $imagesNamesArray[] = $imageCollection->getGameImage(array('id' => $imageId));\n }\n //End\n\n //$imagesNameArray array contains the images names and they are used to delete\n //the actual images from the folder small_images\n foreach($imagesNamesArray as $imageName) {\n unlink('../small_images/'.$imageName[0]->getImage());\n }\n\n ///Delete records from table games_gallery images using the ids stored in $imagesIdArray\n foreach($imagesIdArray as $imageGallery) {\n $imageCollection->delete($imageGallery);\n }\n\n header('Location: index.php?c=game&m=index');\n }", "public function actionDelete($id_skill, $id_course)\n\t{\n $model = CourseAndSkills::model()->findByAttributes(array('id_skill'=>$id_skill, 'id_course'=>$id_course));\n if($model) {\n $model->delete();\n $res['success'] = 1;\n } else {\n $res['success'] = 0;\n }\n echo CJSON::encode($res);\n\t}", "public function delOrgInfo($code) \n {\n $this->db->where(\"UPPER(toh_org_code) = UPPER('$code')\");\n return $this->db->delete('ims_hris.training_organizer_head');\n }", "public function dropCourse($personId, $sectionId){\n $query = \"delete from students \"\n . \" where person_id = \"\n . $personId\n . \" and section_id = \"\n . $sectionId;\n\n return $this->query($query);\n\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM compra_coletiva';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "function delete() {\n\t \t$sql = \"DELETE FROM evs_database.evs_key_component\n\t \t\t\tWHERE kcp_id=?\";\n\t \t$this->db->query($sql, array($this->kcp_id));\n\t\t\n\t }", "public function delCustomerCompare($csid){\n\t\t$sql = \"DELETE FROM tbl_compare WHERE csId = '$csid'\";\n\t\t$result = $this->db->delete($sql);\n\t}", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public static function course_deleted_observer(\\core\\event\\course_deleted $event) {\n global $DB;\n $DB->delete_records('tool_kholland', ['courseid' => $event->objectid]);\n }", "public function delete()\n\t{\n\t\t$transaction = $this->dbConnection->beginTransaction();\n\t\ttry {\n\t\t\tforeach ($this->previnterventions as $prev) {\n\t\t\t\t$prev->delete();\n\t\t\t}\n\t\t\tforeach ($this->relevantinterventions as $relv) {\n\t\t\t\t$relv->delete();\n\t\t\t}\n\t\t\tforeach ($this->deviationreasons as $devr) {\n\t\t\t\t$devr->delete();\n\t\t\t}\n\t\t\tforeach ($this->filecollection_assignments as $fca) {\n\t\t\t\t$fca->delete();\n\t\t\t}\n\t\t\tif (parent::delete()) {\n\t\t\t\t$transaction->commit();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Exception('unable to delete');\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$transaction->rollback();\n\t\t\tthrow $e;\n\t\t}\n\n\t}", "function del_lecture($lid)\n {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n\n $query = \"DELETE from lecturers where lid=?\";\n $stmt = $mysqli->prepare($query);\n\n if($stmt = $mysqli->prepare($query))\n {\n $stmt->bind_param('i',$lid);\n $stmt->execute();\n echo \"<script>alert('Lecture data has been deleted')</script>\";\n echo \"<script>window.location.href='view_lectures.php'</script>\";\n }\n else\n {\n $error = $mysqli->errno . ' ' . $mysqli->error;\n echo $error;\n } \n }", "public function destroy($id)\n {\n DB::delete('delete from courses where cid = ?',[$id]);\n return redirect('/admin/course');\n }", "public function destroy(Courses $course)\n {\n $course->delete();\n return redirect('/teacher/courses');\n }", "function DeleteCourse($courseId, $deleteLatestVersionOnly = False)\r\n\t{\r\n\r\n if($deleteLatestVersionOnly === true || $deleteLatestVersionOnly === \"true\")\r\n {\r\n $versionResult = $this->courseApiClient->getCourseLastVersionByCourseId($courseId);\r\n $this->courseApiClient->deleteCourseByCourseIdByVersion($courseId, $versionResult->result);\r\n }\r\n else\r\n {\r\n $this->courseApiClient->deleteCourseByCourseId($courseId);\r\n }\r\n return '<?xml version=\"1.0\" encoding=\"utf-8\" ?>' . \"\\n\" . '<rsp stat=\"ok\"><success /></rsp>';\r\n }", "function delete() {\n $cids = JRequest::getVar('cid', array(0), 'post', 'array');\n\n $row = & $this->getTable(\"ssprojects\");\n\n if (count($cids)) {\n foreach ($cids as $cid) {\n\n /* if (!$row->delete( $cid )) {\n $this->setError( $row->getErrorMsg() );\n return false;\n } */\n $db = $this->_db;\n $db->BeginTrans();\n if (!$row->delete($cid)) {\n $this->setError($row->getErrorMsg());\n $db->RollbackTrans();\n return false;\n } else {\n $q = \"delete from #__ssunits where ProjectID = '\" . $cid . \"'\";\n $db->setQuery($q);\n $db->query();\n if ($db->getErrorNum()) {\n $db->RollbackTrans();\n $this->setError(\"error deleting related units\");\n return false;\n }\n $db->CommitTrans();\n }\n }//foreach\n }\n return true;\n }", "public function adminDelComm()\n {\n $commID = $_POST['commID'];\n $del = \"DELETE FROM comment_section WHERE comm_id = ?\";\n $do = $this->connect()->prepare($del);\n $do->execute([$commID]);\n }", "public function delete_index_for_course(int $oldcourseid) {\n $this->deletes[] = ['course', $oldcourseid];\n return true;\n }", "public function destroy($id)\n\t{\n $course = Course::findOrFail($id);\n $course->delete();\n return 'true';\n\t}", "static public function mdlBorrarInstructor($tabla, $datos,$tabla1)\n\t{\n\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE Cod_Cliente= :idInstructor\");\n\t\t$stmt -> bindParam(\":idInstructor\", $datos, PDO::PARAM_INT);\n\t\t\n \n\n\n $stmt1 = Conexion::conectar()->prepare(\"DELETE FROM $tabla1 WHERE Id_Instructor= :idInstructor\");\n\t\t$stmt1 -> bindParam(\":idInstructor\", $datos, PDO::PARAM_INT);\n\t\tif($stmt1 -> execute()&&$stmt -> execute())\n\t\t{\n\t\t\treturn \"ok\";\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"error\";\t\n }\n \n\t\t$stmt -> close();\n\t\t$stmt = null;\n $stmt1 -> close();\n\t\t$stmt1 = null;\n\t\n }", "public function destroy($id)\n {\n DB::table(\"courses\")->where('id',$id)->delete();\n return redirect()->route('all-courses')->with('msg','Course deleted successfully.');\n }", "public function destroy(Request $request, $course_id)\n {\n //\n \n $course = Course::where('course_id',$course_id)->first();\n \n $user = User::where('email', $request->input('email'))->first();\n \n $courseUser = CourseUser::where('course_id', $course_id)->where('user_id',$user->id);\n\n if($courseUser->delete()){\n $request->session()->flash('success', $user->email.' successfully unassigned');\n }else{\n $request->session()->flash('error', 'There was an error unassigning the administrator');\n }\n\n $courseUsers = CourseUser::where('course_id', $course_id)->get();\n if (count($courseUsers) == 0){\n $course->assigned = -1;\n }\n\n $course->save();\n\n if($course->type == \"assigned\"){\n return redirect()->route('programWizard.step3', $request->input('program_id'));\n }else{\n return redirect()->back(); \n }\n\n }", "public function destroy(Course $course)\n {\n if($course->image)\n {\n $filename = $course->image;\n unlink('images/' . $filename);\n } \n $course->delete();\n return redirect('/admin/courses')->withStatus('Course successfully deleted');\n }", "public function destroy($id)\n {\n $crs = Course::find($id);\n $crs->delete();\n \\Session::flash('sucess_message','Course deleted sucessfully');\n return redirect('myAdmin/courses');\n }", "public function delete(): void\n {\n $query_lang = 'DELETE FROM '. rex::getTablePrefix() .'d2u_linkbox_categories '\n .'WHERE category_id = '. $this->category_id;\n $result_lang = rex_sql::factory();\n $result_lang->setQuery($query_lang);\n }", "public function destroy(Course $id)\n {\n $course = Course::all()->where('user_id', Auth::user()->id)->find($id);\n $modules = Module::all()->where('course_id', $id->id);\n\n foreach ($modules as $key => $module) {\n $module->delete();\n }\n\n $course->delete();\n return response()->json([ 'message' => 'Course deleted' ], 200);\n }", "public function excluir_compentecias($iddocumento){\n $this->db->where('fk_iddocumento', $iddocumento);\n return $this->db->delete('tbcompetencias');\n }", "function deleteSchool(){\n mysql_query(\"DELETE FROM school WHERE id='$this->schoolId'\") or die(mysql_error());\n \n // Delete the delegate positions table\n mysql_query(\"DROP TABLE school_$this->schoolId\") or die(mysql_error());\n }", "public function destroy($course_id, $id)\n {\n Enrollment::findOrFail($id)->delete();\n\n return redirect()->back();\n }", "public function destroy($id)\n {\n $course = Course::find($id);\n \n $course->delete();\n return redirect()->back()->with('successMsg','Course successfully Deleted');\n \n }", "public function delete() {\n $sql = \"DELETE FROM archivos WHERE contrato_id=:contrato_id\";\n $args = array(\n \":contrato_id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n $sql = \"DELETE FROM contratos_tipos_contratos WHERE contrato_id=:contrato_id\";\n $args = array(\n \":contrato_id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n $sql = \"DELETE FROM contratos WHERE id=:id\";\n $args = array(\n \":id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n return !$stmt ? false : true;\n }", "public function destroy(AllCourse $allCourse)\n {\n $allCourse->delete();\n return redirect('admins/admin/all-course');\n }", "public function destroy(Course $course,User $enrollment)\n {\n $course->students()->detach($enrollment);\n return redirect()->back();\n }", "function consult_delete_complaint($id=NULL) \r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n $data['patient_id'] = $this->uri->segment(3);\r\n $data['summary_id'] = $this->uri->segment(4);\r\n $data['complaint_id'] = $this->uri->segment(5);\r\n \r\n // Delete records\r\n $del_rec_array['complaint_id'] = $data['complaint_id'];\r\n $del_rec_data = $this->mconsult_wdb->consult_delete_complaint($del_rec_array);\r\n $this->session->set_flashdata('data_activity', 'Complaint deleted.');\r\n $new_page = base_url().\"index.php/ehr_consult/consult_episode/\".$data['patient_id'].\"/\".$data['summary_id'];\r\n header(\"Status: 200\");\r\n header(\"Location: \".$new_page);\r\n \r\n }", "public function deleteRecords($lintidreg) {\r\n $db = Zend_Db_Table::getDefaultAdapter();\r\n $where_delete_records = \" IdStudent = '\".$lintidreg.\"' \" ;\r\n $db->delete('tbl_academicprogress_subjects', $where_delete_records); \r\n $db->delete('tbl_academic_progress', $where_delete_records); \r\n \r\n }", "public function delete() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"DELETE FROM \".$this->getTableName();\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public function removeBid($userid, $course) {\n $sql = 'DELETE FROM bid WHERE userid=:userid and code=:course';\n \n $connMgr = new ConnectionManager();\n $conn = $connMgr->getConnection();\n \n $stmt = $conn->prepare($sql);\n $stmt->bindParam(':userid', $userid, PDO::PARAM_STR);\n $stmt->bindParam(':course', $course, PDO::PARAM_STR); \n $stmt->execute();\n\n $stmt = null; \n $conn = null;\n }", "public function delete(){\n\n\t\t$sql = new Sql();\n\n\t\t$sql->query(\"DELETE FROM tb_categories WHERE idcategory=:idcategory\",array(\n\t\t\t\":idcategory\"=>$this->getidcategory()\n\t\t));\n\n\t\tCategory::updateFile();\n\t}", "public function delete(){\n //Préparation de la requête\n $sql = \"DELETE FROM atelier WHERE idAtelier = ?\";\n $requete = $this->connectBdd->prepare($sql);\n\n //Execution de la requete\n $requete->execute([$this->getIdAtelier()]);\n\n //Fermeture de la requete\n $requete->closeCursor();// requête delete \n }", "public function EliminarCaja()\n\t\t{\n\n\t\t\t$sql = \" select codcaja from ventas where codcaja = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codcaja\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num == 0)\n\t\t\t{\n\n\t\t\t\t$sql = \" delete from cajas where codcaja = ? \";\n\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(1,$codcaja);\n\t\t\t\t$codcaja = base64_decode($_GET[\"codcaja\"]);\n\t\t\t\t$stmt->execute();\n\n\t\t\t\theader(\"Location: cajas?mesage=1\");\n\t\t\t\texit;\n\n\t\t\t}else {\n\n\t\t\t\theader(\"Location: cajas?mesage=2\");\n\t\t\t\texit;\n\t\t\t}\n\n\t\t}", "public function actionDelete()\r\n {\r\n if (!$this->requireValues($_POST, \"id\")) {\r\n AjaxResponse::missParam(\"id in post is required\");\r\n }\r\n if (CourseResource::model()->deleteByPk($_POST['id'], \"user_id=:u\", array('u' => Yii::app()->user->id))) {\r\n AjaxResponse::success();\r\n } else {\r\n AjaxResponse::resourceNotFound();\r\n }\r\n }" ]
[ "0.67806643", "0.66307116", "0.6549853", "0.6407568", "0.62209946", "0.6218145", "0.621035", "0.6115127", "0.6107304", "0.60837024", "0.60436964", "0.6015464", "0.59983766", "0.59737986", "0.59717494", "0.59417194", "0.59223014", "0.5912205", "0.5905412", "0.5818215", "0.5798593", "0.57847244", "0.5774174", "0.5741191", "0.5715742", "0.5699474", "0.56940883", "0.56821436", "0.56676024", "0.565674", "0.5653218", "0.5635151", "0.5635151", "0.5628005", "0.5602875", "0.55980253", "0.5591959", "0.5570319", "0.5561178", "0.55390173", "0.5532256", "0.5523588", "0.5511619", "0.55082184", "0.54995805", "0.54601485", "0.54409915", "0.5439129", "0.54254574", "0.54225796", "0.5407542", "0.53891855", "0.5382296", "0.53775316", "0.53765464", "0.53647685", "0.5363456", "0.53600746", "0.53591555", "0.53430176", "0.5339513", "0.5326415", "0.5319201", "0.5313973", "0.53121716", "0.53036356", "0.52928966", "0.5287555", "0.52718985", "0.525801", "0.52573", "0.5255351", "0.52381194", "0.52373254", "0.5231098", "0.5226663", "0.52211404", "0.5216684", "0.51988876", "0.5197261", "0.519645", "0.51945245", "0.51798564", "0.5171633", "0.5163134", "0.51631075", "0.5162851", "0.51616913", "0.5157906", "0.5157451", "0.51423407", "0.5134725", "0.51316524", "0.5119038", "0.511488", "0.5112061", "0.5111765", "0.5109208", "0.5104213", "0.5089343" ]
0.6013759
12
this is an ajax function that searches for a course based on the get request paramater
public function search_course() { $search_content = $this->input->get("search"); if($search_content==""){ }else{ $search_content = $this->security->xss_clean($search_content); $search_content = htmlspecialchars($search_content); $data = $this->admin_student_courses_mdl->search_course($search_content); print json_encode($data); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function category_wise_course_get() {\n $category_id = $_GET['category_id'];\n $courses = $this->api_model->category_wise_course_get($category_id);\n $this->set_response($courses, REST_Controller::HTTP_OK);\n }", "function get_details() { \n global $dbh;\n \n // allow crn or course name to be used in query (currently only crn is being used)\n if (!empty($_GET['crn']) or !empty($_GET['course'])) {\n if (isset($_SESSION['user'])) {\n $query = 'SELECT term_code,crn,concat(subject_code,\" \",course_number) as course,course_title as title,course_description as description,instructors,days1,startend1,loc1,days2,startend2,loc2,days3,startend3,loc3,alt_wed,prereqs,distribution1,distribution2,distribution3,exists(select * from classes_shopped where student_id = ? and term_code = ? and crn = ?) as shopped FROM courses';\n $term = array($_SESSION['user'],$_GET['term_code'],$_GET['crn']);\n } else {\n $query = 'SELECT term_code,crn,concat(subject_code,\" \",course_number) as course,course_title as title,course_description as description,instructors,days1,startend1,loc1,days2,startend2,loc2,days3,startend3,loc3,alt_wed,prereqs,distribution1,distribution2,distribution3 FROM courses';\n $term = array();\n }\n \n // add additional where clause based on data given\n if (!empty($_GET['crn'])) {\n $term[] = $_GET['crn'];\n $query .= ' WHERE CRN = ?';\n } else {\n $course = explode(' ',$_GET['course']);\n $term[] = strtoupper($course[0]);\n $term[] = $course[1];\n $query .= ' WHERE subject_code = ? AND course_number = ?';\n }\n \n $resultset = prepared_query($dbh, $query, $term);\n \n if ($resultset->numRows() == 0) {\n echo \"No course found for \".implode(' ',$term);\n } else { \n $row = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC);\n display_course($row); // format course data\n }\n }\n}", "function getteachcourses_get(){\n $teaching = $this->get('teachingID');\n // $startdate = $this->get(\"startdate\");\n // if($startdate >= $datetime){\n // }\n $result = $this->lecturers_model->getteachcoursesmodel($teaching);\n\n $this->response($result);\n }", "public function my_courses_get() {\n $response = array();\n $auth_token = $_GET['auth_token'];\n $logged_in_user_details = json_decode($this->token_data_get($auth_token), true);\n\n if ($logged_in_user_details['user_id'] > 0) {\n $response = $this->api_model->my_courses_get($logged_in_user_details['user_id']);\n }else{\n\n }\n return $this->set_response($response, REST_Controller::HTTP_OK);\n }", "function get_course($id = ''){\n\t\t\tprint_r($this->input->post());\n\t\t}", "function student_listCourses(){\n\tinclude 'db.php';\n\t$username = filter_var($_GET['val']);\n\n\t$sql = 'SELECT id ,name ,description , image \n \t\t\tFROM courses JOIN idinfo\n \t\tON courses.id = idinfo.coursesID\n \t\tWHERE idinfo.studentID =' . $username . '' ;\n\t\n\t$result = mysqli_query($conn, $sql);\n\n\tif (mysqli_num_rows($result) > 0) {\n\t\t\tforeach($result as $row) {\t\t\t\t\n\t\t\t\techo \"<a href='courses-info.php?val=\". $row['id'] . \"'>\" . \"<div class='wrapp-img-link'>\" .'<img class=\"img-main\" src=\"data:image/jpeg;base64,'.base64_encode( $row['image'] ).'\" alt=\"' . $row['name'] . '\"/>' . \"</div>\". \"course\" . \" \" . $row['name'] . \"</a>\";\n\t\t\t}\n\t} else {\n\t\t\t\techo \"This student is currently not enrolled in any courses\";\n\t\t\t}\n\t\t\t\t\n\n\t}", "public function search(Request $request){\n\n // Get all courses the user is currently registered in\n $user = User::find(Auth::user()->id);\n $registered_courses = $user->courses()->get();\n\n // validate the user input\n $this->validate($request, ['search_input' => 'required',]);\n $input = $request->input(\"search_input\");\n\n $courses = array();\n\n // find the courses associated with the user input\n $courses_by_name = Course::where('class', 'ilike', '%'.$input.'%')->get();\n $courses_by_title = Course::where('title', 'ilike', '%'.$input.'%')->get();\n\n // courses information by course name\n foreach($courses_by_name as $cbn){\n if(!in_array($cbn, $courses)){\n if($registered_courses->where('title', $cbn->title)->count() === 0){\n $item = array();\n $item['id'] = $cbn->id;\n $item['class'] = $cbn->class;\n $item['section'] = $cbn->section;\n $item['title'] = $cbn->title;\n $item['teacher'] = \"\";\n $courses[] = $item;\n }\n }\n }\n\n // courses information by course title\n foreach($courses_by_title as $cbt){\n if(!in_array($cbt, $courses)){\n if($registered_courses->where('title', $cbt->title)->count() === 0){\n $item = array();\n $item['id'] = $cbt->id;\n $item['class'] = $cbt->class;\n $item['section'] = $cbt->section;\n $item['title'] = $cbt->title;\n $item['teacher'] = \"\";\n $courses[] = $item;\n }\n }\n }\n\n // courses information by course teacher's name\n $allCourses = Course::all();\n foreach ($allCourses as $aCourse){\n $found = $aCourse->teachers()\n ->where('name','ilike', \"%$input%\")\n ->get();\n if(count($found) > 0 && !in_array($aCourse, $courses)){\n if($registered_courses->where('title', $aCourse->title)->count() === 0) {\n $item = array();\n $item['id'] = $aCourse->id;\n $item['class'] = $aCourse->class;\n $item['section'] = $aCourse->section;\n $item['title'] = $aCourse->title;\n $item['teacher'] = $found[0]->name;\n $courses[] = $item;\n }\n }\n }\n\n $paginated_courses = $this->constructPagination($courses);\n\n return view('coursemanager.index', ['registered_courses' => $registered_courses, 'courses' => $paginated_courses,\n 'user' => $user,]);\n }", "public function course_object_by_id_get() {\n\t\t$course_id = $_GET['course_id'];\n\t\t$course = $this->crud_model->get_course_by_id($course_id)->row_array();\n\t\t$course['requirements'] = json_decode($course['requirements']);\n\t\t$course['outcomes'] = json_decode($course['outcomes']);\n\t\t$course['thumbnail'] = $this->get_image('course_thumbnail', $course['id']);\n\t\tif ($course['is_free_course'] == 1) {\n\t\t\t$course['price'] = get_phrase('free');\n\t\t}else{\n\t\t\tif ($course['discount_flag'] == 1){\n\t\t\t\t$course['price'] = currency($course['discounted_price']);\n\t\t\t}else{\n\t\t\t\t$course['price'] = currency($course['price']);\n\t\t\t}\n\t\t}\n\t\t$total_rating = $this->crud_model->get_ratings('course', $course['id'], true)->row()->rating;\n\t\t$number_of_ratings = $this->crud_model->get_ratings('course', $course['id'])->num_rows();\n\t\tif ($number_of_ratings > 0) {\n\t\t\t$course['rating'] = ceil($total_rating / $number_of_ratings);\n\t\t}else {\n\t\t\t$course['rating'] = 0;\n\t\t}\n\t\t$course['number_of_ratings'] = $number_of_ratings;\n\t\t$instructor_details = $this->user_model->get_all_user($course['user_id'])->row_array();\n\t\t$course['instructor_name'] = $instructor_details['first_name'].' '.$instructor_details['last_name'];\n\t\t$course['total_enrollment'] = $this->crud_model->enrol_history($course['id'])->num_rows();\n\t\t$course['shareable_link'] = site_url('home/course/'.slugify($course['title']).'/'.$course['id']);\n\t\treturn $course;\n\t}", "public function fetch_course_name_for_merging()\n {\n $id = $this->input->get(\"id\");\n $id = $this->security->xss_clean(htmlspecialchars($id));\n if($id==\"\"){\n echo \"course name was not gotten there seems to be a problem\";\n }else{\n $get_course = $this->admin_student_courses_mdl->course_from_id($id);\n echo $get_course;\n }\n }", "public function index()\n\t{\n\t\t// $slider = $this->home_model->GetData(['type'=>'slide'],'config')->result();\n\t\t$list_courses = '';\n\t\t$user_id = $this->session->userdata('logged_id');\n\t\t$username_id = $this->auth_model->GetUser(['id_user' => $user_id])->row('username');\n\n\t\t$title = $this->input->get('title');\n\t\t$subject = $this->input->get('subject');\n\n\t\tif (empty($title) && empty($subject)) {\n\t\t$list_courses = $this->course_model->GetListCourses('','');\n\t\t}\n\t\telse if ($title == \"\" && $subject == \"\") {\n\t\t$list_courses = $this->course_model->GetListCourses('','');\n\t\t}\n\t\telse{\n\t\t\tif($subject != \"\"){\n\t\t\t\t$subject = $subject;\n\t\t\t\t// $sbjct_filter = [\"subject\" => $subject];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$subject =\"\";\n\t\t\t\t// $sbjct_filter = \"\";\n\t\t\t}\n\t\t\tif ($title != \"\") {\n\t\t\t\t$title = $title;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$title = \"\";\n\t\t\t}\n\t\t\t$check_name = $this->home_model->GetData([\"name LIKE\"=>\"%\".$title.\"%\"],'user')->num_rows();\n\t\t\t$check_title = $this->home_model->GetData([\"title LIKE\"=>\"%\".$title.\"%\"],'course_title')->num_rows();\n\t\t\tif ($check_title > 0 && $check_name > 0) {\n\t\t\t\tif ($subject != \"\") {\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject],[\"title LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject]);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\"],[\"title LIKE\"=>\"%\".$title.\"%\"]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if ($check_title > 0) {\n\t\t\t\tif ($subject != \"\") {\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"title LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject],\"\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"title LIKE\"=>\"%\".$title.\"%\"],\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($check_name > 0) {\n\t\t\t\tif ($subject != \"\") {\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject],\"\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\"],\"\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse{\n\t\t\tif ($subject != \"\") {\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject],[\"title LIKE\"=>\"%\".$title.\"%\",\"subject\" => $subject]);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$list_courses = $this->course_model->GetListCourses([\"name LIKE\"=>\"%\".$title.\"%\"],[\"title LIKE\"=>\"%\".$title.\"%\"]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t$username = array();\n\t\t$like_amount = array();\n\t\t$comment_amount = array();\n\t\t$liked = array();\n\n\t\tforeach ($list_courses as $courses) {\n\t\t\t$username[$courses->id_user] = $this->auth_model->GetUser(['id_user' => $courses->id_user])->row('username');\n\t\t\t$like_amount[$courses->id_title] = $this->home_model->GetSelectData('COUNT(id_likecourse) as like_amount',['id_title' => $courses->id_title],'like_course')->row('like_amount');\n\t\t\t$comment_amount[$courses->id_title] = $this->home_model->GetSelectData('COUNT(id_comment) as comment_amount',['id_title' => $courses->id_title],'comment')->row('comment_amount');\n\t\t\tif ($this->session->userdata('logged_in') == TRUE) {\n\t\t\t\t$liked[] = $this->home_model->GetData(['id_title'=>$courses->id_title,'id_user'=>$user_id,],'like_course')->row('id_title');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif (!empty($title) || !empty($subject)) {\n\t\t\t\t$data = [\n\t\t\t\t'list_subject'\t=> $this->course_model->GetSubject(),\n\t\t\t\t'username' \t\t=> $username,\n\t\t\t\t'like_amount'\t=> $like_amount,\n\t\t\t\t'comment_amount'=> $comment_amount,\n\t\t\t\t'liked'\t\t\t=> $liked,\n\t\t\t\t'list_courses' \t=> $list_courses,\n\t\t\t\t'title'\t\t \t=> $title,\t//search\n\t\t\t\t'subject'\t\t=> $subject, //search\n\t\t\t\t'main_view' \t=> 'course_view',\n\t\t\t\t'username_id'\t=> $username_id,\n\t\t\t\t// 'slider'\t\t=> $slider,\n\t\t\t\t// 'sld_img'\t\t=> $sld_img,\n\t\t\t\t\t];\n\t\t}\n\t\telse{\n\t\t\t\t$data = [\n\t\t\t\t'list_subject'\t=> $this->course_model->GetSubject(),\n\t\t\t\t'username' \t\t=> $username,\n\t\t\t\t'like_amount'\t=> $like_amount,\n\t\t\t\t'comment_amount'=> $comment_amount,\n\t\t\t\t'liked'\t\t\t=> $liked,\n\t\t\t\t'list_courses' \t=> $list_courses,\n\t\t\t\t'main_view' \t=> 'course_view',\n\t\t\t\t'username_id'\t=> $username_id,\n\t\t\t\t// 'slider'\t\t=> $slider,\n\t\t\t\t// 'sld_img'\t\t=> $sld_img,\n\t\t\t\t\t];\n\t\t}\n\t\t\n\t\t$this->load->view('templet', $data);\n\t}", "public function executeAjaxSearch(sfWebRequest $request)\n {\n if (!$request->isXmlHttpRequest()) $this->forward404();\n if (!$request->hasParameter(\"ajax_query\")) throw new Exception(\"ajax_query does not exist\");\n \n // use fuzzySearch class to get a list of courses matching the query\n $query = $request->getParameter(\"ajax_query\");\n $fuzzySearch = new fuzzySearch();\n try {\n $fuzzySearch->query($query);\n $courseList = $fuzzySearch->getCourseList();\n } catch (Exception $e){\n echo \"<li>No match found</li>\";\n return sfView::NONE;\n }\n \n if (!isset($courseList) || count($courseList) == 0) {\n echo \"<li>No match found</li>\";\n } else {\n foreach ($courseList as $course){\n echo \"<li><a style='cursor:pointer' onclick='addToSelected(\\\"\".$course->getId().\" (\".$course->getDescr().\")\".\"\\\")'>\".$course->getId().\" (\".$course->getDescr().\")</a></li>\";\n }\n }\n \n return sfView::NONE;\n }", "public function index(Request $request){\n $courses = Course::query();\n\n // Fitur search data dengan nama, berdasarkan Query Params: search\n $search = $request->query('search');\n // Query where search LIKE\n $courses->when($search, function($query) use ($search){\n return $query->whereRaw(\"name LIKE '%\".strtolower($search).\"%'\");\n });\n\n // Fitur search berdasarkan status course, berdasarkan Query Params: status\n $status = $request->query('status');\n // Query where equal atau samadengan\n $courses->when($status, function($query) use ($status){\n return $query->where('status', '=', $status);\n });\n \n\n return response()->json([\n 'status' => 'success',\n // Set per Page 10 courses\n 'data' => $courses->paginate(10)\n ]);\n }", "public function getcoursesByid_course ($id_course){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM courses \";\n $sqlQuery .= \" WHERE id_course=’ $id_course ’ \";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }", "public function search_courses()\n {\n\n //run thi url to add courses again\n\n $values = array(\n 'course_id' => 1, 'course_name' => 'DSA', 'course_fee' => '$100', 'course_teacher' => 'Praveen Kumar',\n 'course_review' => '4/5 star rating', 'course_details' => 'Interview prepration course fo beginner',\n 'sign_up'=>'Go TO COURSE'\n );\n DB::table('search_courses')->insert($values);\n\n \n \n $values = array(\n 'course_id' => 2, 'course_name' => 'Anatomy', 'course_fee' => '$100', 'course_teacher' => 'kuldeep Singh',\n 'course_review' => '4 star rating', 'course_details' => 'Anatomy Structured course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 3, 'course_name' => 'Economy', 'course_fee' => '$100', 'course_teacher' => 'Rajat Singh',\n 'course_review' => '5 star rating', 'course_details' => 'Economy Booster course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 4, 'course_name' => 'History', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Learn History through Dates',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 5, 'course_name' => 'mathematics', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Learn about Higher mathematics',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n\n\n \n $values = array(\n 'course_id' => 6, 'course_name' => 'Interior Design', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Booster Course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n \n $values = array(\n 'course_id' => 7, 'course_name' => 'Graphic Design', 'course_fee' => '$100', 'course_teacher' => 'Balbir Singh',\n 'course_review' => '4.5 star rating', 'course_details' => 'Booster Course',\n 'sign_up'=>'SignUp now'\n );\n DB::table('search_courses')->insert($values);\n\n $searchData = SearchCourses::all();\n return view('search_courses')->with('data', $searchData);\n }", "public function index(Request $request)\n { \n $dataSearch = Request::get('search');\n return Courses::with(['getTasks','getCategory'])->whereHas('getCategory', function($q) use ($dataSearch) {\n if($dataSearch){\n $q->where('category_name', 'LIKE', \"%{$dataSearch}%\");\n }\n }) ->latest()\n ->orWhere('course_name', 'LIKE', \"%{$dataSearch}%\")\n ->paginate(); \n }", "public function getCourseby($urlsearch=null,$stream=null,$level=null,$term=null,$page=null,$pagesize=null)\n {\n \n $data=array();\n\n if($term!=\"\"||$term!=null){$this->db->like(array('name'=>$term));}\n if($urlsearch!=\"\"||$urlsearch!=null){$this->db->like(array('name'=>$urlsearch));}\n $this->db->select('cid'); \n $c_result=$this->db->get('courses_list');\n $data[\"query1\"]= $this->db->last_query();\n if($c_result->num_rows()>0)\n {\n $course=$c_result->result_array();\n $course_id = array_column($course, 'cid');\n \n /* getcourse*/\n /* get unique college id and seacrh here*/\n $this->db->distinct('inst_id');\n if($stream!=null){ $this->db->where($stream); }\n if($level!=null){ $this->db->where($level); }\n $this->db->select('inst_id');\n $this->db->where_in('course_id',$course_id);\n $institute=$this->db->get('allcourse'); \n $data[\"query2\"]= $this->db->last_query();\n $inst_id=array_column($institute->result_array(), 'inst_id'); \n if($institute->num_rows()>0)\n {\n \n /** get all distinct institute **/\n if($page!=null &&$pagesize!=null) { $offset=($page-1)*$pagesize; $this->db->limit($pagesize,$offset); }\n $this->db->select('*');\n $this->db->where_in('id',$inst_id);\n $allinstitute=$this->db->get('institute');\n $data[\"query3\"]= $this->db->last_query();\n if($allinstitute->num_rows()>0){\n $data[\"courses\"]=$allinstitute->result_array();\n $data[\"pcount\"]=$institute->num_rows();\n \n \n }\n \n else{\n $data[\"error\"]=\"no information found at server\";\n $data[\"pcount\"]=0;\n }\n \n }\n else{\n $data[\"error\"]=\"no information found at server\";\n $data[\"pcount\"]=0;\n }\n \n }\n return $data;\n }", "public static function find_courses($search) {\n global $DB;\n\n // Validate parameters passed from web service.\n $params = self::validate_parameters(self::find_courses_parameters(), array('search' => $search));\n\n // Capability check.\n if (!has_capability('moodle/course:viewhiddencourses', context_system::instance())) {\n return false;\n }\n\n // Build query.\n $searchsql = '';\n $searchparams = array();\n $searchlikes = array();\n $searchfields = array('c.shortname', 'c.fullname', 'c.idnumber');\n for ($i = 0; $i < count($searchfields); $i++) {\n $searchlikes[$i] = $DB->sql_like($searchfields[$i], \":s{$i}\", false, false);\n $searchparams[\"s{$i}\"] = '%' . $search . '%';\n }\n // We exclude the front page.\n $searchsql = '(' . implode(' OR ', $searchlikes) . ') AND c.id != 1';\n\n // Run query.\n $fields = 'c.id,c.idnumber,c.shortname,c.fullname';\n $sql = \"SELECT $fields FROM {course} c WHERE $searchsql ORDER BY c.shortname ASC\";\n $courses = $DB->get_records_sql($sql, $searchparams, 0);\n return $courses;\n }", "function getCourseByIdValidate(){\n\t\t \n\t\tif(@$this->id != \"\" && @$this->identification != \"\"){\n\t\t\t$this->basics->getCourseById($this->sanitize($this->id), $this->sanitize($this->identification));\n\t\t}else{\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"The Basic Program Blocks seem corrupt. Please Logout then login.\", \"\");\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}\t \n\t\t \n\t}", "public function course()\n\t{ \n//echo \"<pre>\";print_r($_POST);die;\t\n\t\t$data=$_POST;\n\t\t//$data['action']='get_module';\n\t\t//$data['action']='delete_module';\n\t\t//$data['action']='course';\n\t\t//$data['action']='delete_lession';\n\t\t$action='';\n\t\tif(isset($data['action'])){\n\t\t\t$action=$data['action'];\n\t\t}\n\t\tswitch ($action) {\n\t\tcase 'course':\n\t\t\t$this->add_update_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_module':\n\t\t\t$this->delete_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_lession':\n\t\t\t$this->delete_lession($data);\n\t\t\tbreak;\n\t\tcase 'get_module':\n\t\t\t$this->getMOduleDetailsByModuleId($data);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$result['msg']='Bad request!';\n\t\t\t$returnData['response']=$result;\n\t\t\tdie(json_encode($returnData));\n\t\t}\n\t\t\n\t}", "function get_sections($crn,$term,$course) {\n global $dbh;\n \n // get all courses offered in same term with same course name\n $query = 'SELECT term_code,crn FROM courses WHERE term_code = ? and concat(subject_code,\" \",course_number) = ? ORDER BY section_number';\n \n $resultset = prepared_query($dbh, $query, array($term,$course));\n \n $sections = array();\n while ($row = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC)) {\n // if the CRN does not match current course, add it as a different section\n if ($row['crn'] != $crn) $sections[] = '<a href=\"javascript:void(0);\" onclick=\"getDetail('.$row['term_code'].','.$row['crn'].')\">'.$row['crn'].'</a>';\n }\n return $sections; \n}", "public function getCourses(){\n\n $query = \"SELECT FA.Availability as FAV, FA.TimeStart,FA.TimeEnd, FA.Id, FAA.Availability, FA.CourseID, C.CourseName,C.OfficeHourDay,C.OfficeHourTime, F.AshesiEmail,concat(F.FName,' ',F.LName) as Faculty FROM Registered_Courses R INNER JOIN Courses C on R.CourseID = C.CourseID INNER JOIN Faculty F on R.FacultyID = F.FacultyID INNER JOIN Faculty_Course_Availability FA ON FA.CourseID = R.CourseID\n INNER JOIN Faculty_Arrival FAA ON FAA.FacultyID = R.FacultyID WHERE R.StudentID =:id GROUP BY C.CourseID \";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':id', $this->id);\n $stmt->execute();\n return $stmt;\n }", "public function findCourseById($id);", "function getMyCoursesValidate(){\n\t\t\n\t\tif(@$this->major != \"\" && @$this->institution != \"\" && @$this->id != \"\"){\n\t\t\t$this->basics->getMyCourses($this->sanitize($this->institution), $this->sanitize($this->major), $this->sanitize($this->id) );\n\t\t}else{\n\t\t\t$respArray = $this->makeResponse(\"ERROR\",\" The Major and Institution and Id are required! \", \"doSecureAuth();\");\n\t\t\t\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function Search_Document($type,$course_id,$teacher_id)\n {\n if($teacher_id != null)\n {\n $check_access = $this->Check_Access($teacher_id,$course_id);\n }\n else\n {\n $check_access = null;\n }\n if($type =='special')\n {\n $check_access = true;\n $sql = \"SELECT DISTINCT si.`instructor_id`,`firstname`,`lastname`,s.`semester_num`,s.`year` FROM `special_instructor` si,`course_hire_special_instructor` ci, `semester` s\n WHERE ci.`course_id` = '\".$course_id.\"' AND ci.`instructor_id` = si.`instructor_id` AND ci.`semester_id` = s.`semester_id` ORDER BY `ci`.`updated_date` DESC\" ;\n }\n else if ($type == 'evaluate')\n {\n $sql = \"SELECT `semester_num`,`year` FROM `course_evaluate` e,`semester` s\n WHERE e.`course_id` = '\".$course_id.\"' AND e.`semester_id` = s.`semester_id` ORDER BY e.`updated_date` DESC\" ;\n }\n $data = array();\n \n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n if($type == 'special')\n {\n $data['DATA'][$i]['id'] = $result[$i]['instructor_id'];\n $data['DATA'][$i]['name'] = $result[$i]['firstname'].' '.$result[$i]['lastname'];\n }\n $data['DATA'][$i]['semester'] = $result[$i]['semester_num'];\n $data['DATA'][$i]['year'] = $result[$i]['year'];\n }\n }\n else\n {\n $data['DATA'] = false;\n }\n $data['ACCESS'] = $check_access;\n $data['INFO'] = $this->Get_Course_Info($course_id);\n $dept = $this->Search_Course_Dept($course_id,$this->SEMESTER['id']);\n if($dept)\n {\n $data['INFO']['department'] = $dept['id'];\n\n }\n $sql = \"SELECT sum(se.`student`) as num_student FROM `course_evaluate` ce, `student_evaluate` se \";\n $sql .= \"WHERE ce.`course_evaluate_id` = se.`course_evaluate_id` AND ce.`course_id` = '\".$course_id.\"' AND ce.`semester_id` = '\".$this->SEMESTER['id'].\"'\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n\n if(is_null($result[0]['num_student']))\n {\n $data['INFO']['num_student'] = '0';\n }\n else\n {\n $data['INFO']['num_student'] = $result[0]['num_student'];\n }\n }\n //id,name,semester,year\n return $data;\n }", "function getCourse($start_from,$per_page){\r\ninclude 'dbConnect.php';\r\n$sql= 'SELECT * FROM course LIMIT '.$start_from.','.$per_page.';';\r\n$result = mysqli_query($conn, $sql);\r\nif(isset($result)){\r\n\tif(mysqli_num_rows($result) > 0){\r\n\t\techo '<div id=\"products\" class=\"row list-group\">';\r\n\t\twhile($row = mysqli_fetch_assoc($result)){\t\r\n\t\t\techo '<div class=\"item col-xs-4 col-lg-4\">\r\n\t\t\t\t<div class=\"thumbnail\">\r\n\t\t\t\t\t<img class=\"group list-group-image\" src=\"http://placehold.it/400x250/000/fff&text='.$row[\"CourseName\"].'\" />\r\n\t\t\t\t\t<div class=\"caption\">\r\n\t\t\t\t\t\t<h4 class=\"group inner list-group-item-heading\">\r\n\t\t\t\t\t\t\t'.$row[\"CourseName\"].'</h4>\r\n\t\t\t\t\t\t<p class=\"group inner list-group-item-text\">\r\n\t\t\t\t\t\t\t'.$row[\"CourseDesc\"].'</p>\r\n\t\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t\t<div class=\"col-xs-12 col-md-6\">\r\n\t\t\t\t\t\t\t\t<p class=\"lead\">\r\n\t\t\t\t\t\t\t\t\tMYR '.$row[\"CoursePrice\"].'</p>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"col-xs-12 col-md-6\">\r\n\t\t\t\t\t\t\t<form method=\"post\" action=\"classroom.php\">\r\n\t\t\t\t\t\t\t<div><input type=\"hidden\" name=\"course_id\" value=\"'.$row[\"CourseID\"].'\"/></div>\r\n\t\t\t\t\t\t\t<input class=\"btn btn-success\" type=\"submit\" name=\"view\" value=\"View Sessions\"/>\r\n\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>';\r\n\t\t\t}\r\n\t\t\techo '</div>';\r\n\t\t\t\r\n\t\t\t//Now select all from table\r\n\t\t\t$querypage = \"SELECT * FROM Course;\";\r\n\r\n\t\t\t$resultpage = mysqli_query($conn, $querypage);\r\n\r\n\t\t\t// Count the total records\r\n\t\t\t$total_records = mysqli_num_rows($resultpage);\r\n\r\n\t\t\t//Using ceil function to divide the total records on per page\r\n\t\t\t$total_pages = ceil($total_records / $per_page);\r\n\t\t\t\r\n\t\t\t//first page\r\n\t\t\techo \"<ul class='pagination'>\r\n\t\t\t\t <li class='page-item'><a href='course.php?page=1'>\".'<<'.\"</a></li>\";\r\n\r\n\t\t\tfor ($i=1; $i<=$total_pages; $i++) {\r\n\r\n\t\t\techo \"<li class='page-item'><a href='course.php?page=\".$i.\"'>\".$i.\"</a></li>\";\r\n\t\t\t};\r\n\t\t\t// last page\r\n\t\t\techo \"<li class='page-item'><a href='course.php?page=$total_pages'>\".'>>'.\"</a></li>\r\n\t\t\t\t</ul>\";\r\n\t\t}\r\n\t}else{\r\n\t\techo 'Error Database!';\r\n\t}\r\n}", "function download_gold_subject_list() {\n\t\n\t// store everything to an array\n\t$array = array();\n\t\n\t// setup curl params\n\t$url = \"http://my.sa.ucsb.edu/public/curriculum/coursesearch.aspx\";\n\t\n\t$opts = array(\n\t\tCURLOPT_URL => $url,\n\t\tCURLOPT_CONNECTTIMEOUT => 15,\n\t\tCURLOPT_RETURNTRANSFER => 1,\n\t);\n\t\n\t// initialize a curl object\n\t$curl = curl_init();\n\t\n\t// extend any additional curl options to the default ones\n\tcurl_setopt_array($curl, $opts);\n\t\n\t// perform get request & cleanup\n\t$response = curl_exec($curl);\n\tcurl_close($curl);\n\tunset($curl);\n\t\n\t// parse the document\n\t$html = substr($response, strpos($response, '<!DOCTYPE'));\n\t$doc = phpQuery::newDocument($html);\n\tphpQuery::selectDocument($doc);\n\t\n\t// anonymous function: store every hit to the array\n\t$record = function($elmt) use(&$array) {\n\t\t$array[pq($elmt)->val()] = preg_replace('/^(.+) - [A-Z0-9 \\\\-]{2,16}$/', '\\1', pq($elmt)->text());\n\t};\n\t\n\t// fetch all of the course list option values\n\tpq('select[id$=\"courseList\"]')->find('option')->each($record, new CallbackParam);\n\t\n\t// results\n\treturn $array;\n}", "public function fetch_courses()\n {\n $config = array();\n $config[\"base_url\"] = base_url() . \"Home/Student-Courses/\";\n $config['total_rows'] = $this->admin_student_courses_mdl->count_courses();\n $config['per_page'] = 5;\n $config['use_page_numbers'] = TRUE; \n $config['uri_segment'] = 3; \n $this->pagination->initialize($config); \n if($this->uri->segment(3) > 0){\n $offset = ($this->uri->segment(3) + 0)*$config['per_page'] - $config['per_page'];\n }\n else{\n $offset = $this->uri->segment(3);\n }\n $data['results'] = $this->admin_student_courses_mdl->fetch_courses($config[\"per_page\"], $offset);\n $data[\"links\"] = $this->pagination->create_links();\n return $data; \n\n }", "public function coursesAll(Request $req)\n {\n $courses1 = DB::table(\"courses\")\n ->select(\"*\")\n ->where(\"Semester\", $req->Semester)\n ->orwhere(\"Semester\", \"Both\")\n ->whereNotIn(\"Code\", function ($query) {\n $query->select(\"Code\")->from(\"courses_passed\");//get courses not passed\n })\n ->get();\n\n /*$courses1=Course::where('Semester',$req->Semester)\n ->orwhere('Semester','Both')->get();*/\n return response()->json([\n \"row\" => \"$courses1\",\n ]);\n }", "public function course($course)\n {\n $data = \\App\\Entities\\Learn\\Course::with(['skill', 'lessons'])->whereSlug($course)->first();\n\n abort_unless($data, 404);\n \n if ( \\Auth::check() ) {\n $completes = \\App\\Entities\\Learn\\Advance::where('user_id', \\Auth::id())->get()->map(function ($item) {\n return $item->lesson_id;\n });\n $completes = $completes->toArray();\n } else {\n $completes = [];\n }\n\n return view('app::course', [\n 'course' => $data,\n 'completes' => $completes\n ]);\n }", "public function getCourse($start,$limit,$sidx,$sord,$where) {\n\t\t$access_type = $this->db->get_where('users', array('id' => $this->session->userdata('user_id'), 'email' => $this->session->userdata('email'))) -> row_array();\n\n\t\t\tif($access_type['acsess_to'] == \"ATC\") {\n\t\t\t\t$this->db->select('ac.*, cc.course_name, cc.course_description, cc.course_status, ccc.course_category, ccc.course_category_description');\n\t\t\t\t$this->db->limit($limit);\n\t\t\t\t$this->db->join('cdac_courses cc', 'cc.course_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->join('cdac_courses_category ccc', 'ccc.course_category = cc.course_category', 'left');\n\t\t\t\t//$this->db->join('cdac_course_modules ccm', 'ccm.course_code = cc.course_code', 'left');\n\t\t\t\t$this->db->where('ac.entity_code', $access_type['entity_code']);\n\t\t\t\tif($where != NULL)$this->db->where($where,NULL,FALSE);\n\t\t\t $this->db->order_by($sidx.\" \".$sord);\n\t\t\t\t$data = $this->db->get('atc_courses ac',$limit,$start);\n\t\t\t} else if($access_type['acsess_to'] == \"ARC\") {\n\t\t\t\t$this->db->select('ac.*, cc.course_name, cc.course_description, cc.course_status, ccc.course_category, ccc.course_category_description');\n\t\t\t\t$this->db->limit($limit);\n\n\t\t\t\t$this->db->join('cdac_courses cc', 'cc.course_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->join('cdac_courses_category ccc', 'ccc.course_category = cc.course_category', 'left');\n\t\t\t\t$this->db->join('cdac_entities ce', 'ce.entity_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->where('ce.entity_parent_code', $access_type['entity_code']);\n\t\t\t\tif($where != NULL)$this->db->where($where,NULL,FALSE);\n\t\t\t $this->db->order_by($sidx.\" \".$sord);\n\t\t\t\t$data = $this->db->get('atc_courses ac',$limit,$start);\n\t\t\t} else if($access_type['acsess_to'] == \"CDAC\") {\n\t\t\t\t$this->db->select('ac.*, cc.course_name, cc.course_description, cc.course_status, ccc.course_category, ccc.course_category_description');\n\t\t\t\t$this->db->limit($limit);\n\t\t\t\t$this->db->join('cdac_courses cc', 'cc.course_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->join('cdac_courses_category ccc', 'ccc.course_category = cc.course_category', 'left');\n\t\t\t\t//$this->db->join('cdac_course_modules ccm', 'ccm.course_code = cc.course_code', 'left');\n\t\t\t\tif($where != NULL)$this->db->where($where,NULL,FALSE);\n\t\t\t $this->db->order_by($sidx.\" \".$sord);\n\t\t\t\t$data = $this->db->get('atc_courses ac',$limit,$start);\n\t\t\t}\n\n\t\t\t//echo \"==========>>>>>>>>>>>>>>>>>>> <pre>\". $this->db->last_query(); print_r($data->result()); exit;\n\t\t\treturn $data->result();\n\t\t\t\n\t}", "public function viewCourse()\n {\n $courseID = SCMUtility::cleanText($_GET['courseID']);\n\n // get the current logged in user\n if(Session::isLoggedIn())\n {\n // get current logged in user\n $current_user_id = Session::getCurrentUserID();\n $user = User::with('courses')->find($current_user_id);\n\n // check if the course being vied is already on his enrolled courses so we can flash a message\n if( $user->isAlreadyEnrolledToCourse($courseID) )\n {\n SCMUtility::setFlashMessage('You have already enrolled to this course.','info');\n }\n }\n\n // get course meta info\n $data = Course::with('students')->find($courseID);\n\n if( ! $data )\n {\n View::make('templates/system/error.php',array());\n return;\n }\n\n $data = $data->toArray();\n\n View::make('templates/front/course-view.php',compact('data'));\n }", "private function getCourseSection() {\n $this->openConn();\n\n $courseID = $_POST['courseID'];\n\n $sql = \"SELECT Course.courseID, subject, courseNum,\n Section.sectionID, secNo, daysMet, startTime, endTime, totalEnrolment\n FROM Course, Section\n LEFT JOIN SectionTA ON Section.sectionID = SectionTA.sectionID\n LEFT JOIN TA ON SectionTA.taID = TA.taID\n LEFT JOIN Student ON TA.sID = Student.sID\n LEFT JOIN UserAccount ON Student.uID = UserAccount.uID\n WHERE Section.courseID = Course.courseID\n and Course.courseID = :courseID\";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute(array(':courseID'=>$courseID));\n\n $this->results = \"\";\n // Loop through every row\n while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $subject = $row['subject'];\n $courseNum = $row['courseNum'];\n $sectionID = $row['sectionID'];\n $secNo = $row['secNo'];\n $daysMet = $row['daysMet'];\n $startTime = $row['startTime'];\n $endTime = $row['endTime'];\n $totalEnrolment = $row['totalEnrolment'];\n\n\n //display rows\n $this->results = $this->results .'\n <tr class=\"lab-info-row\" name='.$sectionID.'>\n <td><input id=\"sectioncheckbox\" type=\"checkbox\"></td>\n <td id=\"lab-id\" >'.$secNo.'</td>\n <td id=\"lab-time\">'.$daysMet.' | '.$startTime.' - '.$endTime.'</td>\n <td id=\"lab-num\">'.$totalEnrolment.'</td>\n </tr>';\n }\n\n $this->closeConn();\n return $this->results;\n\n }", "public function getTaskbyCourse(){\n // Query\n $query = \"SELECT * from $this->table WHERE course = :course\";\n // prepare query\n $stmt = $this->conn->prepare($query);\n // sanitize data\n $this->course = htmlspecialchars(strip_tags($this->course));\n // bind parameter\n $stmt->bindParam(':course', $this->course);\n\n // excute query\n $stmt->execute();\n \n $result = $stmt;\n \n //get row count\n $num = $result->rowCount();\n // create students array\n $tasks = array();\n // if num > 0\n if($num > 0){\n while($row = $result->fetch(PDO::FETCH_OBJ)){\n array_push($tasks, $row);\n }\n }\n // return\n return $tasks ? $tasks : NULL;\n }", "public function get_course($params) {\n global $DB, $CFG;\n\n require_once($CFG->dirroot . '/local/intelliboard/locallib.php');\n\n $rolefilter = new in_filter($this->get_teacher_roles(), \"trole\");\n $teachersSelect = get_operator(\n 'GROUP_CONCAT',\n \"CONCAT(u.firstname, ' ', u.lastname)\",\n ['separator' => ', ']\n );\n\n $course = $DB->get_record_sql(\n \"SELECT c.*,\n {$teachersSelect} as teachers\n FROM {course} c\n JOIN {context} cx ON cx.instanceid = c.id AND\n cx.contextlevel = :coursecx\n LEFT JOIN {role_assignments} ra ON ra.roleid \" . $rolefilter->get_sql() . \" AND\n ra.contextid = cx.id\n LEFT JOIN {user} u ON u.id = ra.userid\n WHERE c.id = :courseid\n GROUP BY c.id\",\n array_merge(['courseid' => $params['courseid'], 'coursecx' => CONTEXT_COURSE], $rolefilter->get_params())\n );\n\n if($course) {\n $course->url = (\n new moodle_url('/course/view.php', ['id' => $course->id])\n )->out();\n } else {\n return new \\stdClass();\n }\n\n return $course;\n }", "public function get_online_trainee_with_courseclass() {\n $class = $this->input->post('class');\n $course = $this->input->post('course');\n $query_string = htmlspecialchars($_POST['q'], ENT_QUOTES, 'UTF-8');\n $result = $this->classtraineemodel->get_online_user_with_class_course($this->tenant_id, $query_string, '', $class, $course);\n if ($result) {\n foreach ($result as $row) {\n $matches[] = array(\n 'key' => $row->user_id,\n 'label' => $row->first_name . ' ' . $row->last_name . '( Taxcode : ' . $row->tax_code . ')',\n 'value' => $row->first_name . ' ' . $row->last_name\n );\n }\n }\n echo json_encode($matches);\n exit();\n }", "public function get_course_students($params) {\n global $DB, $PAGE;\n\n if(isset($params['report_params'])) {\n $reportparams = json_decode($params['report_params'], true);\n } else {\n $reportparams = [];\n }\n\n $limit = 0;\n $offset = 0;\n\n /** Limit and offset */\n if(isset($reportparams['limit'])) {\n $limit = $reportparams['limit'];\n }\n\n if(isset($reportparams['offset'])) {\n $offset = $reportparams['offset'];\n }\n\n $where = \"cx.contextlevel = :courselvl AND cx.instanceid > 1\";\n $sqlparams = ['courselvl' => CONTEXT_COURSE];\n\n if (!empty($reportparams['courses'])) {\n $coursesfilter = new in_filter($reportparams['courses'], \"crsc\");\n $where .= ' AND cx.instanceid ' . $coursesfilter->get_sql();\n $sqlparams = array_merge($coursesfilter->get_params(), $sqlparams);\n }\n\n if ($reportparams['inactive_users'] == 0) {\n $enroljoin = 'JOIN {enrol} e ON e.courseid = c.id\n JOIN {user_enrolments} ue ON ue.userid = u.id AND ue.enrolid = e.id';\n $sqlenrolfilter = 'AND ue.status = 0';\n } else {\n $enroljoin = $sqlenrolfilter = '';\n }\n\n $rolefilter = new in_filter($this->get_student_roles(), \"srole\");\n list($sql, $sqlparams) = $this->buildSqlRequest(\n \"SELECT CONCAT(u.id, '_', c.id) AS unique_f, u.*, c.id AS course_id,\n c.shortname AS course_short_name, c.fullname AS course_full_name, gg.finalgrade AS grade, gi.grademax AS grademax\n FROM {context} cx\n JOIN {role_assignments} ra ON ra.contextid = cx.id AND\n ra.roleid \" . $rolefilter->get_sql() . \"\n JOIN {user} u ON u.id = ra.userid\n JOIN {course} c ON c.id = cx.instanceid\n {$enroljoin}\n LEFT JOIN {grade_items} gi ON gi.courseid = c.id AND gi.itemtype = 'course'\n LEFT JOIN {grade_grades} gg ON gg.itemid = gi.id AND gg.userid = u.id\n WHERE {$where} {$sqlenrolfilter}\n GROUP BY u.id, c.id, gg.finalgrade, gi.grademax\",\n array_merge($sqlparams, $rolefilter->get_params()),\n $reportparams\n );\n\n $students = $DB->get_records_sql($sql, $sqlparams, $offset, $limit);\n\n foreach($students as &$student) {\n $user_picture = new user_picture($student);\n $user_picture->size = 100;\n $student->picture = $user_picture->get_url($PAGE)->out();\n }\n\n return $students;\n }", "private function retrieveName(){\n\t\t$query = \"SELECT cours_id,code,intitule FROM cours WHERE cours_id=\".$this->course_id.\";\";\n\n\t\t$result = mysqli_query($this->link,$query);\n\t\t$data = $result->fetch_assoc();\n\n\t\t//Check if course exists\n\t\tif(is_null($data))\n\t\t{\n\t\t\techo 'Course with specified id does not exist';\n\t\t\techo \"\\n\";\n\t\t\tmysqli_close($this->link);\n\t\t\texit;\n\t\t}\n\n\t\t$this->course['id'] = $this->course_id;\n\t\t$this->course['code'] = $data['code'];\n\t\t$this->course['title'] = $data['intitule'];\n\t}", "function listallcourse(){\n\t$unregisteredList = new ManageCourses;\n\t$queryResult = $unregisteredList->allcourses();\n\tif($queryResult){\n\t\techo \"<table>\";\n\t\techo \"<tr> <th> Course Code </th> <th> Course Name </th> <th> Course Year </th><th> Action </th></tr>\";\n\t\twhile ($row = $unregisteredList->fetch()) {\n\t\t\t$id = $row['courseid'];\n\t\t\techo \"<tr><td>\";\n\t\t\techo $row['coursecode'];\n\t\t\techo \"</td><td>\";\n\t\t\techo $row['coursename'];\n\t\t\techo \"</td><td>\";\n\t\t\techo $row['courseyear'];\n\t\t\techo \"</td><td>\";\n\t\t\techo '<form action=\"\" method=\"POST\" style=\"background-color: transparent;\">';\n\t\t echo '<input type=\"hidden\" name=\"courseid\" value=\"'.$row['courseid'].'\">';\n\t\t echo '<input type=\"hidden\" name=\"coursename\" value=\"'.$row['coursename'].'\">';\n\t echo '<button type=\"submit\" class=\"btn btn-danger\" name=\"delcourse\" value=\"'.$row['courseid'].'\">Delete</button>'. ' ';\n\t echo '<button type=\"submit\" class=\"btn btn-primary\" name=\"editcourse\" value=\"'.$row['courseid'].'\">Edit</button></form>';\n\t\t\techo \"</td></tr>\";\n\t\t\t//echo '<input type=\"checkbox\" name=\"username\" value=\"'.$row[\"courseid\"].'\">'. $row[\"coursename\"].' <br>';\n\t\t}\n\t\techo \"</table>\";\n\t}\n}", "function get_court_by_court_name($court_name)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `courts` WHERE `court_name`='$court_name'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "public function actionSearch()\r\n\t{\r\n\t\r\n\t\t$this->layout='//layouts/column3';\r\n\t\t$tutorials =array();\r\n\t\t$courses= array();\r\n\t\t$search_string =(isset($_GET['search_string']))? $_GET['search_string'] : '' ;\r\n\t\t//$model=new ContactForm;\r\n\t\t//if(isset($_POST['search_string']) && strlen(trim($_POST['search_string'])) > 2 )\r\n\t//\t{\r\n\t\t\r\n\t\t\t$search_string = $_GET['search_string'];\r\n\t\t\t\r\n\t\t\t$words = explode(' ', $search_string);\r\n\t\t\t\t\r\n\t\t\t$result_set = Keyword::model()->findByPk(trim($search_string));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$q = new CDbCriteria();\r\n\t\t\t$q->distinct=TRUE;\r\n\t\t\t$q->select='TUTORIAL_ID';\r\n\t\t\t\r\n\t\t foreach ($words as $word)\t\t\t\t\r\n\t\t \t\tif (strlen(trim($word)) > 2)\r\n\t\t\t\t\t$q->addSearchCondition('WORD', $word,true, 'OR');\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$tutorials = KeywordTutorial::model()->findAll( $q );\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t//\t}else {\r\n\t\t\t\r\n\t\t\t//$this->render('search',array('model'=>null, 'kTutorials'=>new arr, 'courses'=>array(), 'search_string'=>(isset($_POST['search_string']))) ? $_POST['search_string'] : null);\r\n\t//\t}\r\n\t\t\r\n\t\t$this->promotionItems = SalePromotion::model()->findAllByAttributes(\r\n\t\t\t\tarray(),\r\n\t\t\t\t$condition = 'END_DATE >= :today AND START_DATE <= :today',\r\n\t\t\t\t$params = array(\r\n\t\t\t\t\t\t':today' => date('Y-m-d', time()),\r\n\t\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t\t$this->render('search',array( 'kTutorials'=>$tutorials,'courses'=>$courses, 'search_string'=>$search_string));\r\n\t}", "public function actionGet_course() {\n if (isset($_POST['dep_id']) != 0) {\n $output = '';\n $role_id = $_POST['dep_id'];\n\n if (($role_id == '1') || ($role_id == '2') || ($role_id == '7')) {\n $output .= '<div id=\"usercourse\" class=\"\">';\n $output .= '<div class=\"form-group col-md-4 field-dvusers-course\">';\n $output .= '<input name=\"DvUsers[course]\" value=\"\" type=\"hidden\">';\n $output .= '<select id=\"user_course\" class=\"form-control\" name=\"DvUsers[course][]\" multiple=\"multiple\" size=\"4\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select module\">';\n if (($role_id == '1')||($role_id == '2')) {\n $output .= '<option value=\"dm\">DM</option>';\n $output .= '<option value=\"da\">DA</option>';\n } else {\n //added 20 April 2019 By KK / PP\n $course = DvModuleModel::find()->where(['status' => 1])->all();\n $Dv_course = ArrayHelper::map($course, 'id', 'module_name');\n //unset($Dv_course[1]);\n //unset($Dv_course[2]);\n foreach ($Dv_course as $id => $module_name) {\n $output .= '<option value=\"' . $id . '\">' . $module_name . '</option>';\n }\n }\n\n $output .= '</select>';\n $output .= '</div>';\n\n if ($role_id == '7') {\n $output .='<div class=\"form-group col-md-4 field-dvusers-day_avail\">';\n $output .= '<input name=\"DvUsers[day_avail]\" value=\"\" type=\"hidden\">';\n $output .= '<select id=\"dvusers-day_avail\" class=\"form-control\" name=\"usermeta[day_avail][]\" multiple=\"multiple\" size=\"4\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Day Available\">';\n $output .= '<option value=\"sun\">Sunday</option>';\n $output .= '<option value=\"mon\">Monday</option>';\n $output .= '<option value=\"tue\">Tuesday</option>';\n $output .= '<option value=\"wed\">Wednesday</option>';\n $output .= '<option value=\"thur\">Thursday</option>';\n $output .= '<option value=\"fri\">Friday</option>';\n $output .= '<option value=\"sat\">Saturday</option></select>';\n $output .= '</div>';\n $output .= '<div class=\"form-group col-md-4 field-dvusers-coordinator\">';\n $output .= '<select id=\"dvusers-coordinator\" class=\"form-control\" name=\"DvUsers[coordinator]\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Course Coordinator\">';\n $output .= '<option value=\"\">Select Course Coordinator</option></select>';\n $output .= '</div>';\n }\n\n if ($role_id == '7') {\n $output .= '<div class=\"form-group col-md-4\"><input class=\"form-control\" name=\"usermeta[trainerid]\" placeholder=\"TrainerID\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"TrainerID\" readonly=\"readonly\"></div>';\n\n $output .= '<div class=\"form-group col-md-4\"><input class=\"form-control\" name=\"usermeta[compensation]\" placeholder=\"Compensation\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Compensation\" type=\"number\" pattern=\"\\d*\"></div>';\n\n $output .= '<div class=\"form-group col-md-4\"><select class=\"form-control\" name=\"usermeta[module_led]\" placeholder=\"Module to be Led\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Module to be Led\" multiple><option value=\"\">Select any one</option><option value=\"1\">Core</option><option value=\"2\">Special</option></select></div>';\n\n $output .= '<div class=\"form-group col-md-4\"><select class=\"form-control\" name=\"usermeta[profile_visibility]\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Profile Visibility\" ><option value=\"\">Select Profile Visibility</option><option value=\"1\">Publish</option><option value=\"2\">Draft</option></select></div>';\n \n $output .= '<div class=\"form-group col-md-12\"><textarea id=\"usermeta[description]\" name=\"usermeta[description]\" style=\"display:none;\">Brief Description</textarea></div>';\n }\n\n $output .= '</div>';\n } else {\n $output .= '<div id=\"usercourse\" class=\"hide\">';\n $output .= '<input id=\"dvusers-course\" class=\"form-control\" name=\"DvUsers[course]\" value=\"\" type=\"hidden\">';\n $output .= '<input id=\"dvusers-day_avail\" class=\"form-control\" name=\"DvUsers[day_avail]\" value=\"\" type=\"hidden\">';\n $output .= '<input id=\"dvusers-coordinator\" class=\"form-control\" name=\"DvUsers[coordinator]\" value=\"\" type=\"hidden\"></div>';\n }\n\n return $output;\n } else {\n return $this->redirect(['dv-users/index']);\n }\n }", "function getCourse($course_id){\n\t$sql = \"select * from course_details where course_id='$course_id'\";\n\t$result = DBConnection::execQery($sql);\n\treturn $result;\n\n}", "public function getExistsCourse($courseid)\n {\n Logger::Log(\n 'starts GET GetExistsCourse',\n LogLevel::DEBUG\n );\n\n foreach ( $this->_createCourse as $_link ){\n $result = Request::routeRequest(\n 'GET',\n '/link/exists/course/'.$courseid,\n array(),\n '',\n $_link,\n 'link'\n );\n\n // checks the correctness of the query\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n // nothing\n } else {\n $this->app->response->setStatus( 409 );\n $this->app->response->setBody( null );\n $this->app->stop( );\n }\n }\n\n $this->app->response->setStatus( 200 );\n $this->app->response->setBody( null );\n }", "public function actionGet_course_trainer() {\n if (isset($_POST['dep_id']) != 0) {\n $output = '';\n $role_id = $_POST['dep_id'];\n\n if (($role_id == '1') || ($role_id == '2') || ($role_id == '7')) {\n $output .= '<div id=\"usercourse\" class=\"\">';\n $output .= '<div class=\"form-group col-md-4 field-dvusers-course\">';\n $output .= '<input name=\"DvUsers[course]\" value=\"\" type=\"hidden\">';\n $output .= '<select id=\"user_course\" class=\"form-control\" name=\"DvUsers[course][]\" multiple=\"multiple\" size=\"4\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Course\">';\n if (($role_id == '1')||($role_id == '2')) {\n $output .= '<option value=\"dm\">DM</option>';\n $output .= '<option value=\"da\">DA</option>';\n } else {\n $course = DvCourse::find()->where(['status' => 1])->all();\n $Dv_course = ArrayHelper::map($course, 'id', 'name');\n unset($Dv_course[1]);\n unset($Dv_course[2]);\n foreach ($Dv_course as $id => $name) {\n $output .= '<option value=\"' . $id . '\">' . $name . '</option>';\n }\n }\n\n $output .= '</select>';\n $output .= '</div>';\n\n if ($role_id == '7') {\n $output .='<div class=\"form-group col-md-4 field-dvusers-day_avail\">';\n $output .= '<input name=\"DvUsers[day_avail]\" value=\"\" type=\"hidden\">';\n $output .= '<select id=\"dvusers-day_avail\" class=\"form-control\" name=\"usermeta[day_avail][]\" multiple=\"multiple\" size=\"4\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Day Available\">';\n $output .= '<option value=\"sun\">Sunday</option>';\n $output .= '<option value=\"mon\">Monday</option>';\n $output .= '<option value=\"tue\">Tuesday</option>';\n $output .= '<option value=\"wed\">Wednesday</option>';\n $output .= '<option value=\"thur\">Thursday</option>';\n $output .= '<option value=\"fri\">Friday</option>';\n $output .= '<option value=\"sat\">Saturday</option></select>';\n $output .= '</div>';\n $output .= '<div class=\"form-group col-md-4 field-dvusers-coordinator\">';\n $output .= '<select id=\"dvusers-coordinator\" class=\"form-control\" name=\"DvUsers[coordinator]\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Course Coordinator\">';\n $output .= '<option value=\"\">Select Course Coordinator</option></select>';\n $output .= '</div>';\n }\n\n $output .= '<div class=\"form-group col-md-4\"><input class=\"form-control\" name=\"usermeta[trainerid]\" placeholder=\"TrainerID\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"TrainerID\"></div>';\n\n $output .= '<div class=\"form-group col-md-4\"><input class=\"form-control\" name=\"usermeta[compensation]\" placeholder=\"Compensation\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Compensation\"></div>';\n\n $output .= '<div class=\"form-group col-md-4\"><select class=\"form-control\" name=\"usermeta[module_led]\" placeholder=\"Module to be Led\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Module to be Led\"><option value=\"\">Select any one</option><option value=\"1\">Core</option><option value=\"2\">Special</option></select></div>';\n\n $output .= '<div class=\"form-group col-md-12\"><textarea id=\"usermeta[description]\" name=\"usermeta[description]\">Brief Description</textarea></div>';\n\n $output .= '</div>';\n } else {\n $output .= '<div id=\"usercourse\" class=\"hide\">';\n $output .= '<input id=\"dvusers-course\" class=\"form-control\" name=\"DvUsers[course]\" value=\"\" type=\"hidden\">';\n $output .= '<input id=\"dvusers-day_avail\" class=\"form-control\" name=\"DvUsers[day_avail]\" value=\"\" type=\"hidden\">';\n $output .= '<input id=\"dvusers-coordinator\" class=\"form-control\" name=\"DvUsers[coordinator]\" value=\"\" type=\"hidden\"></div>';\n }\n\n return $output;\n } else {\n return $this->redirect(['dv-users/index']);\n }\n }", "public function actionCourses()\n\t{\n\t\t//echo \"In Courses\";\n\t\tif (!isset($_REQUEST['username'])){\n\t\t\t$_REQUEST['username'] = Yii::app()->user->name;\n\t\t}\n\t\t//if (!Yii::app()->user->checkAccess('admin')){\n\t\t//\t$this->model=User::model()->findByPk(Yii::app()->user->name);\n\t\t//} else {\n\t\t\t$this->model = DrcUser::loadModel();\n\t\t\t//}\n\t\t//$title = \"Title\";\n\t\t//$contentTitle = \"Courses: title\";\n\t\t$title = \"({$this->model->username}) {$this->model->first_name} {$this->model->last_name}\";\n\t\t$contentTitle = \"Courses: {$this->model->term->description}\";\n\t\tif (!Yii::app()->user->checkAccess('admin') && !Yii::app()->user->checkAccess('staff')){\n\t\t\t$title = $this->model->term->description;\n\t\t\t$contentTitle = \"Courses\";\n\t\t}\n\t\t$this->renderView(array(\n\t\t\t'title' => $title,\n\t\t\t'contentView' => '../course/_list',\n\t\t\t'contentTitle' => $contentTitle,\n\t\t\t'menuView' => 'base.views.layouts._termMenu',\n\t\t\t'menuRoute' => 'drcUser/courses',\n\t\t\t'titleNavRight' => '<a href=\"' . $this->createUrl('drcUser/update', array('term_code'=> $this->model->term_code, 'username'=>$this->model->username)) . '\"><i class=\"icon-plus\"></i> User Profile</a>',\n\t\t));\n\t}", "function get_court_by_court_id($court_id)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `courts` WHERE `court_id`='$court_id'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "public function Search(Request $request)\n {\n $currentPage = LengthAwarePaginator::resolveCurrentPage();\n $input = Input::all();\n $input['search'] = strtolower($input['search']);\n $input['search'] = lcfirst($input['search']);\n $entries = collect();\n $col =$entries;\n $perPage = 6;\n $currentPageSearchResults = $col->slice(($currentPage - 1) * $perPage, $perPage)->all();\n $courses = new LengthAwarePaginator($currentPageSearchResults, count($col), $perPage);\n if (isset($input['category-id']) and $input['search']) {\n $category = Category::where('name', $input['category-id'])->first();\n $rs = Course::where('category_id', $category->id)->get();\n $cs = Course::whereHas('tags', function ($query) use ($input) {\n $query->where('tag_name', 'like', $input['search']);\n })->get();\n $entries = collect();\n foreach ($rs as $course) {\n foreach ($cs as $c) {\n $temp = Usecourse::where('activated',1)->whereHas('course', function ($query) use ($c) {\n $query->where('course_id', $c);\n })->orwhereHas('course', function ($query) use ($course) {\n $query->where('course_id', $course->id);\n })->get();\n $entries = $entries->merge($temp);\n $col =$entries;\n $currentPageSearchResults = $col->slice(($currentPage - 1) * $perPage, $perPage)->all();\n $courses = new LengthAwarePaginator($currentPageSearchResults, count($col), $perPage);\n }\n }\n } elseif ($input['search']) {\n $cs = Course::whereHas('tags', function ($query) use ($input) {\n $query->where('tag_name', 'like', $input['search']);\n })->get();\n $entries = collect();\n foreach ($cs as $c)\n {\n $temp = Usecourse::where('activated',1)->whereHas('course', function ($query) use ($c) {\n $query->where('course_id', $c->id);\n })->get();\n $entries = $entries->merge($temp);\n $col =$entries;\n\n $currentPageSearchResults = $col->slice(($currentPage - 1) * $perPage, $perPage)->all();\n $courses = new LengthAwarePaginator($currentPageSearchResults, count($col), $perPage);\n\n }\n } elseif(isset($input['category-id'])) {\n $category = Category::where('name', $input['category-id'])->first();\n $cs = Course::where('category_id', $category->id)->get();\n $entries = collect();\n foreach ($cs as $course) {\n $temp = Usecourse::where('activated',1)->whereHas('course', function ($query) use ($course) {\n $query->where('course_id', $course->id);\n })->get();\n $entries = $entries->merge($temp);\n $col =$entries;\n\n $currentPageSearchResults = $col->slice(($currentPage - 1) * $perPage, $perPage)->all();\n $courses = new LengthAwarePaginator($currentPageSearchResults, count($col), $perPage);\n }\n }else{\n $courses = Usecourse::paginate(6);\n }\n \n// $courses = Usecourse::whereHas('course', function ($query) use ($course) {\n// $query->where('course_id', $course->id);\n// });\n\n// $result = array();\n// $list = array();\n// $list[] = 0;\n// $courses = Course::whereHas('tags', function ($query) use ($input) {\n// $query->where('tag_name', 'like', $input['search']);\n// })->get();\n $categories = Category::all();\n foreach ($courses as $course) {\n $course['name'] = $course->course->name;\n $sections = $course->course->sections;\n $course['time'] = 0;\n foreach ($sections as $section) {\n $course['time'] = $course['time'] + $section->duration;\n\n }\n echo $course['duration'] . \"\\n\";\n // No Need For teachers Yet in index page\n// $counter=0;\n// foreach ($course->teachers as $teacher){\n// if($counter)\n// $course['teachers']=$course['teachers'].\",\".$teacher->name;\n// else\n// $course['teachers']=$teacher->name;\n// $counter++;\n// }\n $course['Durations'] = 0;\n $counter = 0;\n $time = 0;\n foreach ($course->course->sections as $section) {\n $counter++;\n $time += $section->time;\n }\n $course['duration'] = $time;\n $course['sections_count'] = $counter;\n $course['rate'] = -1;\n $check = 0;\n foreach ($course->reviews as $review) {\n if ($check == 0) {\n $course['rate'] = 0;\n $check = 1;\n }\n $course['rate'] += $review->pivot->rate;\n }\n if ($check == 1)\n $course['rate'] = $course['rate'] / count($course->reviews);\n $course['reviews_count'] = count($course->reviews);\n $course['category_name'] = $course->course->category->name;\n }\n $tags = Tag::all();\n $categories = Category::all();\n $teachers = Teacher::all();\n\n $popular_courses = Usecourse::whereHas('reviews', function ($q) {\n $q->where('rate', '>=', 5);\n })->paginate(3);\n\n// $popular_courses = Usecourse::whereHas('reviews', function ($q) {\n// $q->select(DB::raw('avg(rate) as avg_rate, course_id'))\n// ->groupBy('course_id')->having('avg_rate','>=',5);\n// })->get();\n\n foreach ($popular_courses as $course) {\n $course['name'] = $course->course->name;\n $sections = $course->course->sections;\n $course['time'] = 0;\n foreach ($sections as $section) {\n $course['time'] = $course['time'] + $section->duration;\n\n }\n echo $course['duration'] . \"\\n\";\n }\n\n return view('courses.courses-list')->with(['courses' => $courses, 'categories' => $categories, 'popular_courses' => $popular_courses]);\n }", "public function actionRecommend()\r\n {\r\n $course_resource = new CourseResource();\r\n if(isset($_POST['class_id'])&&!empty($_POST['class_id'])){\r\n $class=ActualClass::model()->with('course')->findByPk($_POST['class_id']);\r\n if(!empty($class)){\r\n $_POST['course_id']=$class->course->id;\r\n }else{\r\n unset($_POST['class_id']);\r\n }\r\n }\r\n $course_resource->attributes = array_merge($_POST, array(\r\n 'user_id' => Yii::app()->user->id,\r\n ));\r\n if ($course_resource->save()) {\r\n AjaxResponse::success($this->smarty->fetchString('item', array('resource' => $course_resource)));\r\n } else {\r\n AjaxResponse::success($course_resource->errors);\r\n }\r\n }", "function get_course_by_id($course_id) \n\t{\n\t\t// where do i get the $course_id ? Ans: when i call this model function from controller - courses \n\t\t// fetch_record -> row_array()\n\t\treturn $this->db->query('SELECT * FROM courses WHERE id= ?', array($course_id))->row_array();\n\t}", "public function getCourse($sql){\n\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n\n if($stmt->rowCount() > 0){\n ?><option value=\"\">Select Course</option><?php\n while($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n ?>\n <option value=\"<?php echo $row['id'] ?>\"><?php echo $row['name']; ?></option>\n <?php\n }\n }\n }", "public function findByCourse($id){\n $results = Batch::where('course_id',$id)->get();\n return response()->json($results);\n }", "public function get_courses(){\n\t\t$query = $this->db->get('course');\n\t\treturn $query->result();\n\t}", "abstract protected function getAllByCourse($id);", "public function show()\n\t{\n\t\t$dalCourse = new DALCourse;\n\t\t$result = $dalCourse->get();\n\n\t\t$post = \"\";\n\t\twhile ($res = mysqli_fetch_assoc($result))\n\t\t {\n\n\t\t \t// Extracting varsityId and deptId form varsityDeptId first.\n\t\t\t$dalAssignDept = new DALAssignDept;\n\t\t\t$bllUniversity = new BLLUniversity;\n\t\t\t$bllDepartment = new BLLDepartment;\n\n\t\t \t$varsityId =\"\";\n\t\t \t$deptId =\"\";\n\t\t\t$result2 = $dalAssignDept->getById($res['varsityDeptId']);\n\t\t\twhile ($res2 = mysqli_fetch_assoc($result2)) \n\t\t\t{\n\t\t\t\t$varsityId = $res2['varsityId'];\n\t\t\t\t$deptId = $res2['deptId'];\n\t\t\t}\n\n\t\t \t$post.= '<tr>';\n\t\t\t$post.= '<td>'.$res[\"prefix\"].'</td>';\n\t\t\t$post.= '<td>'.$res['courseNo'].'</td>';\n\t\t\t$post.= '<td>'.$res[\"courseTitle\"].'</td>';\n\t\t\t$post.= '<td>'.$res[\"credit\"].'</td>';\n\t\t\t$post.= '<td>'.$bllUniversity->getName($varsityId).'</td>';\n\t\t\t$post.= '<td>'.$bllDepartment->getName($deptId).'</td>';\n\t\t\t\n\n\t\t\t$post.= '<td class=\"text-right\"><button class=\"btn btn-link\" id=\"btnEdit'.$res[\"id\"].'\" onclick=\"EditCourse('.$res[\"id\"].','.$res[\"yearId\"].','.$res[\"termId\"].','.$varsityId.','.$deptId.','.$res[\"degreeId\"].','.$res[\"prerequisite\"].')\">Edit</button></td>';\n\t\t\t$post.= '<td class=\"text-right\"><button id=\"delete_btn\" class=\"btn btn-link\" onclick=\"delete_btn_click('.$res['id'].',\\'/se/dashboard/bll/bll.course.php\\',\\'submit_delete_course\\')\">Delete</button></td>';\n\t\t\t$post.= '<td style=\"display: none\" id=\"row_id'.$res[\"id\"].'\">'.$res[\"id\"].'</td>';\n\t\t \t$post.= '</tr>';\n\n\t\t }\n\t\t return $post;\n\t}", "function cicleinscription_get_courses_by_cicle_and_courseid($courseid, $cicleinscriptionid){\n\tglobal $DB;\n\t$sql = \"SELECT\n\t\t\t\tccp.*,\n\t\t\t\tc.fullname,\n\t\t\t\tc.shortname\n\t\t\tFROM \n\t\t\t\tmdl_ci_course_prematriculation as ccp\n\t\t\tINNER JOIN\n\t\t\t\tmdl_course c\n\t\t\tON\n\t\t\t\tc.id = ccp.courseid\n\t\t\tWHERE \n\t\t\t\tccp.cicleinscriptionid = ? AND ccp.courseid = ?\";\n\treturn $DB->get_record_sql($sql, array($cicleinscriptionid, $courseid));\n}", "public function index($module,Request $request)\n {\n $cou_title = $request->get('search');\n $param = $cou_title ? ['cou_title' => ['operator' => 'LIKE','value' => \"%%$cou_title%%\"]] : [];\n $orderby = ['id' => 'DESC'];\n $page_size = 20;\n\n if($module == \"list\"){\n $course_list = $this->course->getAllWithPaginate($param,$page_size,$orderby,'user');\n\n } elseif ($module == \"pending\") {\n $param = ['public_status' => ['operator' => '=','value' => 1], 'cou_active' => ['operator' => '=','value' => 0]];\n $course_list = $this->course->getAllWithPaginate($param,$page_size,$orderby,'user');\n\n } elseif ($module == \"activated\") {\n $param = ['cou_active' => ['operator' => '=','value' => 1]];\n $course_list = $this->course->getAllWithPaginate($param,$page_size,$orderby,'user');\n\n } elseif ($module == \"deleted\") {\n $course_list = $this->course->getAllWithOnlyTrashedPaginate($param,$page_size,$orderby,'user');\n\n } else {\n $course_list = $this->course->getAllWithPaginate($param,$page_size,$orderby,'user');\n }\n\n if($course_list){\n $course_list->load('category');\n }\n \n return view('backend.course.index',compact('course_list','module'));\n }", "public function show($course_id, $id)\n {\n \n }", "public function all_enroll_course_request(){\n\t\t\t$load = new Load();\n\t\t\t$request_model = $load->model('course_request_model');\n\t\t\t$all_course_request = $request_model->getByWhere('course_request','request_status','enroll');\n \n\t\t\treturn $all_course_request;\n\t\t}", "public function getCoursesInsideGroup()\n {\n $groupId = $this->input->post(\"groupId\");\n $courses = $this->Group_Model->getCoursesInsideGroup($groupId);\n echo json_encode($courses);\n }", "function getCourseLecturer($lecturerid,$start_from,$per_page){\r\ninclude 'dbConnect.php';\r\n$sql= 'SELECT * FROM course WHERE LID = '.$lecturerid.' LIMIT '.$start_from.','.$per_page.';';\r\n$result = mysqli_query($conn, $sql);\r\nif(isset($result)){\r\n\tif(mysqli_num_rows($result) > 0){\r\n\t\techo '<div id=\"products\" class=\"row list-group\">';\r\n\t\twhile($row = mysqli_fetch_assoc($result)){\t\r\n\t\t\techo '<div class=\"item col-xs-4 col-lg-4\">\r\n\t\t\t\t<div class=\"thumbnail\">\r\n\t\t\t\t\t<img class=\"group list-group-image\" src=\"http://placehold.it/400x250/000/fff&text='.$row[\"CourseName\"].'\" />\r\n\t\t\t\t\t<div class=\"caption\">\r\n\t\t\t\t\t\t<h4 class=\"group inner list-group-item-heading\">\r\n\t\t\t\t\t\t\t'.$row[\"CourseName\"].'</h4>\r\n\t\t\t\t\t\t<p class=\"group inner list-group-item-text\">\r\n\t\t\t\t\t\t\t'.$row[\"CourseDesc\"].'</p>\r\n\t\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t\t<div class=\"col-xs-12 col-md-6\">\r\n\t\t\t\t\t\t\t\t<p class=\"lead\">\r\n\t\t\t\t\t\t\t\t\tMYR '.$row[\"CoursePrice\"].'</p>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"col-xs-12 col-md-6\">\r\n\t\t\t\t\t\t\t<form method=\"post\" action=\"classroom.php\">\r\n\t\t\t\t\t\t\t<div><input type=\"hidden\" name=\"course_id\" value=\"'.$row[\"CourseID\"].'\"/></div>\r\n\t\t\t\t\t\t\t<input class=\"btn btn-success\" type=\"submit\" name=\"view\" value=\"View Sessions\"/>\r\n\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>';\r\n\t\t\t}\r\n\t\t\techo '</div>';\r\n\t\t\t\r\n\t\t\t//Now select all from table\r\n\t\t\t$querypage = 'SELECT * FROM Course WHERE LID = '.$lecturerid.';';\r\n\r\n\t\t\t$resultpage = mysqli_query($conn, $querypage);\r\n\r\n\t\t\t// Count the total records\r\n\t\t\t$total_records = mysqli_num_rows($resultpage);\r\n\r\n\t\t\t//Using ceil function to divide the total records on per page\r\n\t\t\t$total_pages = ceil($total_records / $per_page);\r\n\t\t\t\r\n\t\t\t//first page\r\n\t\t\techo \"<ul class='pagination'>\r\n\t\t\t\t <li class='page-item'><a href='course.php?page=1'>\".'<<'.\"</a></li>\";\r\n\r\n\t\t\tfor ($i=1; $i<=$total_pages; $i++) {\r\n\r\n\t\t\techo \"<li class='page-item'><a href='course.php?page=\".$i.\"'>\".$i.\"</a></li>\";\r\n\t\t\t};\r\n\t\t\t// last page\r\n\t\t\techo \"<li class='page-item'><a href='course.php?page=$total_pages'>\".'>>'.\"</a></li>\r\n\t\t\t\t</ul>\";\r\n\t\t}\r\n\t}else{\r\n\t\techo 'Error Database!';\r\n\t}\r\n}", "function getAllCourses(){\n $resultGetCourses = getCourses();\n // On vérifie si tout se passe bien\n if(!$resultGetCourses){\n $message = 'La récupération des cours n\\'a pas aboutit !';\n }else{\n // Methode qui permet de compter combien entrer il y a dans cours\n $nbCourses = $resultGetCourses->rowCount();\n if($nbCourses == 0){\n $message = \"Il n'y a aucun cours pour le moment!\";\n addOneCourse();\n }else{\n require_once ('views/viewAllCourses.php');\n }\n }\n // Methode qui libère la connexion au serveur permet donc à d'autres requete sql d'être executé\n $resultGetCourses->closeCursor();\n}", "public function getByCriteria() {\n $ret = array();\n $sql = \"SELECT DISTINCT C.courseID FROM Course C INNER JOIN Section S ON C.courseID=S.courseID WHERE S.sessionYear = :sessionYear AND S.sessionCode = :sessionCode AND S.term = :term\";\n $params = array(':sessionCode' => $this->code, ':sessionYear' => $this->year, ':term' => $this->term);\n foreach($this->filters as $name => $val) {\n $sql .= ' AND '.$name.'=:'.$name;\n $params[':'.$name] = $val;\n }\n $stmt = $this->conn->prepare($sql);\n $stmt->execute($params);\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $ret[] = new Course($row['courseID'], $this->head);\n echo $row['courseID'];\n }\n return $ret;\n return (!empty($ret)) ? $ret : false;\n }", "public function get_alltrainee_with_courseclass() {\n $class = $this->input->post('class');\n $course = $this->input->post('course');\n $query_string = htmlspecialchars($_POST['q'], ENT_QUOTES, 'UTF-8');\n $result = $this->classtraineemodel->get_alluser_with_class_course($this->tenant_id, $query_string, '', $class, $course);\n if ($result) {\n foreach ($result as $row) {\n $matches[] = array(\n 'key' => $row->user_id,\n 'label' => $row->first_name . ' ' . $row->last_name . '( Taxcode : ' . $row->tax_code . ')',\n 'value' => $row->first_name . ' ' . $row->last_name\n );\n }\n }\n echo json_encode($matches);\n exit();\n }", "public function activeCourse(){\n if(Input::has('year') && Input::get('year') != ''){\n $year = Input::get('year');\n }else{\n $year = \"2019\";\n }\n \n $start_date = $year.\"-01-01\";\n $end_date = $year.\"-12-31\";\n\n $user_type = explode(',',Auth::user()->official_types);\n $courses = Course::Active()->whereIn('courses.user_type',$user_type)\n ->orderBy('courses.start_date','ASC')\n ->whereBetween('courses.start_date',[$start_date,$end_date])\n ->get();\n $this->layout->sidebar = View::make('coaches.sidebar',['sidebar'=>5,'subsidebar'=>1]);\n $this->layout->main = View::make('coaches.courses.list',['courses'=>$courses,'title'=>'Active Courses', \"year\"=>$year]);\n }", "public function get_reschedule_course_details() {\n $data = array();\n $tenant_id = $this->tenant_id;\n $course_id = $this->input->post('course_id');\n $active_class = $this->input->post('active_class');\n if (!empty($course_id)) {\n $active_enroll_class = $this->classtraineemodel->get_active_class_enrol($tenant_id, $course_id, '');\n $activeenroll_class = get_class_starttime($active_enroll_class);\n if ($activeenroll_class) {\n foreach ($activeenroll_class as $k => $v) {\n $data['active'][] = array(\n 'key' => $k,\n 'value' => $v\n );\n }\n }\n $reschedule_enroll_class = $this->classtraineemodel->get_reschedule_class_enrol($tenant_id, $course_id, $active_class);\n foreach ($reschedule_enroll_class as $k => $row) {\n if ($row->class_pymnt_enrol == 'PDENROL') {\n $totalbooked = $this->class->get_class_booked($row->course_id, $row->class_id, $this->tenant_id);\n if ($totalbooked >= $row->total_seats) {\n unset($reschedule_enroll_class[$k]);\n }\n }\n }\n $rescheduleenroll_class = get_class_starttime($reschedule_enroll_class);\n if ($rescheduleenroll_class) {\n foreach ($rescheduleenroll_class as $k => $v) {\n $data['reschedule'][] = array(\n 'key' => $k,\n 'value' => $v\n );\n }\n }\n }\n \n echo json_encode($data);\n exit();\n }", "public function frontpage_available_courses() {\n\n global $CFG , $DB;\n $coursecontainer = '';\n $chelper = new coursecat_helper();\n $chelper->set_show_courses(self::COURSECAT_SHOW_COURSES_EXPANDED)->set_courses_display_options( array(\n 'recursive' => true,\n 'limit' => $CFG->frontpagecourselimit,\n 'viewmoreurl' => new moodle_url('/course/index.php'),\n 'viewmoretext' => new lang_string('fulllistofcourses')\n ));\n\n $chelper->set_attributes( array( 'class' => 'frontpage-course-list-all frontpageblock-theme' ) );\n\n $courses = core_course_category::get(0)->get_courses( $chelper->get_courses_display_options() );\n\n $totalcount = core_course_category::get(0)->get_courses_count( $chelper->get_courses_display_options() );\n\n $rcourseids = array_keys( $courses );\n\n //$acourseids = array_chunk( $rcourseids, 6);\n $acourseids = $rcourseids;\n $tcount = count($acourseids);\n\n $newcourse = get_string( 'availablecourses' );\n $header = \"\";\n $header .= html_writer::tag('div', \"<div></div>\", array('class' => 'bgtrans-overlay'));\n\n $header .= html_writer::start_tag('div',\n array( 'class' => 'available-courses', 'id' => 'available-courses') );\n $header .= html_writer::start_tag('div', array( 'class' => 'available-overlay' ) );\n $header .= html_writer::start_tag('div', array( 'class' => 'available-block' ) );\n $header .= html_writer::start_tag('div', array('class' => 'container'));\n $header .= html_writer::tag('h2', get_string('availablecourses'));\n\n /* if ($tcount > '1') {\n $header .= html_writer::start_tag('div', array('class' => 'pagenav slider-nav') );\n $header .= html_writer::tag('button', '', array('class' => 'slick-prev nav-item previous', 'type' => 'button') );\n $header .= html_writer::tag('button', '', array('class' => 'slick-next nav-item next', 'type' => 'button') );\n $header .= html_writer::tag('div', '', array('class' => 'clearfix') );\n $header .= html_writer::end_tag('div');\n }*/\n $sliderclass = 'course-slider';\n $header .= html_writer::start_tag('div', array('class' => 'row') );\n $header .= html_writer::start_tag('div', array( 'class' => \" $sliderclass col-md-12\") );\n\n $footer = html_writer::end_tag('div');\n $footer .= html_writer::end_tag('div');\n $footer .= html_writer::end_tag('div');\n $footer .= html_writer::end_tag('div');\n if (count($rcourseids) > 0) {\n $i = '0';\n /* foreach ($acourseids as $courseids) {\n\n $rowcontent = '<div class=\"slider-row \">';*/\n $rowcontent = '';\n foreach ($acourseids as $courseid) {\n $container = '';\n $course = get_course($courseid);\n $noimgurl = $this->output->image_url('no-image', 'theme');\n $courseurl = new moodle_url('/course/view.php', array('id' => $courseid ));\n\n if ($course instanceof stdClass) {\n $course = new core_course_list_element($course);\n }\n\n $imgurl = '';\n $context = context_course::instance($course->id);\n\n foreach ($course->get_course_overviewfiles() as $file) {\n $isimage = $file->is_valid_image();\n $imgurl = file_encode_url(\"$CFG->wwwroot/pluginfile.php\",\n '/'. $file->get_contextid(). '/'. $file->get_component(). '/'.\n $file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage);\n if (!$isimage) {\n $imgurl = $noimgurl;\n }\n }\n\n if (empty($imgurl)) {\n $imgurl = $noimgurl;\n }\n\n $container .= html_writer::start_tag('div', array( 'class' => 'col-md-2') );\n $container .= html_writer::start_tag('div', array( 'class' => 'available-content'));\n $container .= html_writer::start_tag('div', array( 'class' => 'available-img'));\n\n $container .= html_writer::start_tag('a', array( 'href' => $courseurl) );\n $container .= html_writer::empty_tag('img',\n array(\n 'src' => $imgurl,\n 'width' => \"249\",\n 'height' => \"200\",\n 'alt' => $course->get_formatted_name() ) );\n $container .= html_writer::end_tag('a');\n $container .= html_writer::end_tag('div');\n $container .= html_writer::tag('h6', html_writer::tag('a',\n $course->get_formatted_name(),\n array( 'href' => $courseurl ) ),\n array('class' => 'title-text') );\n $container .= html_writer::end_tag('div');\n $container .= html_writer::end_tag('div');\n\n $rowcontent .= $container;\n }\n $i++;\n /*$rowcontent .= html_writer::end_tag('div');*/\n $coursecontainer .= $rowcontent;\n // }\n\n }\n $footer .= html_writer::end_tag('div');\n $footer .= html_writer::end_tag('div');\n $coursehtml = $header.$coursecontainer.$footer;\n return $coursehtml;\n\n if (!$totalcount && !$this->page->user_is_editing() && has_capability('moodle/course:create', context_system::instance())) {\n // Print link to create a new course, for the 1st available category.\n echo $this->add_new_course_button();\n }\n }", "public function individualCourse($universityName,$universityId,$courseName,$courseId) {\n\t\t\n\t\t/*\n\t\t$courseDetail = $this->coursemodel->getCounterValue($courseId);\n\t\t$pageCount = $courseDetail[0]['page_count'];\n\t\tif(!empty($courseId)){\n\t\t\t$count = $pageCount + 1;\n\t\t\t$this->coursemodel->countCourses($count,$courseId);\n\t\t}\n\t\t*/\n\t\t\n\t\t$this->db_campaign = $this->ci->load->database('db_campaign', True);\n\t\t$data['totalLeads'] = $this->collegemodel->getCampaignData();\n\t\t$this->db = $this->ci->load->database('default', True);\n\t\t\n\t\t$spclCharUniv = array(\"(\", \")\",\",\",\"'\");\n\t\t\n\t\t//$university_name = str_replace('-',' ',$universityName);\n\t\t$university_name = str_replace($spclCharUniv,'',$universityName);\n\t\t\n\t\t$spclCharCourse = array(\"$\",\"!\",\"_\",\":\");\n\t\t\n\t\t$course_name = str_replace($spclCharCourse,'',$courseName);\n\t\t\n\t\t$course_name = str_replace('&','and',$course_name);\n\t\t\n\t\t$data['active']=\"\";\n\t\t$data['title'] = \"$university_name - $course_name\";\n\t\t$data['keywords'] = \"\";\n\t\t$data['description'] = \"\";\n\t\t$data['universityName'] = $universityName;\n\t\t$data['universityId'] = $universityId;\n\t\t$data['courseName'] = $courseName;\n\t\t$data[\"accreditationData\"] = $this->coursemodel->getAccreditationData($courseId);\n\t\t$data[\"stagesData\"] = $this->coursemodel->getStagesData($courseId);\n\t\t$data[\"degreeClassesData\"] = $this->coursemodel->getDegreeClassesData($courseId);\n\t\t$data[\"continuationData\"] = $this->coursemodel->getContinuationData($courseId);\n\t\t$data[\"employmentData\"] = $this->coursemodel->getEmploymentData($courseId);\n\t\t$data[\"jobData\"] = $this->coursemodel->getJobData($courseId);\n\t\t$data[\"entryData\"] = $this->coursemodel->getEntryData($courseId);\n\t\t$data[\"salaryData\"] = $this->coursemodel->getSalaryData($courseId);\n\t\t$data[\"commonData\"] = $this->coursemodel->getCommonData($courseId);\n\t\t$data[\"tariffData\"] = $this->coursemodel->getTariffData($courseId);\n\t\t$data[\"nssData\"] = $this->coursemodel->getNssData($courseId);\n\t\t///$data[\"countryId\"] = $this->coursemodel->getountryId($universityId);\n\t\t//echo $course_id;exit;\n\t\t//echo \"<pre>\";print_r($data);exit;\n\t\t\n $this->layout->view('course/individualCourse.php', $data);\n }", "public function retrieve_userid_course($userid, $course)\n {\n $sql = 'SELECT * FROM `section-student` WHERE `userid`=:userid AND `course` = :course ORDER BY `userid` ';\n\n $connMgr = new ConnectionManager();\n $conn = $connMgr->getConnection();\n\n $stmt = $conn->prepare($sql);\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $stmt->bindParam(':userid', $userid, PDO::PARAM_STR);\n $stmt->bindParam(':course', $course, PDO::PARAM_STR);\n $stmt->execute();\n\n $result = FALSE;\n\n if ($row = $stmt->fetch()) {\n $result = new SectionStudent($row['userid'], $row['course'], $row['section'], $row['amount']);\n }\n\n $stmt = null;\n $conn = null;\n\n return $result;\n }", "public function cboCourse(){\n\t\t$db = new connectionClass();\n\n\t\t$sql = $db->query(\"SELECT * FROM cursos\");\n\t\t$numberRecord = $sql->num_rows;\n\n\t\tif ($numberRecord != 0) {\n\t\t\t$dataArray = array();\n\t\t\t$i = 0;\n\n $dataArray[$i] = array(\"id\" => '0' , \"descripcion\" => 'Curso');\n\n\t\t\twhile($data = $sql->fetch_assoc()){\n $i++;\n\t\t\t\t$dataArray[$i] = array(\"id\" => $data['idCurso'], \"descripcion\" => $data['nombreCurso']);\n\t\t\t}\n\n\t\t\theader(\"Content-type: application/json\");\n\t\t\treturn json_encode($dataArray);\n\t\t}\n\t}", "function getCourse($cid)\n {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n\n $query = \"SELECT * FROM courses where cid='\".$cid.\"'\";\n $stmt = $mysqli->query($query);\n\n return $stmt;\n \n }", "public function add_courses()\n {\n if ($this->input->is_ajax_request()) {\n\n $process = $this->M_Courses->add_courses();\n $courses = 'courses';\n if ($process) {\n echo json_encode([\n 'status' => true,\n 'message' => $this->lang->line('success_add_courses')\n ]);\n } else {\n echo json_encode([\n 'status' => false,\n 'message' => $this->lang->line('failed_add_courses')\n ]);\n }\n } else {\n redirect(base_url());\n }\n }", "function process_request()\r\n {\r\n $id = required_param('id', PARAM_INT);\r\n if (!$this->course = sloodle_get_record('course', 'id', $id)) error('Could not find course.');\r\n $this->sloodle_course = new SloodleCourse();\r\n if (!$this->sloodle_course->load($this->course)) error(get_string('failedcourseload', 'sloodle'));\r\n\r\n }", "public function ajax_fetch($isexport = false)\n {\n\n $conditions = array();\n\n if ($this->request->isget() && $this->request->query != null) {\n $data = $this->request->query;\n\n // for Global AJAX search filter\n if (isset($data['searchTerm']) && ($data['searchTerm'] != '' && $data['searchTerm'] != null )) {\n $where_conditions['RoleMaster.role_name LIKE'] = \"%\" . $data['searchTerm'] . \"%\";\n $where_conditions['RoleMaster.description LIKE'] = \"%\" . $data['searchTerm'] . \"%\";\n $conditions['conditions'] = array(\"OR\" => $where_conditions);\n }\n }\n\n $roleMasters = $this->Crud->listdata(array('find_configs' => $conditions), $isexport);\n\n $this->autoRender = false;\n echo $roleMasters;\n exit();\n }", "function getCourseByPass($conn_moodle,$key){\n\t\t\t$sql = \"select id from mdl_course where idnumber='$key'\";\n\t\t\t$data = $conn_moodle->GetRow($sql);\n\t\t\n\t\t\treturn $data['id'];\n\t\t\t\n\t\t}", "function get_course()\n {\n $this -> db -> select('course_name,course_id,course_status');\n $this -> db -> from('tbl_course');\n $this->db->where('course_status','0');\n //$this->db->where('course_parent', ' ');\n $this->db->order_by('course_name', 'asc');\n $query = $this->db->get();\n return $query->result();\n }", "function searchCoursesByQuery($searchQuery){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name, author, image FROM Course WHERE name LIKE '%\" . $searchQuery . \"%' OR description LIKE '%\" . $searchQuery . \"%' OR author LIKE '%\" . $searchQuery . \"%' ORDER BY creationDate\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\t}", "function local_mediacore_fetch_courses() {\n global $DB;\n $query = \"SELECT *\n FROM {course}\n WHERE format != :format\n AND visible = :visible\n ORDER BY shortname ASC\";\n return $DB->get_records_sql($query, array(\n 'format' => 'site',\n 'visible' => '1',\n ));\n}", "function get_all_courses()\n {\n $this->db->select('cs.*,cat.name as category');\n $this->db->from('courses as cs');\n $this->db->join('courses_categories_gp as cc', 'cc.course_id=cs.id');\n $this->db->join('categories as cat', 'cat.id=cc.category_id');\n $this->db->where('cat.status', 1);\n $this->db->where('cs.status', 1);\n $this->db->order_by('cs.sort_order', 'asc');\n $query = $this->db->get();\n if ($query->num_rows() > 0) {\n $courses = $query->result();\n return $courses;\n }\n return false;\n }", "public function findcoursesByString ( $str ){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM courses \";\n $sqlQuery .= \" WHERE description LIKE ’% $str %’\";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }", "function get_courses_json($library) {\n\n $json = \\Drupal::cache()->get('ares_course_list')->data;\n if (!$json) {\n //global $courses_url;\n $courses_url = 'https://mannservices.mannlib.cornell.edu/LibServices/showCourseReserveList.do?output=json&library=';\n // static $ares_courses_json;\n $cid = 'ares_courses_' . $library;\n $url = $courses_url . $library;\n $response = \\Drupal::httpClient()->get($url, ['verify' => false]);\n $json = json_decode((string) $response->getBody(), true);\n \\Drupal::cache()->set('ares_course_list', $json, time() + 600); # 10-minute cache time\n }\n\n return $json;\n }", "function get_course_callback(){\n global $wpdb;\n $table_name = $wpdb->prefix . \"exchanger_cources\";\n $symbol = $wpdb->get_row(\"SELECT * FROM $table_name WHERE code = '\".$_POST['for'].\"' AND exchange_code = '\".$_POST['to'].\"'\");\n\n $course = $symbol->cource*(1-($symbol->koefficient/100));\n\n echo(json_encode(\n array(\n 'status'=>'ok',\n 'request_vars'=>round($course*$_POST['sumfor'],15),\n 'cource' => $course\n )\n )\n );\n wp_die();\n}", "public function index()\n {\n $query = Request::input('q');\n\n\t\tif ($query)\n\t\t{\t\t\n\t\t $courses= Course::where('coursename','LIKE', \"%$query%\")\n\t\t ->orWhere('address','LIKE', \"%$query%\")\n\t\t ->orWhere('city','LIKE', \"%$query%\")\n\t \t ->orWhere('state','LIKE', \"%$query%\")\n\t\t ->orWhere('zip', 'LIKE', \"%$query%\")\n\t\t ->orWhere('phone', 'LIKE', \"%$query%\")\n\t\t ->get();\n\t\t}\n\t\t\n\t\telse\n\t\t{\t\t\n\t\t $courses = Course::all();\n\t\t}\n return View::make('CourseTable', ['courses' => $courses]);\n }", "function get_number_of_courses()\r\n{\r\n\t$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);\r\n $diplomas_course_table = Database :: get_main_table(TABLE_DIPLOMAS_COURSES);\r\n \r\n\t$sql = \"SELECT COUNT(d.course_code) AS total_number_of_items FROM $course_table c, $diplomas_course_table d where c.code = d.course_code\";\r\n\tif (isset ($_GET['keyword']))\r\n\t{\r\n\t\t$keyword = Database::escape_string($_GET['keyword']);\r\n\t\t$sql .= \" and d.course_code LIKE '%\".$keyword.\"%'\";\r\n\t}\r\n\telseif (isset ($_GET['keyword_code']))\r\n\t{\r\n\t\t$keyword_code = Database::escape_string($_GET['keyword_code']);\t\t\r\n\t\t$sql .= \" and d.course_code LIKE '%\".$keyword_code.\"%'\";\r\n\t}\r\n\t$res = api_sql_query($sql, __FILE__, __LINE__);\r\n\t$obj = Database::fetch_object($res);\r\n\treturn $obj->total_number_of_items;\r\n}", "public function sections_get() {\n $response = array();\n $auth_token = $_GET['auth_token'];\n $course_id = $_GET['course_id'];\n $logged_in_user_details = json_decode($this->token_data_get($auth_token), true);\n\n if ($logged_in_user_details['user_id'] > 0) {\n $response = $this->api_model->sections_get($course_id, $logged_in_user_details['user_id']);\n }else{\n }\n return $this->set_response($response, REST_Controller::HTTP_OK);\n }", "function AssignCourse()\n\t{\t$this->resource = new AdminCourseResource($_GET[\"id\"]);\n\t\tif ($this->resource->id)\n\t\t{\t$this->course = new AdminCourse($this->resource->details[\"cid\"]);\n\t\t} else\n\t\t{\t$this->course = new AdminCourse($_GET[\"cid\"]);\n\t\t}\n\t}", "function index(IndexCourseRequest $request)\n {\n // Crea una instanacia del modelo Professional para poder insertar en el modelo course.\n $professional = Professional::getInstance($request->input('professional_id'));\n\n if ($request->has('search')) {\n $courses = $professional->courses()\n ->description($request->input('search'))\n ->name($request->input('search'))\n ->get();\n } else {\n $courses = $professional->courses()->paginate($request->input('per_page'));\n }\n\n if (sizeof($courses) === 0) {\n return response()->json([\n 'data' => null,\n 'msg' => [\n 'summary' => 'No se encontraron Cursos',\n 'detail' => 'Intente de nuevo',\n 'code' => '404'\n ]], 404);\n }\n\n return response()->json($courses, 200);\n }", "public function index(Request $request)\n\t{\n\t\t$title = array(\n\t\t\t'active' => self::active,\n\t\t\t'title' => self::title,\n\t\t\t'slug' => self::slug\n\t\t);\n\t\t/******year loop*********/\n\t\t$years = array();\n\t\t$currentYear = (int)date('Y');\n\t\t$oldYear = $currentYear - 20;\n\t\t$years[''] = 'Select';\n\t\tfor($i=$currentYear;$i>=$oldYear;$i--)\n\t\t{\n\t\t\t$years[$i] = $i;\n\t\t}\t\t\n\t\t/******year loop*********/\n\t\t\n\t\t$search = $request->search;\n\t\t$class_id = $request->class_id;\n\t\t$year = $request->year; \n\t\t$users = User::find(auth()->user()->id);\n\t\t$use = auth()->user();\n\t\t$use->companies->id;\n\t\t\n\t\t$class = Classes::whereCompanyId($use->companies->id)->pluck('name', 'id');\t\n\t\t//echo '<pre>'; print_r($class); exit;\n\t\tif($search||$class_id||$year){\n\t\t\t $query = Students::query();\t\t\n\t\t\t $query = $query->leftJoin('classes_students as c', 'students.id', '=', 'c.student_id');\n\t\t\tif($search){\n\t\t\t\t$query = $query->orWhere('surname', 'like', '%'.$search.'%')\n\t\t\t\t->orWhere('first_name', 'like', '%'.$search.'%')\n\t\t\t\t->orWhere('middle_name', 'like', '%'.$search.'%')\n\t\t\t\t->orWhere('student_no', 'like', '%'.$search.'%');\n\t\t\t}\n\t\t\tif($class_id){\n\t\t\t\t$query = $query->Where('c.class_id', $class_id);\n\t\t\t}\n\t\t\t\n\t\t\tif($year){\n\t\t\t\t$query = $query->Where('c.year', $year);\n\t\t\t}\n\t\t\t\n\t\t\t $students = $query->Where('companies_id', $users->companies->id)->select(['students.*'])\n\t\t\t->paginate(8);\t\t\t\n\t\t}\n\t\telse{\n\t\t\n\t\t$students = Students::whereCompaniesId($users->companies->id)->paginate(8);\n\t\t}\n\t\t$parent = Parents::all();\n\t\t$parentRel = Parent_relations::all();\n\t\treturn view('admin.students.index', compact('title','students','parent','parentRel','search','class','years','class_id','year'));\n\t}", "public function show(Course $course)\n {\n //\n }", "public function show(Course $course)\n {\n //\n }", "public function show(Course $course)\n {\n //\n }", "public function show(Course $course)\n {\n //\n }", "public function approvedStudentSearch(){\n\n\t\t$viewDataController = new ViewDataController();\n\t\t$data = $viewDataController->buildData();\n\n\t\t$input = Request::all();\n\n\t\tif (!isset($input['term']) || empty($input['term'])) {\n\t\t\treturn json_encode($term);\n\t\t}\n\n\t\t$term = $input['term'];\n\n\t\tif (isset($data['agency_collection'])) {\n\n\t\t\t$rec = DB::connection('bk')->table('users as u')\n\t\t\t\t\t->join('agency_recruitment as r', 'r.user_id', '=', 'u.id')\n\t\t\t\t\t->where('r.status', 1)\n\t\t\t\t \t->where('r.agency_recruit', 1)\n\t\t\t\t \t->where('r.user_recruit', 1)\n\t\t\t\t \t->where('r.agency_id', $data['agency_collection']->agency_id)\n\t\t\t\t \t->select('u.id')\n\t\t\t\t ->where(DB::raw('CONCAT(fname, lname)'), 'LIKE', '%'.$term.'%' )\n\t\t\t\t \t->groupBy('u.id');\n\t\t}else{\n\t\t\t$rec = DB::connection('bk')->table('users as u')\n\t\t\t\t\t->join('recruitment as r', 'r.user_id', '=', 'u.id')\n\t\t\t\t\t->where('r.status', 1)\n\t\t\t\t \t->where('r.college_recruit', 1)\n\t\t\t\t \t->where('r.user_recruit', 1)\n\t\t\t\t \t->where('r.college_id', $data['org_school_id'])\n\t\t\t\t \t->select('u.id')\n\t\t\t\t ->where(DB::raw('CONCAT(fname, lname)'), 'LIKE', '%'.$term.'%' )\n\t\t\t\t \t->groupBy('u.id');\n\t\t}\n\t\t\n\t\t\n\t\tif (isset($input['user_ids']) && !empty($input['user_ids'])) {\n\t\t\t\n\t\t\t$user_ids = $input['user_ids'];\t\n\t\t\t$arr = array();\n\t\t\tforeach ($user_ids as $key => $value) {\n\t\t\t\t$arr[] = Crypt::decrypt($value);\n\t\t\t}\n\n\t\t\t$rec = $rec->whereNotIn('u.id', $arr);\n\t\t}\n\n\t\t$rec = $rec->get();\n\n\t\tif (empty($rec)) {\n\t\t\treturn json_encode($rec);\n\t\t}\n\n\t\t$rec_arr = array();\n\n\t\tforeach ($rec as $key) {\n\t\t\t$rec_arr[] = $key->id;\n\t\t}\n\t\t\n\t\t$rec_arr = implode(\",\", $rec_arr);\n\n\t\t$ret = array();\n\t\t\n\t\t$tmp = $this->getRecipientName($data, $rec_arr);\n\n\t\tforeach ($tmp as $key) {\n\t\t\t$arr = array();\n\t\t\t$arr['user_id'] =Crypt::encrypt($key['user_id']);\n\t\t\t$arr['fname'] = $key['fname'];\n\t\t\t$arr['lname'] = $key['lname'];\n\t\t\t$arr['json'] = json_encode($key);\n\t\t\t$arr['json'] = str_replace(\"'\", \"&lsquo;\", $key);\n\t\t\t$arr['json'] = json_encode($arr['json']);\n\n\t\t\t$ret[] = $arr;\n\t\t}\n\n\n\t\treturn $ret;\n\t}", "function get_courses_for_the_gift_voucher($voucher_code)\n {\n \n $enrolled_course_ids = array();\n $course_array = array();\n $coure_list_html = '';\n if(isset($this->session->userdata['student_logged_in']['id'])) \n { \n $user_id = $this->session->userdata['student_logged_in']['id'];\n $enrolled_courses = $this->user_model->get_courses_student($user_id);\n if($enrolled_courses)\n {\n foreach($enrolled_courses as $en_course)\n {\n $enrolled_course_ids[] = $en_course->course_id; \n } \n }\n }\n //$content['course_array'] = $this->sales_model->get_course_by_language($this->language,$enrolled_course_ids);\n \n if(isset($voucher_code))\n { \n $voucherDetails = $this->gift_voucher_model->getDetails_of_vcode($voucher_code); \n $content['course_cat']=$this->gift_voucher_model->get_course_categories(); \n $content['voucher_type'] = $voucherDetails[0]->voucher_type; \n \n if($voucherDetails[0]->courses_idcourses==\"\"||$voucherDetails[0]->courses_idcourses==0)\n {\n $content['course_set']=$this->gift_voucher_model->get_course_in_cat_name_order($this->session->userdata['language'],$enrolled_course_ids);\n $content['voucher_type_course_count']=1; \n //$content['temp']='inside if for course_set'; \n }\n else\n {\n $course_ids = explode(\",\",$voucherDetails[0]->courses_idcourses); \n $course_ids = array_diff($course_ids,$enrolled_course_ids); \n if(!empty($course_ids)) \n { \n $content['course_set']=$this->gift_voucher_model->get_these_courses_for_voucher($course_ids);\n //$content['temp']='inside elseif for course_set';\n //$content['course_set']=$this->db->last_query();\n }\n else\n {\n //$content['temp']='inside else for course_set';\n $content['course_set'] = array();\n }\n \n if($voucherDetails[0]->voucher_type =='one_course_from_list')\n {\n $content['voucher_type_course_count'] = 1;\n }\n elseif($voucherDetails[0]->voucher_type =='two_course_from_list')\n {\n $content['voucher_type_course_count'] = 2;\n }\n elseif($voucherDetails[0]->voucher_type =='four_course_from_list')\n {\n $content['voucher_type_course_count'] = 4;\n }\n elseif($voucherDetails[0]->voucher_type =='one_or_more_predefined')\n {\n $content['voucher_type_course_count'] = count($course_ids);\n }\n else\n {\n $content['voucher_type_course_count'] = 1;\n }\n }\n $content['err_msg'] = 0;\n }\n else\n {\n $content['err_msg'] = 1;\n }\n \n //echo \"<pre>\"; print_r($content); exit;\n \n echo json_encode($content); \n exit;\n \n }", "public function online_trainee()\n {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n extract($_GET);\n $data['courses'] = $courses = $this->course->get_active_course_list_by_tenant($tenant_id, 'classTrainee');\n if ($course) {\n \n $course_classes = $this->class->get_course_class($tenant_id, $course,\"\",\"\",\"classTrainee\");\n $data['classes'] = $course_classes;\n }\n $export_url = '';\n $sort_url = '';\n if(!empty($_GET)){ /// added by shubhranshu to remove the classtrainee list on 01/01/2019\n if (!empty($_GET)) {\n $export_url = '?';\n foreach ($_GET as $k => $v) {\n if (!empty($v)) {\n $export_url .=\"$k=$v&\";\n }\n if ($k != 'f' && $k != 'o') {\n if (!empty($v)) {\n $sort_url .=\"$k=$v&\";\n }\n }\n }\n }\n $export_url = rtrim($export_url, '&');\n $sort_url = rtrim($sort_url, '&');\n $data['export_url'] = $export_url;\n $data['sort_url'] = '?' . $sort_url;\n $course = ($this->input->get('course')) ? $this->input->get('course') : '';\n $class = ($this->input->get('class')) ? $this->input->get('class') : '';\n $class_status = ($this->input->get('class_status')) ? $this->input->get('class_status') : '';\n $search_select = ($this->input->get('search_select')) ? $this->input->get('search_select') : '';\n $taxcode_id = ($this->input->get('taxcode_id')) ? $this->input->get('taxcode_id') : '';\n $trainee_id = ($this->input->get('trainee_id')) ? $this->input->get('trainee_id') : '';\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ce.pymnt_due_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'desc';\n\n $records_per_page = RECORDS_PER_PAGE;\n $baseurl = base_url() . 'class_trainee/online_trainee/';\n $pageno = ($this->uri->segment(3)) ? $this->uri->segment(3) : 1;\n $offset = ($pageno * $records_per_page);\n $data['tenant'] = $tenant_id;\n $company_id = $this->input->get('company_id');\n $this->db->cache_on();\n\n $tabledata = $this->classtraineemodel->online_list_classtrainee_by_tenant_id($tenant_id, $records_per_page, $offset, $field, $order_by, $course, $class, $class_status, $search_select, $taxcode_id, $trainee_id, $company_id);\n \n $totalrows = $this->classtraineemodel->get_all_online_classtrainee_count_by_tenant_id($tenant_id, $course, $class, $class_status, $search_select, $taxcode_id, $trainee_id, $company_id);\n// echo $this->db->last_query();\n// print_r($totalrows);\n// exit();\n \n $new_tabledata = array();\n $role_array = array(\"TRAINER\", \"COMPACT\", \"SLEXEC\");\n foreach ($tabledata as $k => $row) \n {\n if ($row['enrolment_mode'] == 'COMPSPON') \n {\n if ($row['company_id'][0] == 'T') \n {\n $tenant_details = fetch_tenant_details($row['company_id']);\n $company[0]->company_name = $tenant_details->tenant_name;\n } \n else \n {\n $company = $this->company->get_company_details($tenant_id, $row['company_id']);\n }\n $new_tabledata[$k]['enroll_mode'] = $company[0]->company_name;\n } \n else \n {\n $new_tabledata[$k]['enroll_mode'] = 'Individual';\n }\n $paidlabel = rtrim($this->course->get_metadata_on_parameter_id($row['payment_status']), ', ');\n if ($row['payment_status'] == 'PAID') \n {\n $new_tabledata[$k]['paid'] = '<a href=\"javascript:;\" class=\"small_text1 paid_href\" data-class=\"' . $row['class_id'] . '\" data-user=\"' . $row['user_id'] . '\">' . $paidlabel . '<br> $'.number_format($row['total_amount_due'], 2, '.', ''). '</span></a>';\n } \n else if ($row['payment_status'] == 'PYNOTREQD') \n {\n $new_tabledata[$k]['paid'] = '<span style=\"color:#ffcc66;\">' . $paidlabel . '</span>';\n } \n else if (in_array($this->session->userdata('userDetails')->role_id, $role_array)) \n { \n $new_tabledata[$k]['paid'] = '<span class=\"error\">' . $paidlabel . '</span>';\n } \n else \n {\n $enrol_mode = ($row['enrolment_mode'] == 'COMPSPON')?'company&company_id='.$row['company_id']:'individual';\n $invoice_id = $this->classtraineemodel->get_invoice_id_for_class_trainee($row['class_id'],$row['user_id']);\n $get_data = '?invoice_id='.$invoice_id.'&enrol_mode='.$enrol_mode;\n $new_tabledata[$k]['paid'] = '<a href=\"' . base_url() . 'accounting/update_payment'.$get_data.'\"><span class=\"error\">' . $paidlabel .'<br> $'.number_format($row['total_amount_due'], 2, '.', ''). '</span></a>';\n }\n $status = $this->class->get_class_status($row['class_id'], $this->input->get('class_status'));\n $class_end_date = $this->class->get_end_date($row['class_id']);\n if ($status == 'Completed') \n {\n $new_tabledata[$k]['status_text'] = '<span class=\"red\">' . $status . '</span>';\n } \n elseif ($status == 'Yet to Start') \n {\n $new_tabledata[$k]['status_text'] = '<span class=\"green\">' . $status . '</span>';\n } \n elseif ($status == 'In-Progress') \n {\n $cur_date = strtotime(date(\"Y-m-d\"));\n $new_tabledata[$k]['status_text'] = '<span style=\"color:blue;\">' . $status . '</span>';\n if($class_end_date == $cur_date){\n $new_tabledata[$k]['end_class'] = '<form name=\"end_class\" method=\"get\" action=\"'.base_url().'classes/end_class\">'\n . '<input type=\"hidden\" name=\"end_class\" value=\"'.$row['class_id'].'\">'\n . '<button style=\"color:blue;\" >End Class</button></form>';\n }\n } \n else \n {\n $new_tabledata[$k]['status_text'] = $status;\n }\n if ($row['account_type'] == 'INTUSR') \n {\n $new_tabledata[$k]['taxcode'] = '<a href=\"' . base_url() . 'internal_user/view_user/' . $row['user_id'] . '\">' . $row['tax_code'] . '</a>';\n } \n else \n {\n $new_tabledata[$k]['taxcode'] = '<a href=\"' . base_url() . 'trainee/view_trainee/' . $row['user_id'] . '\">' . $row['tax_code'] . '</a>';\n }\n $new_tabledata[$k]['name'] = $row['first_name'] . ' ' . $row['last_name'];\n $new_tabledata[$k]['certi_coll'] = !empty($row['certificate_coll_on']) ? date('d/m/Y', strtotime($row['certificate_coll_on'])):'';\n $new_tabledata[$k]['class_end_datetime'] = $row['class_end_datetime'];\n $new_tabledata[$k]['course_id'] = $row['course_id'];\n $new_tabledata[$k]['class_id'] = $row['class_id'];\n $new_tabledata[$k]['user_id'] = $row['user_id'];\n $new_tabledata[$k]['feedback_answer'] = $row['feedback_answer'];\n \n $new_tabledata[$k]['SalesExec'] = $this->class->get_class_salesexec1($tenant_id, $row['course_id'], $row['sales_executive_id']);\n \n $new_tabledata[$k]['course_class'] = $row['crse_name'] . ' - ' . $row['class_name'];\n $new_tabledata[$k]['duration'] = date('d/m/Y', strtotime($row['class_start_datetime'])) . ' - ' . date('d/m/Y', strtotime($row['class_end_datetime']));\n $new_tabledata[$k]['subsidy'] = '<a href=\"javascript:;\" class=\"get_update\" data-class=\"' . $row['class_id'] . '\" data-user=\"' . $row['user_id'] . '\">Update</a>';\n $TGAMT = !empty($row['subsidy_amount']) ? \"$\".$row['subsidy_amount'] : \"NA\";\n $TGNO = !empty($row['tg_number']) ? $row['tg_number'] : \"NA\";\n $TGNOBR= !empty($row['tg_number']) ? \"<br>\": \"\";\n $data['trainee_feedback'] = $this->reportsModel->get_trainee_feedback_by_user_id($tenant_id, $new_tabledata[$k]['course_id'], $new_tabledata[$k]['class_id'], $new_tabledata[$k]['user_id']); \n $linkStr = '';\n if ($row['account_status'] == 'PENDACT') \n {\n $linkStr = '<span style=\"color:red;\">Account not yet activated.</span>';\n } \n else if ($row['account_status'] == 'INACTIV') \n {\n $linkStr = get_links($row['enrolment_mode'], $row['payment_status'], $row['invoice_id'], $row['user_id'], $row['pymnt_due_id'], $row['class_id'], $this, $row['account_status'], $row['cc_class_status'], $row['company_id']);\n } \n else \n {\n $linkStr = ''; \n $cur_date = strtotime(date('Y-m-d'));\n $class_end_datetime = date(\"Y-m-d\", strtotime($row['class_end_datetime']));\n $class_end_datetime_str = strtotime($class_end_datetime);\n if ($cur_date >= $class_end_datetime_str) \n { \n $check_attendance=$this->classtraineemodel->check_attendance_row($tenant_id,$row['course_id'],$row['class_id']);\n $check_competent=$this->classtraineemodel->check_competent($tenant_id,$row['course_id'],$row['class_id'],$row['user_id']);\n $linkStr = ''; \n if ($this->user->role_id == 'ADMN' || $this->user->role_id == 'CRSEMGR') \n {\n $status = $this->class->get_class_status($row['class_id'], $this->input->get('class_status'));\n if ($status == 'Completed') \n {\n if($check_attendance>0){\n $linkStr .= ' <a href=\"#ex7\" rel=\"modal:open\" data-course=\"' . $row['course_id'] . '\" '\n . 'data-class=\"' . $row['class_id'] . '\" data-user=\"' . $row['user_id'] . '\"data-payment=\"'.$row['pymnt_due_id']. '\"class=\"training_update small_text1\">Trainer Feedback</a><br/>'; \n if($check_competent>0)\n {\n $linkStr .= ' <a href=\"#ex6\" rel=\"modal:open\" data-course=\"' . $row['course_id'] . '\" data-class=\"' . $row['class_id'] . '\" data-user=\"' . $row['user_id'] . '\" class=\"training_update small_text1\"><span>Trainee Feedback</span></a><br/>';\n }\n \n }\n else{\n $linkStr.='<form action=\"'.base_url().'class_trainee/mark_attendance\" method=\"post\" name=\"maarkatt[]\"><input type=\"hidden\" name=\"course_id\" value=\"'.$row['course_id'].'\" /><input type=\"hidden\" name=\"class_id\" value=\"'.$row['class_id'].'\" /><input type=\"submit\" class=\"red\" value =\"Mark Attendance\" /></form><br />';\n }\n } \n \n } \n if ($row['payment_status'] != 'PYNOTREQD' &&\n ($this->user->role_id == 'ADMN' || $this->user->role_id == 'CRSEMGR')\n ) \n {\n $linkStr .= '<a href=\"javascript:;\" class=\"get_update\" data-class=\"' . $row['class_id'] . '\" data-user=\"' . $row['user_id'] . '\">TG No: <span style=\"font-weight:normal;color:#000\">'. $TGNO .' </span> </a>';\n \n $linkStr .= '<br><a href=\"#\"> TG Amt : <span style=\"font-weight:normal;color:#000\"> '.$TGAMT.' </span> </a><br/>';\n }\n \n \n \n if($check_competent>0)\n {\n $linkStr .= '<a href=\"' . base_url() . 'trainee/print_loc/' . $row['class_id'] . '/' . $row['user_id'] . '\">LOC</a><br/>';\n } \n \n }\n else \n {\n if ($row['payment_status'] != 'PYNOTREQD' &&\n $this->user->role_id == 'ADMN') \n {\n $linkStr = '<a href=\"javascript:;\" class=\"get_update\" data-class=\"' . $row['class_id'] . '\" data-user=\"' . $row['user_id'] . '\">TG No: <span style=\"font-weight:normal;color:#000\">'. $TGNO .' </span> </a>';\n\n $linkStr .= '<br><a href=\"#\"> TG Amt : <span style=\"font-weight:normal;color:#000\"> '.$TGAMT.' </span> </a><br/>';\n } \n } \n $linkStr .= get_links($row['enrolment_mode'], $row['payment_status'], $row['invoice_id'], $row['user_id'], $row['pymnt_due_id'], $row['class_id'], $this, $row['account_status'], $row['cc_class_status'],$row['company_id'],$row['att_status']);\n } \n $new_tabledata[$k]['action_link'] = $linkStr;\n $new_tabledata[$k]['referrer'] = $row['referral_details'];// referrer details\n if($row['friend_id']!=''){\n $new_tabledata[$k]['friend_id'] = $row['friend_id']; \n $res = $check_attendance=$this->classtraineemodel->get_friend_details($tenant_id,$row['course_id'],$row['class_id'],$row['user_id'],$row['friend_id']);\n $new_tabledata[$k]['friend_details'] = $res;\n \n }\n \n }\n $this->db->cache_off();\n \n \n \n }\n $data['tabledata'] = $new_tabledata;\n $data['sort_order'] = $order_by;\n $data['controllerurl'] = 'class_trainee/online_trainee/';\n $this->load->helper('pagination');\n if ($sort_url) \n {\n $pag_sort = $order_by . '&' . $sort_url;\n } \n else \n {\n $pag_sort = $order_by;\n }\n \n// $data['trainee_count'] = $totalrows;\n $total_trainee_enrolled = $this->classtraineemodel->get_total_enrolled_trainee($tenant_id);\n $data['trainee_count'] = $total_trainee_enrolled ? $total_trainee_enrolled : 00;\n $data['pagination'] = get_pagination($records_per_page, $pageno, $baseurl, $totalrows, $field, $pag_sort);\n $data['page_title'] = 'Online Class Trainee';\n $data['main_content'] = 'classtrainee/onlinetraineelist';\n $this->load->view('layout', $data);\n \n }", "public function Get_Dept_Course($department_id,$semester_id)\n {\n $DATA = array();\n $sql = \"SELECT DISTINCT c.`course_id`,c.`course_name_en`,c.`course_name_th`,c.`credit` FROM `department_course_responsible` dc, `course` c\n WHERE c.`course_id` = dc.`course_id` AND dc.`department_id` = '\".$department_id.\"'\";\n if($semester_id != 'all')\n {\n $sql .= \" AND dc.`semester_id` = \".$semester_id;\n }\n $sql .= \" ORDER BY c.`course_id` ASC\";\n $result = $this->DB->Query($sql);\n\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n $course['id'] = $result[$i]['course_id'];\n $course['name'] = $result[$i]['course_name_en'];\n $course['name_th'] = $result[$i]['course_name_th'];\n $course['credit'] = $result[$i]['credit'];\n $staff = $this->Get_Responsible_Teacher($course['id'],$semester_id);\n $course['teacher'] = $staff['teacher'];\n $course['assessor'] = $staff['assessor'];\n array_push($DATA,$course);\n }\n return $DATA;\n }\n else if ($result == null)\n {\n return null;\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่สามารถค้นหาข้อมูลได้ กรุณาติดต่อผู้ดูแลระบบ';\n return $return;\n }\n\n }", "public function frontpage_available_courses() {\n global $CFG, $DB;\n\n $chelper = new coursecat_helper();\n $chelper->set_show_courses(self::COURSECAT_SHOW_COURSES_EXPANDED)->set_courses_display_options(array(\n 'recursive' => true,\n 'limit' => $CFG->frontpagecourselimit,\n 'viewmoreurl' => new moodle_url('/course/index.php'),\n 'viewmoretext' => new lang_string('fulllistofcourses')));\n\n $chelper->set_attributes(array('class' => 'frontpage-course-list-all'));\n $courses = core_course_category::get(0)->get_courses($chelper->get_courses_display_options());\n $totalcount = core_course_category::get(0)->get_courses_count($chelper->get_courses_display_options());\n if (!$totalcount &&\n !$this->page->user_is_editing() &&\n has_capability('moodle/course:create', \\context_system::instance())\n ) {\n // Print link to create a new course, for the 1st available category.\n return $this->add_new_course_button();\n }\n $latestcard = get_config('theme_remui', 'enablenewcoursecards');\n $coursehtml = '<div class=\"\">\n <div class=\"card-deck slick-course-slider slick-slider ' . ($latestcard ? 'latest-cards' : '') . '\">';\n\n if (!empty($courses)) {\n foreach ($courses as $course) {\n $coursesummary = strip_tags($chelper->get_course_formatted_summary(\n $course,\n array('overflowdiv' => false, 'noclean' => false, 'para' => false)\n ));\n $coursesummary = strlen($coursesummary) > 100 ? substr($coursesummary, 0, 100).\"...\" : $coursesummary;\n $image = \\theme_remui_coursehandler::get_course_image($course, 1);\n $coursename = strip_tags($chelper->get_course_formatted_name($course));\n if (!$latestcard) {\n $coursehtml .= \"\n <div class='card w-100 rounded-bottom mx-0 bg-transparent d-inline-flex flex-column' style='height: 100%;'>\n <div class='m-2 bg-white border' style='height: 100%;'>\n <div\n class='rounded-top'\n style='height: 200px;\n background-image: url({$image});\n background-size: cover;\n background-position: center;\n box-shadow: 0 2px 5px #cccccc;'>\n </div>\n <div class='card-body p-3'>\n <h4 class='card-title m-1 ellipsis ellipsis-2'>\n <a\n href='{$CFG->wwwroot}/course/view.php?id={$course->id}'\n class='font-weight-400 blue-grey-600 font-size-18'>\n {$coursename}\n </a>\n </h4>\n <p class='card-text m-1'>{$coursesummary}</p>\n </div>\n </div>\n </div>\";\n } else {\n if (isset($course->startdate)) {\n $startdate = date('d M, Y', $course->startdate);\n $day = substr($startdate, 0, 2);\n $month = substr($startdate, 3, 3);\n $year = substr($startdate, 8, 4);\n }\n $categoryname = $DB->get_record('course_categories', array('id' => $course->category))->name;\n $categoryname = strip_tags(format_text($categoryname));\n $coursehtml .= \"\n <div class='px-1 course_card card '>\n <div class='wrapper h-100'\n style='background-image: url({$image});\n background-size: cover;\n background-position: center;\n position: relative;'>\n <div class='date btn-primary'>\n <span class='day'>{$day}</span>\n <span class='month'>{$month}</span>\n <span class='year'>{$year}</span>\n </div>\n <div class='data'>\n <div class='content' title='{$coursename}'>\n <span class='author'>{$categoryname}</span>\n <h4 class='title ellipsis ellipsis-3' style='-webkit-box-orient: vertical;visibility: visible;'>\n <a href='{$CFG->wwwroot}/course/view.php?id={$course->id}'>{$coursename}</a>\n </h4>\n <p class='text'>{$coursesummary}</p>\n </div>\n </div>\n </div>\n </div>\";\n }\n }\n }\n\n $coursehtml .= '</div></div>';\n\n $coursehtml .= \" <div class='available-courses button-container w-100 text-center '>\n <button type='button' class='btn btn-floating btn-primary btn-prev btn-sm'>\n <i class='icon fa fa-chevron-left' aria-hidden='true'></i>\n </button>\n <button type='button' class='btn btn-floating btn-primary btn-next btn-sm'>\n <i class='icon fa fa-chevron-right' aria-hidden='true'></i>\n </button>\n </div>\";\n\n $coursehtml .= \"\n <div class='row'>\n <div class='col-12 text-right'>\n <a href='{$CFG->wwwroot}/course' class='btn btn-primary'>\" . get_string('viewallcourses', 'core').\"</a>\n </div>\n </div>\";\n\n return $coursehtml;\n }", "public function course_details_by_id_get($user_id = \"\", $course_id = \"\") {\n\t\t$course_details = $this->crud_model->get_course_by_id($course_id)->result_array();\n\t\t$response = $this->course_data($course_details);\n\t\tforeach ($response as $key => $resp) {\n\t\t\t$response[$key]['sections'] = $this->sections_get($course_id);\n\t\t\t$response[$key]['is_wishlisted'] = $this->is_added_to_wishlist($user_id, $course_id);\n\t\t\t$response[$key]['includes'] = array(\n\t\t\t\t$this->crud_model->get_total_duration_of_lesson_by_course_id($course_id).' '.get_phrase('on_demand_videos'),\n\t\t\t\t$this->crud_model->get_lessons('course', $course_id)->num_rows().' '.get_phrase('lessons'),\n\t\t\t\tget_phrase('high_quality_videos'),\n\t\t\t\tget_phrase('life_time_access'),\n\t\t\t);\n\t\t}\n\t\treturn $response;\n\t}", "function iadlearning_get_instances_course($id) {\n global $DB;\n\n return $DB->get_records('iadlearning', array('course' => $id));\n\n}", "public static function getMyCourses($id,$needCourseDetail=True)\r\n { \r\n $courses = MyCourses::where('user_id', '=', $id)->get();\r\n foreach ($courses as &$value) {\r\n unset($value->updated_at);\r\n unset($value->created_at);\r\n $enrollment = Enrollment::where('user_id',$id)->where('course_id',$value->course_id)->first();\r\n if($needCourseDetail) {\r\n $course = Course::find($value->course_id);\r\n $value->name = $course->name;\r\n $value->shortDescription = $course->shortDescription;\r\n $value->price = $course->price;\r\n }\r\n if($enrollment) {\r\n $value->enrollment_status = $enrollment->status;\r\n $value->enrollment_status_updated_at = $enrollment->updated_at;\r\n $value->enrollment_at = $enrollment->created_at;\r\n }\r\n }\r\n return json_encode($courses);\r\n }", "public function course()\n {\n $input = Input::all();\n \n $data = StudentPackage::orderBy('code', 'ASC');\n\n if( !empty($input['class_id']) ){\n $data->where('class_id', $input['class_id']);\n }\n if( !empty($input['subject_id']) ){\n $data->where('subject_id', $input['subject_id']);\n }\n if( !empty($input['level_id']) ){\n $data->where('level_id', $input['level_id']);\n }\n if( !empty($input['package_id']) ){\n $data->where('package_id', $input['package_id']);\n }\n $data = $data->paginate(PAGINATE);\n return View::make('admin.schedule.course')->with(compact('data'));\n }" ]
[ "0.669923", "0.6453347", "0.63746977", "0.6349463", "0.6286662", "0.6282747", "0.6271205", "0.6240696", "0.61871415", "0.6159901", "0.6111983", "0.6074421", "0.60493916", "0.60340744", "0.5996027", "0.59930396", "0.598645", "0.59315735", "0.59141916", "0.5912604", "0.58902156", "0.5865261", "0.58642673", "0.58605254", "0.5849527", "0.58429635", "0.58221155", "0.5818925", "0.5792276", "0.5788726", "0.57829034", "0.578263", "0.5776991", "0.577467", "0.57739335", "0.57722664", "0.5764909", "0.5758156", "0.5757987", "0.5754533", "0.5748575", "0.573253", "0.5728281", "0.57146984", "0.5714274", "0.57129484", "0.57005966", "0.56908965", "0.56878096", "0.56857723", "0.5681159", "0.5674767", "0.5672261", "0.5659167", "0.5652333", "0.5637351", "0.5626889", "0.56244147", "0.56223536", "0.56206524", "0.5610304", "0.5609722", "0.5588937", "0.5584802", "0.55768114", "0.5575759", "0.55702543", "0.5565822", "0.55597633", "0.5554755", "0.55530393", "0.555055", "0.5545801", "0.5531074", "0.5528418", "0.5526528", "0.5525495", "0.5524936", "0.55229616", "0.5514837", "0.54973006", "0.54954994", "0.5489524", "0.5483879", "0.5481764", "0.5478997", "0.547876", "0.5477587", "0.5477587", "0.5477587", "0.5477587", "0.5474597", "0.5473709", "0.5473252", "0.5472951", "0.54656065", "0.546225", "0.54543537", "0.54509294", "0.5446063" ]
0.66849524
1
this ajax function fetches a specific course name based on the id as a get paramter
public function fetch_course_name_for_merging() { $id = $this->input->get("id"); $id = $this->security->xss_clean(htmlspecialchars($id)); if($id==""){ echo "course name was not gotten there seems to be a problem"; }else{ $get_course = $this->admin_student_courses_mdl->course_from_id($id); echo $get_course; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function retrieveName(){\n\t\t$query = \"SELECT cours_id,code,intitule FROM cours WHERE cours_id=\".$this->course_id.\";\";\n\n\t\t$result = mysqli_query($this->link,$query);\n\t\t$data = $result->fetch_assoc();\n\n\t\t//Check if course exists\n\t\tif(is_null($data))\n\t\t{\n\t\t\techo 'Course with specified id does not exist';\n\t\t\techo \"\\n\";\n\t\t\tmysqli_close($this->link);\n\t\t\texit;\n\t\t}\n\n\t\t$this->course['id'] = $this->course_id;\n\t\t$this->course['code'] = $data['code'];\n\t\t$this->course['title'] = $data['intitule'];\n\t}", "function get_course($id = ''){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function getNameOfCoursebyId($id)\n {\n $courses = TableRegistry::getTableLocator()->get('Courses');\n $courses = $courses->find('all')->where(['id' => $id]);\n foreach($courses as $course){\n $course = $course->name;\n echo $course;\n }\n }", "public function course_object_by_id_get() {\n\t\t$course_id = $_GET['course_id'];\n\t\t$course = $this->crud_model->get_course_by_id($course_id)->row_array();\n\t\t$course['requirements'] = json_decode($course['requirements']);\n\t\t$course['outcomes'] = json_decode($course['outcomes']);\n\t\t$course['thumbnail'] = $this->get_image('course_thumbnail', $course['id']);\n\t\tif ($course['is_free_course'] == 1) {\n\t\t\t$course['price'] = get_phrase('free');\n\t\t}else{\n\t\t\tif ($course['discount_flag'] == 1){\n\t\t\t\t$course['price'] = currency($course['discounted_price']);\n\t\t\t}else{\n\t\t\t\t$course['price'] = currency($course['price']);\n\t\t\t}\n\t\t}\n\t\t$total_rating = $this->crud_model->get_ratings('course', $course['id'], true)->row()->rating;\n\t\t$number_of_ratings = $this->crud_model->get_ratings('course', $course['id'])->num_rows();\n\t\tif ($number_of_ratings > 0) {\n\t\t\t$course['rating'] = ceil($total_rating / $number_of_ratings);\n\t\t}else {\n\t\t\t$course['rating'] = 0;\n\t\t}\n\t\t$course['number_of_ratings'] = $number_of_ratings;\n\t\t$instructor_details = $this->user_model->get_all_user($course['user_id'])->row_array();\n\t\t$course['instructor_name'] = $instructor_details['first_name'].' '.$instructor_details['last_name'];\n\t\t$course['total_enrollment'] = $this->crud_model->enrol_history($course['id'])->num_rows();\n\t\t$course['shareable_link'] = site_url('home/course/'.slugify($course['title']).'/'.$course['id']);\n\t\treturn $course;\n\t}", "public function category_wise_course_get() {\n $category_id = $_GET['category_id'];\n $courses = $this->api_model->category_wise_course_get($category_id);\n $this->set_response($courses, REST_Controller::HTTP_OK);\n }", "public function getcoursesByid_course ($id_course){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM courses \";\n $sqlQuery .= \" WHERE id_course=’ $id_course ’ \";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }", "public function getCourse($sql){\n\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n\n if($stmt->rowCount() > 0){\n ?><option value=\"\">Select Course</option><?php\n while($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n ?>\n <option value=\"<?php echo $row['id'] ?>\"><?php echo $row['name']; ?></option>\n <?php\n }\n }\n }", "function getLessonCourseById($lessonId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT Course.name AS courseName, Course.id AS courseId\n\t\tFROM Course INNER JOIN CourseLesson ON CourseLesson.idCourse=Course.id \n\t\tWHERE CourseLesson.idLesson='\". $lessonId . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\treturn \"NO_LESSON_BY_ID\";\n\t\t}else{\n\t\t\t$courseName = $result->fetch_assoc(); \n\t\t\treturn $courseName;\n\t\t}\n\n\t}", "function student_listCourses(){\n\tinclude 'db.php';\n\t$username = filter_var($_GET['val']);\n\n\t$sql = 'SELECT id ,name ,description , image \n \t\t\tFROM courses JOIN idinfo\n \t\tON courses.id = idinfo.coursesID\n \t\tWHERE idinfo.studentID =' . $username . '' ;\n\t\n\t$result = mysqli_query($conn, $sql);\n\n\tif (mysqli_num_rows($result) > 0) {\n\t\t\tforeach($result as $row) {\t\t\t\t\n\t\t\t\techo \"<a href='courses-info.php?val=\". $row['id'] . \"'>\" . \"<div class='wrapp-img-link'>\" .'<img class=\"img-main\" src=\"data:image/jpeg;base64,'.base64_encode( $row['image'] ).'\" alt=\"' . $row['name'] . '\"/>' . \"</div>\". \"course\" . \" \" . $row['name'] . \"</a>\";\n\t\t\t}\n\t} else {\n\t\t\t\techo \"This student is currently not enrolled in any courses\";\n\t\t\t}\n\t\t\t\t\n\n\t}", "public function individualCourse($universityName,$universityId,$courseName,$courseId) {\n\t\t\n\t\t/*\n\t\t$courseDetail = $this->coursemodel->getCounterValue($courseId);\n\t\t$pageCount = $courseDetail[0]['page_count'];\n\t\tif(!empty($courseId)){\n\t\t\t$count = $pageCount + 1;\n\t\t\t$this->coursemodel->countCourses($count,$courseId);\n\t\t}\n\t\t*/\n\t\t\n\t\t$this->db_campaign = $this->ci->load->database('db_campaign', True);\n\t\t$data['totalLeads'] = $this->collegemodel->getCampaignData();\n\t\t$this->db = $this->ci->load->database('default', True);\n\t\t\n\t\t$spclCharUniv = array(\"(\", \")\",\",\",\"'\");\n\t\t\n\t\t//$university_name = str_replace('-',' ',$universityName);\n\t\t$university_name = str_replace($spclCharUniv,'',$universityName);\n\t\t\n\t\t$spclCharCourse = array(\"$\",\"!\",\"_\",\":\");\n\t\t\n\t\t$course_name = str_replace($spclCharCourse,'',$courseName);\n\t\t\n\t\t$course_name = str_replace('&','and',$course_name);\n\t\t\n\t\t$data['active']=\"\";\n\t\t$data['title'] = \"$university_name - $course_name\";\n\t\t$data['keywords'] = \"\";\n\t\t$data['description'] = \"\";\n\t\t$data['universityName'] = $universityName;\n\t\t$data['universityId'] = $universityId;\n\t\t$data['courseName'] = $courseName;\n\t\t$data[\"accreditationData\"] = $this->coursemodel->getAccreditationData($courseId);\n\t\t$data[\"stagesData\"] = $this->coursemodel->getStagesData($courseId);\n\t\t$data[\"degreeClassesData\"] = $this->coursemodel->getDegreeClassesData($courseId);\n\t\t$data[\"continuationData\"] = $this->coursemodel->getContinuationData($courseId);\n\t\t$data[\"employmentData\"] = $this->coursemodel->getEmploymentData($courseId);\n\t\t$data[\"jobData\"] = $this->coursemodel->getJobData($courseId);\n\t\t$data[\"entryData\"] = $this->coursemodel->getEntryData($courseId);\n\t\t$data[\"salaryData\"] = $this->coursemodel->getSalaryData($courseId);\n\t\t$data[\"commonData\"] = $this->coursemodel->getCommonData($courseId);\n\t\t$data[\"tariffData\"] = $this->coursemodel->getTariffData($courseId);\n\t\t$data[\"nssData\"] = $this->coursemodel->getNssData($courseId);\n\t\t///$data[\"countryId\"] = $this->coursemodel->getountryId($universityId);\n\t\t//echo $course_id;exit;\n\t\t//echo \"<pre>\";print_r($data);exit;\n\t\t\n $this->layout->view('course/individualCourse.php', $data);\n }", "public function show($course_id, $id)\n {\n \n }", "abstract protected function getAllByCourse($id);", "public function Get_Course_Name($course_id)\n {\n\n $sql=\"SELECT `course_name_en` FROM `course` WHERE `course_id` ='\".$course_id.\"'\";\n\n $result = $this->DB->Query($sql);\n if($result)\n {\n $course_name = $result[0]['course_name_en'];\n return $course_name;\n }\n else\n {\n return '-';\n }\n //search teacher data\n }", "public function recieveAjax($id, $dept)\n {\n $explode = explode(\" \",$id);\n $level = $explode[0];\n $semester = $explode[1];\n $res = Course::where('Semester', '=', $semester)->where('level', '=', $level)->where('department_id','=', $dept)->get();\n $result= json_encode($res);\n $arraydata = json_decode($result);\n return $arraydata;\n }", "public function course_details_by_id_get($user_id = \"\", $course_id = \"\") {\n\t\t$course_details = $this->crud_model->get_course_by_id($course_id)->result_array();\n\t\t$response = $this->course_data($course_details);\n\t\tforeach ($response as $key => $resp) {\n\t\t\t$response[$key]['sections'] = $this->sections_get($course_id);\n\t\t\t$response[$key]['is_wishlisted'] = $this->is_added_to_wishlist($user_id, $course_id);\n\t\t\t$response[$key]['includes'] = array(\n\t\t\t\t$this->crud_model->get_total_duration_of_lesson_by_course_id($course_id).' '.get_phrase('on_demand_videos'),\n\t\t\t\t$this->crud_model->get_lessons('course', $course_id)->num_rows().' '.get_phrase('lessons'),\n\t\t\t\tget_phrase('high_quality_videos'),\n\t\t\t\tget_phrase('life_time_access'),\n\t\t\t);\n\t\t}\n\t\treturn $response;\n\t}", "function getCourseById($courseId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT Course.name, Course.description, Course.difficulty, Course.popularity, Course.author, Course.creationDate, Course.image, Category.name AS category \n\t\tFROM Course INNER JOIN Category ON Course.CategoryId=Category.id\n\t\tWHERE Course.id='\". $courseId . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\treturn \"NO_COURSE_BY_ID\";\n\t\t}else{\n\t\t\treturn $result->fetch_assoc();\n\t\t}\n\n\t}", "function getCourseByIdValidate(){\n\t\t \n\t\tif(@$this->id != \"\" && @$this->identification != \"\"){\n\t\t\t$this->basics->getCourseById($this->sanitize($this->id), $this->sanitize($this->identification));\n\t\t}else{\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"The Basic Program Blocks seem corrupt. Please Logout then login.\", \"\");\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}\t \n\t\t \n\t}", "function get_course_by_id($course_id) \n\t{\n\t\t// where do i get the $course_id ? Ans: when i call this model function from controller - courses \n\t\t// fetch_record -> row_array()\n\t\treturn $this->db->query('SELECT * FROM courses WHERE id= ?', array($course_id))->row_array();\n\t}", "public function findCourseById($id);", "public static function getCourseName($id)\r\n {\r\n $db = Db::getInstance();\r\n $sql = \"SELECT title, courseCode FROM course WHERE courseID = ?\";\r\n $data = array($id);\r\n $stmt = $db->prepare($sql);\r\n $stmt->execute($data);\r\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\r\n return array(1, $result);\r\n }", "public function getCourses(){\n\n $query = \"SELECT FA.Availability as FAV, FA.TimeStart,FA.TimeEnd, FA.Id, FAA.Availability, FA.CourseID, C.CourseName,C.OfficeHourDay,C.OfficeHourTime, F.AshesiEmail,concat(F.FName,' ',F.LName) as Faculty FROM Registered_Courses R INNER JOIN Courses C on R.CourseID = C.CourseID INNER JOIN Faculty F on R.FacultyID = F.FacultyID INNER JOIN Faculty_Course_Availability FA ON FA.CourseID = R.CourseID\n INNER JOIN Faculty_Arrival FAA ON FAA.FacultyID = R.FacultyID WHERE R.StudentID =:id GROUP BY C.CourseID \";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':id', $this->id);\n $stmt->execute();\n return $stmt;\n }", "public function show()\n\t{\n\t\t$dalCourse = new DALCourse;\n\t\t$result = $dalCourse->get();\n\n\t\t$post = \"\";\n\t\twhile ($res = mysqli_fetch_assoc($result))\n\t\t {\n\n\t\t \t// Extracting varsityId and deptId form varsityDeptId first.\n\t\t\t$dalAssignDept = new DALAssignDept;\n\t\t\t$bllUniversity = new BLLUniversity;\n\t\t\t$bllDepartment = new BLLDepartment;\n\n\t\t \t$varsityId =\"\";\n\t\t \t$deptId =\"\";\n\t\t\t$result2 = $dalAssignDept->getById($res['varsityDeptId']);\n\t\t\twhile ($res2 = mysqli_fetch_assoc($result2)) \n\t\t\t{\n\t\t\t\t$varsityId = $res2['varsityId'];\n\t\t\t\t$deptId = $res2['deptId'];\n\t\t\t}\n\n\t\t \t$post.= '<tr>';\n\t\t\t$post.= '<td>'.$res[\"prefix\"].'</td>';\n\t\t\t$post.= '<td>'.$res['courseNo'].'</td>';\n\t\t\t$post.= '<td>'.$res[\"courseTitle\"].'</td>';\n\t\t\t$post.= '<td>'.$res[\"credit\"].'</td>';\n\t\t\t$post.= '<td>'.$bllUniversity->getName($varsityId).'</td>';\n\t\t\t$post.= '<td>'.$bllDepartment->getName($deptId).'</td>';\n\t\t\t\n\n\t\t\t$post.= '<td class=\"text-right\"><button class=\"btn btn-link\" id=\"btnEdit'.$res[\"id\"].'\" onclick=\"EditCourse('.$res[\"id\"].','.$res[\"yearId\"].','.$res[\"termId\"].','.$varsityId.','.$deptId.','.$res[\"degreeId\"].','.$res[\"prerequisite\"].')\">Edit</button></td>';\n\t\t\t$post.= '<td class=\"text-right\"><button id=\"delete_btn\" class=\"btn btn-link\" onclick=\"delete_btn_click('.$res['id'].',\\'/se/dashboard/bll/bll.course.php\\',\\'submit_delete_course\\')\">Delete</button></td>';\n\t\t\t$post.= '<td style=\"display: none\" id=\"row_id'.$res[\"id\"].'\">'.$res[\"id\"].'</td>';\n\t\t \t$post.= '</tr>';\n\n\t\t }\n\t\t return $post;\n\t}", "public function get_all_courses_by_id($id) {\n $slct_query =\"SELECT * FROM courses WHERE course_id='$id' AND course_deleted='0'\";\n $slct_exe =mysqli_query($GLOBALS['con'],$slct_query) or die(mysqli_error($GLOBALS['con']));\n return $slct_exe;// return the record\n }", "public function my_courses_get() {\n $response = array();\n $auth_token = $_GET['auth_token'];\n $logged_in_user_details = json_decode($this->token_data_get($auth_token), true);\n\n if ($logged_in_user_details['user_id'] > 0) {\n $response = $this->api_model->my_courses_get($logged_in_user_details['user_id']);\n }else{\n\n }\n return $this->set_response($response, REST_Controller::HTTP_OK);\n }", "public function course_request_by_id($request_id){\n\t\t\t$load = new Load();\n\t\t\t$request_model = $load->model('course_request_model');\n\t\t\t$request_info = $request_model->get_all_course_request_by_id('course_request',$request_id);\n \n\t\t\treturn $request_info;\n\t\t}", "public function getCourseById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$return\t\t\t= ($id) ? $db->getRow('tb_course', '*', \"id = {$id}\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function courses( $id ){\r\n $select = \"SELECT `courses`.`id`, `courses`.`name` \r\n FROM `courses`\r\n LEFT JOIN `enrollment`\r\n ON `enrollment`.`course_id` = `courses`.`id`\r\n WHERE `enrollment`.`student_id`=:id\";\r\n $sth = $this->db->pdo->prepare($select );\r\n $sth->bindParam( ':id', $id );\r\n $sth->execute();\r\n $result = $sth->fetchAll( PDO::FETCH_ASSOC );\r\n return $result;\r\n }", "public function findByCourse($id){\n $results = Batch::where('course_id',$id)->get();\n return response()->json($results);\n }", "public function getCourse($id)\n\t\t{\n\t\t\t$query = \"select a.department_id, a.department_name, b.course_id, b.course_name from tbldepartment a inner join tblcourse b where b.department_id = a.department_id && a.department_id = \".$id.\"\";\n\t\t\treturn $this->db->query($query)->result_object();\n\t\t}", "public function course()\n\t{ \n//echo \"<pre>\";print_r($_POST);die;\t\n\t\t$data=$_POST;\n\t\t//$data['action']='get_module';\n\t\t//$data['action']='delete_module';\n\t\t//$data['action']='course';\n\t\t//$data['action']='delete_lession';\n\t\t$action='';\n\t\tif(isset($data['action'])){\n\t\t\t$action=$data['action'];\n\t\t}\n\t\tswitch ($action) {\n\t\tcase 'course':\n\t\t\t$this->add_update_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_module':\n\t\t\t$this->delete_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_lession':\n\t\t\t$this->delete_lession($data);\n\t\t\tbreak;\n\t\tcase 'get_module':\n\t\t\t$this->getMOduleDetailsByModuleId($data);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$result['msg']='Bad request!';\n\t\t\t$returnData['response']=$result;\n\t\t\tdie(json_encode($returnData));\n\t\t}\n\t\t\n\t}", "public static function getCourseData($id)\n {\n global $cont;\n $courseData =$cont->prepare(\"SELECT courses.id AS courseId , courses.title AS title , courses.price AS price , courses.catagory_id AS catId , courses.body AS body , courses.image AS `image` , categories.name AS catName FROM courses INNER JOIN categories ON courses.catagory_id = categories.id WHERE courses.id = ? LIMIT 1 \");\n $courseData->execute([$id]);\n return $courseData->fetchObject();\n }", "function get_course($course)\n{\n $course_id = get_prefix($course).\" \".get_number($course).\" \".get_name($course);\n return $course_id;\n}", "public function retrieveCourseByID($course_id){\n $conn_manager = new ConnectionManager();\n $pdo = $conn_manager->getConnection();\n \n $sql = \"select * from course where course_id=:course_id\";\n $stmt = $pdo->prepare($sql);\n $stmt->bindParam(\":course_id\",$course_id,PDO::PARAM_STR);\n $stmt->execute();\n \n $course = null;\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n if($row = $stmt->fetch()){\n $course = new Course($row[\"course_id\"],$row[\"course_name\"],$row[\"description\"] );\n }\n \n $stmt = null;\n $pdo = null;\n return $course;\n }", "public function getCursos($id){\n\t\treturn $this->query(\"SELECT fullname FROM mdl_course WHERE category = ? \",array($id));\n\t\t\n\t}", "function get_court_by_court_id($court_id)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `courts` WHERE `court_id`='$court_id'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "public static function getMyCourses($id,$needCourseDetail=True)\r\n { \r\n $courses = MyCourses::where('user_id', '=', $id)->get();\r\n foreach ($courses as &$value) {\r\n unset($value->updated_at);\r\n unset($value->created_at);\r\n $enrollment = Enrollment::where('user_id',$id)->where('course_id',$value->course_id)->first();\r\n if($needCourseDetail) {\r\n $course = Course::find($value->course_id);\r\n $value->name = $course->name;\r\n $value->shortDescription = $course->shortDescription;\r\n $value->price = $course->price;\r\n }\r\n if($enrollment) {\r\n $value->enrollment_status = $enrollment->status;\r\n $value->enrollment_status_updated_at = $enrollment->updated_at;\r\n $value->enrollment_at = $enrollment->created_at;\r\n }\r\n }\r\n return json_encode($courses);\r\n }", "function get_course_info($course_id, $field) {\n global $DB;\n $course = $DB->get_record('block_acclaim_courses', array('courseid' => $course_id));\n return empty($course) ? '' : $course->$field;\n }", "function getCourseByPass($conn_moodle,$key){\n\t\t\t$sql = \"select id from mdl_course where idnumber='$key'\";\n\t\t\t$data = $conn_moodle->GetRow($sql);\n\t\t\n\t\t\treturn $data['id'];\n\t\t\t\n\t\t}", "public function actionGet_course() {\n if (isset($_POST['dep_id']) != 0) {\n $output = '';\n $role_id = $_POST['dep_id'];\n\n if (($role_id == '1') || ($role_id == '2') || ($role_id == '7')) {\n $output .= '<div id=\"usercourse\" class=\"\">';\n $output .= '<div class=\"form-group col-md-4 field-dvusers-course\">';\n $output .= '<input name=\"DvUsers[course]\" value=\"\" type=\"hidden\">';\n $output .= '<select id=\"user_course\" class=\"form-control\" name=\"DvUsers[course][]\" multiple=\"multiple\" size=\"4\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select module\">';\n if (($role_id == '1')||($role_id == '2')) {\n $output .= '<option value=\"dm\">DM</option>';\n $output .= '<option value=\"da\">DA</option>';\n } else {\n //added 20 April 2019 By KK / PP\n $course = DvModuleModel::find()->where(['status' => 1])->all();\n $Dv_course = ArrayHelper::map($course, 'id', 'module_name');\n //unset($Dv_course[1]);\n //unset($Dv_course[2]);\n foreach ($Dv_course as $id => $module_name) {\n $output .= '<option value=\"' . $id . '\">' . $module_name . '</option>';\n }\n }\n\n $output .= '</select>';\n $output .= '</div>';\n\n if ($role_id == '7') {\n $output .='<div class=\"form-group col-md-4 field-dvusers-day_avail\">';\n $output .= '<input name=\"DvUsers[day_avail]\" value=\"\" type=\"hidden\">';\n $output .= '<select id=\"dvusers-day_avail\" class=\"form-control\" name=\"usermeta[day_avail][]\" multiple=\"multiple\" size=\"4\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Day Available\">';\n $output .= '<option value=\"sun\">Sunday</option>';\n $output .= '<option value=\"mon\">Monday</option>';\n $output .= '<option value=\"tue\">Tuesday</option>';\n $output .= '<option value=\"wed\">Wednesday</option>';\n $output .= '<option value=\"thur\">Thursday</option>';\n $output .= '<option value=\"fri\">Friday</option>';\n $output .= '<option value=\"sat\">Saturday</option></select>';\n $output .= '</div>';\n $output .= '<div class=\"form-group col-md-4 field-dvusers-coordinator\">';\n $output .= '<select id=\"dvusers-coordinator\" class=\"form-control\" name=\"DvUsers[coordinator]\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Course Coordinator\">';\n $output .= '<option value=\"\">Select Course Coordinator</option></select>';\n $output .= '</div>';\n }\n\n if ($role_id == '7') {\n $output .= '<div class=\"form-group col-md-4\"><input class=\"form-control\" name=\"usermeta[trainerid]\" placeholder=\"TrainerID\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"TrainerID\" readonly=\"readonly\"></div>';\n\n $output .= '<div class=\"form-group col-md-4\"><input class=\"form-control\" name=\"usermeta[compensation]\" placeholder=\"Compensation\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Compensation\" type=\"number\" pattern=\"\\d*\"></div>';\n\n $output .= '<div class=\"form-group col-md-4\"><select class=\"form-control\" name=\"usermeta[module_led]\" placeholder=\"Module to be Led\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Module to be Led\" multiple><option value=\"\">Select any one</option><option value=\"1\">Core</option><option value=\"2\">Special</option></select></div>';\n\n $output .= '<div class=\"form-group col-md-4\"><select class=\"form-control\" name=\"usermeta[profile_visibility]\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Profile Visibility\" ><option value=\"\">Select Profile Visibility</option><option value=\"1\">Publish</option><option value=\"2\">Draft</option></select></div>';\n \n $output .= '<div class=\"form-group col-md-12\"><textarea id=\"usermeta[description]\" name=\"usermeta[description]\" style=\"display:none;\">Brief Description</textarea></div>';\n }\n\n $output .= '</div>';\n } else {\n $output .= '<div id=\"usercourse\" class=\"hide\">';\n $output .= '<input id=\"dvusers-course\" class=\"form-control\" name=\"DvUsers[course]\" value=\"\" type=\"hidden\">';\n $output .= '<input id=\"dvusers-day_avail\" class=\"form-control\" name=\"DvUsers[day_avail]\" value=\"\" type=\"hidden\">';\n $output .= '<input id=\"dvusers-coordinator\" class=\"form-control\" name=\"DvUsers[coordinator]\" value=\"\" type=\"hidden\"></div>';\n }\n\n return $output;\n } else {\n return $this->redirect(['dv-users/index']);\n }\n }", "public function actionCourse($id)\n {\n\t\t$this->subPageTitle = 'Thông tin khóa học';\n $userID = Yii::app()->user->id;\n $course = CourseStudent::model()->checkPermission($userID,$id);\n if($course ==false){\n $this->redirect(array('index'));\n }\n $sessions = $course->getSessions();\n $this->render('course',array(\n \"sessions\"=>$sessions,\n \"course\"=>$course,\n ));\n }", "function getCourse($course_id){\n\t$sql = \"select * from course_details where course_id='$course_id'\";\n\t$result = DBConnection::execQery($sql);\n\treturn $result;\n\n}", "function get_details() { \n global $dbh;\n \n // allow crn or course name to be used in query (currently only crn is being used)\n if (!empty($_GET['crn']) or !empty($_GET['course'])) {\n if (isset($_SESSION['user'])) {\n $query = 'SELECT term_code,crn,concat(subject_code,\" \",course_number) as course,course_title as title,course_description as description,instructors,days1,startend1,loc1,days2,startend2,loc2,days3,startend3,loc3,alt_wed,prereqs,distribution1,distribution2,distribution3,exists(select * from classes_shopped where student_id = ? and term_code = ? and crn = ?) as shopped FROM courses';\n $term = array($_SESSION['user'],$_GET['term_code'],$_GET['crn']);\n } else {\n $query = 'SELECT term_code,crn,concat(subject_code,\" \",course_number) as course,course_title as title,course_description as description,instructors,days1,startend1,loc1,days2,startend2,loc2,days3,startend3,loc3,alt_wed,prereqs,distribution1,distribution2,distribution3 FROM courses';\n $term = array();\n }\n \n // add additional where clause based on data given\n if (!empty($_GET['crn'])) {\n $term[] = $_GET['crn'];\n $query .= ' WHERE CRN = ?';\n } else {\n $course = explode(' ',$_GET['course']);\n $term[] = strtoupper($course[0]);\n $term[] = $course[1];\n $query .= ' WHERE subject_code = ? AND course_number = ?';\n }\n \n $resultset = prepared_query($dbh, $query, $term);\n \n if ($resultset->numRows() == 0) {\n echo \"No course found for \".implode(' ',$term);\n } else { \n $row = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC);\n display_course($row); // format course data\n }\n }\n}", "public function curriculum_course_id($id)\n {\n $usertype = JWTAuth::getPayload()->get('usertype');\n\n if ($usertype != \"staff\") {\n $response = [\n 'status' => 'Error',\n 'result' => 'Permission error'\n ];\n return response()->json($response, 404);\n }\n\n $collection = Curriculum_Course::find($id);\n\n $response = [\n 'status' => 'Success',\n 'result' => $collection\n ];\n\n return response()->json($response, 201);\n }", "public function category_wise_course_get($category_id) {\n\t\t$category_details = $this->crud_model->get_category_details_by_id($category_id)->row_array();\n\n\t\tif ($category_details['parent'] > 0) {\n\t\t\t$this->db->where('sub_category_id', $category_id);\n\t\t}else {\n\t\t\t$this->db->where('category_id', $category_id);\n\t\t}\n\t\t$this->db->where('status', 'active');\n\t\t$courses = $this->db->get('course')->result_array();\n\n\t\t// This block of codes return the required data of courses\n\t\t$result = array();\n\t\t$result = $this->course_data($courses);\n\t\treturn $result;\n\t}", "function theme_moove_get_course_category($id){\n\n global $DB;\n\n $sql_query = \"SELECT category\n FROM {course}\n WHERE id = $id\";\n\n $categoryid = $DB->get_record_sql($sql_query)->category;\n\n return $categoryid;\n }", "function getCourse($cid)\n {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n\n $query = \"SELECT * FROM courses where cid='\".$cid.\"'\";\n $stmt = $mysqli->query($query);\n\n return $stmt;\n \n }", "function get_name($course)\n{\n return $course->name;\n}", "function get_course()\n {\n $this -> db -> select('course_name,course_id,course_status');\n $this -> db -> from('tbl_course');\n $this->db->where('course_status','0');\n //$this->db->where('course_parent', ' ');\n $this->db->order_by('course_name', 'asc');\n $query = $this->db->get();\n return $query->result();\n }", "public function actionGet($id) {\n $lang = Yii::app()->language;\n $field = 'title_' . $lang;\n $model = AddressCity::model()->findByPk($id);\n $result = ['id' => $model->id, 'title' => $model->$field];\n $this->renderPartial('//ajax/json', ['body' => json_encode($result, JSON_FORCE_OBJECT)]);\n }", "public function getById($id)\n {\n $qr = $this->db->query(\"Select * from $this->table where id = $id\");\n $course = $qr->first_row(\"array\");\n return $course;\n }", "public function getCoursesByFieldId($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$table\t\t\t= 'tb_course';\n\t\t\t$select_what\t= 'id, vc_course AS vc_name';\n\t\t\t$conditions\t\t= \"id_field = {$id} ORDER BY vc_course ASC\";\n\t\t\t$return\t\t\t= ($id) ? $db->getAllRows_Arr($table, $select_what, $conditions) : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function Get_All_Course($dept_id)\n {\n $sql = \"SELECT `course_id`as id,`course_name_en` as name_en,`course_name_th`as name_th,`credit` FROM `course`\";\n if($dept_id != 'all')\n {\n $sql .=\" WHERE `department_id` = '\".$dept_id.\"'\";\n }\n $sql.=\" ORDER BY `course_id` ASC\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n $data = array();\n for($i=0;$i<count($result);$i++)\n {\n $course['id'] = $result[$i]['id'];\n $course['name']['en'] = $result[$i]['name_en'];\n $course['name']['th'] = $result[$i]['name_th'];\n $course['credit'] = $result[$i]['credit'];\n array_push($data,$course);\n }\n return $data;\n }\n else\n {\n $this->LOG->Write(\"Error course : search all course failed\");\n return false;\n }\n }", "public function show(Course $course, $id)\n {\n //\n }", "public static function showCourses($id)\n {\n global $cont;\n $courses = $cont->prepare(\"SELECT courses.id AS courseId , courses.title AS title , courses.price AS price , courses.body AS body , courses.image AS `image` , categories.name AS catName FROM courses INNER JOIN categories ON courses.catagory_id = categories.id WHERE categories.id = ?\");\n $courses->execute([$id]);\n return $courses->fetchAll();\n }", "public function actionGet_course_trainer() {\n if (isset($_POST['dep_id']) != 0) {\n $output = '';\n $role_id = $_POST['dep_id'];\n\n if (($role_id == '1') || ($role_id == '2') || ($role_id == '7')) {\n $output .= '<div id=\"usercourse\" class=\"\">';\n $output .= '<div class=\"form-group col-md-4 field-dvusers-course\">';\n $output .= '<input name=\"DvUsers[course]\" value=\"\" type=\"hidden\">';\n $output .= '<select id=\"user_course\" class=\"form-control\" name=\"DvUsers[course][]\" multiple=\"multiple\" size=\"4\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Course\">';\n if (($role_id == '1')||($role_id == '2')) {\n $output .= '<option value=\"dm\">DM</option>';\n $output .= '<option value=\"da\">DA</option>';\n } else {\n $course = DvCourse::find()->where(['status' => 1])->all();\n $Dv_course = ArrayHelper::map($course, 'id', 'name');\n unset($Dv_course[1]);\n unset($Dv_course[2]);\n foreach ($Dv_course as $id => $name) {\n $output .= '<option value=\"' . $id . '\">' . $name . '</option>';\n }\n }\n\n $output .= '</select>';\n $output .= '</div>';\n\n if ($role_id == '7') {\n $output .='<div class=\"form-group col-md-4 field-dvusers-day_avail\">';\n $output .= '<input name=\"DvUsers[day_avail]\" value=\"\" type=\"hidden\">';\n $output .= '<select id=\"dvusers-day_avail\" class=\"form-control\" name=\"usermeta[day_avail][]\" multiple=\"multiple\" size=\"4\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Day Available\">';\n $output .= '<option value=\"sun\">Sunday</option>';\n $output .= '<option value=\"mon\">Monday</option>';\n $output .= '<option value=\"tue\">Tuesday</option>';\n $output .= '<option value=\"wed\">Wednesday</option>';\n $output .= '<option value=\"thur\">Thursday</option>';\n $output .= '<option value=\"fri\">Friday</option>';\n $output .= '<option value=\"sat\">Saturday</option></select>';\n $output .= '</div>';\n $output .= '<div class=\"form-group col-md-4 field-dvusers-coordinator\">';\n $output .= '<select id=\"dvusers-coordinator\" class=\"form-control\" name=\"DvUsers[coordinator]\" required=\"required\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Course Coordinator\">';\n $output .= '<option value=\"\">Select Course Coordinator</option></select>';\n $output .= '</div>';\n }\n\n $output .= '<div class=\"form-group col-md-4\"><input class=\"form-control\" name=\"usermeta[trainerid]\" placeholder=\"TrainerID\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"TrainerID\"></div>';\n\n $output .= '<div class=\"form-group col-md-4\"><input class=\"form-control\" name=\"usermeta[compensation]\" placeholder=\"Compensation\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Compensation\"></div>';\n\n $output .= '<div class=\"form-group col-md-4\"><select class=\"form-control\" name=\"usermeta[module_led]\" placeholder=\"Module to be Led\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Module to be Led\"><option value=\"\">Select any one</option><option value=\"1\">Core</option><option value=\"2\">Special</option></select></div>';\n\n $output .= '<div class=\"form-group col-md-12\"><textarea id=\"usermeta[description]\" name=\"usermeta[description]\">Brief Description</textarea></div>';\n\n $output .= '</div>';\n } else {\n $output .= '<div id=\"usercourse\" class=\"hide\">';\n $output .= '<input id=\"dvusers-course\" class=\"form-control\" name=\"DvUsers[course]\" value=\"\" type=\"hidden\">';\n $output .= '<input id=\"dvusers-day_avail\" class=\"form-control\" name=\"DvUsers[day_avail]\" value=\"\" type=\"hidden\">';\n $output .= '<input id=\"dvusers-coordinator\" class=\"form-control\" name=\"DvUsers[coordinator]\" value=\"\" type=\"hidden\"></div>';\n }\n\n return $output;\n } else {\n return $this->redirect(['dv-users/index']);\n }\n }", "public function edit($id)\n {\n //$course=course::findOrFail($id);\n \n $course=DB::table('courses')\n ->where('courses.id',$id)->join('classes','classes.id','courses.class_id')->join('users','users.id','courses.instructor_id')\n ->select('courses.*','classes.class_name','users.first_name','users.last_name')\n ->first();\n $userData['data'] = $course;\n // dd($userData);\n echo json_encode($userData);\n exit;\n \n//return view('courses.update_course')->with('course',$course)->with('classes',classes::all())->with('users',User::all());\n }", "public function viewCourse()\n {\n $courseID = SCMUtility::cleanText($_GET['courseID']);\n\n // get the current logged in user\n if(Session::isLoggedIn())\n {\n // get current logged in user\n $current_user_id = Session::getCurrentUserID();\n $user = User::with('courses')->find($current_user_id);\n\n // check if the course being vied is already on his enrolled courses so we can flash a message\n if( $user->isAlreadyEnrolledToCourse($courseID) )\n {\n SCMUtility::setFlashMessage('You have already enrolled to this course.','info');\n }\n }\n\n // get course meta info\n $data = Course::with('students')->find($courseID);\n\n if( ! $data )\n {\n View::make('templates/system/error.php',array());\n return;\n }\n\n $data = $data->toArray();\n\n View::make('templates/front/course-view.php',compact('data'));\n }", "public function getCourseInfo($training_id) {\n\t\tif(!$training_id) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$select = $this->select()\n\t\t->from($this->_name, array('training_title_option_id'))\n\t\t->setIntegrityCheck(false)\n\t//\t->join(array('c' => 'course'), \"$this->_name.training_title_option_id = c.id\",'training_title_option_id')\n\t\t->join(array('t' => 'training_title_option'), \"training_title_option_id = t.id\",'training_title_phrase')\n\t\t->where(\"$this->_name.id = $training_id\");\n\n\t\treturn $this->fetchRow($select);\n\t}", "private function getCourseSection() {\n $this->openConn();\n\n $courseID = $_POST['courseID'];\n\n $sql = \"SELECT Course.courseID, subject, courseNum,\n Section.sectionID, secNo, daysMet, startTime, endTime, totalEnrolment\n FROM Course, Section\n LEFT JOIN SectionTA ON Section.sectionID = SectionTA.sectionID\n LEFT JOIN TA ON SectionTA.taID = TA.taID\n LEFT JOIN Student ON TA.sID = Student.sID\n LEFT JOIN UserAccount ON Student.uID = UserAccount.uID\n WHERE Section.courseID = Course.courseID\n and Course.courseID = :courseID\";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute(array(':courseID'=>$courseID));\n\n $this->results = \"\";\n // Loop through every row\n while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $subject = $row['subject'];\n $courseNum = $row['courseNum'];\n $sectionID = $row['sectionID'];\n $secNo = $row['secNo'];\n $daysMet = $row['daysMet'];\n $startTime = $row['startTime'];\n $endTime = $row['endTime'];\n $totalEnrolment = $row['totalEnrolment'];\n\n\n //display rows\n $this->results = $this->results .'\n <tr class=\"lab-info-row\" name='.$sectionID.'>\n <td><input id=\"sectioncheckbox\" type=\"checkbox\"></td>\n <td id=\"lab-id\" >'.$secNo.'</td>\n <td id=\"lab-time\">'.$daysMet.' | '.$startTime.' - '.$endTime.'</td>\n <td id=\"lab-num\">'.$totalEnrolment.'</td>\n </tr>';\n }\n\n $this->closeConn();\n return $this->results;\n\n }", "public function course_details($id){\n\n $Courses = Courses::where('id', $id)->first();\n return view('UI.course_details', compact('Courses'));\n\n }", "public function getCourseByCodeObject($id) {\n $mount = \\DB::table('subjectallocations')->where('id',$id)->first();\n \n $course = \\DB::table('courses')->where('code',$id)->first();\n \n return @$course;\n }", "function get_court_by_court_name($court_name)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `courts` WHERE `court_name`='$court_name'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "function getteachcourses_get(){\n $teaching = $this->get('teachingID');\n // $startdate = $this->get(\"startdate\");\n // if($startdate >= $datetime){\n // }\n $result = $this->lecturers_model->getteachcoursesmodel($teaching);\n\n $this->response($result);\n }", "function AssignCourse()\n\t{\t$this->resource = new AdminCourseResource($_GET[\"id\"]);\n\t\tif ($this->resource->id)\n\t\t{\t$this->course = new AdminCourse($this->resource->details[\"cid\"]);\n\t\t} else\n\t\t{\t$this->course = new AdminCourse($_GET[\"cid\"]);\n\t\t}\n\t}", "public function show($id)\n {\n $course = Course::find($id);\n if ($course != NULL) {\n return response()->json($course);\n }\n return \"No existe un curso con esa ID.\";\n }", "public function get_id_code_name($id)\n {\n if($id==\"\"){\n $slct_qry=\"SELECT course_id,course_code,course_title FROM courses WHERE course_deleted='0'\";\n $exe_qry=mysqli_query($GLOBALS['con'],$slct_qry) or die(mysqli_error($GLOBALS['con']));\n } else {\n $slct_qry=\"SELECT course_id,course_code,course_title FROM courses WHERE course_id = $id AND course_deleted='0'\";\n $exe_qry=mysqli_query($GLOBALS['con'],$slct_qry) or die(mysqli_error($GLOBALS['con']));\n }\n return $exe_qry;\n }", "function listallcourse(){\n\t$unregisteredList = new ManageCourses;\n\t$queryResult = $unregisteredList->allcourses();\n\tif($queryResult){\n\t\techo \"<table>\";\n\t\techo \"<tr> <th> Course Code </th> <th> Course Name </th> <th> Course Year </th><th> Action </th></tr>\";\n\t\twhile ($row = $unregisteredList->fetch()) {\n\t\t\t$id = $row['courseid'];\n\t\t\techo \"<tr><td>\";\n\t\t\techo $row['coursecode'];\n\t\t\techo \"</td><td>\";\n\t\t\techo $row['coursename'];\n\t\t\techo \"</td><td>\";\n\t\t\techo $row['courseyear'];\n\t\t\techo \"</td><td>\";\n\t\t\techo '<form action=\"\" method=\"POST\" style=\"background-color: transparent;\">';\n\t\t echo '<input type=\"hidden\" name=\"courseid\" value=\"'.$row['courseid'].'\">';\n\t\t echo '<input type=\"hidden\" name=\"coursename\" value=\"'.$row['coursename'].'\">';\n\t echo '<button type=\"submit\" class=\"btn btn-danger\" name=\"delcourse\" value=\"'.$row['courseid'].'\">Delete</button>'. ' ';\n\t echo '<button type=\"submit\" class=\"btn btn-primary\" name=\"editcourse\" value=\"'.$row['courseid'].'\">Edit</button></form>';\n\t\t\techo \"</td></tr>\";\n\t\t\t//echo '<input type=\"checkbox\" name=\"username\" value=\"'.$row[\"courseid\"].'\">'. $row[\"coursename\"].' <br>';\n\t\t}\n\t\techo \"</table>\";\n\t}\n}", "public function retrieve_userid_course($userid, $course)\n {\n $sql = 'SELECT * FROM `section-student` WHERE `userid`=:userid AND `course` = :course ORDER BY `userid` ';\n\n $connMgr = new ConnectionManager();\n $conn = $connMgr->getConnection();\n\n $stmt = $conn->prepare($sql);\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $stmt->bindParam(':userid', $userid, PDO::PARAM_STR);\n $stmt->bindParam(':course', $course, PDO::PARAM_STR);\n $stmt->execute();\n\n $result = FALSE;\n\n if ($row = $stmt->fetch()) {\n $result = new SectionStudent($row['userid'], $row['course'], $row['section'], $row['amount']);\n }\n\n $stmt = null;\n $conn = null;\n\n return $result;\n }", "function getCourseLessonsById($courseId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT Lesson.name, Lesson.guide, Lesson.video\n\t\tFROM CourseLesson INNER JOIN Lesson ON CourseLesson.idLesson=Lesson.id\n\t\tWHERE CourseLesson.idCourse='\". $courseId . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\techo \"Error selecting \" . $courseId . \" details\";\n\t\t}else{\n\t\t\treturn $result->fetch_assoc();\n\t\t}\n\n\t}", "function subjectName($id){\n\t$con = mysqli_connect('localhost','root','','e-examsproject');\n\t$subject_query_with_id = mysqli_query($con,\"SELECT * FROM subjects where id = '\".$id.\"' \");\n\t$subject_query_with_id_result = mysqli_fetch_all($subject_query_with_id,MYSQLI_ASSOC);\n\t\n\treturn $subject_query_with_id_result[0]['name'];\n}", "public function getCoursesByInstructor($id)\n {\n $courses = $this->coursesService->getCoursesByInstructor($id);\n $statuscode = ($courses) ? 200 : 404;\n $allData = [];\n $allData['status'] = ($courses) ? true : false;\n $allData['message'] = ($courses) ? 'All Courses' : 'No courses Found';\n $allData['errors'] = [];\n $allData['data'] = $courses;\n\n return response()->json($allData,$statuscode);\n }", "public function edit($id)\n {\n return response()->json(Course::findOrFail($id));\n }", "public function getCoursesInsideGroup()\n {\n $groupId = $this->input->post(\"groupId\");\n $courses = $this->Group_Model->getCoursesInsideGroup($groupId);\n echo json_encode($courses);\n }", "public function getCVWorksById()\n\t{\n\t\ttry {\n\t\t\tif(Request::ajax()){\n\t\t\t\t$id = Input::get(\"id\");\n\t\t\t\t$cvWorksItems = CvArtist::getCVWorksItems($id);\n\t\t\t\treturn Response::json(array('success' => true, 'cvWorksItems' => $cvWorksItems));\n\t\t\t} else{\n\t\t\t\treturn Response::json(array('success' => false, 'msg' => 'No se ha podido enviar su mensaje'));\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\treturn \"Ha ocurrido un error inesperado - \".$e->getMessage();\n\t\t}\n\t}", "function echoMyCourseSelect($tea_id){\r\n\tglobal $db;\r\n\t$course_id=NULL;\r\n\techo '<select name=\"pro_id\" required id=\"course_list\">';\r\n\r\n\t$sql=\"SELECT *\r\n\tfrom project\r\n\twhere tea_id = $tea_id\";\r\n\r\n\t$result = $db->query($sql);\r\n\tif ($result->num_rows == 0) {\r\n\t\techo \"<option>Please add your course first</option>\";\r\n } else {\r\n\t\twhile($row = $result->fetch_array(MYSQLI_ASSOC)){\r\n\t\t\t$course_id = $row['course_id'] ;\r\n\t\t\t$course_name = getCourseName($course_id);\r\n\t\t\t$status= ($row['status']=='on')?'未结课':(($row['status']=='off')?'已结课':'');\r\n\t\t\t\r\n\t\t\techo \"<option value='\".$row['pro_id'].\"'>\" \r\n\t\t\t. $course_name.\",\"\r\n\t\t\t. $row['year'].\"学年,第\"\r\n\t\t\t. $row['term'].\"学期-\"\r\n\t\t\t. $row['stu_grade'].\"-\"\r\n\t\t\t. $row['stu_major'].\"-\"\r\n\t\t\t. $status\r\n\t\t\t. \"</option>\";\r\n\t\t}\r\n\t}\r\n\r\n\techo '</select>';\r\n}", "public function get($id){\n $data = StudentToCourse::select()->where('student_id',$id)->get();\n return response()->json(['success'=>1,'data'=>$data],200,[],JSON_NUMERIC_CHECK);\n\n }", "function AssignCourse()\n\t{\t$this->date = new AdminCourseDate($_GET['id']);\n\t\tif ($this->date->id)\n\t\t{\t$this->course = new AdminCourse($this->date->details['cid']);\n\t\t} else\n\t\t{\t$this->course = new AdminCourse($_GET['cid']);\n\t\t}\n\t}", "public function cboCourse(){\n\t\t$db = new connectionClass();\n\n\t\t$sql = $db->query(\"SELECT * FROM cursos\");\n\t\t$numberRecord = $sql->num_rows;\n\n\t\tif ($numberRecord != 0) {\n\t\t\t$dataArray = array();\n\t\t\t$i = 0;\n\n $dataArray[$i] = array(\"id\" => '0' , \"descripcion\" => 'Curso');\n\n\t\t\twhile($data = $sql->fetch_assoc()){\n $i++;\n\t\t\t\t$dataArray[$i] = array(\"id\" => $data['idCurso'], \"descripcion\" => $data['nombreCurso']);\n\t\t\t}\n\n\t\t\theader(\"Content-type: application/json\");\n\t\t\treturn json_encode($dataArray);\n\t\t}\n\t}", "function teacher_get_own_course($tea_id){\r\n\tglobal $db;\r\n\t$course_id=NULL;\r\n\techo '<select name=\"pro_id\" required onchange=\"showAddedDate(this.value)\" id=\"course_list\">';\r\n\r\n\t$sql=\"SELECT pro_id,stu_grade,stu_major,course_id \r\n\tfrom project\r\n\twhere tea_id = $tea_id\";\r\n\r\n\t// ** test if_condition is work ir not\r\n\t// $sql=\"SELECT course_name from course where course_id in(\r\n\t// SELECT course_id from project where tea_id = 0\r\n\t// )\";\r\n\r\n\t$result = $db->query($sql);\r\n\tif ($result->num_rows == 0) {\r\n\t\techo \"<option>Please set your course first</option>\";\r\n } else {\r\n\t\twhile($row = $result->fetch_array(MYSQLI_ASSOC)){\r\n\t\t\t$course_id = $row['course_id'] ;\r\n\r\n\t\t\t$sql2=\"SELECT course_name\r\n\t\t\tfrom course\r\n\t\t\twhere course_id = '$course_id' \";\r\n\t\t\t$result2 = $db->query($sql2);\r\n\t\t\t$row2 = $result2->fetch_array(MYSQLI_ASSOC);\r\n\r\n\t\t\techo \"<option value='\".$row['pro_id'].\"'>\" \r\n\t\t\t. $row['stu_grade'].\"-\"\r\n\t\t\t. $row['stu_major'].\"-\"\r\n\t\t\t. $row2['course_name'] \r\n\t\t\t. \"</option>\";\r\n\t\t}\r\n\t}\r\n\r\n\techo '</select>';\r\n}", "function iadlearning_get_instances_course($id) {\n global $DB;\n\n return $DB->get_records('iadlearning', array('course' => $id));\n\n}", "public function add_courses()\n {\n if ($this->input->is_ajax_request()) {\n\n $process = $this->M_Courses->add_courses();\n $courses = 'courses';\n if ($process) {\n echo json_encode([\n 'status' => true,\n 'message' => $this->lang->line('success_add_courses')\n ]);\n } else {\n echo json_encode([\n 'status' => false,\n 'message' => $this->lang->line('failed_add_courses')\n ]);\n }\n } else {\n redirect(base_url());\n }\n }", "public function Get_Dept_Course($department_id,$semester_id)\n {\n $DATA = array();\n $sql = \"SELECT DISTINCT c.`course_id`,c.`course_name_en`,c.`course_name_th`,c.`credit` FROM `department_course_responsible` dc, `course` c\n WHERE c.`course_id` = dc.`course_id` AND dc.`department_id` = '\".$department_id.\"'\";\n if($semester_id != 'all')\n {\n $sql .= \" AND dc.`semester_id` = \".$semester_id;\n }\n $sql .= \" ORDER BY c.`course_id` ASC\";\n $result = $this->DB->Query($sql);\n\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n $course['id'] = $result[$i]['course_id'];\n $course['name'] = $result[$i]['course_name_en'];\n $course['name_th'] = $result[$i]['course_name_th'];\n $course['credit'] = $result[$i]['credit'];\n $staff = $this->Get_Responsible_Teacher($course['id'],$semester_id);\n $course['teacher'] = $staff['teacher'];\n $course['assessor'] = $staff['assessor'];\n array_push($DATA,$course);\n }\n return $DATA;\n }\n else if ($result == null)\n {\n return null;\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่สามารถค้นหาข้อมูลได้ กรุณาติดต่อผู้ดูแลระบบ';\n return $return;\n }\n\n }", "public function show($id)\n {\n $course = Course::with('categorie')->find($id);\n\n if($course)\n {\n return response()->json([\n 'course' => $course\n ], 200);\n }\n else\n {\n return response()->json([\n 'error' => 'ce cours n\\'éxiste pas ! ' \n ], 404);\n }\n }", "public function getInfoTemplate($course_id) {\n }", "function single_course_id($data)\n {\n $this->db->select('*');\n $this->db->from('tbl_course');\n $this->db->where('course_id', $data);\n $query = $this->db->get();\n return $query->result() ;\n }", "public function edit($id)\n {\n\n if (!Gate::allows('course_edit')) {\n return abort(401);\n }\n\n $coursesRaw = Course::all();\n $allLearned = [];\n foreach ($coursesRaw as $course) {\n if ($course->learned && $course->learned != 'null') {\n foreach (json_decode($course->learned) as $learnItem) {\n $allLearned[$learnItem] = $learnItem;\n }\n }\n }\n $allLearned_ar = [];\n foreach ($coursesRaw as $course) {\n if ($course->learned_ar && $course->learned_ar != 'null') {\n foreach (json_decode($course->learned_ar) as $learnItem) {\n $allLearned_ar[$learnItem] = $learnItem;\n }\n }\n }\n $allAcademies = User::role('academy')->with('academy')->get();\n $academies = [];\n foreach ($allAcademies as $academy) {\n $academies[$academy->id] = $academy->full_name;\n }\n $teachersToSelect = [];\n $status = true;\n $selectedTeachers = $course->teachers->pluck('id')->toArray();\n\n \n\n $allTeachers = User::role('teacher')->select('ar_first_name', 'ar_last_name', 'first_name', 'last_name', 'id')->get();\n \n foreach ($allTeachers as $key => $teacher) {\n\n $teachersToSelect[$teacher->id] = $teacher->full_name;\n \n if( in_array( $teacher->id, $selectedTeachers)){\n \n }\n }\n \n $allCategories = Category::where('status', '=', 1)->get();\n $categoriesToSelect = [];\n foreach ($allCategories as $key => $category) {\n $categoriesToSelect[$category->id] = $category->getDataFromColumn('name');\n }\n $allCourses = Course::pluck('title', 'id');\n\n $course = Course::findOrFail($id);\n $date = $course->date ? json_decode($course->date, true) : null;\n\n $date = json_decode($date, true);\n //dd($date) ;\n //dd(json_decode($date,true));\n\n $opt_courses = $course->optional_courses ? json_decode($course->optional_courses) : null;\n\n $mand_courses = $course->mandatory_courses ? json_decode($course->mandatory_courses) : null;\n $learned = $course->learned ? json_decode($course->learned) : null;\n $prevLearned = [];\n if ($learned != null) {\n foreach ($learned as $key => $value) {\n $prevLearned[$value] = $value;\n }\n }\n $learned_ar = $course->learned_ar ? json_decode($course->learned_ar) : null;\n $prevLearned_ar = [];\n if ($learned_ar != null) {\n foreach ($learned_ar as $key => $value) {\n $prevLearned_ar[$value] = $value;\n }\n }\n\n $courseEduSemIDs = CourseEduStatgeSem::where('course_id',$id)->pluck('edu_statge_sem_id');\n\n $semesterIds = EduStageSemester::wherein('id',$courseEduSemIDs)->pluck('semester_id');\n\n // $semesters = Semester::wherein('id',$semesterIds)->get();\n\n $eduStatgeIDs = EduStageSemester::wherein('id',$courseEduSemIDs)->pluck('edu_stage_id');\n\n $eduStatges = EduStage::wherein('id',$eduStatgeIDs)->get();\n\n $allEducationStatges = EduStage::get();\n\n $eduSystemIds = $eduStatges->pluck('edu_system_id');\n $allEduSystems = EduSystem::select('id','en_name')->get();\n $allEduSystems =$allEduSystems;\n $allEduSystems2 = [];\n foreach($allEduSystems as $index => $EduSystem){\n $allEduSystems2[]=[$allEduSystems[$index]->id,$allEduSystems[$index]->en_name];\n\n }\n $allEduSystems->toJson();\n // return $allEduSystems;\n $allYears = Year::get();\n $yearsToSelect = [];\n foreach ($allYears as $key => $year) {\n $yearsToSelect[$year->id] = $year->year;\n }\n \n $edusystemdata = EduSystem::wherein('id',$eduSystemIds)->get();\n $country_id = $edusystemdata->pluck('country_id');\n $country = Country::where('id',$country_id)->get();\n $countriesToSelect = [];\n $countries = Country::get();\n foreach ($countries as $key => $country) {\n $countriesToSelect[$country->id] = $country->getDataFromColumn('name');\n }\n $courseTimeLine = CourseTimeline::where('course_id', $id)->with(['model'])->orderBy('sequence', 'asc')->get();\n $courseSequence = [];\n foreach ($courseTimeLine as $key => $item) {\n if ($item->model_type == Chapter::class) {\n $courseChapter[$item->id] = $item;\n $courseChapter[$item->id]['childs'] = CourseTimeline::where('course_id', $id)\n ->where('chapter_id', $item->model_id)\n ->whereIn('model_type', [Lesson::class,Test::class])\n ->orderBy('sequence', 'asc')->get();\n array_push($courseSequence, $courseChapter[$item->id]);\n }\n }\n $videos = Media::where('type', 'upload')->where('model_id', null)->orWhere('model_id', $id)->pluck('file_name', 'id');\n $notSelectedVideos = Media::where('type', 'upload')->where('model_id', null)->pluck('file_name', 'id');\n if (count($videos) == 0 || count($notSelectedVideos) == 0) {\n $videos = ['' => 'No videos available'];\n $notSelectedVideos = ['' => 'No videos available'];\n }\n return view('backend.courses.edit', compact( 'semesterIds','yearsToSelect','eduSystemIds','allEducationStatges','courseEduSemIDs','allEduSystems','allEduSystems2','eduStatgeIDs','countriesToSelect','country_id','notSelectedVideos', 'courseSequence', 'videos', 'teachersToSelect', 'categoriesToSelect', 'course', 'opt_courses', 'mand_courses', 'allCourses', 'prevLearned', 'prevLearned_ar', 'allLearned', 'allLearned_ar', 'academies', 'date'));\n\n\n }", "public function edit($course_id, $id)\n {\n \n }", "public function getCourse( $name )\n\t{\n\n\t\t$course = Course::getByName($name);\n\n\t\tself::addArgument('hashid', Hashids::encode($course->id));\n\n\t\tself::addArgument('course', $course);\n\t\t\n\t\tself::addArgument('sidebar_closed', true);\n\n\t\treturn self::make('show');\n\n\t}", "function getCourseCategoryByCategoryId($id){\n\n $select=$this->select()->where(\" categoryid = ?\",$id);\n return $this->fetchAll($select)->toArray();\n }", "public function updatecourse($id)\n {\n \n }", "public function show(Request $request, $id)\n {\n $id = base64_decode(urldecode($id));\n return Courses::where('id',$id)->with('getCategory')->first(); \n // return Courses::findOrFail($id);\n }", "function getTitleOfAds(){\n if(isset($_GET['cat_id'])){\n global $con;\n if($_GET['cat_id'] != 'all'){\n $cat_id = $_GET['cat_id'];\n $query = $con->prepare(\"SELECT cat_title FROM categories where cat_id = '$cat_id'\");\n $query->execute();\n $result = $query->fetch(PDO::FETCH_ASSOC);\n $cat_title = $result['cat_title'];\n echo $cat_title;\n }\n else{\n echo \"كل الإعلانات\";\n }\n }\n}", "private function get_course_id($param = '')\r\n\t{\r\n\t\treturn $this->db->get_where('course', array('course_code' => $param))->row('course_id');\r\n\t}", "public function get_student_details_by_id($type = \"\", $id = \"\") {\n\t\t$enrol_data = array();\n\t\tif ($type == \"section\") {\n\t\t\t$checker = array(\n\t\t\t\t'section_id' => $id,\n\t\t\t\t'session' => $this->active_session,\n\t\t\t\t'school_id' => $this->school_id\n\t\t\t);\n\t\t\t$enrol_data = $this->db->get_where('enrols', $checker)->result_array();\n\t\t\tforeach ($enrol_data as $key => $enrol) {\n\t\t\t\t$student_details = $this->db->get_where('students', array('id' => $enrol['student_id']))->row_array();\n\t\t\t\t$enrol_data[$key]['code'] = $student_details['code'];\n\t\t\t\t$enrol_data[$key]['user_id'] = $student_details['user_id'];\n\t\t\t\t$enrol_data[$key]['parent_id'] = $student_details['parent_id'];\n\t\t\t\t$user_details = $this->db->get_where('users', array('id' => $student_details['user_id']))->row_array();\n\t\t\t\t$enrol_data[$key]['name'] = $user_details['name'];\n\t\t\t\t$enrol_data[$key]['email'] = $user_details['email'];\n\t\t\t\t$enrol_data[$key]['role'] = $user_details['role'];\n\t\t\t\t$enrol_data[$key]['address'] = $user_details['address'];\n\t\t\t\t$enrol_data[$key]['phone'] = $user_details['phone'];\n\t\t\t\t$enrol_data[$key]['birthday'] = $user_details['birthday'];\n\t\t\t\t$enrol_data[$key]['gender'] = $user_details['gender'];\n\t\t\t\t$enrol_data[$key]['blood_group'] = $user_details['blood_group'];\n\n\t\t\t\t$class_details = $this->crud_model->get_class_details_by_id($enrol['class_id'])->row_array();\n\t\t\t\t$section_details = $this->crud_model->get_section_details_by_id('section', $enrol['section_id'])->row_array();\n\n\t\t\t\t$enrol_data[$key]['class_name'] = $class_details['name'];\n\t\t\t\t$enrol_data[$key]['section_name'] = $section_details['name'];\n\t\t\t}\n\t\t}\n\t\telseif ($type == \"class\") {\n\t\t\t$checker = array(\n\t\t\t\t'class_id' => $id,\n\t\t\t\t'session' => $this->active_session,\n\t\t\t\t'school_id' => $this->school_id\n\t\t\t);\n\t\t\t$enrol_data = $this->db->get_where('enrols', $checker)->result_array();\n\t\t\tforeach ($enrol_data as $key => $enrol) {\n\t\t\t\t$student_details = $this->db->get_where('students', array('id' => $enrol['student_id']))->row_array();\n\t\t\t\t$enrol_data[$key]['code'] = $student_details['code'];\n\t\t\t\t$enrol_data[$key]['user_id'] = $student_details['user_id'];\n\t\t\t\t$enrol_data[$key]['parent_id'] = $student_details['parent_id'];\n\t\t\t\t$user_details = $this->db->get_where('users', array('id' => $student_details['user_id']))->row_array();\n\t\t\t\t$enrol_data[$key]['name'] = $user_details['name'];\n\t\t\t\t$enrol_data[$key]['email'] = $user_details['email'];\n\t\t\t\t$enrol_data[$key]['role'] = $user_details['role'];\n\t\t\t\t$enrol_data[$key]['address'] = $user_details['address'];\n\t\t\t\t$enrol_data[$key]['phone'] = $user_details['phone'];\n\t\t\t\t$enrol_data[$key]['birthday'] = $user_details['birthday'];\n\t\t\t\t$enrol_data[$key]['gender'] = $user_details['gender'];\n\t\t\t\t$enrol_data[$key]['blood_group'] = $user_details['blood_group'];\n\n\t\t\t\t$class_details = $this->crud_model->get_class_details_by_id($enrol['class_id'])->row_array();\n\t\t\t\t$section_details = $this->crud_model->get_section_details_by_id('section', $enrol['section_id'])->row_array();\n\n\t\t\t\t$enrol_data[$key]['class_name'] = $class_details['name'];\n\t\t\t\t$enrol_data[$key]['section_name'] = $section_details['name'];\n\t\t\t}\n\t\t}\n\t\telseif ($type == \"student\") {\n\t\t\t$checker = array(\n\t\t\t\t'student_id' => $id,\n\t\t\t\t'session' => $this->active_session,\n\t\t\t\t'school_id' => $this->school_id\n\t\t\t);\n\t\t\t$enrol_data = $this->db->get_where('enrols', $checker)->row_array();\n\t\t\t$student_details = $this->db->get_where('students', array('id' => $enrol_data['student_id']))->row_array();\n\t\t\t$enrol_data['code'] = $student_details['code'];\n\t\t\t$enrol_data['user_id'] = $student_details['user_id'];\n\t\t\t$enrol_data['parent_id'] = $student_details['parent_id'];\n\t\t\t$user_details = $this->db->get_where('users', array('id' => $student_details['user_id']))->row_array();\n\t\t\t$enrol_data['name'] = $user_details['name'];\n\t\t\t$enrol_data['email'] = $user_details['email'];\n\t\t\t$enrol_data['role'] = $user_details['role'];\n\t\t\t$enrol_data['address'] = $user_details['address'];\n\t\t\t$enrol_data['phone'] = $user_details['phone'];\n\t\t\t$enrol_data['birthday'] = $user_details['birthday'];\n\t\t\t$enrol_data['gender'] = $user_details['gender'];\n\t\t\t$enrol_data['blood_group'] = $user_details['blood_group'];\n\n\t\t\t$class_details = $this->crud_model->get_class_details_by_id($enrol_data['class_id'])->row_array();\n\t\t\t$section_details = $this->crud_model->get_section_details_by_id('section', $enrol_data['section_id'])->row_array();\n\n\t\t\t$enrol_data['class_name'] = $class_details['name'];\n\t\t\t$enrol_data['section_name'] = $section_details['name'];\n\t\t}\n\t\treturn $enrol_data;\n\t}", "public function render($id, $mode)\n {\n\n\n $conditions = array('WHERE' => array(\"ID\" => \"$id\"), 'ORDER' => 'Subject');\n $json = makeRequest($conditions);\n\n $course = $json[0];\n $subjects = array(\"T\" => \"Sport\", \"M\" => \"Mathematik\", \"D\" => \"Deutsch\", \"B\" => \"Biologie\", \"P\" => \"Physik\", \"BG\" => \"Bildnerisches Gestalten\", \"RL\" => \"Religion\", \"GR\" => \"Griechisch\", \"L\" => \"Lateinisch\", \"SP\" => \"Spanisch\", \"IT\" => \"Italienisch\", \"G\" => \"Geschichte\", \"GG\" => \"Geografie\", \"MU\" => \"Musik\", \"E\" => \"Englisch\", \"F\" => \"Französisch\", \"C\" => \"Chemie\", \"AM\" => \"Angewandte Mathematik\", \"AC\" => \"Anwendungen des Computers\", \"\");\n\n switch ($mode) {\n case \"secretary\":\n $course->Label = $subjects[$course->Subject] . \" (\" . $course->Teacher . \") [\" . $course->Class . \"]\";\n break;\n\n case \"teacher\":\n $course->Label = $subjects[$course->Subject] . \" (\" . $course->Class . \")\";\n break;\n\n case \"student\":\n $course->Label = $subjects[$course->Subject].\" (\".$course->Teacher.\")\";\n break;\n }\n\n\n return $course->Label;\n\n\n }", "public static function sq_selectSubjectsCourse()\n {\n return \"SELECT corsi.PK_id, corsi.nome AS c_name, lauree.nome AS l_name\n FROM corsi INNER JOIN lauree ON corsi.FK_laurea = lauree.PK_id\";\n }", "public function getCourse($start,$limit,$sidx,$sord,$where) {\n\t\t$access_type = $this->db->get_where('users', array('id' => $this->session->userdata('user_id'), 'email' => $this->session->userdata('email'))) -> row_array();\n\n\t\t\tif($access_type['acsess_to'] == \"ATC\") {\n\t\t\t\t$this->db->select('ac.*, cc.course_name, cc.course_description, cc.course_status, ccc.course_category, ccc.course_category_description');\n\t\t\t\t$this->db->limit($limit);\n\t\t\t\t$this->db->join('cdac_courses cc', 'cc.course_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->join('cdac_courses_category ccc', 'ccc.course_category = cc.course_category', 'left');\n\t\t\t\t//$this->db->join('cdac_course_modules ccm', 'ccm.course_code = cc.course_code', 'left');\n\t\t\t\t$this->db->where('ac.entity_code', $access_type['entity_code']);\n\t\t\t\tif($where != NULL)$this->db->where($where,NULL,FALSE);\n\t\t\t $this->db->order_by($sidx.\" \".$sord);\n\t\t\t\t$data = $this->db->get('atc_courses ac',$limit,$start);\n\t\t\t} else if($access_type['acsess_to'] == \"ARC\") {\n\t\t\t\t$this->db->select('ac.*, cc.course_name, cc.course_description, cc.course_status, ccc.course_category, ccc.course_category_description');\n\t\t\t\t$this->db->limit($limit);\n\n\t\t\t\t$this->db->join('cdac_courses cc', 'cc.course_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->join('cdac_courses_category ccc', 'ccc.course_category = cc.course_category', 'left');\n\t\t\t\t$this->db->join('cdac_entities ce', 'ce.entity_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->where('ce.entity_parent_code', $access_type['entity_code']);\n\t\t\t\tif($where != NULL)$this->db->where($where,NULL,FALSE);\n\t\t\t $this->db->order_by($sidx.\" \".$sord);\n\t\t\t\t$data = $this->db->get('atc_courses ac',$limit,$start);\n\t\t\t} else if($access_type['acsess_to'] == \"CDAC\") {\n\t\t\t\t$this->db->select('ac.*, cc.course_name, cc.course_description, cc.course_status, ccc.course_category, ccc.course_category_description');\n\t\t\t\t$this->db->limit($limit);\n\t\t\t\t$this->db->join('cdac_courses cc', 'cc.course_code = ac.entity_code', 'left');\n\t\t\t\t$this->db->join('cdac_courses_category ccc', 'ccc.course_category = cc.course_category', 'left');\n\t\t\t\t//$this->db->join('cdac_course_modules ccm', 'ccm.course_code = cc.course_code', 'left');\n\t\t\t\tif($where != NULL)$this->db->where($where,NULL,FALSE);\n\t\t\t $this->db->order_by($sidx.\" \".$sord);\n\t\t\t\t$data = $this->db->get('atc_courses ac',$limit,$start);\n\t\t\t}\n\n\t\t\t//echo \"==========>>>>>>>>>>>>>>>>>>> <pre>\". $this->db->last_query(); print_r($data->result()); exit;\n\t\t\treturn $data->result();\n\t\t\t\n\t}", "function getCourseCategoryByCourseId($id){\n $select=$this->select()->where(\" courseid = ?\",$id);\n return $this->fetchAll($select)->toArray();\n }", "public function actionCourses()\n\t{\n\t\t//echo \"In Courses\";\n\t\tif (!isset($_REQUEST['username'])){\n\t\t\t$_REQUEST['username'] = Yii::app()->user->name;\n\t\t}\n\t\t//if (!Yii::app()->user->checkAccess('admin')){\n\t\t//\t$this->model=User::model()->findByPk(Yii::app()->user->name);\n\t\t//} else {\n\t\t\t$this->model = DrcUser::loadModel();\n\t\t\t//}\n\t\t//$title = \"Title\";\n\t\t//$contentTitle = \"Courses: title\";\n\t\t$title = \"({$this->model->username}) {$this->model->first_name} {$this->model->last_name}\";\n\t\t$contentTitle = \"Courses: {$this->model->term->description}\";\n\t\tif (!Yii::app()->user->checkAccess('admin') && !Yii::app()->user->checkAccess('staff')){\n\t\t\t$title = $this->model->term->description;\n\t\t\t$contentTitle = \"Courses\";\n\t\t}\n\t\t$this->renderView(array(\n\t\t\t'title' => $title,\n\t\t\t'contentView' => '../course/_list',\n\t\t\t'contentTitle' => $contentTitle,\n\t\t\t'menuView' => 'base.views.layouts._termMenu',\n\t\t\t'menuRoute' => 'drcUser/courses',\n\t\t\t'titleNavRight' => '<a href=\"' . $this->createUrl('drcUser/update', array('term_code'=> $this->model->term_code, 'username'=>$this->model->username)) . '\"><i class=\"icon-plus\"></i> User Profile</a>',\n\t\t));\n\t}", "public static function glueserver_get_url_course($urlid, $courseid){\n\t\tglobal $DB,$CFG;\n \n $sql = \"SELECT url.*\n FROM {$CFG->prefix}url url\n WHERE url.id = ? AND course = ?\";\n $sqlparams = array($urlid, $courseid);\n return $DB->get_records_sql($sql, $sqlparams);\t\n }" ]
[ "0.7151769", "0.6881356", "0.6790038", "0.6713046", "0.6632258", "0.6587846", "0.6493558", "0.64224267", "0.63592136", "0.63252246", "0.6270154", "0.62516433", "0.6241985", "0.6225451", "0.621234", "0.6210548", "0.61982703", "0.6194064", "0.6175547", "0.61040205", "0.609663", "0.6091311", "0.60882545", "0.6079481", "0.60761935", "0.6072291", "0.60682803", "0.606816", "0.60560155", "0.60232586", "0.60189074", "0.59849876", "0.5976361", "0.59470737", "0.5934845", "0.59212816", "0.59204507", "0.591384", "0.591089", "0.58713835", "0.5869773", "0.58516634", "0.58488107", "0.5845688", "0.5789209", "0.57855165", "0.57809806", "0.5779444", "0.5778183", "0.576866", "0.5760669", "0.5757174", "0.57532775", "0.5749669", "0.5748932", "0.5741293", "0.5710803", "0.5705332", "0.57029694", "0.5694495", "0.5693906", "0.56911653", "0.56792134", "0.5676207", "0.5674679", "0.56601316", "0.56576216", "0.5656327", "0.5653165", "0.56471884", "0.5629593", "0.5626298", "0.5624822", "0.5611876", "0.5610836", "0.5608266", "0.5606297", "0.5601088", "0.5589032", "0.5588", "0.5584629", "0.55749536", "0.5574721", "0.5571699", "0.55678827", "0.5556644", "0.55531645", "0.5530954", "0.55303717", "0.5530308", "0.55268186", "0.55259746", "0.55240566", "0.5513804", "0.55120885", "0.55105335", "0.55102503", "0.5508639", "0.5489341", "0.5482107" ]
0.7466677
0
this ajax function adds a new merged course it:
public function add_new_merge() { $course_name = $this->input->post("course_name"); $class_name = $this->input->post("class_name"); $course_name = $this->security->xss_clean($this->authadmin->sanitize_string($course_name)); $class_name = $this->security->xss_clean($this->authadmin->sanitize_string($class_name)); if($course_name==""){ echo "please be sure to select a course"; }else if($class_name==""){ echo "class name cannot be left empty"; }else{ $check_course_name = $this->admin_student_courses_mdl->check_course($course_name); if($check_course_name==0){ echo "proccess was uncessful because this course doesnt exist in the database"; }else{ $check_class_name = $this->admin_classes_mdl->check_classes($class_name); if($check_class_name==0){ echo "proccess was uncessful because this class doesnt exist in the database"; }else{ $check_if_pair_exist = $this->admin_student_courses_mdl->check_if_pair_exist($course_name, $class_name); if($check_if_pair_exist==TRUE){ echo "this course and class have already been merged"; }else{ $this->admin_student_courses_mdl->merge_new_course($course_name, $class_name); echo "merge process was successfull"; } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_courses()\n {\n if ($this->input->is_ajax_request()) {\n\n $process = $this->M_Courses->add_courses();\n $courses = 'courses';\n if ($process) {\n echo json_encode([\n 'status' => true,\n 'message' => $this->lang->line('success_add_courses')\n ]);\n } else {\n echo json_encode([\n 'status' => false,\n 'message' => $this->lang->line('failed_add_courses')\n ]);\n }\n } else {\n redirect(base_url());\n }\n }", "public function addCourse()\n {\n Logger::Log(\n 'starts POST AddCourse',\n LogLevel::DEBUG\n );\n\n $body = $this->app->request->getBody();\n\n $course = Course::decodeCourse($body);\n\n foreach ( $this->_createCourse as $_link ){\n $result = Request::routeRequest(\n 'POST',\n '/course',\n array(),\n Course::encodeCourse($course),\n $_link,\n 'course'\n );\n\n // checks the correctness of the query\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $this->app->response->setStatus( 201 );\n if ( isset( $result['headers']['Content-Type'] ) )\n $this->app->response->headers->set(\n 'Content-Type',\n $result['headers']['Content-Type']\n );\n\n } else {\n\n /* if ($course->getId()!==null){\n $this->deleteCourse($course->getId());\n }*/\n\n Logger::Log(\n 'POST AddCourse failed',\n LogLevel::ERROR\n );\n $this->app->response->setStatus( isset( $result['status'] ) ? $result['status'] : 409 );\n $this->app->response->setBody( Course::encodeCourse( $course ) );\n $this->app->stop( );\n }\n }\n\n $this->app->response->setBody( Course::encodeCourse( $course ) );\n }", "function addcourse($id = NULL) {\n\t\t\n\t\t\n\t/*\techo '<pre>';\n\t\t\n\t\tprint_r($this->data['TutCourse']['course_id']);*/\n\t\t\n\t\t$uniquecourse = array_unique($this->data['TutCourse']['course_id']);\n\t\t\n\t\t$cntcourse = count($this->data['TutCourse']['course_id']);\n\t\t$cntunqcourse = count($uniquecourse);\n\t\t\n\t\t\n\t\tif($cntunqcourse < $cntcourse)\n\t\t{\n\t\t\t$this->Session->setFlash('There are duplicate courses.');\n\t\t\t$this->redirect($this->referer());\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$this->layout = '';\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t//pr($this->data);\n\t\t//echo $id;\n\t\tif ($id != \"\") {\n\t\t\t$this->TutCourse->deleteAll(array(\n\t\t\t\t'TutCourse.member_id' => $this->Session->read('Member.memberid')\n\t\t\t));\n\t\t}\n\t\t//die;\n\t\t$i = 0;\n\t\tforeach ($this->data['TutCourse']['course_id'] as $data) {\n\t\t\t$mySaving['TutCourse']['school_id'] = $this->data['TutCourse']['school_id'];\n\t\t\t$mySaving['TutCourse']['course_id'] = $this->data['TutCourse']['course_id'][$i];\n\t\t\t$mySaving['TutCourse']['rate'] = $this->data['TutCourse']['rate'][$i];\n\t\t\t$mySaving['TutCourse']['member_id'] = $this->Session->read('Member.memberid');\n\t\t\t$db = $this->TutCourse->getDataSource();\n\t\t\t$mySaving['TutCourse']['created'] = $db->expression(\"NOW()\");\n\t\t\tif ($mySaving['TutCourse']['course_id']) {\n\t\t\t\t$this->TutCourse->create();\n\t\t\t\t$saved = $this->TutCourse->save($mySaving['TutCourse']);\n\t\t\t}\n\t\t\t$i++;\n\t\t\t\n\t\t}\n\t\tif ($saved) {\n\t\t\t$this->Session->setFlash('Your courses has been saved successfully');\n\t\t\t\n\t\t\t$this->Member->updateAll(array(\n\t\t\t\t'Member.school_id' => \"'\" . $this->data['TutCourse']['school_id'] . \"'\"\n\t\t\t), array(\n\t\t\t\t'Member.id' => $this->Session->read('Member.memberid')\n\t\t\t));\n\t\t\t\n\t\t\t\n\t\t\t$this->redirect(array(\n\t\t\t\t'controller' => 'members',\n\t\t\t\t'action' => 'tutor_dashboard'\n\t\t\t));\n\t\t} else {\n\t\t\t$this->redirect(array(\n\t\t\t\t'controller' => 'members',\n\t\t\t\t'action' => 'tutor_dashboard'\n\t\t\t));\n\t\t}\n\t\t\n\t}", "function add(){\n\n $this->layout = 'ajax';\n $comptypeId = $this->params['form']['comptypeId'];\n $distroId = $this->params['form']['distroId'];\n\n $updsource = '';\n $keyring = '';\n $u_keyring = '';\n $common = '';\n $specific = '';\n \n\n if(array_key_exists('updateSource',$this->params['form'])){\n $updsource = $this->params['form']['updateSource'];\n $keyring = $this->params['form']['updateKeyring'];\n $u_keyring = $this->params['form']['updateUdebKeyring'];\n }else{ //We assume it is a network type\n $common = $this->params['form']['updateCommon'];\n $specific = $this->params['form']['updateSpecific'];\n }\n\n //Get the name of the component\n $name_q = $this->Componenttype->find('first',array('conditions' => array('Componenttype.id' => $comptypeId),'fields'=>array('Componenttype.name')));\n $name = $name_q['Componenttype']['name'];\n\n //---------------------------------------------------\n //Add the component\n $d = array();\n $d['Distrocomponent']['id'] = '';\n $d['Distrocomponent']['componenttype_id'] = $comptypeId;\n $d['Distrocomponent']['distribution_id'] = $distroId;\n $d['Distrocomponent']['updsource'] = $updsource;\n $d['Distrocomponent']['dir_common'] = $common;\n $d['Distrocomponent']['dir_specific'] = $specific;\n $d['Distrocomponent']['keyring'] = $keyring;\n $d['Distrocomponent']['u_keyring'] = $u_keyring;\n\n $this->Distrocomponent->save($d);\n $comp_id = $this->Distrocomponent->id;\n //----------------------------------------------------------\n\n\n //----Specific for the Reprepro component---\n //Get the repository name + arch of the repoarch\n $distro_ret = $this->Distribution->find('first',array('conditions'=>array('Distribution.id' =>$distroId),'fields'=>array('Repoarches.id','Distribution.name')));\n $ra_id = $distro_ret['Repoarches']['id'];\n $distro_name = $distro_ret['Distribution']['name']; //Need this\n\n $repoarch_ret = $this->Repoarch->find('first',array('conditions'=>array('Repoarch.id' =>$ra_id),'fields' =>array('Repository.name','Architecture.name')));\n $repo_name = $repoarch_ret['Repository']['name']; //Need this\n $arch_name = $repoarch_ret['Architecture']['name']; //Need this\n //---------------------------------------------------------\n\n\n //------------------------------------------------------\n $udeb = false;\n if(array_key_exists('updateInstaller',$this->params['form'])){\n\n $udeb = true;\n }\n\n $compdata = array('repo' => $repo_name,'arch' =>$arch_name,'distro' =>$distro_name,'comp' => $name,'source' => $updsource,'udeb' =>$udeb);\n $this->Reprepro->compAdd($compdata);\n //-------------------------------------------------------\n\n\n //--------------------------------------------\n $json_return = array();\n $json_return['json']['status'] = 'ok'; \n //$json_return['json']['status'] = 'error';\n //$json_return['json']['detail'] = \"UP Source $updsource CD $common_dir SP $specific_dir\";\n $json_return['component']['name'] = $name;\n $json_return['component']['id'] = $comp_id;\n $this->set('json_return',$json_return);\n //--------------------------------------------\n\n }", "public function save_course_request(){\n\t\t\n\t\t\t$user_id = get_current_user_id();\n\t\t\t$course_id = (int)$_REQUEST['course_id'];\n\t\t\t$group_leader_id = (int)$_REQUEST['group_leader_id'];\n\t\t\t$request_text = $_REQUEST['request_text'];\n\t\t\t$status = $_REQUEST['request_status'];\n\t\t\t \n\t\t\t$data \t = array();\n\t\t\t$data['user_id'] \t = $user_id;\n\t\t\t$data['course_id']\t = $course_id;\n\t\t\t$data['request_text'] = $request_text;\n\t\t\t$data['request_status']= $status;\n\t\t\t$load = new Load();\n\t\t\t$typeModel = $load->model('course_request_model');\n\t\t\t$success_insert = $typeModel->save_course_request('course_request' , $data);\n\t\t\t$msg = array();\n\t\t\tif($success_insert){\n\t\t\t\t$msg['success_msg'] = \"Data has been added\";\n\t\t\t\t$course_link = get_permalink($course_id);\n\t\t\t\twp_redirect($course_link.'?msg='.$msg['success_msg']);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$msg['error_msg'] = \"Cannot added data to server\";\n\t\t\t\t$course_link = get_permalink($course_id);\n\t\t\t\twp_redirect($course_link.'?msg='.$msg['error_msg']);\n\t\t\t}\n\t\t}", "public function add_course()\n {\n $course_name = $this->input->post(\"course_name\");\n if($course_name==\"\"){\n echo \"please course/subject section is empty\";\n }else{\n $courses = $data = $this->security->xss_clean($course_name);\n $courses = $this->authadmin->sanitize_string($course_name);\n $total = $this->admin_student_courses_mdl->check_course($course_name);\n if($total==0){\n $data = array(\n 'course_name' => $course_name,\n );\n $this->admin_student_courses_mdl->add_course($data);\n echo \"new course/subject successfully added\"; \n }else{\n echo \"this course/subject already exist\";\n }\n }\n }", "function add_course(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "private function addSection() {\n // courseid, secNo, daysMet, startTime, endTime, totalReleasedSeats, building, room\n\n $courseID = $_POST['courseID'];\n $secNo = $_POST['secNo'];\n $daysMet = $_POST['daysMet'];\n $startTime = $_POST['startTime'];\n $endTime = $_POST['endTime'];\n $totalReleasedSeats = $_POST['totalReleasedSeats'];\n $building = $_POST['building'];\n $room = $_POST['room'];\n\n $this->openConn();\n\n $sql = \"SELECT DISTINCT term, secStartDate, secEndDate, sessionYear, sessionCode FROM Section WHERE courseID = :courseID\";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute(array(':courseID'=> $courseID));\n\n while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $term = $row['term'];\n $secStartDate = $row['secStartDate'];\n $secEndDate = $row['secEndDate'];\n $sessionYear = $row['sessionYear'];\n $sessionCode = $row['sessionCode'];\n }\n\n $totalEnrolment = 0;\n $isOptimized = 0;\n $secType = \"LAB\";\n\n // if($row){\n //\n // }\n\n $sql2 = \"INSERT INTO Section (courseID, secNo, daysMet, startTime, endTime, totalReleasedSeats, totalEnrolment, building, room,\n term, isOptimized, secStartDate, secEndDate, sessionYear, sessionCode, secType)\n VALUES (:courseID, :secNo, :daysMet, :startTime, :endTime, :totalReleasedSeats, :totalEnrolment, :building, :room,\n :term, :isOptimized, :secStartDate, :secEndDate, :sessionYear, :sessionCode, :secType)\";\n $stmt2 = $this->conn->prepare($sql2);\n $stmt2->execute(array(':courseID'=> $courseID, ':secNo'=> $secNo, ':daysMet'=> $daysMet, ':startTime'=> $startTime, ':endTime'=> $endTime, ':totalReleasedSeats'=> $totalReleasedSeats, ':totalEnrolment'=> $totalEnrolment, ':building'=> $building, ':room'=> $room,\n ':term'=> $term, ':isOptimized'=> $isOptimized, ':secStartDate'=> $secStartDate, ':secEndDate'=> $secEndDate, ':sessionYear'=> $sessionYear, ':sessionCode'=> $sessionCode, ':secType'=> $secType));\n\n $this->closeConn();\n\n }", "public static function addCourse()\n {\n global $cont;\n if(!empty($_POST['script']))\n {\n session_start();\n $_SESSION['message'] = \"you are script\";\n header(\"location:../admin/pages/forms/add-course.php\");\n die();\n }\n $title = $_POST['title'];\n $price = $_POST['price'];\n $body = $_POST['body'];\n $categoryId = $_POST['cat_id'];\n \n $imageName = $_FILES['image']['name'];\n $imageType = $_FILES['image']['type'];\n $imageTmp = $_FILES['image']['tmp_name'];\n \n\n $imageExt = Courses::checkImageExt($imageType); \n\n if($imageExt == 0 )\n {\n session_start();\n $_SESSION['error'] = \"U Must Upload Correct File\";\n header(\"location:../admin/pages/forms/add-course.php\");\n die();\n }\n\n \n $imageLink = dirname(__FILE__) . \"/../admin/pages/upload/courses/\";\n\n $avatarName = Courses::chekImageExist(time() . \"_\" . $imageName);\n\n move_uploaded_file($imageTmp , $imageLink.$avatarName);\n\n\n $courses = $cont->prepare(\"INSERT INTO courses(title , price , `image` , body , catagory_id) VALUES (? , ? , ? , ? , ?) \");\n $courses->execute([$title , $price , $avatarName , $body , $categoryId]);\n session_start();\n $_SESSION['message'] = \"course was created\";\n header(\"location:../admin/pages/tables/Courses.php\");\n \n }", "function add_course(){\n\n\t\t$course_title =$this->input->post('course_title');\n\n\t\t$courses = array(\n\t\t\t'course_title' => $this->input->post('course_title'),\n\t\t\t'course_duration' => $this->input->post('duration'),\n\t\t\t'course_fees'=> $this->input->post('fees'),\n\t\t\t'course_description'=> $this->input->post('course_description'),\n\t\t);\n\n\t\t//================= Activity Log Monitoring==========================//\n $activity_log_activity = \"Add new Courses \".$course_title ; \n\n $activitylogs = array( \n 'activity_log_activity' =>$activity_log_activity, \n 'activity_date'=> date('Y-m-d h:i:s:a') ,\n 'user_id'=> $this->session->userdata('user_id')\n ); \n\n $this->setting_model->insert($activitylogs , 'activity_log');\n\n //==================== Activity Log Monitoring End=====================//\n\n\t\t$this->setting_model->insert($courses,'course');\n\n\t\t$this->session->set_flashdata('msg',\"<div class='alert alert-success'><strong>\". $course_title .\"</strong> Added Successfully!</div><style>.table>tbody>tr:nth-child(2){ background:#d9ff66; }</style>\");\n\n\t\tredirect('admin/add_course_view');\n\t\t\n\t}", "function addAjax() {\n header('Content-Type: application/json');\n if (isset($_POST) && count($_POST) > 0) {\n $jobLineItemsWorkName = $this->input->post('jobLineItemsWorkName');\n $jobLineItemsDescription = $this->input->post('jobLineItemsDescription');\n $descCount = 0;\n\n $this->Jcline_model->delete_all_jcline_by_jcid($this->input->post('jobcardid'));\n foreach ($jobLineItemsWorkName as $workname) {\n $params = array(\n 'workname' => $workname,\n 'description' => $jobLineItemsDescription[$descCount],\n 'jobcardid' => $this->input->post('jobcardid')\n );\n\n $jcline_id = $this->Jcline_model->add_jcline($params);\n $descCount++;\n }\n echo json_encode([\"success\" => true]);\n } else {\n echo json_encode([\"success\" => false]);\n }\n }", "public function ajax_add_existing_question() {\n\t\t$challengeId = $this->input->post('challenge_id');\n $questionId = $this->input->post('question_id');\n\n\t\t$this->challenge_question_model->update_challenge_question_table($questionId, $challengeId, 0);\n $out = array('success' => true);\n $this->output->set_output(json_encode($out));\n\t}", "public function add()\n {\n $course_description = new CourseDescription();\n $session_id = api_get_session_id();\n $course_description->set_session_id($session_id);\n\n $data = array();\n if (strtoupper($_SERVER['REQUEST_METHOD']) == \"POST\") {\n if (!empty($_POST['title']) && !empty($_POST['contentDescription'])) {\n if (1) {\n $title = $_POST['title'];\n $content = $_POST['contentDescription'];\n $description_type = $_POST['description_type'];\n if ($description_type >= ADD_BLOCK) {\n $course_description->set_description_type($description_type);\n $course_description->set_title($title);\n $course_description->set_content($content);\n $course_description->insert(api_get_course_int_id());\n }\n\n Display::addFlash(\n Display::return_message(\n get_lang('CourseDescriptionUpdated')\n )\n );\n }\n $this->listing(false);\n } else {\n $data['error'] = 1;\n $data['default_description_titles'] = $course_description->get_default_description_title();\n $data['default_description_title_editable'] = $course_description->get_default_description_title_editable();\n $data['default_description_icon'] = $course_description->get_default_description_icon();\n $data['question'] = $course_description->get_default_question();\n $data['information'] = $course_description->get_default_information();\n $data['description_title'] = $_POST['title'];\n $data['description_content'] = $_POST['contentDescription'];\n $data['description_type'] = $_POST['description_type'];\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('add');\n $this->view->render();\n }\n } else {\n $data['default_description_titles'] = $course_description->get_default_description_title();\n $data['default_description_title_editable'] = $course_description->get_default_description_title_editable();\n $data['default_description_icon'] = $course_description->get_default_description_icon();\n $data['question'] = $course_description->get_default_question();\n $data['information'] = $course_description->get_default_information();\n $data['description_type'] = $course_description->get_max_description_type();\n // render to the view\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('add');\n $this->view->render();\n }\n }", "public function create_course() {\n\n $data['get_all_courses'] = $this->courses_model->getCourses();\n\n \n //user access\n $data['view_access'] = $this->user_permission->has_permission('view_course' , 'access');\n $data['create_access'] = $this->user_permission->has_permission('create_course' , 'access');\n $data['edit_access'] = $this->user_permission->has_permission('edit_course' , 'access');\n \n \n // validate form input\n $this->form_validation->set_rules('course', \"Course\", 'required');\n $this->form_validation->set_rules('duration', \"Duration\", 'required');\n $this->form_validation->set_rules('fee', \"Fee\", 'required');\n\n\n if ($this->form_validation->run() == TRUE) {\n\n $status = $this->input->post('status');\n if ($status == 1) {\n $status = 1;\n } else {\n $status = 0;\n }\n\n $posted_data = array(\n 'name' => $this->input->post('course'),\n 'duration' => $this->input->post('duration'),\n 'fee' => $this->input->post('fee'),\n 'description' => $this->input->post('description'),\n 'status' => $status,\n );\n\n $new_course_id = $this->courses_model->create_course($posted_data);\n if ($new_course_id) {\n $data['message'] = $this->session->set_flashdata('message', \"Successfully added\");\n $this->load->template('index', $data);\n }\n } else {\n\n if (validation_errors()) {\n $data['message'] = validation_errors();\n $this->load->template('index', $data);\n }\n }\n }", "public function bhadd(){\n $this->autoRender = false;\n $this->BullhornConnection->BHConnect();\n $params = $this->request->data; \n if(!isset($params['candidate_id'])){\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Candidate id is required!\"\n ]\n );\n exit;\n }\n if(isset($params['skill_ids']) && is_array($params['skill_ids'])){\n //pr($params);\n $skills = implode(',', $params['skill_ids']);\n $skillSetUpdate = \"\";\n list($categories,$skillsL,$catSkills) = $this->split_cat_skill($params['existingSkillSet']);\n $isDuplicated = array_count_values($skillsL);\n if(isset($params['existingSkillSet']) && isset($params['skillSet'])){\n $skillArr = array_filter(explode(',',$params['existingSkillSet']));\n $getIndex = array_search($params['skillSet'],$skillArr);\n //pr($skillArr);\n //echo $params['skillSet'];\n if($getIndex == false){\n $skillArr[] = $params['skillSet'];\n }\n\n $skillSetUpdate = implode(',',$skillArr);\n if(!isset($isDuplicated[$params['skill_ids'][0]])){\n $url = $_SESSION['BH']['restURL'] . '/entity/Candidate/'.$params['candidate_id'].'/primarySkills/'.$skills.'?BhRestToken=' . $_SESSION['BH']['restToken'];\n\n $post_params = json_encode([]);\n $req_method = 'PUT';\n $response = $this->BullhornCurl->curlFunction($url, $post_params, $req_method);\n }\n }\n /* if(isset($response['errors'])){ // if adding skill returns any errors\n echo json_encode([\n 'status' => 0,\n 'message' => $response \n ]); \n exit; \n }else{ */\n // $skillIds = []; \n $url = $_SESSION['BH']['restURL'] . '/entity/Candidate/' . $params['candidate_id'] . '?BhRestToken=' . $_SESSION['BH']['restToken'];\n\n $post_params = json_encode([\n 'id' => $params['candidate_id'],\n 'skillSet' => $skillSetUpdate\n ]);\n $req_method = 'POST';\n $response = $this->BullhornCurl->curlFunction($url, $post_params, $req_method);\n if(isset($response['data'])){\n list($categories,$skills,$catSkills) = $this->split_cat_skill($response['data']['skillSet']);\n /* foreach($response['data']['primarySkills']['data'] as $skill){\n $skillIds[] = $skill['id'];\n }*/\n if(empty($catSkills)){\n $result = $this->getSkills($skills); // returns duplicate skills with different category\n }else{\n $result = $this->getSkills($skills,'skill_id',$catSkills);\n }\n echo json_encode(\n [\n 'status' => 1,\n 'data' => isset($result['data'])?$result['data']:[],\n 'existingSkillSet' => $response['data']['skillSet'],\n ]\n );\n exit;\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'data' => $response\n ]\n );\n exit;\n }\n //}\n\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"skill ids are required and also it need to be in array format!\"\n ]\n );\n exit;\n }\n }", "public function course()\n\t{ \n//echo \"<pre>\";print_r($_POST);die;\t\n\t\t$data=$_POST;\n\t\t//$data['action']='get_module';\n\t\t//$data['action']='delete_module';\n\t\t//$data['action']='course';\n\t\t//$data['action']='delete_lession';\n\t\t$action='';\n\t\tif(isset($data['action'])){\n\t\t\t$action=$data['action'];\n\t\t}\n\t\tswitch ($action) {\n\t\tcase 'course':\n\t\t\t$this->add_update_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_module':\n\t\t\t$this->delete_course($data);\n\t\t\tbreak;\n\t\tcase 'delete_lession':\n\t\t\t$this->delete_lession($data);\n\t\t\tbreak;\n\t\tcase 'get_module':\n\t\t\t$this->getMOduleDetailsByModuleId($data);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$result['msg']='Bad request!';\n\t\t\t$returnData['response']=$result;\n\t\t\tdie(json_encode($returnData));\n\t\t}\n\t\t\n\t}", "public function add_new_enrol() { \n $data['sideMenuData'] = fetch_non_main_page_content();\n $data['page_title'] = 'Class Trainee';\n $tenant_id = $this->tenant_id;\n $data['privilage'] = $this->manage_tenant->get_privilage();//added by shubhranshu\n $data['companies'] = $this->classtraineemodel->get_company_list($tenant_id);\n $data['main_content'] = 'classtrainee/addnewenroll';\n $this->load->view('layout', $data);\n }", "public function fetch_course_name_for_merging()\n {\n $id = $this->input->get(\"id\");\n $id = $this->security->xss_clean(htmlspecialchars($id));\n if($id==\"\"){\n echo \"course name was not gotten there seems to be a problem\";\n }else{\n $get_course = $this->admin_student_courses_mdl->course_from_id($id);\n echo $get_course;\n }\n }", "function addsubjectajaxAction(){\r\n \tif($this->getRequest()->isPost()){\r\n \t\t$data = $this->getRequest()->getPost();\r\n \t\t$_dbmodel = new Global_Model_DbTable_DbSubjectExam();\r\n \t\t$option=$_dbmodel->addSubjectajax($data);\r\n \t\t$result = array(\"id\"=>$option);\r\n \t\tprint_r(Zend_Json::encode($result));\r\n \t\texit();\r\n \t}\r\n }", "public function createShareCourseMaterial() {\n $incomingFormData = $this->readHttpRequest();\n $formData = json_decode($incomingFormData);\n $createResult = $this->Coursematerial_model->createShareCourseMaterial($formData);\n// $shareCrsListFlag = 1;\n// $shareCourseMaterialList = $this->index($shareCrsListFlag); // call department List\n if ($createResult == true) {\n $data['status'] = 'ok';\n } else {\n $data['status'] = 'fail';\n }\n// $data['shareCourseMaterialList'] = $shareCourseMaterialList;\n echo json_encode($data);\n }", "public function add()\n {\n if ($this->form_validation->run('compadd')) {\n $this->complaint_model->add();\n if ($this->db->affected_rows()) {\n $array = array(\n 'success' => '<div class=\"alert alert-success\" role=\"alert\"><strong>Selamat! </strong>pesan Anda sudah terkirim. Untuk melihat status/balasan komplain silahakn klik menu \"Riwayat Komplain\"</div>'\n );\n } else {\n $array = array(\n 'danger' => '<div class=\"alert alert-danger\" role=\"alert\"><strong>Maaf! </strong>pesan Anda gagal dikirim.</div>'\n );\n };\n } else {\n $array = array(\n 'error' => true,\n 'title_error' => form_error('comp_title'),\n 'message_error' => form_error('comp_message')\n );\n }\n\n echo json_encode($array);\n }", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('coursedoc')) {\n\n try {\n $data = $this->_filterDates($data, array('doc_date'));\n $coursedoc = $this->_initCoursedoc();\n $coursedoc->addData($data);\n $courseDocFileName = $this->_uploadAndGetName(\n 'course_doc_file',\n Mage::helper('bs_coursedoc/coursedoc')->getFileBaseDir(),\n $data\n );\n\n $coursedoc->setData('course_doc_file', $courseDocFileName);\n $products = $this->getRequest()->getPost('products', -1);\n if ($products != -1) {\n $coursedoc->setProductsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($products));\n }else {\n if(isset($data['hidden_course_id']) && $data['hidden_course_id'] > 0){\n $coursedoc->setProductsData(\n array(\n $data['hidden_course_id'] => array(\n 'position' => \"\"\n )\n )\n );\n\n\n }\n }\n $coursedoc->save();\n\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.document.location.href = \\''.$this->getUrl('*/catalog_product/edit', array('id'=>$data['hidden_course_id'], 'back'=>'edit', 'tab'=>'product_info_tabs_coursedocs')).'\\'; window.close()</script>';\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_coursedoc')->__('Course Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n if($add != ''){\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId(), 'tab' => 'product_info_tabs_coursedocs'));\n }else {\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId()));\n }\n\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('There was a problem saving the course doc.')\n );\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('Unable to find course doc to save.')\n );\n $this->_redirect('*/*/');\n }", "function addstudent(){\n include('../../config.php'); \n $classid = $_GET['classid'];\n $studid = $_GET['studid'];\n $verify = $this->verifystudent($studid,$classid);\n if($verify){\n echo $q = \"INSERT INTO studentsubject (studid,classid) VALUES ('$studid', '$classid');\";\n mysql_query($q);\n header('location:../classstudent.php?r=success&classid='.$classid.'');\n }else{\n header('location:../classstudent.php?r=duplicate&classid='.$classid.'');\n }\n \n $tmp = mysql_query(\"select * from class where id=$classid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_subject = $tmp_row['subject'];\n $tmp_class = $tmp_row['course'].' '.$tmp_row['year'].'-'.$tmp_row['section'];\n \n $tmp = mysql_query(\"select * from student where id=$studid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_student = $tmp_row['fname'].' '.$tmp_row['lname'];\n \n $act = \"add student $tmp_student to class $tmp_class with the subject of $tmp_subject\";\n $this->logs($act);\n }", "public function actionSaveNoIncluye(){\r\n\r\n if(isset($_POST['ProgramaNoIncluye'])){\r\n\r\n $id = Yii::app()->request->getParam('id');\r\n $programa = $_POST['programa'];\r\n $msj = '';\r\n\r\n if(empty($id)){\r\n $model = new ProgramaNoIncluye();\r\n $model->attributes = $_POST['ProgramaNoIncluye'];\r\n $model->programa_id = $programa;\r\n $msj = 'insert';\r\n }else{\r\n $model = ProgramaNoIncluye::model()->findByPk($id);\r\n $model->attributes = $_POST['ProgramaNoIncluye'];\r\n $msj = 'update';\r\n }\r\n\r\n if($model->validate()){\r\n if($model->save()){\r\n\r\n $link = '<li id=\"li-'.$model->id.'\" class=\"list-group-item list-group-item-danger\">';\r\n $link .= '<i class=\"fa fa-check-square-o\"></i>'.$model->nombre;\r\n $link .= '<div class=\"action\">';\r\n $link .= CHtml::link('<i class=\"fa fa-pencil-square-o\"></i>','',array('onclick'=>\"js:openNoIncluye({$model->id})\"));\r\n $link .= Chtml::link('<i class=\"fa fa-trash-o\"></i>','',array('onclick'=>\"js:deleteNoIncluye({$model->id})\"));\r\n $link .= '</div>';\r\n $link .= '</li>';\r\n\r\n header(\"Content-type: application/json\");\r\n echo CJSON::encode(array(\r\n 'result'=> $msj,\r\n 'link' => $link,\r\n 'id' => $model->id,\r\n 'data' => $model->nombre\r\n ));\r\n exit;\r\n }\r\n }\r\n }\r\n header(\"Content-type: application/json\");\r\n echo CJSON::encode(array(\r\n 'result'=>true,\r\n 'data'=>$this->renderPartial('_formNoIncluye',array('model'=>$model,'programa'=>$programa),true)\r\n ));\r\n exit;\r\n }", "public function add_course_view(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_course';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add course',\n\t\t\t'course_list'=> $this->setting_model->Get_All('course'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "function create_course_subject(){\n\n\t\t$Input_course_id =$this->input->post('course');\n\n\t\t$course_data =$this->setting_model->Get_All('course');\n\n\t\tforeach ($course_data as $data) {\n\t\t\tif($data['course_id'] == $Input_course_id){\n\t\t\t\t$course_title =$data['course_title'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$courses_modules= array(\n\t\t\t'module_subjects' => implode(\" \", $this->input->post('myInputs')),\n\t\t\t'course_id' => $this->input->post('course'),\n\t\t);\t\n\n\t\t//================= Activity Log Monitoring==========================//\n $activity_log_activity = \"Add new Courses subjects for\".$course_title; \n\n $activitylogs = array( \n 'activity_log_activity' =>$activity_log_activity, \n 'activity_date'=> date('Y-m-d h:i:s:a') ,\n 'user_id'=> $this->session->userdata('user_id')\n ); \n\n $this->setting_model->insert($activitylogs , 'activity_log');\n\n //==================== Activity Log Monitoring End=====================//\n\n\n\t\t$this->setting_model->insert($courses_modules,'course_module_subject');\n\n\t\t$this->session->set_flashdata('msg',\"<div class='alert alert-success'><strong>\". $course_title .\"</strong> Course Subjects Added Successfully!</div><style>.table>tbody>tr:nth-child(2){ background:#d9ff66; }</style>\");\n\n\t\tredirect('admin/add_course_subject');\n\t}", "public function courseAction(){\n\t\t\n\t\t$action = $this->input->post(\"action\");\n\t\tswitch($action){\n\t\t\tcase \"add\":\n\t\t\t\t#===========================================================================================================\n\t\t\t\t$this->form_validation->set_error_delimiters('', '');\n\t\t\t\t$this->form_validation->set_rules(\"title\", \"Course Title\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"departmentID\", \"Department\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"description\", \"Description\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"duration\", \"Duration In Hrs.\", \"trim|required|numeric|greater_than[14]\");\n\t\t\t\t$this->form_validation->set_rules(\"maxDays\", \"Max Days\", \"trim|required|numeric\");\n\t\t\t\tif($this->form_validation->run() == FALSE){\n\t\t\t\t\t\n\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'message' => \"<p class='text-danger'>\".implode('!</br>',explode('.', validation_errors())).\"</p>\"\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\t$duration = decimalToTime($this->input->post(\"duration\"));\n\t\t\t\t\t$inputs = array(\n\t\t\t\t\t\t'title' => $this->input->post(\"title\"),\n\t\t\t\t\t\t'departmentID' => $this->input->post(\"departmentID\"),\n\t\t\t\t\t\t'description' => $this->input->post(\"description\"),\n\t\t\t\t\t\t'duration' => $duration,\n\t\t\t\t\t\t'maxDays' => $this->input->post(\"maxDays\")\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif($this->course->add($inputs)){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'message' => \"New Course Added Successfully!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to save\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#===========================================================================================================\n\t\t\tbreak;\n\t\t\tcase \"get\":\n\t\t\t\t#===========================================================================================================\n\t\t\t\t$this->form_validation->set_error_delimiters('', '');\n\t\t\t\t$this->form_validation->set_rules(\"courseID\", \"Course ID\", \"trim|required\");\n\t\t\t\t\n\t\t\t\tif($this->form_validation->run() == FALSE){\n\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'message' => \"<p class='text-danger'>\".implode('!</br>',explode('.', validation_errors())).\"</p>\"\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\t$id = $this->input->post(\"courseID\");\n\t\t\t\t\t$data['courseInfo'] = $this->course->get($id);\n\t\t\t\t\tif(!empty($data['courseInfo'])){\n\t\t\t\t\t\t$data['courseInfo']->duration = timeToDecimal($data['courseInfo']->duration);\n\t\t\t\t\t}\n\t\t\t\t\t$data['departments'] = $this->department->getAll();\n\t\t\t\t\tif($data){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'data' => $data\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to Load!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#======================================================================================\n\t\t\tbreak;\n\t\t\tcase \"update\":\n\t\t\t\t#======================================================================================\n\t\t\t\t$this->form_validation->set_error_delimiters('', '');\n\t\t\t\t$this->form_validation->set_rules(\"title\", \"Course Title\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"departmentID\", \"Department\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"description\", \"Description\", \"trim|required\");\n\t\t\t\t$this->form_validation->set_rules(\"duration\", \"Duration In Hrs.\", \"trim|required|numeric|greater_than[14]\");\n\t\t\t\t$this->form_validation->set_rules(\"maxDays\", \"Max Days\", \"trim|required|numeric|greater_than[29]\");\n\t\t\t\tif($this->form_validation->run() == FALSE){\n\t\t\t\t\t\n\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'message' => \"<p class='text-danger'>\".implode('!</br>',explode('.', validation_errors())).\"</p>\"\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\t$duration = decimalToTime($this->input->post(\"duration\"));\n\t\t\t\t\t$courseID = $this->input->post(\"courseID\");\n\t\t\t\t\t$inputs = array(\n\t\t\t\t\t\t'title' => $this->input->post(\"title\"),\n\t\t\t\t\t\t'departmentID' => $this->input->post(\"departmentID\"),\n\t\t\t\t\t\t'description' => $this->input->post(\"description\"),\n\t\t\t\t\t\t'duration' => $duration,\n\t\t\t\t\t\t'maxDays' => $this->input->post(\"maxDays\")\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif($this->course->update($courseID, $inputs)){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'message' => \"Course Updated Successfully!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to update!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t#=======================================================================================\n\t\t\tbreak;\n\t\t\tcase \"delete\": \n\t\t\t\t$courseID = $this->input->post(\"courseID\");\n\t\t\t\t\n\t\t\t\tif($this->course->delete($courseID)){\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t\t'message' => \"Course Deleted Successfully!\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo json_encode( array(\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'message' => \"Unable to delete\"\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t}\n\t}", "public function upload($curriculum, $course) {\n\n// $incomingFormData = $this->readHttpRequest();\n// $formData = json_decode($incomingFormData);\n\n $fileUploadResult = $this->Coursematerial_model->fileUpload($curriculum, $course);\n// $shareCrsListFlag = 1;\n if ($fileUploadResult == true) {\n $data['status'] = 'ok';\n } else {\n $data['status'] = 'fail';\n }\n// $shareCourseMaterialList = $this->index($shareCrsListFlag); // call department List\n// $data['shareCourseMaterialList'] = $shareCourseMaterialList;\n echo json_encode($data);\n }", "function ajax_add() {\n\t\t$result = array(\n\t\t\t'success' => false,\n\t\t\t'message' => 'default message'\n\t\t);\n\t\t\n\t\tif (isset($_POST)) {\n\t\t\tif (isset($_POST['author']) && isset($_POST['email']) && isset($_POST['subject']) && isset($_POST['body']) && isset($_POST['productId']) && isset($_POST['personalEmail']) && isset($_POST['workEmail'])) {\n\t\t\t\t$author = $_POST['author'];\n\t\t\t\t$email = $_POST['email'];\n\t\t\t\t$subject = $_POST['subject'];\n\t\t\t\t$body = $_POST['body'];\n\t\t\t\t$product_id = $_POST['productId'];\n\t\t\t\t$personal_email = $_POST['personalEmail'];\n\t\t\t\t$work_email = $_POST['workEmail'];\n\t\t\t\t\n\n\t\t\t\tif ($this->Comment->is_spam($body)) {\n\t\t\t\t\t$result['message'] = 'Váš komentář obsahuje zakázaná slova a je proto považován za SPAM. Kometář nebyl uložen.';\n\t\t\t\t} else {\n\t\t\t\t\t$comment = array(\n\t\t\t\t\t\t'Comment' => array(\n\t\t\t\t\t\t\t'author' => $author,\n\t\t\t\t\t\t\t'email' => $email,\n\t\t\t\t\t\t\t'subject' => $subject,\n\t\t\t\t\t\t\t'body' => $body,\n\t\t\t\t\t\t\t'product_id' => $product_id,\n\t\t\t\t\t\t\t'created' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t'personal_email' => $personal_email,\n\t\t\t\t\t\t\t'work_email' => $work_email\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t$this->Comment->create();\n\t\t\t\t\tif ($this->Comment->save($comment)) {\n\t\t\t\t\t\t// komentar byl vlozen, notifikace adminu o novem dotazu\n\t\t\t\t\t\t$this->Comment->notify_new_comment($this->Comment->id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$result['message'] = 'Váš kometář byl uložen ke zpracování. Po schválení se bude zobrazovat.';\n\t\t\t\t\t\t$result['success'] = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result['message'] = 'Chyba při ukládání, zkontrolujte formulář a zkuste to prosím znovu.';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$result['message'] = 'Nejsou známá všechna potřebná formulářová pole.';\n\t\t\t}\n\t\t} else {\n\t\t\t$result['message'] = 'Neznám POST data';\n\t\t}\n\t\t\n\t\techo json_encode($result);\n\t\tdie();\n\t}", "public function fetchCoursesInsert($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails) {\r\n $db = Zend_Db_Table::getDefaultAdapter();\r\n $Year_Level_Block = '';\r\n\t // get the courses\r\n $sql = $db->select()\r\n ->from(array('a' => 'tbl_landscapesubject'),array('a.IdSubject','a.SubjectType','a.IdSemester','a.CreditHours','a.UpdUser'))\r\n ->joinLeft(array('f'=>'tbl_subjectmaster'),' f.IdSubject = a.IdSubject ',array('f.courseDescription')) \r\n ->where('a.IdLandscape = ?',$landscapeID)\r\n ->where('a.IdProgram = ?',$programID);\r\n $result = $db->fetchAll($sql);\r\n \r\n // INSERT the courses\r\n $tableNAme = 'tbl_academicprogress_subjects';\r\n \r\n foreach($result as $values) {\r\n \r\n // get the year id for idsemester for a landscape if the landscpae is block based.\r\n if($studentdetails['LandscapeType']=='44') { \r\n $sqlBY = $db->select()\r\n ->from(array('by' => 'tbl_blocksemesteryear'),array('by.Year')) \r\n ->where('by.IdLandscape = ?',$landscapeID)\r\n ->where(\"by.YearSemester = ?\",$values['IdSemester']);\r\n $resultBy = $db->fetchRow($sqlBY); \r\n if(count($resultBy)>0) { $Year_Level_Block = $resultBy['Year']; }\r\n }\r\n \r\n // get the level id for idsemester for a landscape if the landscpae is level based.\r\n if($studentdetails['LandscapeType']=='42') { \r\n $sqlBL = $db->select()\r\n ->from(array('bl' => 'tbl_landscapeblocksemester'),array('bl.blockid')) \r\n ->where('bl.IdLandscape = ?',$landscapeID)\r\n ->where(\"bl.semesterid = ?\",$values['IdSemester']);\r\n $resultBL = $db->fetchRow($sqlBL);\r\n if(count($resultBL)>0) { $Year_Level_Block = $resultBL['blockid']; }\r\n }\r\n \r\n if($studentdetails['LandscapeType']=='43') {\r\n $Year_Level_Block = '';\r\n }\r\n \r\n $paramData = array(\r\n 'IdStudent' => $lintidreg,\r\n 'IdAcademicProgress' => $academicprogressID,\r\n 'Year_Level_Block' => $Year_Level_Block,\r\n 'Semester' => $values['IdSemester'],\r\n 'IdCourseType' => $values['SubjectType'],\r\n 'CourseID' => $values['IdSubject'],\r\n 'CourseDescription' => $values['courseDescription'],\r\n 'CreditHours' => $values['CreditHours'],\r\n 'Grade' => '',\r\n 'IsRegistered' => '0',\r\n 'UpdUser' => $values['UpdUser'],\r\n 'UpdDate' => date('Y-m-d H:i:s'),\r\n );\r\n $db->insert($tableNAme,$paramData); \r\n }\r\n \r\n }", "public function store(Request $request)\n {\n if($request->ajax())\n {\n $alloted = Alloted::where('class_name', $request->course)\n ->where('section', $request->section)->where('acadamic_year', $request->acadmic_year)->first();\n if(empty($alloted))\n {\n $alloted = new Alloted();\n $alloted->class_name = $request->course;\n $alloted->section = $request->section;\n $alloted->acadamic_year = $request->acadmic_year;\n $alloted->save();\n }\n \n $admission = $request->admission;\n \n \n for($i=0; $i<count($admission); $i++)\n {\n $allot = AllotedStudent::where('allotment_id',$alloted->id)->where('admission_id',$admission[$i])->first();\n if (empty($allot)){\n $allot=new AllotedStudent();\n $allot->allotment_id = $alloted->id;\n $allot->admission_id= $admission[$i];\n $allot->save();\n $changeadmission = StudentProfile::where('id',$admission[$i])->update(['status'=>1]);\n \n }\n }\n \n }\n }", "function add_course($course, $school, $title, $description, $exam_date, $exam_start, $exam_end){\n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n\n $stmt = $conn->prepare(\"INSERT INTO course VALUES(:course, :school, :title, :description, :exam_date, :exam_start, :exam_end)\");\n \n $stmt->bindParam(\":course\", $course);\n $stmt->bindParam(\":school\", $school);\n $stmt->bindParam(\":title\", $title);\n $stmt->bindParam(\":description\", $description);\n $stmt->bindParam(\":exam_date\", $exam_date);\n $stmt->bindParam(\":exam_start\", $exam_start);\n $stmt->bindParam(\":exam_end\", $exam_end);\n\n $success = $stmt->execute();\n\n $stmt = null;\n $conn = null;\n\n return $success;\n }", "public function addAjax()\n {\n $contact = $this->Contacts->newEntity();\n if ($this->request->is('post')) {\n $contact = $this->Contacts->patchEntity($contact, $this->request->data);\n if ($res = $this->Contacts->save($contact)) {\n $res['success'] = 'New contact has been saved. ID: ' . $res['id'];\n } else {\n $res['error'] = 'The contact could not be saved.';\n }\n }\n $ContactTypes = $this->Contacts->ContactTypes->find('list');\n if (isset($res)) { //dump data in JSON format\n $this->viewBuilder()->layout(''); //get rid of the layout (skip header, footer, navbar)\n $this->set('value', json_encode($res));\n $this->render('/Imits/dumpvalues');\n } else {\n $this->set(compact('contact','ContactTypes'));\n $this->set('_serialize', ['contact']);\n }\n }", "public function saveTutorProfileAjax() {\n\t\t//Getting Variables\t\n\t\t$tutor_id = $_POST['tutor_id'];\n\t\t$level_id = $_POST['level_id'];\n\t\t$subject_id = $_POST['subject_id'];\n\t\tif($subject_id != \"null\"){\n\t\t\t$subject_id = explode(',',$subject_id);\n\t\t} else {\n\t\t\t$subject_id = \"\";\n\t\t}\n\t\t$travel_distance = $_POST['travel_distance'];\n\t\t$headline = $_POST['headline'];\n\t\t$personal_statement = $_POST['personal_statement'];\n\t\t$hourly_rate = $_POST['hourly_rate'];\n\t\t// education\n\t\t$t_education = $_POST['education'];\n\t\t$t_education = explode(',institute_name',$t_education);\n\t\tforeach($t_education as $index=>$s_rows){\n\t\t\t\t$t_rows = explode(\",\",$s_rows);\n\t\t\t\tforeach($t_rows as $t_attribute){\n\t\t\t\t\t$attribute = explode(\"+=\",$t_attribute);\n\t\t\t\t\t$education[$index][(empty($attribute[0]) ? 'institute_name':$attribute[0])] = $attribute[1];\n\t\t\t\t\t\n\t\t\t\t}\n\t\t}\n\t\t$education = json_encode($education);\n\t\t// teaching\n\t\t$t_teaching = $_POST['teaching'];\n\t\t$t_teaching = explode(',institute_name',$t_teaching);\n\t\tforeach($t_teaching as $index=>$s_rows){\n\t\t\t\t$t_rows = explode(\",\",$s_rows);\n\t\t\t\tforeach($t_rows as $t_attribute){\n\t\t\t\t\t$attribute = explode(\"+=\",$t_attribute);\n\t\t\t\t\t$teaching[$index][(empty($attribute[0]) ? 'institute_name':$attribute[0])] = $attribute[1];\n\t\t\t\t\t\n\t\t\t\t}\n\t\t}\n\t\t$teaching = json_encode($teaching);\n\t\t$tutor_experience = $_POST['tutor_experience'];\n\t\tif(empty($tutor_experience)){\n\t\t\t$tutor_experience = 0;\n\t\t}\n\t\t$tutor_hours = $_POST['tutor_hours'];\n\t\t$tutor_subjects = $_POST['tutor_subjects'];\n\t\t/* avaiability */\n\t\t$avaiability = $_POST['avaiability'];\n\t\t$t_avaiable = array();\n\t\t$t_avaiable_index = 0;\n\t\t$available = array();\n\t\tif(!empty($avaiability)){\n\t\t\t$avaiability = explode(';',$avaiability);\n\t\t\tforeach($avaiability as $index=>$a_rows){\n\t\t\t\tif($a_rows != \"\"){\n\t\t\t\t\t$t_avaiable[$t_avaiable_index] = $a_rows;\n\t\t\t\t\t$t_avaiable_index++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor($i=0;$i<count($t_avaiable);$i++){\n\t\t\t\t$days = $t_avaiable[$i++];\n\t\t\t\t$times = explode(',',$t_avaiable[$i]);\n\t\t\t\t$available[$days]['times'] = $times;\n\t\t\t}\n\t\t}\n\t\t/* group avaiability */\n\t\t$group_avaiability = $_POST['group_avaiability'];\n\t\t$group_available = array();\n\t\tif(!empty($group_avaiability)){\n\t\t\t$group_avaiability = explode(';',$group_avaiability);\n\t\t\t$g_t_avaiable = array();\n\t\t\t$g_t_avaiable_index = 0;\n\t\t\tforeach($group_avaiability as $index=>$a_rows){\n\t\t\t\tif($a_rows != \"\"){\n\t\t\t\t\t$g_t_avaiable[$g_t_avaiable_index] = $a_rows;\n\t\t\t\t\t$g_t_avaiable_index++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor($i=0;$i<count($g_t_avaiable);$i++){\n\t\t\t\t$syllabus = $g_t_avaiable[$i++];\n\t\t\t\t$days = $g_t_avaiable[$i++];\n\t\t\t\t$no_of_students = $g_t_avaiable[$i++];\n\t\t\t\t$times = explode(',',$g_t_avaiable[$i]);\n\t\t\t\t$group_available[$days]['no_of_students'] = $no_of_students;\n\t\t\t\t$group_available[$days]['times'] = $times;\n\t\t\t\t$group_available[$days]['syllabus'] = $syllabus;\n\t\t\t}\n\t\t}\n\t\t$teaching_level = $_POST['teaching_level'];\n\t\t$subject_text = $_POST['subject_text'];\n\t\tif(!empty($subject_text)){\n\t\t\t$subject_text = explode(',',$subject_text);\t\t\t\n\t\t}\n\t\t$subject_level = $_POST['subject_level'];\n\t\t$info_file = $_POST['info_file'];\n\t\t$group_hourly_rate = $_POST['group_hourly_rate'];\n\t\t//Getting Current Profile Image\n\t\t$user_data = $this->user_model->getUserById($tutor_id);\n\t\t\n\t\t$user_file = $this->profile_model->getTutorDetailsById($tutor_id);\n\n\t\t$user_status = ($user_data['role'] == STUDENT && empty($user_file))? APPROVAL_STATUS_ID: $user_data['is_active'];\n\n\t\t//Uploading Image\n\t\t$file_element_name = 'imgInp1'; \n\t\t$config['upload_path'] = ASSET_FRONTEND_UPLOADS_PATH.\"profile\";\n\t\t$config['allowed_types'] = 'zip';\n\t\t$this->load->library('upload', $config);\n\t\tif(!$this->upload->do_upload($file_element_name)) {\n\t\t\t$msg = $this->upload->display_errors('', ''); \n\t\t\t$status = 2;\n\t\t\t\t$response['status'] = $status;\n\t\t\t\t$response['response'] = $msg;\n\t\t\t\t$response['url'] = \"\";\n\t\t\t\t//if($msg != \"You did not select a file to upload.\"){\n\t\t\t\t//\techo json_encode($response);\n\t\t\t\t//\techo $msg;\n\t\t\t\t//\tdie();\n\t\t\t\t//}\n\t\t} else {\n\t\t\t\t$data = array('upload_data' => $this->upload->data());\n\t\t}\n\t\t\t//upload file <end>\n\t\t\t//validate image\n\t\t\t$certificate_file = (isset($data['upload_data']) ? $data['upload_data']['file_name']:$user_file['certificate_file']);\n\t\t\t\t$this->profile_model->changeUserStatus($tutor_id,$user_status);\n\t\t\t\t\n\t\t\t\t$qResponse = $this->profile_model->saveTutorProfile($tutor_id,$level_id,$subject_id,$travel_distance,$headline,$personal_statement,$hourly_rate,\n\t\t\t\t\t\t\t\t\t$education,$teaching,$tutor_experience,$tutor_hours,$tutor_subjects,$available,$group_available,$certificate_file,$teaching_level,$subject_text,$subject_level,$info_file,$group_hourly_rate);\n\t\t\t\tif($qResponse == true){\n\t\t\t\t\t//Redirect to User profile page\n\t\t\t\t\t$msg = 'Tutor profile saved successfully';\n\t\t\t\t\t$status = 1;\n\t\t\t\t\t$url = ROUTE_LESSONS;\n\t\t\t\t\tif(!empty($group_available) || !empty($available)){\n\t\t\t\t\t\t$requested_students = $this->message_model->getNoLessonMsgsByReceiverId($tutor_id);\n\t\t\t\t\t\tif(!empty($requested_students)){\n\t\t\t\t\t\t\tforeach($requested_students as $student){\n\t\t\t\t\t\t\t\t$email = $student['email'];\n\t\t\t\t\t\t\t\t$subject = \"New Message\";\n\t\t\t\t\t\t\t\t$profile_link = ROUTE_SEARCH_DETAIL.'/'.preg_replace(\"/&([a-z])[a-z]+;/i\", \"$1\", htmlentities( strtolower(str_replace(' ', '', $user_data['first_name'])))).'/'.$tutor_id;\n\t\t\t\t\t\t\t\t$email_msg = \"Hello \".ucfirst($student['first_name']).\",<br><br> You contacted a tutor through Open Mind Tutors. The tutor has now updated their availability schedule. Please select a time slot to continue your conversation. To view the tutor's profile, click \n\t\t\t\t\t\t\t\t<a href='\".$profile_link.\"'>here</a><br><br>\n\t\t\t\t\t\t\t\tSincerely,<br>\n\t\t\t\t\t\t\t\t<img alt='logo' style='width: 120px;' src='\".FRONTEND_ASSET_IMAGES_DIR.\"omt-logo.png'/>\";\n\t\t\t\t\t\t\t\t$sender = NO_REPLY;\n\t\t\t\t\t\t\t\tsendEmail($sender,$email,$email_msg,$subject);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->message_model->changeNoMessageStatus($tutor_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\t$msg = 'Tutor profile not saved successfully';\n\t\t\t\t\t$url = \"\";\n\t\t\t\t\t$status = 0;\n\t\t\t\t}\n\t\t$response['status'] = $status;\n\t\t$response['response'] = $msg;\n\t\t$response['url'] = $url;\n\t\techo json_encode($response);\n\t\tdie();\n }", "public function add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $skillsTable = TableRegistry::get('Skill');\n $candidateSkillsTable = TableRegistry::get('CandidateSkill');\n $getSkill = [];\n if (isset($params['skill_id'])) {\n $getSkill = $skillsTable->find()->select()->where(['id' => $params['skill_id']])->toArray();\n //$skillType = 'skill_id';\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"No skill id given!\"\n ]\n );\n exit;\n }\n /*else {\n $getSkill = $skillsTable->find()->select()->where(['skill_name' => $params['skill_name'],'skill_category_id'=>$params['skill_category_id']])->toArray();\n $skillType = 'skill_name';\n }\n if (empty($getSkill) && $skillType == \"skill_name\") {\n $skils = $skillsTable->newEntity($params);\n if ($result = $skillsTable->save($skils)) {\n $getSkill[0]['id'] = $result->id;\n }\n } else */\n if (empty($getSkill)) {\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"No Skill is available!\"\n ]\n );\n exit;\n }\n if (!empty($getSkill)) {\n $getCandidateSkills = $candidateSkillsTable->find()->select()->where(['candidate_id' => $params['candidate_id']])->toArray();\n if (empty($getCandidateSkills)) {\n $params['skill_ids'] = $getSkill[0]['id'];\n $skill = $candidateSkillsTable->newEntity($params);\n if ($candidateSkillsTable->save($skill)) {\n $this->bhSkillSet($params['candidate_id']);\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Added!\",\n ]\n );\n exit;\n }\n }\n if (!empty($getCandidateSkills)) { \n //if (strpos($getCandidateSkills[0][\"skill_ids\"], $getSkill[0]['id']) === false) {\n if (!in_array($getSkill[0]['id'], explode(',',$getCandidateSkills[0][\"skill_ids\"]))) {\n $candidate_skills_id = $getCandidateSkills[0][\"id\"];\n $candidate_skills = $candidateSkillsTable->get($candidate_skills_id);\n $candidateSkillsTable->patchEntity($candidate_skills, $params);\n $candidate_skills->id = $candidate_skills_id;\n $candidate_skills->candidate_id = $params['candidate_id'];\n $candidate_skills->skill_ids = $getCandidateSkills[0][\"skill_ids\"] . \",\" . $getSkill[0]['id'];\n $candidateSkillsTable->save($candidate_skills);\n $this->bhSkillSet($params['candidate_id']);\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Added!\"\n ]\n );\n exit;\n } else {\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Already Skill Added!\"\n ]\n );\n exit;\n }\n }\n }\n }", "public function ajaxAttrAdd()\n {\n $input = Input::except('_token');\n $clert = session('admin') ? session('admin'): '1';\n $res = ProCombination::create(['name'=>$input['com_name'],'clert'=> $clert,'state'=>'0']);\n $com_id = $res->id;//新建属性组的id\n $attr_id = '';\n foreach($input['attr'] as $k => $attr){\n if($attr !== null){\n $res = ProAttr::create(['name'=>$attr, 'clert'=>$clert, 'state'=>'0', 'status'=>$input['attr_type'][$k]]);\n $attr_id .= '_'.$res->id;\n }else{\n ProCombination::where('id',$com_id)->delete();\n return 0;\n }\n\n }\n $attr_id = trim($attr_id, '_');\n ProCombination::where('id',$com_id)->update(['conbination'=>$attr_id]);\n return $com_id;\n }", "public function postCreate()\n\t{\n\n\t\tif( Input::get('title') == '' ):\n\n\t\t\tself::setWarning('coordinators_courses_title_err', 'Error al agregar curso', 'por favor ingrese un Título, no puede dejar este campo vacío.');\n\n\t\t\treturn self::go( 'create' );\n\n\t\telseif( Input::get('author_id') == null ):\n\n\t\t\tself::setWarning('coordinators_courses_author_id_err', 'Error al agregar curso', 'Debe seleccionar un profesor encargado del Curso.');\n\n\t\t\treturn self::go( 'create' );\n\n\t\telse:\n\n\t\t\t$name = Course::setPermalink(Input::get('title'));\n\n\t\t\t$directory = Course::makeFullDirectory( $name );\n\n\t\t\t$course = new Course();\n\t\t\t$course->author_id = Input::get('author_id');\n\t\t\t$course->title = Input::get('title');\n\t\t\t$course->name = $name;\n\t\t\t$course->description = Input::get('description');\n\t\t\t$course->status = 'inactive';\n\t\t\t$course->main_picture = Input::file('main_picture') != null ? Course::uploadMainPicture( Input::file('main_picture'), $name ) : '';\n\t\t\t$course->cover_picture = Input::file('cover_picture') != null ? Course::uploadCoverPicture( Input::file('cover_picture'), $name ) : '';\n\t\t\t$course->thumbnail_picture = Input::file('thumbnail_picture') != null ? Course::uploadThumbnailPicture( Input::file('thumbnail_picture'), $name ) : '';\n\n\t\t\t$teacher = User::find(Input::get('author_id'));\n\n\t\t\t\n\t\t\tif( $course->save() ):\n\t\n\t\t\t\t\\Event::fire('notification.course_assigned', array($teacher, $course));\n\t\t\t\tself::setSuccess('coordinators_courses_create', 'Curso Agregado', 'El curso ' . $course->title . ' fue agregado exitósamente');\n\n\t\t\t\treturn self::go( 'inactive' );\n\n\t\t\telse:\n\n\t\t\t\tself::setDanger('coordinators_courses_create_err', 'Error al agregar curso', 'Hubo un error al agregar el curso ' . $course->title);\n\n\t\t\t\treturn self::go( 'create' );\n\n\t\t\tendif;\n\n\t\tendif;\n\n\t}", "public function ajax_save_category()\n {\n $translation = ee()->input->post('translation');\n $status = ee()->input->post('publisher_save_status');\n\n // Stop here if false or if the array is empty\n if ( !$translation || empty($translation))\n {\n ee()->publisher_helper->send_ajax_response('failure');\n }\n\n $result = ee()->publisher_category->save_translation($translation, $status);\n\n if ($result)\n {\n ee()->publisher_helper->send_ajax_response('success');\n }\n else\n {\n ee()->publisher_helper->send_ajax_response($result);\n }\n }", "public function addCompound(){\n if ($this->request->is('post')){ //check if the save button has being clicked \n $data = $this->request->data; //gets the data\n if ($data['Compound']['cas'] != '' && $this->Compound->find('count', ['conditions' => ['cas' => $data['Compound']['cas']]]) > 0){\n $this->set('alert', 'The compound you entered is already in the database');\n return;\n } //if the cas number already exists then exit\n $this->Compound->create(); //adds the compound\n if ($this->Compound->save($data)){ //saves the Compound\n return $this->redirect(['controller' => 'General', 'action' => 'blank', '?' => ['alert' => 'Compound Saved']]);\n } //if successful then redirect to blank with a message\n } //makes sure that the form was submitted\n }", "public function saveSelectedMissionAction()\n\t{\n\t\tif($this->_request-> isPost() && $this->adminLogin->userId) \n {\n\t\t\t$selected_parameters=$this->_request->getParams();\n\n\t\t\t//$this->quote_creation->select_missions['single_article_price']=array();\t\n\t\t\t//$this->quote_creation->select_missions['mission_ca']=array();\n\n\t\t\t//get all selected missions\n\t\t\t$k=1;\n\t\t\tforeach($_POST as $key => $missions)\n\t\t\t{\t\t\t \n\t\t\t if (strpos($key, 'overview_missions_') === 0)\n\t\t\t {\t\n\t\t\t \tforeach($missions as $mission)\n\t\t\t \t{\n\t\t\t \t\t$missions_selected[]=$mission;\t\t\t \t\t\n\t\t\t \t\t$this->quote_creation->select_missions['single_article_price'][]=$_POST['single_article_price_'.($k)];\n\t\t\t \t\t$this->quote_creation->select_missions['mission_ca'][]=$_POST['mission_ca_'.($k)];\n\t\t\t \t\t\n\t\t\t \t}\n\t\t\t \t$k++;\t\n\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t\tif($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest') //for auto match popup\n\t\t\t{\n\t\t\t\t$mission_id=$selected_parameters['mission_id'];\n\n\t\t\t\t$updateMissionObj=new Ep_Quote_QuoteMissions();\n\n\t\t\t\t//GET QUOTE MISSION DETAILS\n\t\t\t\t$seoParameters['mission_id']=$mission_id;\n\t\t\t\t$MissionDetails=$updateMissionObj->getMissionDetails($seoParameters);\n\n\t\t\t\t$mission_nb_words=$MissionDetails[0]['nb_words'];\n\t\t\t\t$conversion=$MissionDetails[0]['conversion'];\n\n\n\t\t\t\t$newSuggesion=$missions_selected[0];\n\n\t\t\t\t//get archieved mission details\n\t\t\t\t$archMissionObj=new Ep_Quote_Mission();\n\t\t\t\t$archData['mission_id']=$newSuggesion;\n\t\t\t\t$archMissionDetails=$archMissionObj->getMissionDetails($archData);\n\n\t\t\t\tif($archMissionDetails)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$data['unit_price']=($archMissionDetails[0]['selling_price']);\n\t\t\t\t\t//$data['mission_length']=$archMissionDetails[0]['mission_length'];\n\t\t\t\t\t$data['margin_percentage']=$archMissionDetails[0]['margin_before_signature'];\n\t\t\t\t\t//$data['volume']=$archMissionDetails[0]['num_of_articles'];\n\n\t\t\t\t\t$archieve_nb_words=$archMissionDetails[0]['article_length'];\t\t\n\t\t\t\t\t\n\t\t\t\t\t$writing_cost=$archMissionDetails[0]['writing_cost_before_signature']*$conversion;\n\t\t\t\t\t$correction_cost=$archMissionDetails[0]['correction_cost_before_signature']*$conversion;\n\t\t\t\t\t$other_cost=$archMissionDetails[0]['other_cost_before_signature']*$conversion;\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\t//updating the details\n\t\t\t\t$data['sales_suggested_missions']=$newSuggesion;\n\t\t\t\t$updateMissionObj->updateQuoteMission($data,$mission_id);\n\t\t\t\t\n\n\t\t\t\t$json_update['mission_id']=$mission_id;\n\t\t\t\t$json_update['writing_cost']=zero_cut((($mission_nb_words/$archieve_nb_words)*$writing_cost),2);\n\t\t\t\t$json_update['correction_cost']=zero_cut((($mission_nb_words/$archieve_nb_words)*$correction_cost),2);\n\t\t\t\t$json_update['other_cost']=zero_cut((($mission_nb_words/$archieve_nb_words)*$other_cost),2);\n\n\t\t\t\t//echo $archieve_nb_words.\"--\".$writer_cost.\"--\".$correction_cost.\"--\".$other_cost.\"--\".$mission_nb_words;\n\t\t\t\t//echo \"<pre>\";print_r($json_update);exit;\n\t\t\t\techo json_encode($json_update);\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\t\t \n\n\t\t\t\t$this->quote_creation->select_missions['missions_selected']=$missions_selected;\n\t\t\t\t$this->quote_creation->select_missions['total_suggested_price']=$selected_parameters['total_suggested_price'];\n\t\t\t\t$this->quote_creation->select_missions['currency']=$this->quote_creation->create_step1['currency'];//$selected_parameters['currency_type_1'];\n\t\t\t\t\n\t\t\t\t//echo \"<pre>\";print_r($selected_parameters);print_r($this->quote_creation->select_missions);exit;\t\t\t\t\n\t\t\t\t$this->_redirect(\"/quote/send-quote?submenuId=ML13-SL2\");\t\n\t\t\t}\t\n\n\t\t}\t\n\t\telse\n\t\t\t$this->_redirect(\"/quote/create-quote-step1?submenuId=ML13-SL2\");\t\n\t\t\n\t}", "public function uploadUpdate($matId, $curriculum, $course) {\n\n// $incomingFormData = $this->readHttpRequest();\n// $formData = json_decode($incomingFormData);\n $fileUploadUpdateResult = $this->Coursematerial_model->fileUploadUpdate($matId, $curriculum, $course);\n// $shareCrsListFlag = 1;\n if ($fileUploadUpdateResult == true) {\n $data['status'] = 'ok';\n } else {\n $data['status'] = 'fail';\n }\n// $shareCourseMaterialList = $this->index($shareCrsListFlag); // call department List\n// $data['shareCourseMaterialList'] = $shareCourseMaterialList;\n echo json_encode($data);\n }", "function ajax_add()\n {\n\t\n }", "public function course() {\n $this->data['page_title'] = lang('courses');\n $data['returnedData'] = '';\n\n $packageId = (int) $this->uri->segment(4);\n if(!empty($packageId)) {\n $data['packageId'] = $packageId;\n $id = (int) $this->uri->segment(5);\n if (!empty($id)) {\n $returnedData = $this->package_course_model->get($id);\n $data['returnedData'] = $returnedData;\n }\n\n $validation_rules = array(\n array('field' => 'titleAR', 'label' => lang('arabic_title'), 'rules' => 'trim|required'),\n array('field' => 'titleGE', 'label' => lang('title').' ('.lang('german').')', 'rules' => 'trim|required')\n );\n $this->form_validation->set_rules($validation_rules);\n\n if ($this->form_validation->run() == false) {\n $this->form_validation->set_error_delimiters('<div class=\"alert alert-danger\" >', '</div>');\n //set the flash data error message if there is one\n $data['message'] = (validation_errors() ? validation_errors() : $this->session->flashdata('msg'));\n }else {\n if($_POST) {\n $postedArray = $this->input->post( NULL, TRUE );\n $postedArray['userId'] = $this->admin_ion_auth->user()->row()->id;\n $postedArray['packageId'] = $packageId;\n\n if (!empty($id)) { //update\n $postedArray['lastModifiedDate'] = date(\"Y-m-d H:i:s\");\n\n if ($this->package_course_model->update($postedArray, $id)) {\n $this->session->set_flashdata('msg', \"<div class='alert alert-success'>\".lang('update_success_message').\"</div>\");\n redirect('admin/packages/packageData/'.$packageId , 'location');\n } else {\n $this->session->set_flashdata('msg', \"<div class='alert alert-danger'>\".lang('update_error').\"</div>\");\n redirect('admin/packages/course/'.$packageId.'/'. $id, 'location');\n }\n }//end id\n else{//insert\n $postedArray['addingDate'] = date(\"Y-m-d H:i:s\");\n\n if ($this->package_course_model->insert($postedArray)) {\n $this->session->set_flashdata('msg', \"<div class='alert alert-success'>\".lang('insert_success_message').\"</div>\");\n } else {\n $this->session->set_flashdata('msg', \"<div class='alert alert-danger'>\".lang('insert_error').\"</div>\");\n }\n redirect('admin/packages/packageData/'.$packageId , 'location');\n }\n }//post\n }//else\n $this->load->vars($data);\n $this->render('admin/packages/course');\n } else {\n redirect('admin/packages', 'location');\n }\n }", "function add()\n { \n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'id_user' => $this->input->post('id_user'),\n\t\t\t\t'secteur' => $this->input->post('secteur'),\n\t\t\t\t'nom_organisation' => $this->input->post('nom_organisation'),\n\t\t\t\t'numero_enregistrement' => $this->input->post('numero_enregistrement'),\n\t\t\t\t'pays' => $this->input->post('pays'),\n\t\t\t\t'ville' => $this->input->post('ville'),\n\t\t\t\t'province' => $this->input->post('province'),\n\t\t\t\t'site_internet' => $this->input->post('site_internet'),\n );\n \n $organisation_id = $this->Organisation_model->add_organisation($params);\n redirect('organisation/index');\n }\n else\n {\n\t\t\t$this->load->model('User_model');\n\t\t\t$data['all_user'] = $this->User_model->get_all_user();\n\n\t\t\t$this->load->model('Secteur_model');\n\t\t\t$data['all_secteur'] = $this->Secteur_model->get_all_secteur();\n\n\t\t\t$this->load->view('include/header');\n\t\t\t$this->load->view('advocate/organisation/add',$data);\n\t\t\t$this->load->view('include/footer');\n }\n }", "public function individualCourse($universityName,$universityId,$courseName,$courseId) {\n\t\t\n\t\t/*\n\t\t$courseDetail = $this->coursemodel->getCounterValue($courseId);\n\t\t$pageCount = $courseDetail[0]['page_count'];\n\t\tif(!empty($courseId)){\n\t\t\t$count = $pageCount + 1;\n\t\t\t$this->coursemodel->countCourses($count,$courseId);\n\t\t}\n\t\t*/\n\t\t\n\t\t$this->db_campaign = $this->ci->load->database('db_campaign', True);\n\t\t$data['totalLeads'] = $this->collegemodel->getCampaignData();\n\t\t$this->db = $this->ci->load->database('default', True);\n\t\t\n\t\t$spclCharUniv = array(\"(\", \")\",\",\",\"'\");\n\t\t\n\t\t//$university_name = str_replace('-',' ',$universityName);\n\t\t$university_name = str_replace($spclCharUniv,'',$universityName);\n\t\t\n\t\t$spclCharCourse = array(\"$\",\"!\",\"_\",\":\");\n\t\t\n\t\t$course_name = str_replace($spclCharCourse,'',$courseName);\n\t\t\n\t\t$course_name = str_replace('&','and',$course_name);\n\t\t\n\t\t$data['active']=\"\";\n\t\t$data['title'] = \"$university_name - $course_name\";\n\t\t$data['keywords'] = \"\";\n\t\t$data['description'] = \"\";\n\t\t$data['universityName'] = $universityName;\n\t\t$data['universityId'] = $universityId;\n\t\t$data['courseName'] = $courseName;\n\t\t$data[\"accreditationData\"] = $this->coursemodel->getAccreditationData($courseId);\n\t\t$data[\"stagesData\"] = $this->coursemodel->getStagesData($courseId);\n\t\t$data[\"degreeClassesData\"] = $this->coursemodel->getDegreeClassesData($courseId);\n\t\t$data[\"continuationData\"] = $this->coursemodel->getContinuationData($courseId);\n\t\t$data[\"employmentData\"] = $this->coursemodel->getEmploymentData($courseId);\n\t\t$data[\"jobData\"] = $this->coursemodel->getJobData($courseId);\n\t\t$data[\"entryData\"] = $this->coursemodel->getEntryData($courseId);\n\t\t$data[\"salaryData\"] = $this->coursemodel->getSalaryData($courseId);\n\t\t$data[\"commonData\"] = $this->coursemodel->getCommonData($courseId);\n\t\t$data[\"tariffData\"] = $this->coursemodel->getTariffData($courseId);\n\t\t$data[\"nssData\"] = $this->coursemodel->getNssData($courseId);\n\t\t///$data[\"countryId\"] = $this->coursemodel->getountryId($universityId);\n\t\t//echo $course_id;exit;\n\t\t//echo \"<pre>\";print_r($data);exit;\n\t\t\n $this->layout->view('course/individualCourse.php', $data);\n }", "function new_course($course_name, $depart_prefix, $course_num, $description, $ldap_group, $professor, $acc_code){\n $sql_conn = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASSWD, DATABASE);\n if(!$sql_conn){\n return 1;\n }\n \n $query = \"INSERT INTO courses (depart_pref, course_num, course_name, description, ldap_group, professor, access_code)\n VALUES (?, ?, ?, ?, ?, ?, ?)\n ON DUPLICATE KEY UPDATE description=?, ldap_group=?, professor=?, access_code=?\";\n $stmt = mysqli_prepare($sql_conn, $query);\n if(!$stmt){\n mysqli_close($sql_conn);\n return 1;\n }\n mysqli_stmt_bind_param($stmt, \"sssssssssss\", $depart_prefix, $course_num, $course_name, $description, $ldap_group, $professor, $acc_code, $description, $ldap_group, $professor, $acc_code);\n if(!mysqli_stmt_execute($stmt)){\n mysqli_stmt_close($stmt);\n mysqli_close($sql_conn);\n return 1;\n } \n\n mysqli_stmt_close($stmt);\n mysqli_close($sql_conn);\n return 0;\n}", "public function add_cat() { \n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\tdie();\n\t\t}\n\t\t$main_cat_id = $this->input->post('main_cat_id');\n\t\t$title = $this->input->post('title'); \n\n\n\t\t$array_data['main_cat_id'] = $main_cat_id ; \n\t\t$array_data['title'] = $title ; \n\t\t$this->db->insert(\"categories\" , $array_data); \n\t\t$result = array('statu' => 'ok');\n\t\techo json_encode($result);\n\n\t}", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "public function company_addLicense() {\n $this->layout = \"ajax\";\n $this->loadModel('State');\n $this->loadModel('StateLicense');\n $findState = $this->StateLicense->find('list', array(\n 'fields' => array('state_id'),\n 'conditions' => array(\n 'StateLicense.comp_id' => $this->Auth->user('id'),\n 'StateLicense.active_status' => 1\n )));\n $state = $this->State->find('list', array('fields' => array('id', 'state'), 'conditions' => array('State.id' => $findState)));\n $this->set('state', $state);\n if (!empty($_POST)) {\n $this->set('child', $_POST['child']);\n }\n }", "function create_course($cshort,$cfull,$cdate)\n {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n $query = \"INSERT into courses(cshort,cfull,cdate) values (?,?,?)\";\n $stmt = $mysqli->prepare($query);\n\n\t\tif($stmt = $mysqli->prepare($query))\n {\n $stmt->bind_param('sss',$cshort,$cfull,$cdate);\n $stmt->execute();\n echo \"<script>alert('Course Added Successfully')</script>\";\n }\n else\n {\n $error = $mysqli->errno . ' ' . $mysqli->error;\n \t\techo $error;\n } \n }", "public function updateShareCourseMaterial() {\n $incomingFormData = $this->readHttpRequest();\n $formData = json_decode($incomingFormData);\n\n $updateResult = $this->Coursematerial_model->updateShareCourseMaterial($formData);\n// $shareCrsListFlag = 1;\n if ($updateResult == true) {\n $data['status'] = 'ok';\n } else {\n $data['status'] = 'fail';\n }\n// $shareCourseMaterialList = $this->index($shareCrsListFlag); // call department List\n// $data['shareCourseMaterialList'] = $shareCourseMaterialList;\n echo json_encode($data);\n }", "function insertAreaCenso(){\r\n \r\n $data['cens_id'] = $this->input->post('id_censo');\r\n $data['arge_id'] = $this->input->post('id_area');\r\n $arrayAreaCenso['_post_censo_area_add'] = $data; \r\n $response = $this->Censos->insertAreaCenso($arrayAreaCenso);\r\n echo json_encode($response); \r\n }", "function frmext_createcourse($data){\n\t$return = false;\n\t\n\treturn $return;\n}", "function addAction()\n\t{\n global $langCode;\n\t\t$error \t= array();\n\t\t$success \t= array();\n\t\t$contents \t= '';\n\t\t$formData \t= array();\n\t\t\n\t\t$parentid = (int)($this->registry->router->getArg('parentid'));\n\t\tif($parentid > 0)\n\t\t\t$formData['fparentid'] = $parentid; \n\t\t\n\t\tif(!empty($_POST['fsubmit']))\n\t\t{\n if($_SESSION['productcategoryAddToken']==$_POST['ftoken'])\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->addActionValidator($formData, $error))\n {\n $myProductCat = new Core_ProductCategory();\n //thong tin khong lien quan ngon ngu\n $myProductCat->name = $formData['fname'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n //Neu nguoi dung nhap SeoUrl thi xu li dau cua chuoi nguoi dung nhap \n //Truong hop nguoi dung khong nhap thi chung ta lay idtext de thay the!!!!!\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname'][$langCode]), true);\n //cac thong tin lien quan ngong ngu\n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n if($myProductCat->addData())//them vao database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succAdd']);\n $this->registry->me->writelog('ProductCategoryadd', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n $formData = array('fparentid' => $formData['fparentid']); \n }\n else\n {\n $error[] = $this->registry->lang['controller']['errAdd']; \n }\n }\n }\n $_SESSION['productcategoryAddToken']=Helper::getSecurityToken();//Tao token moi\n\t\t}\n\t\t\n\t\t\n\t\t$this->registry->smarty->assign(array(\t'formData' \t\t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'\t=> $this->getRedirectUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t'success'\t\t=> $success,\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'add.tpl');\n\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategoryadd',\n\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_add'],\n\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t}", "public function add() \n { \n $data['piutang'] = $this->piutangs->add();\n $data['action'] = 'piutang/save';\n \n $tmp_statuss = $this->statuss->get_all();\n foreach($tmp_statuss as $row){\n $statuss[$row['id']] = $row['status'];\n }\n $data['statuss'] = $statuss;\n \n $this->template->js_add('\n $(document).ready(function(){\n // binds form submission and fields to the validation engine\n $(\"#form_piutang\").parsley();\n });','embed');\n \n $this->template->render('piutang/form',$data);\n\n }", "public function addCourrierAction()\n {\n try {\n $this->_helper->viewRenderer->setNoRender();\n\n $error = 'null';\n\n // Extension du fichier uploadé\n $string_extension = strrchr($_FILES['COURRIER']['name'], '.');\n\n // On check si on veut uploader un document odt\n if ('.odt' == $string_extension) {\n if (move_uploaded_file($_FILES['COURRIER']['tmp_name'], REAL_DATA_PATH.DS.'uploads'.DS.'courriers'.DS.$this->_request->id_membre.$this->_request->type.'_'.$_FILES['COURRIER']['name'])) {\n // Les modèles\n $model_membres = new Model_DbTable_CommissionMembre();\n\n // On récupère l'instance du membres\n $row_membre = $model_membres->find($this->_request->id_membre)->current();\n $row = 'COURRIER_'.$this->_request->type;\n\n // Si il y a déjà un courrier, on le supprime\n if (null != $row_membre->{$row} && $row_membre->{$row} !== $_FILES['COURRIER']['name']) {\n unlink(REAL_DATA_PATH.DS.'uploads'.DS.'courriers'.DS.$this->_request->id_membre.$this->_request->type.'_'.$row_membre->{$row});\n }\n\n // On met à jour le libellé du courrier modifié\n $row_membre->{$row} = $_FILES['COURRIER']['name'];\n\n // et on sauvegarde\n $row_membre->save();\n } else {\n $error = 'Le téléchargement a échoué.';\n }\n } else {\n $error = 'Extension non supportée.';\n }\n\n // CALLBACK\n echo \"<script type='text/javascript'>window.top.window.callback('{$error}');</script>\";\n $this->_helper->flashMessenger([\n 'context' => 'success',\n 'title' => 'Le document a bien été sauvegardé',\n 'message' => '',\n ]);\n } catch (Exception $e) {\n $this->_helper->flashMessenger([\n 'context' => 'error',\n 'title' => 'Erreur lors de la sauvegarde du document',\n 'message' => $e->getMessage(),\n ]);\n }\n }", "public function actionAddLesson()\n {\n if (Yii::$app->request->isAjax) {\n $row = Yii::$app->request->post('Lesson');\n if ((Yii::$app->request->post('isNewRecord') && Yii::$app->request->post('_action') == 'load' && empty($row)) || Yii::$app->request->post('_action') == 'add')\n $row[] = [];\n return $this->renderAjax('_formLesson', ['row' => $row]);\n } else {\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n }", "public function actionCreate($accion_central, $accion_especifica)\n {\n $request = Yii::$app->request;\n $model = new AcEspUej(); \n // $unidades_ejecutoras = UnidadEjecutora::find()->asArray('id','nombre')->all();\n $unidades_ejecutoras=ArrayHelper::map(UnidadEjecutora::find()->all(), 'id', 'nombre');\n $verificar =ArrayHelper::map(AcEspUej::find()->where('id_ac_esp= :id', ['id'=>$accion_especifica])->all(),'id','id_ue');\n \n \n // print_r($unidades_ejecutoras); exit();\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n\n // if(count($verificar)>0){\n\n \n /* return [\n 'title'=> \"Editar Unidades Ejecutoras\",\n 'content'=>$this->renderAjax('_form', [\n 'model' => $model , 'accion_central'=>$accion_central,\n 'accion_especifica'=>$accion_especifica,\n 'unidades_ejecutoras'=>$unidades_ejecutoras,\n 'precarga'=>$verificar,\n ]),\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Save',['class'=>'btn btn-primary','type'=>\"submit\"])\n \n ];\n exit();\n }*/\n\n if($request->isGet){\n \n return [\n 'title'=> \"Agregar Unidades Ejecutoras\",\n 'content'=>$this->renderAjax('_form', [\n 'model' => $model , 'accion_central'=>$accion_central,\n 'accion_especifica'=>$accion_especifica,\n 'unidades_ejecutoras'=>$unidades_ejecutoras\n ]),\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Save',['class'=>'btn btn-primary','type'=>\"submit\"])\n \n ]; \n }else //if($model->load($request->post()) && $model->save()){ \n if($model->load($request->post())){\n //se cuenta las unidades ejecutoras seleccionadas y se van guardando de una a una\n $uni_eje=$request->post('id_ue');\n $i=0;\n\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n try { \n while(count($request->post('id_ue'))!=$i){\n $model->id_ue=$uni_eje[$i];\n $id_ac_esp=$request->post('AcEspUej');\n $model->id_ac_esp=$id_ac_esp['id_ac_esp'];\n $i++;\n $model->id = NULL; \n $model->isNewRecord = true;\n if($model->save()){\n }else{\n $transaction->rollback();\n $i=count($request->post('id_ue'));\n //print_r($model->errors);\n }\n }\n\n \n $transaction->commit();\n\n return [\n 'forceReload'=>'false',\n 'title'=> \"Agregar Unidades Ejecutoras\",\n 'contenedorId' => '#especifica-pjax', //Id del contenedor\n 'contenedorUrl' => Url::to(['ac-ac-espec/index', 'ac_centralizada' => $request->post('accion_central')]),\n 'content'=>'<span class=\"text-success\">Se Ha Guardado Satisfactoriamente!</span>',\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"])\n //Html::a('Seguir Creando',['create'],['class'=>'btn btn-primary','role'=>'modal-remote'])\n \n ]; \n } catch(Exception $e) {\n $transaction->rollback();\n }\n\n }else{ \n return [\n 'title'=> \"Create new AcEspUej3\",\n 'content'=>$this->renderAjax('create', [\n 'model' => $model,\n 'accion_especifica'=>$accion_especifica,\n 'unidades_ejecutoras'=>$unidades_ejecutoras\n ]),\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Save',['class'=>'btn btn-primary','type'=>\"submit\"])\n \n ]; \n }\n }else{\n /*\n * Process for non-ajax request\n */\n if ($model->load($request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n \n }", "public function insertCourseSertifikat($data){\n if(!isset($data['id'])){\n // Generate Random id\n $idList = $this->getCourseSertifikat(0,'id');\n if ($idList) {\n $isUnique = false;\n while(!$isUnique) { \n $id = $this->randomGenerator(5);\n $id = $id;\n if(!in_array($id, $idList)){\n $isUnique = true;\n }\n }\n $data['id'] = 'CST'.$id;\n }else {\n $data['id'] = 'CST'.$this->randomGenerator(5);\n }\n }\n\n // insert\n $this->insert($data); \n\n // check if inputed\n if( $this->where('id', $data['id'])->first() ) {\n return true;\n }else{\n return false;\n }\n }", "public function insertcourses ($id_course ,$description , $lecture_id ){\n $sqlQuery = \" INSERT INTO courses (id_course , description , lecture_id ) \";\n $sqlQuery .= \" VALUES (’ $id_course ’, ’$description' , 'lecture_id')\";\n $result = $this -> getDbManager () -> executeInsertQuery ( $sqlQuery );\n return $result ;\n }", "function add_course($course_details)\n\t{\n\t\t$query = 'INSERT INTO courses (name, description, created_at, updated_at) \n\t\tVALUES (?,?,?,?)';\n\t\t$values = array($course_details['name'], $course_details['description'],\n\t\t\tdate(\"Y-m-d, H:i:s\"),date(\"Y-m-d, H:i:s\"));\n\t\treturn $this->db->query($query, $values);\n\t}", "function getAllCourses(){\n $resultGetCourses = getCourses();\n // On vérifie si tout se passe bien\n if(!$resultGetCourses){\n $message = 'La récupération des cours n\\'a pas aboutit !';\n }else{\n // Methode qui permet de compter combien entrer il y a dans cours\n $nbCourses = $resultGetCourses->rowCount();\n if($nbCourses == 0){\n $message = \"Il n'y a aucun cours pour le moment!\";\n addOneCourse();\n }else{\n require_once ('views/viewAllCourses.php');\n }\n }\n // Methode qui libère la connexion au serveur permet donc à d'autres requete sql d'être executé\n $resultGetCourses->closeCursor();\n}", "public function add() { \n\t\t\n\t\t$data = $this->load_module_info ();\n\t\t\n\t\t/* form submit */\n\t\t\n\n\n\t\tif ($this->input->post ( 'action' ) == \"Add\") {\n\t\t\tcheck_ajax_request (); /* skip direct access */\n\t\t\t$insert_array = array ();\n\t\t\t//print_r($_POST); exit;\t\t\n\t\t\t$this->form_validation->set_rules('category_name', 'lang:cate_name', 'trim|required|callback_cate_exists');\n\t\n\t\n\t\t\tif ($this->form_validation->run () == TRUE) {\n\t\t\t \n\t\t\t\t$insert_array = array(\n\t\t\t\t\t'category_name' \t=> post_value('category_name'), \n\t\t\t\t\t'category_status' \t\t=> ($this->input->post ( 'status' ) == \"A\" ? 'A' : 'I'),\n\t\t\t\t\t'category_created_by' \t=> get_admin_id(),\n\t\t\t\t\t'category_created_ip' \t=> get_ip(),\n\t\t\t\t\t'category_created_on' \t=> current_date()\n\t\t\t\t);\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t$insert_id = $this->Mydb->insert ( $this->table, $insert_array );\n\t\t\t\t\n\t\t\t\t$this->session->set_flashdata ( 'admin_success', sprintf ( $this->lang->line ( 'success_message_add' ), $this->module_label ) );\n\t\t\t\t$result ['status'] = 'success';\n\t\t\t} else {\n\t\t\t\t$result ['status'] = 'error';\n\t\t\t\t$result ['message'] = validation_errors ();\n\t\t\t}\n\t\t\t\n\t\t\techo json_encode ( $result );\n\t\t\texit ();\n\t\t}\n\t\t\n\t\t\n\t\t/* Common labels */\n\t\t$data ['breadcrumb'] = $data ['form_heading'] = get_label ( 'add' ) . ' ' . $this->module_label;\n\t\t$data ['module_action'] = 'add';\n\t\t$this->layout->display_admin ( $this->folder . $this->module . '-add', $data );\n\t\t\n\t}", "public function academicprogressCoursesInsert($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails,$userId) {\r\n $db = Zend_Db_Table::getDefaultAdapter();\r\n //$tableNAme = 'tbl_academicprogress_subjects';\r\n //$Year_Level_Block = ''; \r\n \r\n // check all DUMMY SEMESTERS and their subjects for the student. This will be listed in registered courses listing.\r\n $this->fninsertDummySubjects($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails,$userId); \r\n \r\n // COUNT the latest sem for the STUDENT\r\n $sqlTotalSem = $db->select()\r\n ->from(array('totstudsem' => 'tbl_studentsemesterstatus'),array('totstudsem.*')) \r\n ->where('totstudsem.IdStudentRegistration = ?',$lintidreg); \r\n $resultTotalSem = $db->fetchAll($sqlTotalSem);\r\n $finalTotal = count($resultTotalSem);\r\n //die;\r\n \r\n //CHECK FOR ALL \"CT\" SUBJECTS and are not \"DUMMY\", will be listed in registered course listing.\r\n $this->fninsertCTSubjects($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails,$userId); \r\n \r\n \r\n \r\n // from semester status, order by date asc, get the semester list, the first semId will be treated as sem1, next id will be sem2, ...\r\n $this->fninsertSemesterSubjects($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails,$userId); \r\n \r\n \r\n \r\n \r\n \r\n // CHECK FOR THE LATEST SEM and check from the landscape, the semester.\r\n $this->fninsertLandscapeSubjects($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails,$userId,$finalTotal); \r\n //$currentDate = date('Y-m-d'); \r\n \r\n \r\n \r\n \r\n \r\n }", "public function addAction()\n { \n $req_model = new Default_Model_Requisition(); \n $cand_model = new Default_Model_Candidatedetails();\n $cand_work_model = new Default_Model_Candidateworkdetails();\n $countriesModel = new Default_Model_Countries();\n $auth = Zend_Auth::getInstance();\n $msgarray = array();\n $popConfigPermission = array();\n \tif($auth->hasIdentity()){\n $loginUserId = $auth->getStorage()->read()->id;\n $loginuserRole = $auth->getStorage()->read()->emprole;\n\t\t\t$loginuserGroup = $auth->getStorage()->read()->group_id;\n }\n \n if(sapp_Global::_checkprivileges(COUNTRIES,$loginuserGroup,$loginuserRole,'add') == 'Yes'){\n\t\t\t\tarray_push($popConfigPermission,'country');\n\t\t}\n\t\tif(sapp_Global::_checkprivileges(STATES,$loginuserGroup,$loginuserRole,'add') == 'Yes'){\n\t\t\t\tarray_push($popConfigPermission,'state');\n\t\t}\n\t\tif(sapp_Global::_checkprivileges(CITIES,$loginuserGroup,$loginuserRole,'add') == 'Yes'){\n\t\t\t\tarray_push($popConfigPermission,'city');\n\t\t}\n \n $req_data = $req_model->getRequisitionsForCV(\"'Approved','In process'\");\n $req_options = array();\n foreach($req_data as $req){\n $req_options[$req['id']] = $req['requisition_code'].' - '.$req['jobtitlename'];\n }\n if(count($req_options)==0)\n {\n $msgarray['requisition_id'] = \"No approved requisitions.\";\n }\n $id = $this->getRequest()->getParam('id');\n\t\t$approvedrequisition_id=$this->getRequest()->getParam('req_id');\n\t\t\n $callval = $this->getRequest()->getParam('call');\n if($callval == 'ajaxcall')\n $this->_helper->layout->disableLayout();\n $form = new Default_Form_Candidatedetails(); \n $form->setAction(BASE_URL.'candidatedetails/add');\n\t\tif(!empty($approvedrequisition_id))\n\t\t{\n\t\t$form->setDefault('requisition_id',$approvedrequisition_id);\n\t\t}\n\t\t$countrieslistArr = $countriesModel->getTotalCountriesList();\n\t\tif(sizeof($countrieslistArr)>0){\n\t\t\t$form->country->addMultiOption('','Select Country');\n\t\t\tforeach($countrieslistArr as $countrieslistres)\n\t\t\t{\n\t\t\t\t$form->country->addMultiOption($countrieslistres['id'],utf8_encode($countrieslistres['country_name']) );\n\t\t\t}\n\t\t}else{\n\t\t\t$msgarray['country'] = 'Countries are not configured yet.';\n\t\t}\n\t\t/**\n NA->Not applicable candidate value defined in constant\n **/\n\t\t$notapplicable=array(NA=>'Not Applicable Candidate');\n\t\t$form->requisition_id->addMultiOptions(array(''=>'Select Requisition ID')+$req_options+$notapplicable);\n if(isset($_POST['country']) && $_POST['country']!='')\n {\n $statesmodel = new Default_Model_States();\n $statesmodeldata = $statesmodel->getStatesList(intval($_POST['country']));\n $st_opt = array();\n if(count($statesmodeldata) > 0)\n {\n foreach($statesmodeldata as $dstate)\n {\n $st_opt[$dstate['id'].'!@#'.$dstate['state_name']] = $dstate['state_name'];\n }\n }\n $form->state->addMultiOptions(array(''=>'Select State')+$st_opt);\n }\n if(isset($_POST['state']) && $_POST['state']!='')\n {\n $citiesmodel = new Default_Model_Cities();\n $citiesmodeldata = $citiesmodel->getCitiesList(intval($_POST['state']));\n $ct_opt = array();\n if(count($citiesmodeldata) > 0)\n {\n foreach($citiesmodeldata as $dcity)\n {\n $ct_opt[$dcity['id'].'!@#'.$dcity['city_name']] = $dcity['city_name'];\n }\n }\n $form->city->addMultiOptions(array(''=>'Select City')+$ct_opt);\n }\n\t\tif(isset($_POST['source']) && $_POST['source']=='Vendor')\n {\n \n\t\t\t$vendorsmodel= new Default_Model_Vendors();\n\t\t\t$vendorsdataArr=$vendorsmodel->getVendorsList();\n\t\t $vendors_array = array();\n\t\t\tif(sizeof($vendorsdataArr)>0){\n\t\t\t\t\n\t\t\t\tforeach($vendorsdataArr as $vendors)\n\t\t\t\t{\n\t\t\t\t\t $vendors_array[$vendors['id']] = $vendors['name'];\n\t\t\t\t}\n\t\t\t}\n $form->vendors->addMultiOptions(array(''=>'Select Vendor')+$vendors_array);\n }\n\t\t\n\t\t\n $data = array();\n \n\t\t$data['cand_resume'] = $this->_getParam('cand_resume'); \n\t\t$data['selected_option'] = $this->_getParam('selected_option'); \n\t\t$this->view->form = $form; \n $this->view->data = $data;\n $this->view->popConfigPermission = $popConfigPermission;\n $this->view->msgarray = $msgarray;\n if($this->getRequest()->getPost())\n {\n\t\t\t\t$result = $this->save($form);\n $this->view->msgarray = $result; \n $this->view->messages = $result;\t\n }\n }", "function addCategory($data){\n\t\t\t\n\t\t\t$token = '847895ee848fdb5fb2d43b275705470c';\n\t\t\t$domainname = 'https://elearning.inaba.ac.id';\n\t\t\t$functionname = 'core_course_create_categories';\n\t\t\t$restformat = 'json';\n\t\t\t\t$category = new stdClass();\n\t\t\t\t$category->name=$data['nama'];\t\n\t\t\t\t$category->parent=$data['parent'];\t\t\t\t\t\n\t\t\t\t$category->description='<p>'.$data['nama'].'</p>';\n\t\t\t\t$category->idnumber=$data['idnumber'];\t\t\t\t\t\n\t\t\t\t$category->descriptionformat=1;\t\t\t\t\t\t\t\t\t\n\t\t\t\t$categories = array($category);\n\t\t\t\t$params = array('categories' => $categories);\n\t\t\t\t/// REST CALL\n\t\t\t\t//header('Content-Type: text/plain');\n\t\t\t\t$serverurl = $domainname . '/webservice/rest/server.php'. '?wstoken=' . $token . '&wsfunction='.$functionname;\n\t\t\t\trequire_once($conf['model_dir'].'m_curl.php');\n\t\t\t\t$curl = new curl;\n\t\t\t\t//if rest format == 'xml', then we do not add the param for backward compatibility with Moodle < 2.2\n\t\t\t\t$restformat = ($restformat == 'json')?'&moodlewsrestformat=' . $restformat:'';\n\t\t\t\t$resp = $curl->post($serverurl . $restformat, $params);\n\t\t\t\t$data = json_decode($resp, true);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\n\n\t\t}", "public function store(StoreCoursesRequest $request)\n {\n // dd($request->all());\n if (!Gate::allows('course_create')) {\n return abort(401);\n }\n $request = $this->saveFiles($request);\n $slug = str_slug($request->title);\n\n $slug_lesson = Course::where('slug', '=', $slug)->first();\n if ($slug_lesson != null) {\n return back()->withFlashDanger(__('alerts.backend.general.slug_exist'));\n }\n\n $seats = 0;\n // if ($request->offlineData) {\n // foreach (json_decode($request->offlineData) as $key => $item) {\n // $item = json_decode(json_encode($item), true);\n // $seats += $item['seats-' . $key];\n // }\n // }\n // dd($request->all());\n\n\n\n foreach ($request->eduStatge as $i => $statge) {\n foreach($request->semesters as $j => $semester) {\n $ids[] = EduStageSemester::where('edu_stage_id',$request->eduStatge [$i])->where('semester_id',$request->semesters [$j])->pluck('id');\n }\n\n }\n $statgeSemestersIDS = Arr::collapse($ids);\n \n $course = Course::create($request->except(['offlineData', 'duration', 'learned', 'learned_ar', 'opt_courses', 'mand_courses', 'seats']));\n $course->slug = $slug;\n $course->optional_courses = $request->opt_courses ? json_encode($request->opt_courses) : null;\n $course->mandatory_courses = $request->mand_courses ? json_encode($request->mand_courses) : null;\n $course->learned = $request->learned ? json_encode($request->learned) : json_encode([]);\n $course->learned_ar = $request->learned_ar ? json_encode($request->learned_ar) : json_encode([]);\n $course->date = $request->offlineData ? json_encode($request->offlineData) : null;\n $course->seats = $seats;\n $course->published = 1;\n $course->online = 1;\n\n\n $course->save();\nforeach($statgeSemestersIDS as $i=>$semID){\n\n $courseSemester = new CourseEduStatgeSem();\n $courseSemester->course_id = $course->id;\n $courseSemester->edu_statge_sem_id = $statgeSemestersIDS[$i];\n $courseSemester->save();\n}\n\n\n //Saving videos\n if ($request->media_type != \"\") {\n $model_type = Course::class;\n $model_id = $course->id;\n $size = 0;\n $media = '';\n $url = '';\n $video_id = '';\n $name = $course->title . ' - video';\n $media = $course->mediavideo;\n if ($media == \"\") {\n $media = new Media();\n }\n if ($request->media_type != 'upload') {\n if (($request->media_type == 'youtube') || ($request->media_type == 'vimeo')) {\n $video = $request->video;\n $url = $video;\n $video_id = array_last(explode('/', $request->video));\n $size = 0;\n\n } else if ($request->media_type == 'embed') {\n $url = $request->video;\n }\n $media->model_type = $model_type;\n $media->model_id = $model_id;\n $media->name = $name;\n $media->url = $url;\n $media->type = $request->media_type;\n $media->file_name = $video_id;\n $media->size = 0;\n $media->user_id = auth()->user()->id;\n $media->duration = $request->duration;\n $media->save();\n }\n\n if ($request->media_type == 'upload') {\n\n if ($request->video_file) {\n $media = Media::findOrFail($request->video_file)->first();\n\n $media->model_type = $model_type;\n $media->model_id = $model_id;\n $media->name = $name;\n $media->save();\n } else {\n redirect()->back()->withFlashDanger('Please select a video from the list');\n }\n\n }\n }\n\n\n if ((int)$request->price == 0) {\n $course->price = NULL;\n $course->free = 1;\n $course->save();\n }\n\n\n $teachers = (auth()->user()->isAdmin() || auth()->user()->hasRole('academy')) ? array_filter((array)$request->input('teachers')) : [\\Auth::user()->id];\n $course->teachers()->sync($teachers);\n\n return redirect()->route('admin.courses.edit', ['course' => $course->id])->withFlashSuccess(trans('alerts.backend.general.created'));\n }", "public function process_lesson()\n {\n if ($this->input->is_ajax_request()) {\n\n $process = $this->M_Courses->process_lesson();\n } else {\n redirect(base_url());\n }\n }", "function update_course(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function actionAdd_educa() {\n\n if (Yii::app()->request->isAjaxRequest) {\n $model = new ResumeEducation;\n\n $data = json_decode($_POST['data']);\n\n $model->user_id = Yii::app()->user->id;\n $model->resume_id = $_POST['reid'];\n $model->school_name = $data->school_name;\n $model->grade_year = $data->grade_year;\n $model->gpa = $data->gpa;\n $model->class_rank = $data->class_rank;\n\n if ($model->save()) {\n echo $model->id;\n } else {\n echo 0;\n }\n } else {\n echo 0;\n }\n }", "public function store(CoursesRequest $request)\n {\n \n $course = new Courses($request->validated());\n $course->course_name = $request->course_name;\n $course->course_description = $request->course_description;\n $course->is_active = $request->is_active;\n $course->type = $request->type == 1 ? '1' : '0';\n $course->save();\n if($course){\n $course->getCategory()->attach($request->cat_id);\n } \n return response()->json($course, 201);\n }", "public function add()\n\t{\n\t\t$master['status'] = True;\n $data = array();\n $master = array();\n $this->form_validation->set_rules('category', 'Category', 'trim|required|max_length[64]|is_unique[tbl_product_category.category]');\n $this->form_validation->set_rules('remarks', 'Remarks', 'trim|max_length[254]');\n $this->form_validation->set_error_delimiters('<p class=\"text-danger\">', '</p>');\n\t\tif ($this->form_validation->run() == True) \n\t\t{\n\t\t\t$this->product_category->insert();\n\t\t\t$master['status'] = True;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$master['status'] = false;\n foreach ($_POST as $key => $value) \n {\n if (form_error($key) != '') \n {\n $data['error_string'] = $key;\n $data['input_error'] = form_error($key);\n array_push($master, $data);\n }\n }\n\t\t}\n\t\techo(json_encode($master));\n\t}", "public function actionCreate()\n\t{\n if($_REQUEST['flag'])\n {\n yii::app()->session['stuCreate']=true;\n }\n \n if(!yii::app()->session['stuCreate'])\n {\n $this->redirect(array('admin'));\n }\n \n $form =\"_form_2\";\n /* if(isset($_REQUEST['sectionName']))\n {\n \n \n \n yii::app()->session['batName']=substr($_REQUEST['sectionName'], '-',-2);\n yii::app()->session['secName']=substr($_REQUEST['sectionName'], -1);\n }\n */\n \n $data = array();\n \n $person = new Person();\n $student=new Student();\n $admission = new Admission();\n $acHistory = new AcademicHistory();\n $jobExp= new JobExperiance();\n \n \n if($data = DBhelper::getStudentId(yii::app()->session['secName'], yii::app()->session['batName'],yii::app()->session['proCode']))\n {\n \n $student->studentID = $data['studentID'];\n $student->stu_academicTerm = $data['bat_term'];\n $student->stu_academicYear = $data['bat_year'];\n $student->programmeCode= $data['programmeCode'];\n $admission->studentID = $data['studentID'];\n $admission->sectionName = $data['sectionName'];\n $admission->batchName = $data['batchName'];\n $admission->programmeCode = $data['programmeCode'];\n //echo $student->studentID;\n \n \n }\n \n\t\t //Uncomment the following line if AJAX validation is needed\n \n\n\n\t\tif(isset($_REQUEST['Person']) && isset($_REQUEST['Admission']) && isset($_REQUEST['Student']))\n\t\t{\n \n \n CActiveForm::validate($person);\n CActiveForm::validate($admission);\n CActiveForm::validate($student);\n CActiveForm::validate($acHistory);\n \n \n $person->attributes = $_REQUEST['Person']; \n $admission->attributes = $_REQUEST['Admission'];\n $student->attributes = $_REQUEST['Student'];\n \n \n $acHistory->ach_degree= $_REQUEST['ach_degree'];\n $acHistory->ach_group= $_REQUEST['ach_group'];\n $acHistory->ach_board= $_REQUEST['ach_board'];\n $acHistory->ach_institution= $_REQUEST['ach_institution'];\n $acHistory->ach_passingYear= $_REQUEST['ach_passingYear'];\n $acHistory->ach_result= $_REQUEST['ach_result'];\n \n $jobExp->joe_employer= $_REQUEST['joe_employer'];\n $jobExp->joe_address= $_REQUEST['joe_address'];\n $jobExp->joe_contact= $_REQUEST['joe_contact'];\n $jobExp->joe_position= $_REQUEST['joe_position'];\n $jobExp->joe_startDate= $_REQUEST['joe_startDate'];\n $jobExp->joe_endDate= $_REQUEST['joe_endDate'];\n \n \n \n if($person->validate() && $student->validate() && $admission->validate() )\n { \n \n //echo \"Bismillah Hir Rah Manir Rahim\";\n //echo \"pre:\".$_REQUEST['preview'];\n //echo \"isset\".isset($_REQUEST['preview']);\n if(isset($_REQUEST['preview']) && $_REQUEST['preview']==1)\n {\n $form=\"_form_3\";\n \n }\n elseif(isset($_REQUEST['preview']) && $_REQUEST['preview']==2 && yii::app()->session['stuCreate'])\n { //echo \"saved:\".$_REQUEST['preview'];\n \n if($person->save())\n {\t\n\n $student->personID= $person->personID;\n\n $i=0; $achFlag=false;$coma='';\n foreach($acHistory->ach_degree as $item)\n {\n\n if ($item) \n { $achFlag= true;\n if($i==0){\n $sql = \"INSERT INTO tbl_academichistory (`ach_degree`, `ach_group`, `ach_institution`, `ach_board`, `ach_passingYear`, `ach_result`, `personID`) VALUES\"; \n }\n else $coma=\",\";\n\n\n $sql .=$coma.\" ( '{$item}', '{$acHistory->ach_group[$i]}', '{$acHistory->ach_institution[$i]}', '{$acHistory->ach_board[$i]}', '{$acHistory->ach_passingYear[$i]}', '{$acHistory->ach_result[$i]}', '{$person->personID}')\"; \n }\n\n\n\n $i++;\n }\n\n //echo $sql;\n $j=0; $joeFlag=false;$coma='';\n foreach($jobExp->joe_employer as $item)\n {\n\n if ($item) \n { $joeFlag= true;\n if($j==0){\n $sql2 = \"INSERT INTO `tbl_jobexperiance` (`jobExperianceID`, `joe_employer`, `joe_address`, `joe_position`, `joe_startDate`, `joe_endDate`, `joe_contact`, `personID`) VALUES\"; \n }\n else $coma=\",\";\n\n\n $sql2 .=$coma.\" ( '{$item}', '{$jobExp->joe_employer[$j]}', '{$jobExp->joe_address[$j]}', '{$jobExp->joe_contact[$j]}', '{$jobExp->joe_position[$j]}', '{$jobExp->joe_startDate[$j]}', '{$jobExp->joe_endDate[$j]}', '{$person->personID}')\"; \n }\n\n\n\n $j++;\n }\n\n \n\n //echo $sql2;\n if($student->save() && $admission->save())\n {\n if($achFlag)Yii::app()->db->createCommand($sql)->execute();\n if($joeFlag)Yii::app()->db->createCommand($sql2)->execute();\n yii::app()->session['stuCreate']=false;\n $this->redirect(array('admin'));\n }\n\n }\n }\n \n \n \n \n }\n\t\t}\n \n \n $this->render('create',array(\n 'admission'=>$admission,'student'=>$student,'person'=>$person,'acHistory'=>$acHistory,'jobExp'=>$jobExp, 'form'=>$form\n ));\n \n \n \n \n\t\t\n\t}", "public function skills_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n $message = [];\n if (!isset($params['candidate_id'])) {\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"candidate id is required!\"\n ]\n );\n exit;\n }\n if (isset($params['old_skill_ids']) && is_array($params['old_skill_ids'])) {\n $skills = implode(',', $params['old_skill_ids']);\n if($this->update_candidate_skills($params['candidate_id'],$skills,'DELETE'))\n $message[] = 'Deleted skill id:'.$skills;\n }\n if (isset($params['old_category_ids']) && is_array($params['old_category_ids'])) {\n $categories = implode(',', $params['old_category_ids']);\n if($this->update_candidate_categories($params['candidate_id'],$categories,'DELETE'))\n $message[] = 'Deleted category id:'.$categories;\n }\n if (isset($params['new_category_ids']) && is_array($params['new_category_ids'])) {\n $categories = implode(',', $params['new_category_ids']);\n if($this->update_candidate_categories($params['candidate_id'],$categories,'PUT'))\n $message[] = 'Added category id:'.$categories;\n }\n if (isset($params['new_skill_ids']) && is_array($params['new_skill_ids'])) {\n $skills = implode(',', $params['new_skill_ids']);\n if($this->update_candidate_skills($params['candidate_id'],$skills,'PUT'))\n $message[] = 'Added skill id:'.$skills;\n } \n \n if(!empty($message)){\n $result = [\n 'status' => 1,\n 'message' => $message\n ];\n echo json_encode($result);\n }else{\n $result = [\n 'status' => 0,\n 'message' => $message\n ];\n echo json_encode($result);\n }\n }", "public function add_experience_ajax(){\n \n $this->request->onlyAllow('ajax');\n App::uses('AuthComponent', 'Controller/Component');\n \n //on recupere les experiences si c'est un utilisateur admin qui est connecté\n if($this->Auth->user('id') && $this->Auth->user('role') == 'admin'){\n \n //on recherche l'email de l'etudiant pour savoir s'il a deja un compte\n $user = $this->Experience->User->findByEmail($this->request->data['email']);\n \n //l'etudiant n'existe pas -> on le créer\n if(empty($user)){\n $this->Experience->User->create();\n $user['User']['email'] = $this->request->data['email'];\n $user['User']['firstname'] = $this->request->data['firstname'];\n $user['User']['lastname'] = $this->request->data['lastname'];\n $user['User']['school_id'] = $this->request->data['school_id'];\n $user['User']['department_id'] = $this->request->data['department_id'];\n $user['User']['active'] = \"1\";\n $user = $this->Experience->User->save($user);\n }\n \n //ajout de la ville si besoin\n $city = array();\n $city['City']['name'] = $this->request->data['city_name'];\n $city['City']['lat'] = $this->request->data['city_lat'];\n $city['City']['lon'] = $this->request->data['city_lon'];\n $city['City']['Country']['id'] = $this->request->data['country_id'];\n $city['City']['Country']['name'] = $this->request->data['country_name'];\n $city_id = $this->_createCityAndCountryIfNeeded($city, $city['City']);\n \n //puis ajout de l'experience\n $this->Experience->create();\n $experience = array();\n $experience['Experience']['dateStart'] = $this->request->data['dateStart'];\n $experience['Experience']['dateEnd'] = $this->request->data['dateEnd'];\n $experience['Experience']['establishment'] = $this->request->data['establishment'];\n $experience['Experience']['description'] = $this->request->data['description'];\n $experience['Experience']['comment'] = $this->request->data['comment'];\n $experience['Experience']['city_id'] = $city_id;\n $experience['Experience']['motive_id'] = $this->request->data['motive_id'];\n $experience['Experience']['user_id'] = $user['User']['id'];\n $experience['Experience']['typenotification_id'] = $this->request->data['typenotification_id'];\n \n if($this->Experience->save($experience) && $this->_upload_experienceNumber($city_id,1)){\n return new CakeResponse(array('body'=> json_encode(array('errorMessage'=>0)),'status'=>200));\n }\n \n return new CakeResponse(array('body'=> json_encode(array('errorMessage'=>\"Erreur lors de l'ajout\")),'status'=>500));\n }\n return new CakeResponse(array('body'=> json_encode(array('errorMessage'=>\"Vous n'êtes pas admin\")),'status'=>500));\n }", "public function add()\n {\n $update_data = $this->insert_global_model->globalinsert($this->tbl_exam_users_activity,array('user_id'=>$this->logged_in_user->id,\n 'activity_time'=>date('Y-m-d H:i:s'),'activity'=>'Create New Survey View'));\n // set page specific variables\n $page_info['title'] = 'Create New Survey'. $this->site_name;\n $page_info['view_page'] = 'administrator/survey_form_view';\n $page_info['message_error'] = '';\n $page_info['message_success'] = '';\n $page_info['message_info'] = '';\n $page_info['is_edit'] = false;\n //$page_info['cat_survey_lists'] = $this->cat_survey_lists;\n //echo \"<pre>\";\n ///print_r($this->cat_survey_lists); die();\n\n $this->_set_fields();\n $this->_set_rules();\n $page_info['catList'] = $this->select_global_model->Select_array('exm_survey_categories');\n //$page_info['catList'] = $this->question_list;\n\n //print_r_pre($page_info['catList']);\n // determine messages\n if ($this->session->flashdata('message_error')) {\n $page_info['message_error'] = $this->session->flashdata('message_error');\n }\n\n if ($this->session->flashdata('message_success')) {\n $page_info['message_success'] = $this->session->flashdata('message_success');\n }\n\n // load view\n\t$this->load->view('administrator/layouts/default', $page_info);\n }", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('curriculumdoc')) {\n try {\n $data = $this->_filterDates($data, array('cdoc_date'));\n $curriculumdoc = $this->_initCurriculumdoc();\n $curriculumdoc->addData($data);\n $cdocFileName = $this->_uploadAndGetName(\n 'cdoc_file',\n Mage::helper('bs_curriculumdoc/curriculumdoc')->getFileBaseDir(),\n $data\n );\n $curriculumId = null;\n\n if(isset($data['hidden_curriculum_id']) && $data['hidden_curriculum_id'] > 0) {\n $curriculumId = $data['hidden_curriculum_id'];\n }elseif($this->getRequest()->getParam('curriculum_id')){\n $curriculumId = $this->getRequest()->getParam('curriculum_id');\n }\n $curriculumdoc->setData('cdoc_file', $cdocFileName);\n $curriculums = $this->getRequest()->getPost('curriculums', -1);\n if ($curriculums != -1) {\n $curriculumdoc->setCurriculumsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($curriculums));\n }else {\n if(isset($data['hidden_curriculum_id']) && $data['hidden_curriculum_id'] > 0){\n $curriculumId = $data['hidden_curriculum_id'];\n $curriculumdoc->setCurriculumsData(\n array(\n $data['hidden_curriculum_id'] => array(\n 'position' => \"\"\n )\n )\n );\n }\n }\n\n $curriculumdoc->save();\n\n $add = '';//traininglist_curriculum/edit/id/1/back/edit/tab/curriculum_info_tabs_curriculumdocs/\n $backUrl = $this->getUrl('*/traininglist_curriculum/edit/', array('back'=>'edit','id' => $curriculumId, 'tab'=>'curriculum_info_tabs_curriculumdocs'));\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.location.href=\\''.$backUrl.'\\'; window.close()</script>';//window.opener.location.reload()\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_curriculumdoc')->__('Curriculum Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $curriculumdoc->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['cdoc_file']['value'])) {\n $data['cdoc_file'] = $data['cdoc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setCurriculumdocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['cdoc_file']['value'])) {\n $data['cdoc_file'] = $data['cdoc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('There was a problem saving the curriculum doc.')\n );\n Mage::getSingleton('adminhtml/session')->setCurriculumdocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('Unable to find curriculum doc to save.')\n );\n $this->_redirect('*/*/');\n }", "public function AddCourses(){\n\t\theader('Access-Control-Allow-Origin:*');\n\t\t//\tdie(print_r($_REQUEST));\n\t\t$this->load->library(\"form_validation\");\n\t\t$this->form_validation->set_error_delimiters();\n\t\t$this->form_validation->set_rules('course_name', 'Course Name', 'required');\n\t\t$this->form_validation->set_rules('course_desc', 'Description', 'required');\n\t\t//$this->form_validation->set_rules('category', 'category', 'required');\n\t\t$this->form_validation->set_rules('course_price', 'Price', 'required');\n\t\t\n\t\t\n\n\t\t\t$_FILES[\"course_image\"];\n\t\t\t$config['upload_path'] = 'uploads/';\n\t\t\t$config['allowed_types'] = 'jpg|png|jpeg';\n\t\t\t$config['max_size']\t= '500';\n\t\t\t$config['max_width']= '870';\n\t\t\t$config['max_height']= '300';\n\t\t\t$config['encrypt_name']= TRUE;\n\t\t\t$this->load->library('upload', $config);\n\t\t\tif ( ! $this->upload->do_upload('course_image'))\n\t\t\t\t{\n\t\t\t\t\t$error = array('error' => $this->upload->display_errors());\n\t\t\t\t\tdie($error['error']);\n\t\t\t\t}\n\n\t\t\t$image = array('upload_data' => $this->upload->data());\n\t\t \n\n\t\t\tif($this->form_validation->run())\n\t\t\t{\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\"course_name\"=>$this->input->post(\"course_name\"),\n\t\t\t\t\t\"course_desc\"=>$this->input->post(\"course_desc\"),\n\t\t\t\t\t\"category_id\"=>1,\n\t\t\t\t\t\"course_price\"=>$this->input->post(\"course_price\"),\n\t\t\t\t\t\"course_image\"=>$image['upload_data']['file_name']\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//die(print_r($data));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($res=$this->PostModel->NewCourse($data))\n\t\t\t\t\t{\n\t\t\t\t\t\tdie ('Submit Successfully');\t\t\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\tdie ('Please ReSubmit');\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\techo validation_errors();\n\t\t\t}\n\t}", "function addsubjectAction(){\r\n\t\tif($this->getRequest()->isPost()){\r\n\t\t\t$data = $this->getRequest()->getPost();\r\n\t\t\t$_dbmodel = new Global_Model_DbTable_DbSubjectExam();\r\n\t\t\t$data['status']=1;\t\r\n\t\t\t$id=$_dbmodel->addNewSubjectExam($data);\r\n\t\t\tprint_r(Zend_Json::encode($id));\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "function add()\n { \n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'id_commission' => $this->input->post('id_commission'),\n\t\t\t\t'id_user' => $this->input->post('id_user'),\n );\n \n $commission_groupe_id = $this->Commission_groupe_model->add_commission_groupe($params);\n redirect('commission_groupe/index');\n }\n else\n {\n\t\t\t$this->load->model('Commission_tech_model');\n\t\t\t$data['all_commission_tech'] = $this->Commission_tech_model->get_all_commission_tech();\n\n\t\t\t$this->load->model('User_model');\n\t\t\t$data['all_user'] = $this->User_model->get_all_user();\n\n\t\t\t$this->load->view('include/header');\n\t\t\t$this->load->view('advocate/commission_groupe/add',$data);\n\t\t\t$this->load->view('include/footer');\n }\n }", "function add_student($data){\n $this->where('payinslip_id',$data->reference)->get();\n if($this->result_count()== 0){\n $this->student_id =preg_replace(\"/[.]/\",'/', $data->student);\n $this->student_name = $data->name;\n $this->paid_amount =$data->amount;\n $this->date_of_deposit = $data->date;\n $this->payinslip_id = $data->reference;\n $this->transaction_key = $data->reference;\n $this->checked =$data->checked;\n $this->checked_by = $data->checkedby;\n $this->academic_year = $data->acyear;\n $this->payinslip_file = $data->payinslip_file;\n $this->form_iv_index = preg_replace(\"/[.]/\",'/',$data->index);\n $this->comments = $data->description;\n $this->paid_for = $data->description;;\n $this->import_date = $data->importdate;\n $this->bank_branch = $data->branch;\n $status = $this->skip_validation(true)->save();\n }else{\n return 'Item Exists';\n }\n /* if(!$success){\n\n if($this->valid){\n $status['status']=false;\n $status['msg']='The record has failed to save';\n }else{\n $status['status']=false;\n $this->set_form_errors();\n $status['msg']=$this->form_error();\n }\n\n }else{\n\n $status['status']=$this->count();\n $status['msg']='Success';\n \n } */\n\n return $status;\n }", "public function compAjaxUpdate() {\r\n $req = $this->input->post('req');\r\n updateComponentDetails($req);\r\n }", "public function actionUpdateCourses()\n\t{\n\t\t$courses = Course::model()->findAll('faculty_id=:X', array(':X' => (int) $_POST['faculty_id']));\n\n\t\techo CHtml::dropDownList('Note[course_id]', '',\n\t\t\tCHtml::listData($courses, 'id', 'name'),\n\t\t\t array('prompt' => 'Pilih mata kuliah'));\n\t}", "public function newAction() {\n\n $ajaxResponse = new \\Igestis\\Ajax\\AjaxResult();\n if ($this->request->IsPost()) {\n\n $cloneFromId = $this->request->getPost(\"copyFrom\");\n $cloneFrom = null;\n if($cloneFromId) $cloneFrom = $this->_em->find(\"CommercialCommercialDocument\", $cloneFromId);\n $document = new \\CommercialCommercialDocument($cloneFrom);\n\n // Create the new commercial document\n $parser = new \\IgestisFormParser();\n $parser->FillEntityFromForm($document, $_POST);\n $document->setCustomerUser($this->_em->getRepository(\"CoreUsers\")->find($this->request->getPost(\"customerUser\")));\n\n try {\n if($this->request->getPost(\"projectId\")) {\n $project = $this->_em->find(\"CommercialProject\", $this->request->getPost(\"projectId\"));\n if(!$project) throw new \\Exception(\\Igestis\\I18n\\Translate::_(\"Unknown project\"));\n $document->setProject($project)->setCustomerUser($project->getCustomerUser());\n }\n\n //throw new \\Exception(\\Igestis\\Utils\\Dump::get($document));\n \n $this->context->entityManager->persist($document);\n $this->context->entityManager->flush();\n // Show wizz to article the document update\n new \\wizz(_(\"The document has been successfully created\"), \\WIZZ::$WIZZ_SUCCESS);\n $ajaxResponse->setRedirection(\\ConfigControllers::createUrl(\"commercial_selling_document_edit\", array(\"Id\" => $document->getId())))\n ->setSuccessful(\"ok\")\n ->render();\n } catch (\\Exception $e) {\n $ajaxResponse\n ->addWizz(sprintf(\\Igestis\\I18n\\Translate::_(\"An error has occurred during the project creation : %s\"), $e->getMessage()), \\wizz::$WIZZ_ERROR, \"#selling-document-wizz\")\n ->setError(sprintf(\\Igestis\\I18n\\Translate::_(\"An error has occurred during the project creation : %s\"), $e->getMessage()), $e);\n }\n }\n else {\n $ajaxResponse->setError(\\Igestis\\I18n\\Translate::_(\"No data has been received for the selling document creation\"));\n }\n\n }", "public function addContentData()\n\t\t{\n\t\t\t_is_logged_in();\n\n\t\t\t$data = array();\n\n\t\t\tif ($_POST) {\n\n\t\t\t\tforeach ($this->input->post() as $key => $value) {\n\n\t\t\t\t\tif ($key == 'section_name') {\n\t\t\t\t\t\t$data['section_slug'] = url_title(convert_accented_characters($value));\n\t\t\t\t\t}\n\t\t\t\t\t$data[$key] = $value;\n\t\t\t\t}\n\n\t\t\t\t$data['language'] = $this->session->userdata('language');\n\t\t\t}\n\n\t\t\t// Send data\n\t\t\t$query = $this->co_pages_model->add_section($data);\n\n\t\t\tif ($query > 0) {\n\t\t\t\tredirect('admin/co_pages/add_content?action=success');\n\t\t\t} else {\n\t\t\t\tredirect('admin/co_pages/add_content?action=error');\n\t\t\t}\n\n\t\t}", "public function add() \n { \n $data['delivery_method'] = $this->delivery_methods->add();\n $data['action'] = 'delivery_method/save';\n \n $this->template->js_add('\n $(document).ready(function(){\n // binds form submission and fields to the validation engine\n $(\"#form_delivery_method\").parsley();\n });','embed');\n \n $this->template->render('delivery_method/form',$data);\n\n }", "public function actionInsert()\n\t{\n\t\t$model=new Knowledgecatalogue();\n\t\t$model->fCatalogueNo=GuidUtil::getUuid();\n\t\t$model->fFatherCatalogueNo=$_POST['no'];\n\t\t$model->fCatalogueName=$_POST['name'];\n\t\t$model->fStatus=$_POST['statu'];\n\t\t$model->fIsDownLoad=$_POST['down'];\n\t\t$model->fCreateUser=Yii::app()->params->loginuser->fUserName;\n\t\t$model->fCreateDate=time();\n\t\t$model->fUpdateUser=Yii::app()->params->loginuser->fUserName;\n\t\t$model->fUpdateDate=time();\n\t\tif($model->save())\n\t\t{\n\t\t\t$this->renderPartial('update',array(\n\t\t\t\t\t'data'=>UFSBaseUtil::printJson(array(\n\t\t\t\t\t\t\t'fCatalogueNo'=>CHtml::encode($model->fCatalogueNo),\n\t\t\t\t\t\t\t'fIsDownLoad'=>CHtml::encode($model->fIsDownLoad),\n\t\t\t\t\t\t\t'fCatalogueName'=>CHtml::encode($model->fCatalogueName),\n\t\t\t\t\t\t\t'fFatherNo'=>$model->fFatherCatalogueNo,\n\t\t\t\t\t\t\t'fStatus'=>CHtml::encode($model->fStatus),\n\t\t\t\t\t\t\t'fCreateDate'=>CHtml::encode(empty($model->fCreateDate)?'':date('Y-m-d',$model->fCreateDate)),\n\t\t\t\t\t\t\t'fCreateUser'=>CHtml::encode($model->fCreateUser),\n\t\t\t\t\t\t\t'fUpdateDate'=>CHtml::encode(empty($model->fUpdateDate)?'':date('Y-m-d',$model->fUpdateDate)),\n\t\t\t\t\t\t\t'fUpdateUser'=>CHtml::encode($model->fUpdateUser),\n\t\t\t\t\t\t\t'msg'=>$this->FrameInfo(Yii::app()->params['layouttype']['top'],Yii::t('message','Add Success'),Yii::app()->params['notytype']['success']),\n\t\t\t\t\t))\n\t\t\t));\n\t\t}\n\t}", "function add_exam(){\n\t\t\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$act_mode \t= mysqli_real_escape_string($con,$_POST['act_mode']);\n\t\t$cmbcourse \t= mysqli_real_escape_string($con,$_POST['cmbcourse']);\n\t\t$cmbetype = mysqli_real_escape_string($con,$_POST['cmbetype']);\n\t\t$paper = mysqli_real_escape_string($con,$_POST['paper']);\n\t\t$txtmarks = mysqli_real_escape_string($con,$_POST['txtmarks']);\n\t\t$cmbduration = mysqli_real_escape_string($con,$_POST['cmbduration']);\n\t\t//alert($cid);\n\t\t\n\t\t$sth = $dbh->prepare('INSERT INTO exam (examtype,paper,examduration,exammarks,couID) VALUES(?,?,?,?,?);');\n\t\t$sth->execute(Array($cmbetype,$paper,$cmbduration,$txtmarks,$cmbcourse));\n\t\t\n\t\tif(count($sth)<0){\n\t\t\t\t\t \n\t\t\t\t\t $status =\"false\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\n\t\t\t\t\t$status =\"true\";\n\t\t\t\t}\n\t\n\t\t\t\techo json_encode($status);\n\t}", "public function actionRecommend()\r\n {\r\n $course_resource = new CourseResource();\r\n if(isset($_POST['class_id'])&&!empty($_POST['class_id'])){\r\n $class=ActualClass::model()->with('course')->findByPk($_POST['class_id']);\r\n if(!empty($class)){\r\n $_POST['course_id']=$class->course->id;\r\n }else{\r\n unset($_POST['class_id']);\r\n }\r\n }\r\n $course_resource->attributes = array_merge($_POST, array(\r\n 'user_id' => Yii::app()->user->id,\r\n ));\r\n if ($course_resource->save()) {\r\n AjaxResponse::success($this->smarty->fetchString('item', array('resource' => $course_resource)));\r\n } else {\r\n AjaxResponse::success($course_resource->errors);\r\n }\r\n }", "function new_Education(){\r\n\tif($_GET['url']=='new_Education'){\r\n\t\r\n\t$arrArgs= array(\"institute\"=>@$_GET['newinstitute'],\r\n\t\"start_year\"=>@$_GET['newistart'],\r\n\t\"end_year \"=>@$_GET['newiend'],\r\n\t\"university\"=>@$_GET['newuniversity'], \r\n\t\r\n\t);\r\n\t$arrData=loadModel(\"personalprofile\",\"insert_Education\",$arrArgs);\r\n\t\r\n\theader(\"location:\".ROOTPATH.\"/index.php?controller=profile\");\r\n\t\r\n\t}\r\n\t}", "public function addCourse(Request $request)\n {\n $validatedData = $request->validate([\n 'course_id' => 'required',\n 'start_date' => 'required'\n ]);\n\n $enrollment_exists = CourseEnrollment::where('course_id', $request->input('course_id'))\n ->where('student_id', $request->input('student_id'))\n ->first();\n $student = Student::find($request->input('student_id'));\n if ($enrollment_exists) {\n return redirect()->route('admin.students.show', $student)->with('warning', 'Course already exists');\n }\n\n $enrollment = new CourseEnrollment;\n $enrollment->student_id = $request->input('student_id');\n $enrollment->course_id = $request->input('course_id');\n $enrollment->start_date = Carbon::parse($request->input('start_date'))->format('Y-m-d');\n $enrollment->save();\n\n return redirect()->route('admin.students.show', $student)->with('save', 'Course saved successfully');\n }", "static public function ctrAgregarColaborador(){\n\n if (isset($_POST['nuevoDocumento'])) {\n\n if (preg_match('/^[0-9]+$/', $_POST[\"nuevoDocumento\"]) &&\n\t\t\t\tpreg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST['nuevoNombre'])) {\n\n $tabla = \"tbusuario\";\n\t\t\t\t$datos = array(\n\t\t\t\t\t\"documento\" => $_POST['nuevoDocumento'],\n\t\t\t\t\t\"nombre\" => $_POST['nuevoNombre'],\n\t\t\t\t\t\"password\" => $_POST['nuevoDocumento'],\n\t\t\t\t\t\"area\" => $_POST['nuevaArea'],\n\t\t\t\t\t\"empresa\" => $_POST['nuevaEmpresa'],\n\t\t\t\t\t\"tipoUsuario\" => 2\n );\n\t\t\t\t\n\t\t\t\t$respuesta = ModeloColaboradores::mdlAgregarColaborador($tabla,$datos);\n\n\t\t\t\tif ($respuesta == \"ok\") {\n\n\t\t\t\t\techo '<script> \n\t\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\t\ticon: \"success\",\n\t\t\t\t\t\t\t\ttitle: \"El colaborador ha sido guardado correctamente!\",\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false,\n\t\t\t\t\t \t\t}).then((result)=>{\n\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\twindow.location =\"colaboradores\";\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n\t\t\t\t\t\t\n\t\t\t\t\techo '<script>\n\n\t\t\t\t\t\t\tCommand: toastr[\"success\"](\"El colaborador '.$_POST[\"nuevoNombre\"].' se agrego a la tabla\")\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo '<script> \n\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\ticon: \"error\",\n\t\t\t\t\t\ttitle: \"Ocurrio un error vuelva a intentarlo\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\tcloseOnConfirm: false,\n\t\t\t\t\t }).then((result)=>{\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\twindow.location =\"colaboradores\";\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t}else{\n\n\t\t\t\techo '<script> \n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ticon: \"error\",\n\t\t\t\t\t\t\ttitle: \"El colaborador no puede ir vacío o llevar caracteres especiales\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\tcloseOnConfirm: false,\n\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\twindow.location =\"colaboradores\";\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\t\t\t}\n \n }\n\n\t}", "public function add()\n {\n \t\t$options = array(\n \t\t\t\t'order' => array('Categories.name' => 'asc')\n \t\t);\n \t\t//Get Categories\n \t\t$categories = $this->Jobs->Categories->find('list', $options);\n \t\t//Set Categories\n \t\t$this->set('categories', $categories);\n\n \t\t//Get types for select list\n \t\t$types = $this->Jobs->Types->find('list');\n \t\t//Set Types\n \t\t$this->set('types', $types);\n\n $job = $this->Jobs->newEntity();\n if($this->request->is('post')){\n $this->request->data['Jobs']['user_id'] = $this->Auth->user('id');\n $job = $this->Jobs->patchEntity($job, $this->request->data);\n\n if($this->Jobs->save($job)){\n $this->Flash->success('Your job has been listed');\n return $this->redirect(array('action' => 'index'));\n }\n\n $this->Flash->set('Unable to add your job');\n }\n }", "function add() {\n if (isset($_POST) && count($_POST) > 0) {\n $params = array(\n 'workname' => $this->input->post('workname'),\n 'description' => $this->input->post('description'),\n );\n\n $jcline_id = $this->Jcline_model->add_jcline($params);\n redirect('jcline/index');\n } else {\n $data['_view'] = 'jcline/add';\n $this->load->view('layouts/main', $data);\n }\n }", "public function add_course($id = null)\n {\n if (!$id) {\n throw new MethodNotAllowedException();\n }\n\n if ($this->request->is('post')) {\n $data = $this->ClassesCourse->find('first',\n array(\"conditions\" => \"ClassesCourse.class_id = \" . $this->request->data['ClassesCourse']['class_id'] . \"\n and ClassesCourse.course_id = \" . $this->request->data['ClassesCourse']['course_id']));\n if (!$data) {\n $this->ClassesCourse->create();\n if ($this->ClassesCourse->save($this->request->data)) {\n $this->Session->setFlash(__('New course has been successfully added.'), 'flash_success');\n return $this->redirect(array('action' => 'view', $id));\n } else {\n $this->Session->setFlash(__('The course could not be added. Please, try again.'), 'flash_fail');\n }\n }\n else {\n $this->Session->setFlash(__('Oops! Selected course is already added to this class.'), 'flash_fail');\n }\n }\n $this->set(array('courses' => $this->Course->find('list'),\n 'class' => $this->StudentClass->findById($id)));\n }", "public function actionCreate($sectionid)\n {\n $model = new News();\n // $sections = SecNews::find()->select(['id','header'])->asArray()->all();\n $sections = SecNews::find()->select(['id','header'])->all();\n $sections = ArrayHelper::map($sections,'id','header');\n // echo \"<pre>\";\n // var_dump($a);\n // die;\n $params = [\n 'prompt' => 'Выберите секцию…'\n ];\n if (isset($sectionid)) {\n $params['options'] = [$sectionid => ['Selected'=>'selected']];\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'sections' => $sections,\n 'params' => $params,\n ]);\n }\n }", "public function addnew()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'component', 'create')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\tif (!empty($_FILES['fupload']['tmp_name'])) {\n\t\t\t\t$exp = explode('.', $_FILES['fupload']['name']);\n\t\t\t\t$componentName = $this->postring->seo_title($exp[0]).'-'.rand(000000,999999).'-popoji.'.$exp[1];\n\t\t\t\t$componentType = $this->postring->valid($_POST['type'], 'xss');\n\t\t\t\tif ($componentType == 'component') {\n\t\t\t\t\t$folderinstall = 'component';\n\t\t\t\t} else {\n\t\t\t\t\t$folderinstall = 'widget';\n\t\t\t\t}\n\t\t\t\tif (in_array($exp[1], array('zip'))) {\n\t\t\t\t\tmove_uploaded_file($_FILES['fupload']['tmp_name'], '../'.DIR_CON.'/uploads/'.$componentName);\n\t\t\t\t\tif (file_exists('../'.DIR_CON.'/'.$folderinstall.'/'.strtolower($this->postring->valid($_POST['component'], 'xss')))) {\n\t\t\t\t\t\tunlink('../'.DIR_CON.'/uploads/'.$componentName);\n\t\t\t\t\t\t$this->poflash->error($GLOBALS['_']['component_message_3'], 'admin.php?mod=component');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$archive = new PoPclZip('../'.DIR_CON.'/uploads/'.$componentName);\n\t\t\t\t\t\tif ($archive->extract(PCLZIP_OPT_PATH, '../'.DIR_CON.'/'.$folderinstall.'/'.strtolower($this->postring->valid($_POST['component'], 'xss'))) == 0) {\n\t\t\t\t\t\t\tunlink('../'.DIR_CON.'/uploads/'.$componentName);\n\t\t\t\t\t\t\t$this->poflash->error($GLOBALS['_']['component_message_3'], 'admin.php?mod=component');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t'component' => strtolower($this->postring->valid($_POST['component'], 'xss')),\n\t\t\t\t\t\t\t'type' => $this->postring->valid($_POST['type'], 'xss'),\n\t\t\t\t\t\t\t'datetime' => date('Y-m-d H:i:s')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$query_component = $this->podb->insertInto('component')->values($data);\n\t\t\t\t\t\t$query_component->execute();\n\t\t\t\t\t\tunlink('../'.DIR_CON.'/uploads/'.$componentName);\n\t\t\t\t\t\tif (file_exists('../'.DIR_CON.'/'.$folderinstall.'/'.strtolower($this->postring->valid($_POST['component'], 'xss')).'/install.php')) {\n\t\t\t\t\t\t\t$this->poflash->success($GLOBALS['_']['component_message_1'], 'admin.php?mod=component&act=install&folder='.strtolower($this->postring->valid($_POST['component'], 'xss')));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->poflash->success($GLOBALS['_']['component_message_1'], 'admin.php?mod=component');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->poflash->error($GLOBALS['_']['component_message_3'], 'admin.php?mod=component');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->poflash->error($GLOBALS['_']['component_message_3'], 'admin.php?mod=component');\n\t\t\t}\n\t\t}\n\t\t?>\n\t\t<div class=\"block-content\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t<?=$this->pohtml->headTitle($GLOBALS['_']['component_addnew']);?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t<?=$this->pohtml->formStart(array('method' => 'post', 'action' => 'route.php?mod=component&act=addnew', 'enctype' => true, 'autocomplete' => 'off'));?>\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t<div class=\"col-md-6\">\n\t\t\t\t\t\t\t\t\t\t<?=$this->pohtml->inputText(array('type' => 'text', 'label' => $GLOBALS['_']['component_title'], 'name' => 'component', 'id' => 'component', 'mandatory' => true, 'options' => 'required'));?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"col-md-6\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t$item = array();\n\t\t\t\t\t\t\t\t\t\t\t$item[] = array('value' => 'component', 'title' => 'Component');\n\t\t\t\t\t\t\t\t\t\t\t$item[] = array('value' => 'widget', 'title' => 'Widget');\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<?=$this->pohtml->inputSelect(array('id' => 'type', 'label' => $GLOBALS['_']['component_type'], 'name' => 'type', 'mandatory' => true), $item);?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t\t\t\t\t\t<?=$this->pohtml->inputText(array('type' => 'file', 'label' => $GLOBALS['_']['component_browse_file'], 'name' => 'fupload', 'id' => 'fupload', 'mandatory' => true));?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<?=$this->pohtml->formAction();?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?=$this->pohtml->formEnd();?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "public function actionManageLessonGroup()\n {\n //$data = lesson tuong ung\n $message = null;\n if (isset($_GET['lesson_id']) && isset($_GET['student'])) {\n $data = Lesson::model()->findByPk($_GET['lesson_id']);\n }\n\n $lesson_id = $_GET['lesson_id'];\n $old_student_id = $_GET['student'];\n if (isset($_POST['student'])) {\n // check if the student already enroll for that lesson\n {\n for ($i = 0; $i < count($data->students); $i++) {\n if ($data->students[$i]->student_id == $_POST['student']) {\n\n throw new CHttpException('The student ' . $_POST['student'] .\n 'already enrolled in the lesson!');\n }\n }\n }\n\n\n if (count($data->students) >= 4) {\n throw new CHttpException('The maximum students in the lesson is 4 !');\n }\n // save student lesson\n $s = new Studentlesson;\n $s->student_id = $_POST['student'];\n $s->lesson_id = $data->id;\n // save invoice\n $in = Invoice::model()->findByAttributes(array('student_id' => $old_student_id));\n $price_id = $data->price_id;\n $in->date_create = date('y-m-d h:m:s');\n $price = Price::model()->findByPk($price_id)->rate;\n $total_week = $data->total;\n $in->lesson_id = $lesson_id;\n $in->total = $price * $total_week;\n $gg = $in->total;\n\n if (!($in->save())) {\n throw new CHttpException('Unable to save old invoice!');\n }\n if (!($s->save())) {\n throw new CHttpException('Unable to save!');\n }\n // change old invoice\n\n // new invoice\n $invoice = new Invoice;\n $invoice->number = $_POST['student'] . '000000';\n $invoice->date_create = date('y-m-d h:m:s');\n $invoice->status = 1;\n $price_rate = Price::model()->findByPk($price_id)->rate;\n\n $invoice->total = $price_rate * $total_week;\n $invoice->student_id = $_POST['student'];\n $invoice->lesson_id = $lesson_id;\n $invoice->save();\n //save changes to sessions\n $count = count($data->sessions);\n $new_student = (string )$_POST['student'];\n for ($i = 0; $i < $count; $i++) {\n $session = Session::model()->findByPk($data->sessions[$i]->id);\n\n if (count(explode(',', $session->students_id)) >= 4) {\n throw new CHttpException('only 4 students in the sessions!');\n }\n //echo $session->students_id;\n //break;\n $session->students_id = $session->students_id . ',' . $new_student;\n if (!($session->save())) {\n throw new CHttpException('Unable to save!');\n }\n }\n //break;\n //\n\n $message = \"Save Successful!!!\";\n }\n\n $this->render('manageLessonGroup', array(\n 'message' => $message,\n 'data' => $data,\n 'test' => $old_student_id));\n\n }", "public static function add_course($course_name, $course_number, $association)\n\t{\n\t\t$email = $_SESSION['email'];\n\t\t$dbhandle=DataAccessHelper::getConnection();\n\n\t\t$sql = \"select * from course WHERE email = ? AND courseName =? AND courseNumber = ? AND association=?;\";\n\t\t$stmt = \tmysqli_stmt_init($dbhandle);\n\n\t\tif(!mysqli_stmt_prepare($stmt, $sql)){\n\n\t\t\techo \"SQL statement failed\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmysqli_stmt_bind_param($stmt, \"ssss\",$email, $course_name, $course_number, $association);\n\t\t\tmysqli_stmt_execute($stmt);\n\t\t\t$result = mysqli_stmt_get_result($stmt);\n\t\t\tif($result->num_rows > 0){\n\t\t\t\t\treturn \"Record already exists!\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$sql = \"INSERT INTO course (email,courseName,courseNumber,association) VALUES (?, ? , ?, ?)\";\n\t\t\t\t\t$stmt = mysqli_stmt_init($dbhandle);\n\t\t\t\t\tif(!mysqli_stmt_prepare($stmt, $sql)){\n\t\t\t\t\t\t\n\t\t\t\t\t\techo \"SQL error\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\n\t\t\t\t\t\tmysqli_stmt_bind_param($stmt, \"ssss\",$email, $course_name, $course_number, $association);\n\t\t\t\t\t\tmysqli_stmt_execute($stmt);\n\t\t\t\t\t\treturn \"course added successfully\";\n\n\t\t\t\t\t}\n\t\t\t}\n\n\n\n\n\t\t\t// $result = mysqli_query($dbhandle,\"select * from course WHERE email = '$email' AND courseName ='$course_name' AND courseNumber ='$course_number' AND association='$association';\") or die(\"Failed to query database\".mysqli_error($dbhandle));\n\t\t\t// //echo $result->num_rows;\n\t\t\t// if ($result->num_rows > 0) {\n\t\t\t// \treturn \"Record already exists!\";\n\t\t\t// }\n\t\t\t// else{\n\t\t\t// \tmysqli_query($dbhandle,\"INSERT INTO course(email,courseName,courseNumber,association) VALUES ('$email', '$course_name' , '$course_number','$association')\");\n\n\t\t\t// \treturn \"course added successfully\";\n\t\t\t }\n\t\t\n\t}", "function updateRelation() {\n $bl = new BL();\n $m= new StudentCourseModel($param);\n $courses=$m->getCourseID();\n \n for($i=0; $i<count($courses); $i++) {\n $newCourses= \"id_course = '\".$courses[i].\"', course_name='\".$m->getName().\"',course_description = '\" .$m->getDescription(). \"',\n course_image = '\". $m->getImage().\"'\";\n $updatedCourse = $bl->updateData('school_relation', $m->getID(),$newCourses);\n if ($updatedCourse ==true){\n return true;\n }\n else{ return false;\n}\n} \n }" ]
[ "0.7340121", "0.6612516", "0.63692796", "0.62752384", "0.6167571", "0.6139919", "0.6110265", "0.6075473", "0.60590464", "0.60541105", "0.60468006", "0.5952584", "0.58993226", "0.5861476", "0.5836988", "0.5827297", "0.58088994", "0.580705", "0.5794801", "0.57909715", "0.5756418", "0.5755837", "0.5750361", "0.5691228", "0.5687027", "0.5683784", "0.5670763", "0.5646466", "0.56220216", "0.56090343", "0.56038576", "0.5600227", "0.5593437", "0.55793834", "0.5578201", "0.5578115", "0.5573155", "0.5566466", "0.5563486", "0.5555469", "0.55498564", "0.5548368", "0.5528553", "0.55275255", "0.55252", "0.55249614", "0.5524509", "0.5507905", "0.54981744", "0.54914516", "0.5480982", "0.54745156", "0.5468169", "0.5446371", "0.5440683", "0.543208", "0.5430079", "0.5426812", "0.5407649", "0.54039073", "0.54005086", "0.5396223", "0.5395668", "0.5394209", "0.53918886", "0.5391336", "0.5372985", "0.5372632", "0.5370659", "0.5359983", "0.53576756", "0.53542703", "0.535183", "0.5347225", "0.53389204", "0.5337634", "0.53264964", "0.5326146", "0.5325643", "0.5319359", "0.5306983", "0.53047127", "0.52999455", "0.5287955", "0.5287464", "0.52863693", "0.5281093", "0.5279834", "0.5275732", "0.52721095", "0.5254997", "0.52527654", "0.5251391", "0.5250966", "0.52455217", "0.52451795", "0.5242942", "0.52408624", "0.5237629", "0.5237043" ]
0.6956506
1
/ ADD A NEW sessions ========================================================================
public function add_sessions() { $sessions = $this->input->post("sessions"); if($sessions==""){ echo "please sessions section is empty"; }else{ $sessions = $data = $this->security->xss_clean($sessions); $sessions = $this->authadmin->sanitize_string($sessions); $total = $this->admin_student_courses_mdl->check_sessions($sessions); if($total==0){ $data = array( 'sessions_name' => $sessions, ); $this->admin_student_courses_mdl->add_sessions($data); echo "new sessions successfully added"; }else{ echo "this sessions already exist"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function addSession($session);", "public function addToSession() {\n $s = Session::getInstance();\n $key = $this->sessionId;\n $s->$key = $this->getId();\n if ($s->$key === null) {\n Log::warn(\"Adding null user ID to session\");\n }\n $this->setAuthed(true);\n }", "function add_session($id, $key)\n{\n try {\n $dir = VAR_FOLDER;\n $filename = DEFAULT_SESSIONSFILE;\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n }\n $sessions = array();\n $account = null;\n // if file exists, try to update the entry\n if (file_exists($filename)) {\n $content = file_get_contents($filename);\n $sessions = parse_sessions($content);\n if (($index = getindex_sessionbykey($id, $key, $sessions)) > -1) {\n $sessions[$index]->time = (new \\DateTime())->getTimestamp();\n }\n }\n // else, create a new session\n if (!$account) {\n $sessions[] = (object) array(\n 'id' => password_hash($id, PASSWORD_DEFAULT),\n 'time' => (new \\DateTime())->getTimestamp()\n );\n }\n $file = fopen($filename, \"w\");\n fwrite($file, json_encode($sessions). \"\\n\");\n fclose($file);\n return true;\n } catch (Exception $e) {\n throw new Exception($e->getMessage(), $e->getCode());\n }\n}", "public function onSessionsAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function newSession();", "public function insertSession()\n\t{\n\t\t$date = date('Y-m-d');\n\n\t\t$oCounter_Session = Core_Entity::factory('Counter_Session');\n\n\t\t$oCounter_Session->counter_display_id = $this->display != ''\n\t\t\t? $this->update('counter_displays', array(\n\t\t\t\t'site_id' => $this->site->id,\n\t\t\t\t'date' => $date,\n\t\t\t\t'display' => mb_substr($this->display, 0, 11)\n\t\t\t\t))\n\t\t\t: 0;\n\n\t\t$oCounter_Session->counter_useragent_id = $this->update('counter_useragents', array(\n\t\t\t'site_id' => $this->site->id,\n\t\t\t'date' => $date,\n\t\t\t'useragent' => mb_substr(Core_Str::removeEmoji($this->userAgent), 0, 255),\n\t\t\t'crawler' => intval($this->bBot)\n\t\t));\n\n\t\t$oCounter_Session->counter_os_id = !$this->bBot\n\t\t\t? $this->update('counter_oses', array('site_id' => $this->site->id, 'date' => $date, 'os' => self::getOs($this->userAgent)))\n\t\t\t: 0;\n\n\t\t$oCounter_Session->counter_browser_id = !$this->bBot\n\t\t\t? $this->update('counter_browsers', array('site_id' => $this->site->id, 'date' => $date, 'browser' => self::getBrowser($this->userAgent)))\n\t\t\t: 0;\n\n\t\t$oCounter_Session->counter_device_id = !$this->bBot\n\t\t\t? $this->update('counter_devices', array('site_id' => $this->site->id, 'date' => $date, 'device' => self::getDevice($this->userAgent)))\n\t\t\t: 0;\n\n\t\t$oCounter_Session->site_id = $this->site->id;\n\t\t$oCounter_Session->last_active = Core_Date::timestamp2sql(time());\n\t\t$oCounter_Session->save();\n\n\t\t// Флаг добавления новой сессии - истина\n\t\t$this->bNewSession = TRUE;\n\n\t\treturn $oCounter_Session->id;\n\t}", "function add_session($id, $name) {\n $this->start_session();\n $_SESSION['id'] = $id;\n $_SESSION['name'] = $name;\n setcookie('id', $id, time() + 60 * 60 * 24 * 7, '/');\n }", "public function addNewClient() {\n\t\t$this->Db->query(\"INSERT INTO `yp_sessions` (`hash`, `last_time`) \n\t\t\tVALUES ('{$this->_thisClientHash()}', '{$this->Request->time}');\");\n\n\t\t\n\t}", "function addSession($username) {\n if (!$username) {\n $username = \" \";\n };\n $IP = getenv(\"REMOTE_ADDR\");\n \n $sessionValue = session_id();\n \n $sql = \"INSERT INTO sessions (sessionID, sessionValue,sessionTimestamp, sessionUser,sessionIP) VALUES (0, '$sessionValue',NOW(),'$username','$IP')\";\n $result = mysql_query($sql) or die(\"Unable to insert search log.\");\n}", "private function addSession(Cookie\\Session $session) {\n self::$sessions[] = $session;\n }", "public function add_session($item)\n\t\t{\n\t\t\tparent::add_item($item,'session_items');\n\t\t}", "public function storeSession() {}", "function saveSession() {}", "function setSession($key,$value){\n return Yii::app()->getSession()->add($key, $value);\n}", "private function saveSession() {\n $connection = \\Drupal::database();\n $select = $connection->select('conreg_payment_sessions', 'S');\n $select->addField('S', 'paysessionid');\n $select->condition('S.payid', $this->payId);\n $select->condition('S.session_id', $this->sessionId);\n // We only want to save if not already on table.\n if (empty($select->execute()->fetchField())) {\n $connection->insert('conreg_payment_sessions')->fields(['payid' => $this->payId, 'session_id' => $this->sessionId])->execute();\n }\n}", "static public function addSession($webAppSession) {\n\t\t\n\t\t$f = file_put_contents('sessions/' . $webAppSession->SessionId . '.txt', serialize($webAppSession));\n\t\t\n\t\tself::setSSOSessionMapping($webAppSession->SSOSessionId, $webAppSession->SessionId);\n\t}", "public function addAction()\n\t{\n\t\t// fetch list of experiments to show note when none exist\n\t\t$experimentModel = Sophie_Db_Experiment :: getInstance();\n\t\t$overviewSelect = $experimentModel->getOverviewSelect();\n\n\t\t// allow admin to see everything\n\t\t$adminMode = (boolean)$this->_getParam('adminMode', false);\n\t\t$adminRight = Symbic_User_Session::getInstance()->hasRight('admin');\n\n\t\tif ($adminMode && $adminRight)\n\t\t{\n\t\t\t$overviewSelect->order(array('experiment.name'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem_Acl::getInstance()->addSelectAcl($overviewSelect, 'experiment');\n\t\t\t$overviewSelect->order(array('experiment.name', 'acl.rule'));\n\t\t}\n\t\t$overviewSelect->group(array('experiment.id'));\n\t\t$this->view->hasTreatment = sizeof($overviewSelect->query()->fetchAll()) > 0;\n\n\t\t// prepare interface to add session\n\t\t$sessiontypeId = $this->_getParam('sessiontypeId', null);\n\t\t$sessiontypeModel = new Sophie_Db_Treatment_Sessiontype();\n\t\tif (! is_null($sessiontypeId))\n\t\t{\n\t\t\t$sessiontype = $sessiontypeModel->find($sessiontypeId)->current($sessiontypeId);\n\t\t\tif (is_null($sessiontype))\n\t\t\t{\n\t\t\t\t$this->_helper->FlashMessenger('Select sessiontype not found');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$treatment = $sessiontype->findParentRow('Sophie_Db_Treatment');\n\t\t\t\t$experiment = $treatment->findParentRow('Sophie_Db_Experiment');\n\t\t\t\t$this->view->sessiontypeTreeSelect = \"['sessiontypeRoot', 'experiment\" . $experiment->id . \"', 'treatment\" . $treatment->id . \"', 'sessiontype\" . $sessiontypeId . \"']\";\n\t\t\t\t$this->view->sessiontypeTreeSelectSessiontypeId = $sessiontypeId;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$treatmentId = $this->_getParam('treatmentId', null);\n\t\t\tif (!is_null($treatmentId))\n\t\t\t{\n\t\t\t\t$treatmentModel = new Sophie_Db_Treatment();\n\t\t\t\t$treatment = $treatmentModel->find($treatmentId)->current();\n\t\t\t\tif (is_null($treatment))\n\t\t\t\t{\n\t\t\t\t\t$this->_helper->FlashMessenger('Select treatment not found');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$experiment = $treatment->findParentRow('Sophie_Db_Experiment');\n\t\t\t\t\t$this->view->sessiontypeTreeSelect = \"['sessiontypeRoot', 'experiment\" . $experiment->id . \"', 'treatment\" . $treatmentId . \"']\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$experimentId = $this->_getParam('experimentId', null);\n\t\t\t\tif (! is_null($experimentId))\n\t\t\t\t{\n\t\t\t\t\t$this->view->sessiontypeTreeSelect = \"['sessiontypeRoot', 'experiment\" . $experimentId . \"']\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t$this->view->breadcrumbs[] = array (\n\t\t\t'title' => 'Create Session',\n\t\t\t'small' => 'Session:',\n\t\t\t'name' => 'Create'\n\t\t);\n\t}", "public function storeSessionData() {}", "public function storeSessionData() {}", "private function createSession()\n {\n session_regenerate_id(TRUE);\n $this->session = array();\n $this->session['legit'] = $this->sessionHash();\n $this->session['id'] = $this->userId;\n if (!$this->userId) {\n $this->voidCookie();\n }\n }", "public function addSession($session_id, $qoob_id, $fingerprint, $expires, $data) {\n\t\t$session_id \t= $this->DB->sanitize($session_id);\n\t\t$qoob_id \t\t= $this->DB->sanitize($qoob_id);\n\t\t$fingerprint \t= $this->DB->sanitize($fingerprint);\n\t\t$expires \t\t= $this->DB->sanitize($expires);\n\t\t$data \t\t\t= $this->DB->sanitize($data);\n\t\t$this->DB->query(\"INSERT INTO `session` (`auto_id`, `session_id`, `qoob_id`, `fingerprint`, `expires`, `data`) VALUES (NULL, '$session_id', '$qoob_id', '$fingerprint', '$expires', '$data');\", false);\n\t}", "public function sess_create()\r\r\n\t{\r\r\n\t\tif(session_id() == '') {\r\r\n\t\t\tsession_start();\r\r\n\t\t}\r\r\n\r\r\n\t\t$_SESSION['session_id']\t\t= session_id();\r\r\n\t\t$_SESSION['ip_address']\t\t= $this->CI->input->ip_address();\r\r\n\t\t$_SESSION['user_agent']\t\t= substr($this->CI->input->user_agent(), 0, 120);\r\r\n\t\t$_SESSION['last_activity']\t= $this->parent->now;\r\r\n\r\r\n\t\t$this->parent->userdata = $_SESSION;\r\r\n\t}", "function addUserToSession($user_id = 0, $type=1){\n\tsession_start();\n\t$_SESSION['userid'] = $user_id;\n\t$_SESSION['type'] = $type;\n}", "function session_create($sessionId)\n {\n }", "public function addSession($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public function add_all_session($session_items)\n\t\t{\n\t\t\tparent::add_all_items($session_items,'session_items');\n\t\t}", "function add ($user, $delete_current_session = true) {\n\t\t$user = (int)$user ?: User::GUEST_ID;\n\t\tif ($delete_current_session && is_md5($this->session_id)) {\n\t\t\t$this->del_internal($this->session_id, false);\n\t\t}\n\t\tif (!$this->is_user_active($user)) {\n\t\t\t/**\n\t\t\t * If data was not loaded or account is not active - create guest session\n\t\t\t */\n\t\t\treturn $this->add(User::GUEST_ID);\n\t\t}\n\t\t$session_data = $this->create_unique_session($user);\n\t\tResponse::instance()->cookie('session', $session_data['id'], $session_data['expire'], true);\n\t\t$this->load_initialization($session_data['id'], $session_data['user']);\n\t\t/**\n\t\t * Delete old sessions using probability and system configuration of inserts limits and update ratio\n\t\t */\n\t\t$Config = Config::instance();\n\t\tif (mt_rand(0, $Config->core['inserts_limit']) < $Config->core['inserts_limit'] / 100 * (100 - $Config->core['update_ratio']) / 5) {\n\t\t\t$this->delete_old_sessions();\n\t\t}\n\t\tEvent::instance()->fire(\n\t\t\t'System/Session/add',\n\t\t\t[\n\t\t\t\t'session_data' => $session_data\n\t\t\t]\n\t\t);\n\t\treturn $session_data['id'];\n\t}", "function add_session($session_ID , $variable_name ,$value)\r\n{\r\n\tglobal $DBhost;\r\n\tglobal $DBuser;\r\n\tglobal $DBpasswd;\r\n\tglobal $DBname;\r\n\tglobal $mysql;\r\n\r\n\tconnect_DB();\r\n\t$SQL = \"select survival_time , time_expire from session where ID='$session_ID'\";\r\n\t$ret = 0;\r\n\tif($result=mysql_query($SQL)){\r\n\t\t\tif($row=mysql_fetch_object($result)){\r\n\t\t\t\t$survival_time = time()+ $row->time_expire;\r\n\t\t\t}else return 0;\r\n\t}else return 0;\r\n\r\n\r\n\t$time_expire = $row->time_expire;\r\n\t$survival_time = $row->survival_time;\r\n\r\n\t$SQL = \"update session set s_value='$value' where ID='$session_ID' and s_name='$variable_name' \";\r\n\t$result=mysql_query($SQL);\r\n\r\n\tif( mysql_affected_rows($mysql) <1 ){\r\n\t\t$SQL = \"insert into session(ID , s_name,s_value,survival_time,time_expire) values('$session_ID','$variable_name','$value',$survival_time,'$time_expire');\";\r\n\t\t$result=mysql_query($SQL);\r\n\t\tif($result)\r\n\t\t\t\treturn $session_ID;\r\n\t\telse \r\n\t\t\t\treturn 0;\r\n\t}else return $session_ID;\r\n}", "public function store(Requests\\SessionRequest $request)\n {\n $exerciseIDs = $request->input('id');\n\n foreach($exerciseIDs as $exerciseID)\n {\n $session = new Session;\n $session->exercise_id = $exerciseID;\n $session->session_date = Carbon::now();\n Auth::user()->sessions()->save($session);\n }\n\n return redirect()->action('LogController@showLog');\n }", "public function create(&$session)\n\t{\n\t\t//TODO: Implement this service call.\n\t\treturn false;\t\n\t}", "function createPersistentSession($sid, $uid) {\n $mysqli = ConnectToDatabase();\n $sql = \"INSERT INTO active_sessions \n (id, uid, expiration)\n VALUES \n ('$sid', '$uid', DATE_ADD(CURRENT_DATE, INTERVAL 1 WEEK))\";\n $exec = $mysqli->query($sql);\n if( !empty($error = $mysqli->error) )\n {\n echo $error;\n return 0;\n }\n else if( isset($mysqli->insert_id) )\n {\n return 1;\n }\n else\n {\n return -1;\n }\n\n }", "public function onSessiontypesAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function add($flowsession) {\n $this->db->insert(table('flowsessions_table'), $flowsession); \n }", "public function storeSessionTokenInRegistry() {}", "protected function manageSession()\n {\n $this->session = new WebsiteSession();\n foreach ($this->eventRequest->getSession() as $key => $value) {\n\n if ($key == 'createdAt') {\n $value = time();\n }\n\n $method = 'set' . ucwords($key);\n if (method_exists($this->session, $method)) {\n $this->session->$method($value);\n }\n }\n }", "public function addFromSession()\n {\n if ($this->session->has(\"notifications.$this->name\")) {\n $this->push($this->session->get(\"notifications.$this->name\"));\n }\n if ($this->plural) {\n if ($this->session->has(\"notifications.$this->plural\")) {\n foreach (\n $this->session->get(\"notifications.$this->plural\") as\n $notification\n ) {\n $this->push($notification);\n }\n }\n }\n }", "function addSession($db, $userid) {\n\n # get a unique key to store in the sessions table\n $ukey = generateRandomKey();\n\n # get the user's IP address\n $ip_address = getIPAddress();\n\n # get the user agent\n $user_agent = NULL;\n if (!empty($_POST[\"user_agent\"])) {\n $user_agent = substr($_POST[\"user_agent\"], 0, 200);\n }\n\n $db->bindMore(array(\"userid\" => $userid, \"ukey\" => $ukey, \"ip_address\" => $ip_address, \"device\" => $user_agent));\n $insert = $db->query(\"INSERT INTO mtc_user_session (userid, ukey, ip_address, device) VALUES (:userid, :ukey, :ip_address, :device)\");\n \n # if the session is successfully inserted, return the ukey\n return ($insert > 0) ? $ukey : NULL;\n\n}", "public static function startSession();", "public function fillInAddedSessionData();", "public function addSession($name, $admin_id){\n\t\t\t$sql = \"INSERT INTO sessionz (id, name, admin_id, created_at, updated_at) VALUES (NULL, '$name', '$admin_id', NULL, NULL)\";\n\t\t\t$this->connection()->exec($sql);\n\t\t\treturn true;\n\t\t}", "protected function update_sessions($sessions)\n {\n }", "public function saveSession(): void {\n\t\t$_SESSION[self::SESSION_NAME] = $this;\n\t}", "private function createNewSession($id, $data = '')\n\t{\n\t\t// get table/column\n\t\t$db = $this->jdb;\n\t\t$dbTable = $this->dbOptions['db_table'];\n\t\t$dbDataCol = $this->dbOptions['db_data_col'];\n\t\t$dbIdCol = $this->dbOptions['db_id_col'];\n\t\t$dbTimeCol = $this->dbOptions['db_time_col'];\n\t\t$qry = $db->getQuery(true);\n\t\t\n\t\t// Session data can contain non binary safe characters so we need to encode it.\n\t\t$encoded = base64_encode($data);\n\t\t\n\t\t$qry->insert($db->qn($dbTable))\n\t\t\t->columns($db->qn(array($dbIdCol, $dbDataCol, $dbTimeCol)))\n\t\t\t->values($db->q($id) .','. $db->q($encoded) .','. (int) time());\n\t\t\n\t\t$db->setQuery($qry)->execute();\n\t\n\t\treturn true;\n\t}", "public static function add(string $key, $value)\n {\n if (!is_array($_SESSION[$key])) {\n $_SESSION[$key] = [$value];\n } else {\n $_SESSION[$key][] = $value;\n }\n }", "public function Add($session, $value = NULL)\n\t{\n\t\tif (is_array($session)) :\n\t\t\t\n\t\t\twhile (list($key) = each($session)) :\n\t\t\t\t$this->Add($key, $session[$key]);\n\t\t\tendwhile;\n\t\t\t\n\t\t\treturn NULL;\n\t\tendif;\n\t\t\n\t\t$_SESSION[$session] = $value;\n\t}", "public function startSession() {}", "public function addToSession($login, $password)\n {\n \n $dataUserWhoPressSubmit = $this->checkLogin($login, $password);\n \n if(!empty($dataUserWhoPressSubmit)){\n $_SESSION['user_id'] = $dataUserWhoPressSubmit[0]['id'];\n }\n\t\treturn header('Location: '.$this->connect->config['domain']);\n\t\t\n }", "function MyApp_Session_SID_New()\n {\n $this->MyApp_Session_SID_User_Deletes($this->LoginData[ \"ID\" ]);\n $this->Authenticated=TRUE;\n\n $sid=rand().rand().rand();\n $time=time();\n $this->Session=array\n (\n \"SID\" => $sid,\n \"LoginID\" => $this->LoginData[ \"ID\" ],\n \"Login\" => $this->LoginData[ \"Login\" ],\n \"LoginName\" => $this->LoginData[ \"Name\" ],\n \"CTime\" => $time,\n \"ATime\" => $time,\n \"IP\" => $_SERVER[ \"REMOTE_ADDR\" ],\n \"Authenticated\" => 2,\n \"LastAuthenticationAttempt\" => $time,\n \"LastAuthenticationSuccess\" => $time,\n \"NAuthenticationAttempts\" => 0,\n );\n\n $this->MySqlInsertItem($this->GetSessionsTable(),$this->Session);\n $this->SetCookie(\"SID\",$sid,$time+$this->CookieTTL);\n\n return $sid;\n }", "function crearsession($row){\n session_id($row['usuario']);\n session_start();\n $_SESSION['id_usuario']=$row['id_usuario'];\n $_SESSION['usuario']=$row['usuario'];\n $_SESSION['password']=$row['password'];\n $_SESSION['nombre']=$row['nombre'];\n $_SESSION['apellido1']=$row['apellido1'];\n $_SESSION['apellido2']=$row['apellido2'];\n $_SESSION['email']=$row['email'];\n $_SESSION['rol']=$row['rol'];\n\n}", "private function updateSession()\n {\n $_SESSION[$this->namespace] = $this->session;\n }", "private function newSid() {\r\n\r\n $this->sessionId=$this->generateString($this->sid_len);\r\n \r\n while ( $this->getSidCount($this->sessionId) > 0 || is_int($this->sessionId) ) {\r\n\r\n $this->sessionId=$this->generateString($this->sid_len);\r\n\r\n }\r\n\r\n $this->forcedExpire = time()+ $this->session_max_duration;\r\n $expireTime = time() + $this->session_duration;\r\n\r\n $this->SQLStatement_InsertSession->bindParam(':expires', $expireTime, PDO::PARAM_INT);\r\n $this->SQLStatement_InsertSession->bindParam(':forcedExpires', $this->forcedExpire, PDO::PARAM_INT);\r\n $this->SQLStatement_InsertSession->bindParam(':sid', $this->sessionId, PDO::PARAM_STR, $this->sid_len);\r\n $this->SQLStatement_InsertSession->bindParam(':ua', $this->getUa(), PDO::PARAM_STR, 40);\r\n\r\n return $this->SQLStatement_InsertSession->execute();\r\n\r\n }", "public function addUsuario($usuario){\n $_SESSION[\"usuario\"]=$usuario;\n $this->usuario=$usuario;\n }", "function reg_active_session($id,$token,$Id_localizacion){\n $vigencia = time() + 3600;\n $date = new \\DateTime('now', new \\DateTimeZone('America/Mexico_City'));\n $date -> setTimestamp($vigencia);\n $expira = $date->format(\"Y-m-d H:i:s\");\n $params = array (\n \"token\" => $token,\n \"Id_usuario\" => $id,\n \"expira\" => $expira,\n \"Id_localizacion\" => $Id_localizacion\n );\n return dbInsert(\"sesiones_activas\",\"sisi\",$params);\n \n }", "public function addAction()\n {\n $isPosted = $this->request->getPost('doCreate');\n if (!$isPosted) {\n $this->response->redirect($this->request->getPost('redirect'));\n }\n $comment = $this->getCommentSessionValuesFromForm();\n $comments = new \\Anax\\Comment\\CommentsInSession();\n $comments->setDI($this->di);\n $comments->add($comment);\n $this->response->redirect($this->request->getPost('redirect'));\n }", "public function run()\n {\n $sessions = [\n \t[\n \t\t'session_name' => 'registration',\n \t\t'session_start' => Carbon::now(),\n \t\t'session_end' => Carbon::now()\n \t],\n \t[\n \t\t'session_name' => 'kti_submit',\n \t\t'session_start' => Carbon::now(),\n \t\t'session_end' => Carbon::now()\n \t],\n \t[\n \t\t'session_name' => 'non_kti_submit',\n \t\t'session_start' => Carbon::now(),\n \t\t'session_end' => Carbon::now()\n \t]\n ];\n\n DB::table('sessions')->insert($sessions);\n }", "public function createContextSession();", "public function session($name, $value){\n if( isset($this->openForm) && is_array($this->openForm) )\n $this->openForm['fields'][] = new fe_session(array('name' => $name, 'value' => $value));\n }", "public function startSession($id){\n\n }", "public function createSession()\n {\n session_start();\n }", "private function createNewSession($id, $data = '')\n {\n // get table/column\n $dbTable = $this->dbOptions['db_table'];\n $dbDataCol = $this->dbOptions['db_data_col'];\n $dbIdCol = $this->dbOptions['db_id_col'];\n $dbTimeCol = $this->dbOptions['db_time_col'];\n\n $sql = \"INSERT INTO $dbTable ($dbIdCol, $dbDataCol, $dbTimeCol) VALUES (:id, :data, :time)\";\n\n //session data can contain non binary safe characters so we need to encode it\n $encoded = base64_encode($data);\n $stmt = $this->pdo->prepare($sql);\n $stmt->bindParam(':id', $id, \\PDO::PARAM_STR);\n $stmt->bindParam(':data', $encoded, \\PDO::PARAM_STR);\n $stmt->bindValue(':time', time(), \\PDO::PARAM_INT);\n $stmt->execute();\n\n return true;\n }", "function addNewUser($username, $password, $RealName){\n global $conn;\n $q = \"INSERT INTO users VALUES ('$username', '$password', '$RealName', NULL, NULL)\";\n \n $_SESSION['username']=$username;\n return mysql_query($q,$conn);\n}", "abstract public function persistSessionToken() ;", "public static function addSession(&$user){\n if ($user == null || $user->id == null) return null;\n if (!self::connectDB()) return null;\n\n $query = \"INSERT INTO sesion(SESION_ID, OPCION_ADICIONAL, FECHA_EXPIRACION, FECHA_CREACION, USUARIO_ID) VALUES (?,?,NOW() + INTERVAL \" . self::SESSION_DATE_EXPIRE . \" MINUTE,NOW(),?)\";\n $query = Session::formatQuery($query);\n\n if (!$result = self::$dbManager->query($query)) return null;\n\n $session = new Session();\n $session->id = Session::generateSessionId();\n //$session->opcionAdicional = $aditionalInfo;\n $session->opcionAdicional = $session->opcionAdicional ? json_encode($session->opcionAdicional) : null;\n\n $result->bind_param(\"ssi\",$session->id,$session->opcionAdicional,$user->id);\n if (!self::$dbManager->executeSql($result)) return null;\n if ($result->affected_rows <= 0) $session = null;\n return $session;\n }", "function session_touch($sessionId)\n {\n }", "public function updateSession(){\n # code...\n }", "public function createSessionId() {}", "function _write($id, $sess_data)\n\t{\n\t\t//$row = DB::row(\"SELECT value FROM \" . DB::$db_prefix . \"_sessions WHERE sesskey = '\".$id.\"'\");\n\t\t$time = time()+parent::$sess_lifetime;\n\n\t\tDB::query(\"\n\t\t\tREPLACE INTO \" . DB::$db_prefix . \"_sessions\n\t\t\tVALUES (\n\t\t\t\t'\".$id.\"',\n\t\t\t\t'\".$time.\"',\n\t\t\t\t'\".addslashes($sess_data).\"',\n\t\t\t\t'\".$_SERVER['REMOTE_ADDR'].\"'\n\t\t\t)\n\t\t\");\n\n\t\treturn true;\n\t}", "private function renewSession() {}", "function addDriver() {\n $drivers = $_SESSION['drivers'];\n $l = sizeof($drivers);\n // We don't allow more than 20 drivers in this sandbox\n if ($l>19) {\n throw new Exception(\"You can only have 20 drivers in this sandbox\");\n return;\n }\n $request = Slim::getInstance()->request();\n \t$body = $request->getBody();\n \t$driver = json_decode($body);\n $driver->lastModified = date('Y-m-d H:i:s');\n $driver->deleted = false;\n $driver->id = sizeof($drivers) + 1;\n $drivers[] = $driver;\n $_SESSION['drivers'] = $drivers;\n echo json_encode($driver);\n}", "function session_create()\n\t{\n\t\t$this->data = array();\n\t\treturn true;\n\t}", "function createSession($user, $role){\n\t\t\tSession::setSession('user',$user);\n\t\t\tSession::setSession('role',$role);\n\t\t\tSession::setSession('time',time());\n\t\t\t$expire = $_SESSION['time'] + (5 * 60);\n\t\t\tSession::setSession('expire',$expire);\n\t\t}", "protected function get_sessions()\n {\n }", "public function phpunit_add_session_store($name) {\n $this->configstores[$name] = array(\n 'name' => $name,\n 'plugin' => 'session',\n 'configuration' => array(),\n 'features' => 14,\n 'modes' => 2,\n 'default' => true,\n 'class' => 'cachestore_session',\n 'lock' => 'cachelock_file_default',\n );\n }", "function loadSession() {}", "public function create_session($define_, $value_, $pack_, $time__, $help_, $comment_)\n {\n // Hodnota ID sa neuvadza je generovana automaticka cez methodu AUTO INCREMENT\n // Method volame len z CONTROL directory\n // feed\n $this->const_time = time();\n $this->sql = \" INSERT INTO \" . TABLE_SESSION_RELATION . \" ($this->id_column, $this->name_column, $this->value_column, $this->value_time_const_column, $this->pack_column, $this->create_time_column, $this->help_column, $this->comment_column) \" .\n \" VALUES (NULL, '$define_', $value_, $this->const_time, '$pack_', $time__, '$help_', '$comment_') \";\n $this->result = $this->db->query($this->sql) or die(mysqli_error($this->db));\n $this->db->close();\n }", "public function saveUssdSession()\n {\n try {\n Session::create([\n 'session_id' => $this->sessionId\n ]);\n } catch (\\Exception $exception) {\n //\n }\n }", "private function updateSession() {\n\t\t//update the login time.\n\t\tif (isset ( $this->session )) {\n\t\t\t$this->session ['lastlogin'] = time ();\n\t\t}\n\t\t\n\t\t//write $session['uid'], $session['name'], $session['lastlogin'] to file\n\t\tif (isset ( $this->session )) {\n\t\t\tfile_put_contents ( self::SESSION_FILE, serialize ( $this->session ) );\n\t\t} elseif (file_exists ( self::SESSION_FILE )) { //remove session information\n\t\t\tsession_destroy();\n\t\t\tunlink ( self::SESSION_FILE );\n\t\t}\n\t}", "public function initalizeNewUser(SessionInterface $session)\n {\n if(!$session->has(self::SESSION_ID))\n {\n $session->clear();\n $session->set(self::SESSION_ID,hash('md5',time()));\n }\n }", "protected abstract function get_sessions();", "public function storeObject(){\n return storeSessionDB($this->sessionTime, $this->numberOfParticipants, $this->sessionDate, $this->sessionName);\n /*\n $query = \"\n INSERT INTO session (session_start_time, session_size, session_date, session_name)\n VALUES (?, ?, ?, ?);\n \";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1, $this->sessionTime);\n $stmt->bindValue(2, $this->numberOfParticipants);\n $stmt->bindValue(3, $this->sessionDate);\n $stmt->bindValue(4, $this->sessionName);\n if($stmt->execute()){\n echo \"<script> alert('\". $this->getSessionName() .\"') </script>\";\n return true;\n } else {\n echo \"<script> alert('Database Error') </script>\";\n return false;\n }\n */\n\n }", "function createSession($username)\n{\n $_SESSION[\"username\"] = $username;\n // Get user's roles\n require_once(\"model/users_possesses_roles.php\");\n $roles = getUserRoles($username);\n $_SESSION[\"roles\"] = $roles;\n}", "function createsessions($username,$password,$remme=\"no\") \n{\n \n\n $_SESSION[\"gusername\"] = $username; \n $_SESSION[\"gpassword\"] = $password; \n \n if($remme==\"yes\") \n { \n //Add additional member to cookie array as per requirement \n setcookie(\"gusername\", $_SESSION['gusername'], time()+60*60*24*100, \"/\"); \n setcookie(\"gpassword\", $_SESSION['gpassword'], time()+60*60*24*100, \"/\"); \n return; \n } \n}", "function add_client(){\n\t\t$session_data = $this->session->userdata();\n\t\tif( array_key_exists('role', $session_data ) && isset($session_data['role'])):\n\t\t\t$pagedata['mode'] = 'new';\n\t\t\t$this->load->view('dashboard/header');\n\t\t\t$this->load->view('dashboard/add-client', $pagedata);\n\t\t\t$this->load->view('dashboard/footer');\n\t\telse:\n\t\t\tredirect( base_url( 'Interact/login' ));\n\t\tendif;\n\t}", "function create() {\n\t\t\t$new_code = '';\n\t\t\twhile (! $new_code) {\n\t\t\t\t# Get Large Random value\n\t\t\t\t$randval = mt_rand();\t\t\n\t\n\t\t\t\t# Use hash to further bury session id\n\t\t\t\t$new_code = hash('sha256',$randval);\n\n\t\t\t\t# Make Sure Session Code Not Already Used\n\t\t\t\tif ($this->code_in_use($new_code)) $new_code = \"\";\n\t\t\t}\n\t\t\tapp_log(\"Generated session code '$new_code'\");\n\n\t\t\tif (! is_object($this->customer)) {\n\t\t\t\t$this->customer = new \\Register\\Customer();\n\t\t\t}\n\n\t\t\t# Create The New Session\n\t\t\t$query = \"\n\t\t\t\tINSERT\n\t\t\t\tINTO\tsession_sessions\n\t\t\t\t(\t\tcode,\n\t\t\t\t\t\tfirst_hit_date,\n\t\t\t\t\t\tlast_hit_date,\n\t\t\t\t\t\tuser_id,\n\t\t\t\t\t\tcompany_id,\n\t\t\t\t\t\trefer_url,\n\t\t\t\t\t\tbrowser,\n\t\t\t\t\t\tprev_session,\n\t\t\t\t\t\te_id\n\t\t\t\t)\n\t\t\t\tVALUES\n\t\t\t\t(\t\t?,\n\t\t\t\t\t\tsysdate(),\n\t\t\t\t\t\tsysdate(),\n\t\t\t\t\t\t?,\n\t\t\t\t\t\t?,\n\t\t\t\t\t\t?,\n\t\t\t\t\t\t?,\n\t\t\t\t\t\t?,\n\t\t\t\t\t\t?\n\t\t\t\t)\n\t\t\t\";\n\t\t\t$rs = $GLOBALS['_database']->Execute(\n\t\t\t\t$query,\n\t\t\t\tarray($new_code,\n\t\t\t\t\t $this->customer->id,\n\t\t\t\t\t $this->company->id,\n\t\t\t\t\t $this->refer_url,\n\t\t\t\t\t $_SERVER['HTTP_USER_AGENT'],\n\t\t\t\t\t $this->prev_session,\n\t\t\t\t\t $this->email_id\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ($GLOBALS['_database']->ErrorMsg()) {\n\t\t\t\t$this->SQLError($GLOBALS['_database']->ErrorMsg());\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t$this->id = $GLOBALS['_database']->Insert_ID();\n\n\t\t\t# Set Session Cookie\n\t\t\tif (setcookie($this->cookie_name, $new_code, $this->cookie_expires,$this->cookie_path,$_SERVER['HTTP_HOST'],false,true)) {\n\t\t\t\tapp_log(\"New Session \".$this->id.\" created for \".$this->domain()->id.\" expires \".date(\"Y-m-d H:i:s\",time() + 36000),'debug',__FILE__,__LINE__);\n\t\t\t\tapp_log(\"Session Code \".$new_code,'debug',__FILE__,__LINE__);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tapp_log(\"Could not set session cookie\",'error',__FILE__,__LINE__);\n\t\t\t}\n\t\t\treturn $this->get($new_code);\n\t\t}", "public function add( $key, $value = true ) {\n $_SESSION[$key] = $value;\n return $this;\n }", "public function insert($sessionTarget);", "function HTTP_SessionServer_SaveHandler_write($id, $sess_data)\n{\n $GLOBALS['__session']->put($GLOBALS['__sessionName'], $sess_data);\n return true;\n}", "function storeSessionData($sessionData, $pid) {\n\t\t$GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_wecassessment_pi1:' . $pid, $sessionData);\n\t\t$GLOBALS['TSFE']->fe_user->sesData_change = true;\n\t\t$GLOBALS['TSFE']->fe_user->storeSessionData();\t\t\n\t}", "private function _createSession(){\n return $this->_session = new Session();\n }", "public function add() {\n $page = 'basket';\n $id = $_GET['id'];\n\n $product = $this->productManager->findOne($id);\n\n $productInBasket = $this->inBasket($id); //check if the product is in the basket\n\n if(!empty($product) && isset($_SESSION['user']['basket'])) {\n if ($productInBasket)\n $_SESSION['user']['basket'][$id]['quantity']++;\n else\n $_SESSION['user']['basket'][$id] = array(\"product\" => $product, \"quantity\" => 1);\n }\n\n header(\"Location: ./index.php?ctrl=basket&action=consult\");\n require('./View/default.php');\n }", "function add() {\n RR_Session::start();\n $get = RR_Session::get('loggedin');\n if ($get == true) {\n // blijf op de pagina\n // en laad de admin view\n $this->validateUser(true, 'newuser');\n } else {\n // anders redirect trug naar de login pagina\n $this->validateUser(false);\n }\n }", "function insertSession($DBH, $rname)\n{\n\t// Insert everything but job history data\n\t$stmt = $DBH->prepare(\"insert into Resume values (?, ?, ?, ?, ?, ?)\");\n\t$stmt->bindValue(1, $rname);\n\t$stmt->bindValue(2, $_SESSION['name']);\n\t$stmt->bindValue(3, $_SESSION['address']);\n\t$stmt->bindValue(4, $_SESSION['phone']);\n\t$stmt->bindValue(5, $_SESSION['position']);\n\t$stmt->bindValue(6, $_SESSION['login']);\n\t$stmt->execute();\n\t\n\t// Get needed arrays\n\t$beg = $_SESSION['beg'];\n $end = $_SESSION['end'];\n $job = $_SESSION['job'];\n\t\n\tfor($i = 0; $i < count($beg); $i++)\n\t{\n\t\t$stmt = $DBH->prepare(\"insert into History (RName, Start, End, Description, Login) values (?, ?, ?, ?, ?)\");\n\t\t$stmt->bindValue(1, $rname);\n\t\t$stmt->bindValue(2, $beg[$i]);\n\t\t$stmt->bindValue(3, $end[$i]);\n\t\t$stmt->bindValue(4, $job[$i]);\n\t\t$stmt->bindValue(5, $_SESSION['login']);\n\t\t$stmt->execute();\n\t}\n}", "private function _set_new_session_id($id) {\n\t\t$this->_session_config['_started_session_id'] = $id;\n\t\tZamp::$core->_config['session_settings']['_started_session_id'] = $id;\n\t}", "public function addMessage($message, $type) {\n\t\t$messages = $_SESSION[$this->sessionKey];\n\t\t\n\t\t$messages[] = [\n\t\t\t'message' => $message,\n\t\t\t'type' => $type,\n\t\t];\n\t\t\n\t\t$_SESSION[$this->sessionKey] = $messages;\n\t}", "public function sess_create()\n\t{\n\t\treturn ($this->session_valid()) ? parent::sess_create() : FALSE;\n\t}", "public function addImageToSession(\\Media\\Entity\\File $image)\n {\n $session = self::getSession();\n array_push($session->ids, $image->getId());\n }", "function session_init($hash){\n if(isset($hash)){\n $session=mysqli_fetch_assoc(DB::select('sessions',['*'],'hash=\"'.$hash.'\"'));\n if(isset($session['closed'])){\n session_close($hash);\n $hash = md5(genHash());\n //dbg('Insert new HASH from session_init()');\n if (DB::insert('auth', array('iduser' => USER_ID, 'hash' => $hash))) {\n //session_init($hash);\n setcookie('HASH', $hash, 7000000000);\n }\n }\n //dbg('Insert new SESSION from session_init()');\n DB::insert('sessions',['hash'=>$hash,'iduser'=>USER_ID,'date'=>date('Y-m-d H:i:s'),'last_act'=>date('Y-m-d H:i:s'),'ip'=>$_SERVER['REMOTE_ADDR'],'provider'=>getIspByIp($_SERVER['REMOTE_ADDR']),'closed'=>0]);\n }\n}", "function storeaccount($newaccount)\n\t{\n\t\tif (! isset($_SESSION[\"accounts\"]))\n\t\t\tinitialize();\n\n\t\t$_SESSION[\"accounts\"] = array_merge($_SESSION[\"accounts\"], $newaccount);\n\t}", "function add()\n {\n $gameId = intval($this->registry->params[0]);\n $game = new \\Webshop\\Model\\Game();\n $game = $game->getOne(\"id\", $gameId);\n\n if (!is_numeric($gameId) || (!empty($_SESSION['cart']) && in_array($gameId, $_SESSION['cart']))) {\n echo \"gameId is niet numeric, geldig of winkelwagen bevat al deze game!\";\n } else {\n $amount = 1;\n (isset($_POST['amount']) ? $amount = intval($_POST['amount']) : '');\n\n $supply = $game->supply;\n // Throw error if the requested amount is higher then the supply\n if ($supply < $amount) {\n $_SESSION['addToCartError'] = \"We hebben maar \" . $supply. \" games in voorraad van \". $game->title;\n $amount = $supply;\n }\n\n $gameItem = [intval($gameId), $amount];\n $_SESSION['cart'][] = $gameItem;\n }\n header(\"Location: /cart\");\n }", "public function persistSessionToken() {}" ]
[ "0.77314377", "0.7492235", "0.71663225", "0.71525925", "0.69142777", "0.6862423", "0.6827963", "0.6821867", "0.67908615", "0.67528135", "0.67504025", "0.6742346", "0.6600897", "0.6557083", "0.64661676", "0.64506423", "0.6442008", "0.64090985", "0.6407895", "0.6336083", "0.62351686", "0.62303907", "0.6207241", "0.61836314", "0.6174829", "0.61622345", "0.61251384", "0.6123075", "0.6122465", "0.6120715", "0.6120484", "0.60805184", "0.60794216", "0.6078949", "0.6067657", "0.6057804", "0.6048282", "0.60427713", "0.6022055", "0.5948681", "0.59458417", "0.59396636", "0.59308195", "0.59186953", "0.5912511", "0.58942175", "0.58940285", "0.5854888", "0.5829138", "0.5823704", "0.5798157", "0.57916987", "0.57899857", "0.5763918", "0.5750741", "0.5734327", "0.5725036", "0.57247525", "0.5724119", "0.5713676", "0.57136244", "0.5712711", "0.57117397", "0.5703487", "0.5689041", "0.56778264", "0.5663291", "0.56624055", "0.5659235", "0.56588", "0.5649055", "0.5648464", "0.56440896", "0.56425965", "0.5635966", "0.5623392", "0.5612971", "0.56123567", "0.5604511", "0.5604476", "0.56040275", "0.56031", "0.5600123", "0.55929506", "0.55798894", "0.5576945", "0.5574932", "0.5563341", "0.55574584", "0.5550192", "0.5539519", "0.55331147", "0.55307287", "0.5529403", "0.5528797", "0.55280644", "0.5527093", "0.55212015", "0.5514893", "0.55130154" ]
0.68278295
7
/ DELETE A sessions USING ITS ID ========================================================================
public function delete_sessions() { $id = $this->input->get("id"); if($id==""){ echo "there seems to be a problem"; }else{ $id = $this->security->xss_clean($id); $id = htmlspecialchars($id); $sessions_from_id = $this->admin_student_courses_mdl->sessions_from_id($id); $deleted_sessions = $this->admin_student_courses_mdl->delete_sessions($id); if($deleted_sessions){ $this->admin_student_courses_mdl->delete_deleted_sessions($sessions_from_id); echo "content was successfully deleted"; }else{ echo"there seeems to be a problem"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy($id = '') {\n\t\tif($id == '') {\n\t\t\t$id = $this->id;\n\t\t}\n\t\t$sess = ORM::for_table($this->session_type)->find_one($id);\n\t\tif($sess != false) {\n\t\t\t$sess->delete();\n\t\t}\n\t}", "public function delete() {\n $this->logger->debug(\"Deleting session\");\n $this->repository->removeByKey($this->getKeys());\n self::$instance = null;\n }", "public static function destroy($id){\n//\t\techo 'destroy'.$id.\"\\n<br>\";\n\t\t$db = RuntimeInfo::instance()->connections()->MySQL(RuntimeInfo::instance()->helpers()->Session()->getSessionConfig()->getHosts());\n\t\t$query='DELETE FROM php_session WHERE id='.$db->escape($id);\n\t\treturn $db->query($query);\n\t}", "protected function deleteSession()\n {\n $sessionHash = $this->cookie('sessionhash');\n $this->cookie('sessionhash', '', time() - 3600);\n $this->cookie('userid', '', time() - 3600);\n $this->cookie('password', '', time() - 3600);\n\n $this->query('session')\n ->where('userid', $this->userInfo->userid)\n ->where('useragent', substr($this->request->server('HTTP_USER_AGENT'), 0, 100))\n ->delete();\n\n $hash = md5(microtime() . 0 . $this->request->server('REMOTE_ADDR'));\n $anonymousSession = [\n 'userid' => 0,\n 'sessionhash' => $hash,\n 'host' => $this->request->server('REMOTE_ADDR'),\n 'idhash' => $this->fetchIdHash(),\n 'lastactivity' => time(),\n 'location' => $this->request->server('REQUEST_URI'),\n 'useragent' => substr($this->request->server('HTTP_USER_AGENT'), 0, 100),\n 'loggedin' => 0,\n ];\n\n $this->query('session')->insert($anonymousSession);\n }", "private function removeEntryIdFromSession()\n {\n Session::forget($this->session_key);\n }", "public function delete($sessionID, $audience);", "function deleteSession()\n{\n\tif (!$this->sessName) return;\n\t$this->app->deleteSession($this->sessName);\n}", "public function delete(){\n $bd = Db::getInstance();\n $sql = \"DELETE FROM login WHERE id= :id\";\n $stmt = $bd->prepare($sql);\n $stmt->execute([\":id\" => $this->id]);\n }", "function consult_delete_session($id=NULL) \r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n $data['patient_id'] = $this->uri->segment(3);\r\n $data['summary_id'] = $this->uri->segment(4);\r\n \r\n // Delete records\r\n $del_rec_array['summary_id'] = $data['summary_id'];\r\n $del_rec_data = $this->mconsult_wdb->consult_delete_session($del_rec_array);\r\n $this->session->set_flashdata('data_activity', 'Prescription deleted.');\r\n \r\n echo \"<br />Session deleted.<br />\";\r\n \r\n $new_page = base_url().\"index.php/ehr_consult/consult_episode/\".$data['patient_id'].\"/\".$data['summary_id'];\r\n //header(\"Status: 200\");\r\n //header(\"Location: \".$new_page);\r\n \r\n }", "function MyApp_Session_SID_Delete($sid)\n {\n $this->SetCookie(\"SID\",\"\",time()-$this->CookieTTL);\n $this->Sql_Delete_Items\n (\n array\n (\n \"SID\" => $sid,\n ),\n $this->GetSessionsTable()\n );\n }", "public function sessionDestroy($id,$session_id=null) {\n if (!empty($session_id)) $id = $session_id;\n $modelSession = new \\App\\Models\\Session;\n //$user_id = $this->repo->find($id,$modelSession)->user_id;\n if ($this->repo->delete($id,$modelSession)) {\n //la colonna non viene cancellata perchè è inserita fra i campi hidden del model\n // per motivi di sicurezza.\n //$this->repo->update($user_id, ['remember_token' => null]);\n return redirect()->back()->withSuccess('Sessione cancellata correttamente');\n }\n return redirect()->back();\n }", "function delete_session_register_by_user_logout()\n{\n $token = $_COOKIE[\"sessionToken\"];\n\n $conn = new mysqli(\n $_ENV['onlinenotes_database_server_name'],\n $_ENV['onlinenotes_database_username'],\n $_ENV['onlinenotes_database_password'],\n $_ENV['onlinenotes_database_name']\n );\n\n if ($conn->connect_error) {\n die(\"Database connection failed: \" . $conn->connect_error);\n }\n\n if ($stmt = $conn->prepare(\"DELETE FROM SESSION WHERE token = ?\")) {\n $stmt->bind_param(\n \"s\",\n $token\n );\n\n $stmt->execute();\n $stmt->close();\n }\n\n $conn->close();\n}", "function _destroy($sessionid=false) {\n\t\t$qry = \"DELETE FROM \" . TABLEPREFIX . \"sessions WHERE sessionid='\" . addslashes($sessionid) . \"'\";\n\t\t$result = $this->DbConnection->Query($qry);\n\t\treturn $result;\n\t}", "public function destroy($id){\n $sess_id = $this->sess_id_prefix.$id;\n $deleteResult = $this->coll->deleteOne(array('sess_id'=>$sess_id ));\n return true;\n }", "function destroySession($a_session_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif(!is_array($a_session_id))\n\t\t{\n\t\t\t$q = \"DELETE FROM usr_sess_istorage WHERE session_id = \".\n\t\t\t\t$ilDB->quote($a_session_id, \"text\");\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$q = \"DELETE FROM usr_sess_istorage WHERE \".\n\t\t\t\t$ilDB->in(\"session_id\", $a_session_id, \"\", \"text\");\n\t\t}\n\n\t\t$ilDB->manipulate($q);\n\t}", "function destroy ($session_id) {\n\n # create database object if not create\n self::_connect();\n\n # delete current session from database table\n $res = $this->link->delete($this->table_name,array(array('','session_id','=',$session_id,'')));\n\n return $res !== -1 ? TRUE : FALSE;\n\n }", "function _destroy($ses_id) {\n\t\t#$sessionPath = $_SERVER['DOCUMENT_ROOT'] . '/phpSession';\n\t\t$sessionPath = dirname(__FILE__).\"/../phpSession\";\n\t\t$query = \"Delete from phpSession where id = '$ses_id'\";\n\t\t$result = mysql_query($query, $this->db);\n\t\t$this->recursiveDelete (\"$sessionPath/$ses_id\");\n\t\tprint (\"deleting session\");\n\t\treturn true;\n\t}", "public function destroy(){\n\t\tsession_unset();\n\t\t$id = $this->getId();\n\t\tif (!empty($id)) {\n\t\t\tsession_destroy();\n\t\t}\n\t}", "public function deleteIdentity ()\n\t{\n\t\tif ($this->session->has('user')) {\n\n\t\t\t$this->session->remove('user');\n\t\t}\n\n\t}", "public function destroySession() {}", "public function destroy($session_id) {\n\t}", "protected function deleteOtherSessionRecords(): void\n {\n if (config('session.driver') !== 'database') {\n return;\n }\n\n DB::connection(config('session.connection'))->table(config('session.table', 'sessions'))\n ->where('user_id', Auth::user()?->getAuthIdentifier())\n ->where('id', '!=', session()->getId())\n ->delete();\n }", "public function destroy($id)\n {\n $clients = session('clients');\n $index = $this->getIndex($id, $clients);\n array_splice($clients, $index, 1);\n session(['clients' => $clients]);\n return redirect()->route('clients.index'); \n }", "public function destroy($id)\n\t{\n\t\t$sess_id = 'sess_'.$id;\n\t\t$this->_db->delete($sess_id.'_expire');\n\t\treturn $this->_db->delete($sess_id);\n\t}", "public static function destroySession();", "public function removeSessionData() {}", "public function deleteExpriedSessions(){\r\n\t\t\t$stmt = $this->db->query(\"delete from `user_sessions` where expires > ?\", [time()]);\r\n\t\t}", "public function testDeleteSession()\n {\n $response = $this->loginAsRole(Role::ADMIN)\n ->delete($this->url('sessions/1'));\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'message'\n ]);\n }", "function deleteEntry($id){\r\n $query=\"DELETE FROM entrada WHERE id=$id\";\r\n mysqli_query($_SESSION['connection'], $query);\r\n }", "function delete_user_sessions_admin($user_id)\n{\n // Encrypts the data so can be referenced at session table.\n $user_data_userId_encrypted = AES128_encrypt($user_id);\n\n $conn = new mysqli(\n $_ENV['onlinenotes_database_server_name'],\n $_ENV['onlinenotes_database_username'],\n $_ENV['onlinenotes_database_password'],\n $_ENV['onlinenotes_database_name']\n );\n\n if ($conn->connect_error) {\n die(\"Database connection failed: \" . $conn->connect_error);\n }\n\n if ($stmt = $conn->prepare(\"DELETE FROM SESSION WHERE user_id = ?\")) {\n $stmt->bind_param(\"s\", $user_data_userId_encrypted);\n\n $stmt->execute();\n $stmt->close();\n }\n\n $conn->close();\n}", "public static function delete($sessid,$id) { \n\n\t\t$sessid = Dba::escape($sessid);\n\t\t$id\t= Dba::escape($id);\n\n\t\t$sql = \"DELETE FROM `tmp_playlist` WHERE `session`='$sessid' AND `id` != '$id'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t/* Remove assoicated tracks */\n\t\tself::prune_tracks();\n\n\t\treturn true;\n\n\t}", "public function destroy(string $session_id)\n {\n }", "function delete($id);", "public function delete($id){\n $sql=\" DELETE FROM \" .$this->table[0].\" WHERE sid= '\".$id.\"'\";\n return mysqli_query($this->conn, $sql);\n }", "static public function deleteSession($ssoSessionId) {\n\t\t\n\t\t$sessionMapping = self::getSSOSessionMapping();\n\t\t\n\t\tif(empty($sessionMapping[$ssoSessionId])){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$appSessionId = $sessionMapping[$ssoSessionId];\n\t\t\n\t\tself::removeSSOSessionMapping($ssoSessionId);\n\t\t\n\t\tif (!empty($appSessionId)){\n\t\t\n\t\t\t$f = 'sessions/' . $appSessionId . '.txt';\n\t\t\n\t\t\tif (file_exists($f))\n\t\t\t\treturn unlink($f);\t\n\t\t}\n\t}", "abstract public function delete($id);", "abstract public function delete($id);", "abstract public function delete($id);", "function DelSession($sesid){\n $q = \"DELETE FROM `\".TblSysSession.\"` WHERE `session_id` = '$sesid'\";\n $this->db->db_Query($q);\n //echo '<br>$q='.$q.' $this->db->result='.$this->db->result;\n if (!$this->db->result) return false;\n\n $q = \"DELETE FROM `\".TblSysSessionHash.\"` WHERE `session_id` = '$sesid'\";\n $this->db->db_Query($q);\n //echo '<br>$q='.$q.' $this->db->result='.$this->db->result;\n if (!$this->db->result) return false;\n }", "public function destroy($id)\n {\n $sessao = Sessao::find($id);\n $sessao->delete();\n return redirect('/sessaos');\n }", "public function deleteSession(): void {\n\t\tunset($_SESSION[self::SESSION_NAME]);\n\t}", "public function deleteBook ($session, $id) {\n\n // make a variable for books\n $books = $session->get('books');\n // remove book from books\n unset($books[$id]);\n // not necessarily sure why I need to do this\n $session->put('books', $books);\n\n }", "abstract public function deleteById($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete( $id );", "public function logout() {\n $s = Session::getInstance();\n $key = $this->sessionId;\n unset($s->$key);\n $this->setAuthed(false);\n }", "public function delete($id)\n{\n //faut recupere la qty de l id\n $cart=$this->session->get('cart',[]);\n unset($cart[$id]);\n return $this->session->set('cart', $cart);\n}", "function delete() {\n\t \t$sql = \"DELETE FROM evs_database.evs_identification\n\t \t\t\tWHERE idf_id=?\";\n\t \t$this->db->query($sql, array($this->idf_id));\n\t\t\n\t }", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function SESSION_cleanup ($es_id)\n\t{\n\t\tif (!$es_id) throw new Exception (self::EXCEPTION_MESSAGE_NO_SESSION);\n\n\t\t$this->db->delete(\n\t\t\t\tself::OP_TABLE,\n\t\t\t\tarray('collab_es_id' => $es_id),\n\t\t\t\t__LINE__,\n\t\t\t\t__FILE__\n\t\t);\n\t\t$this->db->delete(\n\t\t\t\tself::SESSION_TABLE,\n\t\t\t\tarray('collab_es_id' => $es_id),\n\t\t\t\t__LINE__,\n\t\t\t\t__FILE__\n\t\t);\n\t\t$this->db->delete(\n\t\t\t\tself::MEMBER_TABLE,\n\t\t\t\tarray('collab_es_id' => $es_id),\n\t\t\t\t__LINE__,\n\t\t\t\t__FILE__\n\t\t);\n\t}", "public abstract function delete($id);", "public function delete($id = NULL) {\n unset($id);\n unset($this->user);\n unset($_SESSION['user']);\n $_SESSION['user'] = NULL;\n session_destroy();\n return TRUE;\n }", "function kill_session($session_ID)\r\n{\r\n\tglobal $DBhost;\r\n\tglobal $DBuser;\r\n\tglobal $DBpasswd;\r\n\tglobal $DBname;\r\n\tglobal $mysql;\r\n\r\n\tconnect_DB();\r\n\t$SQL =\"delete from session where ID = $session_ID\";\r\n\tif($result=mysql_query($SQL)) {\r\n\t\t\t\t\t$ret = 1;\r\n\t} else\t{\r\n\t\t\t\t\t$ret = 0;\r\n\t}\r\n\treturn $ret;\r\n}", "function deleteSession($SessionKey) {\n $this->db->limit(1);\n $this->db->delete('tbl_users_session', array('SessionKey' => $SessionKey));\n return TRUE;\n }", "function destroy($id) { \n $where = \"id = '$id'\";\n if($this->model->delete($where)){\n \t$r = new HttpRequest(URL.':'.USER_CLASS_MICS_PORT.'delete', HttpRequest::METH_POST);\n\t\t\t$r->setOptions(array('cookies' => array('lang' => 'en')));\n\t\t\t$r->addPostFields(array('data' => '{\"class_id\":'.$id.'}'));\t\t\n\t\t\ttry {\n\t\t\t echo $r->send()->getBody();\n\t\t\t} catch (HttpException $ex) {\n\t\t\t echo $ex;\n\t\t\t}\n } \n }", "function delete(){\n\t\t$sql = \"DELETE FROM `tours` WHERE `id`='\".addslashes($this->id).\"'\";\n\n\t\t$this->connection->send_query($sql);\n\t}", "public function destroy($id){}", "function logout() {\n $stmt = self::$_db->prepare(\"UPDATE user SET session='' WHERE session=:sid\");\n $sid = session_id();\n $stmt->bindParam(\":sid\", $sid);\n $stmt->execute();\n }", "public function del($id)\n {\n }", "public function _destroy($id)\n {\n // Set query\n R::exec('DELETE FROM sessions WHERE sid = ?', [$id]);\n\n return true;\n }", "public function delete(){\n\t\t$this->_getDAO(false);\n\t\treturn $this->dao->delete($this->user->getID(), $this->ident);\n\t}", "function phpAds_SessionDataDestroy()\n{\n $dal = new MAX_Dal_Admin_Session();\n\n\tglobal $session;\n $dal->deleteSession($_COOKIE['sessionRPID']);\n\n MAX_cookieAdd('sessionRPID', '');\n MAX_cookieFlush();\n\n\tunset($session);\n\tunset($_COOKIE['sessionRPID']);\n}", "function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }", "public function delete(int $id);" ]
[ "0.7326263", "0.72729653", "0.71944344", "0.6919571", "0.690368", "0.6862217", "0.68259895", "0.6824635", "0.68131286", "0.6808197", "0.6799934", "0.67668426", "0.6763494", "0.6760092", "0.6754926", "0.67104477", "0.670551", "0.6578883", "0.6566022", "0.65528023", "0.6551264", "0.6548079", "0.65332556", "0.65210766", "0.6508767", "0.64992213", "0.64976966", "0.6495922", "0.6485319", "0.64851415", "0.6469457", "0.6455061", "0.6448447", "0.6434792", "0.64243585", "0.64198065", "0.64198065", "0.64198065", "0.6404083", "0.6393687", "0.638981", "0.63790095", "0.63671136", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63645315", "0.63642466", "0.6361054", "0.63516563", "0.63426125", "0.63351613", "0.63351613", "0.63351613", "0.63351613", "0.63351613", "0.63351613", "0.63102746", "0.6308339", "0.63057536", "0.62799704", "0.6275298", "0.6260787", "0.625801", "0.62482256", "0.62407684", "0.6225615", "0.6212074", "0.6211668", "0.62113917", "0.6208697", "0.6204182" ]
0.6921861
3
/ SEARCH FOR A sessions ========================================================================
public function search_sessions() { $search_content = $this->input->get("search"); if($search_content==""){ }else{ $search_content = $this->security->xss_clean($search_content); $search_content = htmlspecialchars($search_content); $data["results"] = $this->admin_student_courses_mdl->search_sessions($search_content); print json_encode($data); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function get_sessions();", "protected function get_sessions()\n {\n }", "public function actionGetListaSessions()\r\n\t\t{\r\n\t\t\treturn $varSession = [\r\n\t\t\t\t\t\t\t'postData',\r\n\t\t\t\t\t\t\t'conf',\r\n\t\t\t\t\t\t\t'begin',\r\n\t\t\t\t\t];\r\n\r\n\t\t}", "public function sessions() {\r\n\t\treturn self::request(self::HTTP_GET, 'sessions');\r\n\t}", "public function session_list()\n\t{\n\t\t$query=$this->db->get('session');\n\t\treturn $query->result();\n\t}", "public function findSession($serializedSession);", "public function selectSession() {\n $query = \"SELECT * FROM sessions \";\n $result = mysqli_query($db, $query);\n if (mysqli_num_rows($result) > 0) {\n while($row = mysqli_fetch_assoc($result)) {\n echo \":session_id \" . $row[\"session_id\"]. \"&nbsp&nbspSession&nbspName&nbsp\" .$row['session_name'].\n \"&nbsp&nbspStart&nbspDate&nbsp\" .$row['start_date'].\"&nbsp&nbspEnd&nbspDate&nbsp\" .$row['end_date'].\"&nbsp&nbspActivity&nbsp\" .$row['activity_numbers']. \"<br>\" ;\n }\n } else {\n echo \"0 results\";\n }\n }", "function wp_get_all_sessions()\n {\n }", "function find_session($session)\n{\n global $db;\n if (isset($session)) {\n $sql = \"SELECT * FROM sessions WHERE session = :session;\";\n $params = array(':session' => $session);\n $sessions = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($sessions) {\n return $sessions[0];\n }\n }\n return NULL;\n}", "function find_session($session) {\n global $db;\n\n if (isset($session)) {\n $sql = \"SELECT * FROM sessions WHERE session = :session;\";\n $params = array(\n ':session' => $session\n );\n $records = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($records) {\n // Sessions is a unique field, so only 1 record should be selected.\n return $records[0];\n }\n }\n // if nothing is returned earlier, then return NULL\n return NULL;\n}", "public function sessions() {\n return $this->rich_model->get_sessions();\n // return $this->rich_model->get_mikrotik_sessions();\n }", "function get_users_by_session($session_id){\n $query = $this->db->query(\"select *\n from mbf_session_user join mbf_user join mbf_session\n on mbf_session_user.user = mbf_user.id and mbf_session_user.session = mbf_session.id\n where mbf_session.id = $session_id\");\n return $query->result();\n }", "function find_session($db, $session)\n{\n if (isset($session)) {\n $records = exec_sql_query(\n $db,\n \"SELECT * FROM sessions WHERE session = :session;\",\n array(':session' => $session)\n )->fetchAll();\n if ($records) {\n // sessions are unique, so there should only be 1 record\n return $records[0];\n }\n }\n return NULL;\n}", "public function getSession();", "public function getListSessions()\n {\n return $this->getProperty('listSessions');\n }", "public function get_all_session()\n\t\t{\n\t\t\treturn parent::get_all_items('session_items');\n\t\t}", "public function getTermSearchSession() {\n \treturn $this->manager->getTermSearchSession();\n\t}", "function findsession($loc) {\r\n\t//trying to find current session, start as false\r\n\t$CurrentSession = false;\r\n\r\n\t//get session list for location from database and make into array\r\n\t$SessionString = getSessionListByLoc($loc);\r\n\tif ($SessionString == false)\t//if no sessions at that location\r\n\t\treturn -1;\r\n\t$SessionList = explode(',', $SessionString);\r\n\t\r\n\t//check date and times to see if it is current session\r\n\tdate_default_timezone_set(\"America/Los_Angeles\");\r\n\tforeach ($SessionList as $ThisSession) {\r\n\t\t//check if current date is same as date of the session\r\n\t\tif (getSessionDate($ThisSession) == date(\"Y-m-d\")) {\r\n\t\t\t//check current time to be in range of start/end of session\r\n\t\t\tif ( date(\"H:i:s\") >= getSessionStart($ThisSession) AND date(\"H:i:s\") <= getSessionEnd($ThisSession)) {\r\n\t\t\t\t$CurrentSession = $ThisSession;\r\n\t\t\t\tbreak;\t//exit foreach loop if found\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//if $CurrentSession remains false, then no current session found, return -1\r\n\tif($CurrentSession == false)\r\n\t\treturn false;\r\n\telse\t//otherwise return found session ID\r\n\t\treturn $CurrentSession;\t\r\n}", "public function getSession() {}", "public function getSessions()\n\t{\n\t\treturn $this->session->all();\n\t}", "public function getCourseSearchSession() {\n \treturn $this->manager->getCourseSearchSession();\n\t}", "abstract protected function getSession();", "static function findBySessionId($session_id, $session_key) {\n $users_table = TABLE_PREFIX . 'users';\n $user_sessions_table = TABLE_PREFIX . 'user_sessions';\n \n return Users::findOneBySQL(\"SELECT $users_table.* FROM $users_table, $user_sessions_table WHERE $users_table.id = $user_sessions_table.user_id AND $user_sessions_table.id = ? AND $user_sessions_table.session_key = ?\", $session_id, $session_key);\n }", "public function listSessions(Request $request, $id = null, $page='page_a') {\n $lifetime = 300; // 5 min.\n $this->repo->setModel('\\App\\Models\\Session')->where('last_activity', '>=', Carbon::now()->getTimestamp() - $lifetime);\n if (!is_null($id)) $this->repo->where('user_id','=',$id);\n return $this->repo->paginateArraySearch($request,$page);\n }", "public function retrieveConcurrentSessions()\n {\n $endpoint = self::$endpoint . '/statistics' . SessionEndpoint::$endpoint;\n return self::sendRequest(Method::GET, $endpoint);\n }", "public function searchWithCriteria(){\n\n\n //change default message for required rule\n $this->unsetSessionData();\n $this->setSessionData();\n\n\n if(isset($_SESSION['searchKeyword']) && isset($_SESSION['timecon'])){\n $this->searchByLocationAndDay();\n }else if(isset($_SESSION['searchKeyword']) && isset($_SESSION['timecon'])==FALSE){\n $this->searchByLocation();\n }else if(isset($_SESSION['searchKeyword'])==FALSE && isset($_SESSION['timecon'])){\n $this->searchByCalendar();\n }\n }", "public function getCourseCatalogSearchSession() {\n \treturn $this->manager->getCourseCatalogSearchSession();\n\t}", "public function getSessionInActiveTabObservation()\n {\n $id = Yii::app()->user->idUser;\n $result = Yii::app()->db->createCommand(\n 'SELECT u.firstName, u.lastName, u.avatarPath, name, title, description, s.datePost,\n s.dateCreate, s.idSession, COUNT(DISTINCT(a.idArchive)) AS numArchive,s.active, s.idUserCreate\n FROM sessions AS s\n LEFT JOIN invited_session AS i ON s.idSession = i.idSession\n INNER JOIN users AS u ON s.idUserCreate = u.idUser\n INNER JOIN topics AS t ON s.idTopic = t.idTopic\n LEFT JOIN archive_session AS a ON s.idSession = a.idSession\n WHERE (i.idUserInvited = :idUserInvited OR s.idUserCreate = :idUserCreate) AND ((s.datePost+ INTERVAL 1 DAY) >= Now())\n AND (t.active = 1) AND s.active = 1 AND (i.isJoined = 1 OR s.idUserCreate = :idUserCreate)\n GROUP BY s.idSession\n ORDER BY s.active desc, s.datePost desc')\n ->bindValues(array(':idUserInvited' => $id, ':idUserCreate' => $id))\n ->queryAll();\n return $result;\n }", "public function active()\n {\n // Create query finding all active sessions\n $query = $this->entityManager->createQuery('SELECT s.id, s.name, s.isPrivate, count(m.id) memberCount FROM Session s LEFT JOIN s.members m WHERE s.lastAction > ?1 GROUP BY s.id');\n $query->setParameter(1, new DateTime('-1 hour'));\n $sessions = $query->getArrayResult();\n return $sessions;\n }", "public static function all()\n {\n return $_SESSION;\n }", "public function getSession($name);", "public function getSessionInfo()\n {\n return $this->execute('user/session', 'GET');\n }", "public function index()\n {\n return Session::all();\n }", "public function fetchSessionData() {}", "public function getAll() {\n \n $this->start();\n return $_SESSION;\n \n }", "function get_sessions_by_user($user){\n $id_user = \"\";\n if(is_int($user)){\n $id_user = $user;\n }else{\n $id_user = $user->id;\n }\n $query = $this->db->query( \"select *\n from mbf_session_user join mbf_session join mbf_user\n on mbf_session_user.session = mbf_session.id and mbf_session_user.user = mbf_user.id\n where mbf_user.id = '$id_user'\n order by date\");\n return $query->result();\n }", "public function consultaSesiones()\r\n\t{\r\n\t\t$this->db->select('id, data');\r\n\t\t$query = $this->db->get('ci_sessions');\r\n\t\tif($query->num_rows() > 0){\r\n\t\t\treturn $query->result_array();\r\n\t\t}else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "function sessionStats()\n{\n return generateQuery('-st | sed \\'s/ */ /g\\' '); \n}", "public function getSession() \r\n\t{\t\t\t\r\n\t\t$this->url = $this->server . \"/X?op=login_request\" .\r\n\t\t\t\"&user_name=\" . $this->username .\r\n\t\t\t\"&user_password=\" . $this->password;\r\n\r\n\t\t// get login_response from Metalib\r\n\r\n\t\t$this->xml = $this->getResponse($this->url, $this->timeout);\r\n\t\t\r\n\t\t// extract session ID\r\n\t\t\r\n\t\t$objSession = $this->xml->getElementsByTagName(\"session_id\")->item(0);\r\n\t\treturn $objSession->nodeValue;\r\n\t}", "private function getSession() {\n\t\t//read session file and fill the array\n\t\tif (file_exists ( self::SESSION_FILE )) {\n\t\t\t$this->session = unserialize ( file_get_contents ( self::SESSION_FILE ) );\n\t\t}\n\t\t\n\t\t//If the last session has expired, remove the session\n\t\tif (isset ( $this->session ) && $this->session ['lastlogin'] + (10 * 60) <= time ()) {\n\t\t\tunset ( $this->session );\n\t\t\t$this->updateSession ();\n\t\t}\n\t}", "public function get_session($id)\n\t\t{\n\t\t\treturn parent::get_item($id,'session_items');\n\t\t}", "abstract function getSessionById($id);", "public function sessions()\n {\n return $this->hasMany(config('laragram.auth.session.model'))->orderBy('last_activity', 'desc');\n }", "public static function getSearchSessionUser()\n {\n $mainframe = JFactory::getApplication();\n\n $main_person = $mainframe->getUserStateFromRequest(\"module.main_person\", 'null');\n $main_person2 = $mainframe->getUserStateFromRequest(\"module.main_person2\", 'null');\n $main_person3 = $mainframe->getUserStateFromRequest(\"module.main_person3\", 'null');\n $main_person4 = $mainframe->getUserStateFromRequest(\"module.main_person4\", 'null');\n\n $join = $mainframe->getUserStateFromRequest(\"module.join\", 'null');\n $country = $mainframe->getUserStateFromRequest(\"module.country\", 'null');\n $region = $mainframe->getUserStateFromRequest(\"module.region\", 'null');\n\n return array(\n 'main_person' => $main_person,\n 'main_person2' => $main_person2,\n 'main_person3' => $main_person3,\n 'main_person4' => $main_person4,\n 'join' => $join,\n 'country' => $country,\n 'region' => $region\n );\n }", "public function get_sessions($request){\r\n\t\treturn $request['session'];\r\n\t}", "public function count_session()\n\t\t{\n\t\t\treturn parent::count_list('session_items');\n\t\t}", "FUNCTION ServiceChat_get_ChatSessionLogins( &$dbh,\n\t\t\t\t\t\t\t\t$sessionid )\n\t{\n\t\tif ( $sessionid == \"\" )\n\t\t{\n\t\t\treturn false ;\n\t\t}\n\t\t$sessionid = database_mysql_quote( $sessionid ) ;\n\t\t$session = ARRAY() ;\n\n\t\t$query = \"SELECT * FROM chatsessionlist WHERE sessionID = $sessionid\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\t\t\n\t\tif ( $dbh[ 'ok' ] )\n\t\t{\n\t\t\twhile( $data = database_mysql_fetchrow( $dbh ) )\n\t\t\t{\n\t\t\t\tif( preg_match( \"/<o(.*)>/\", $data['screen_name'] ) )\n\t\t\t\t\t$session['visitor'] = $data['screen_name'] ;\n\t\t\t\telse\n\t\t\t\t\t$session['admin'] = $data['screen_name'] ;\n\t\t\t}\n\t\t\treturn $session ;\n\t\t}\n\t\treturn false ;\n\t}", "public function getTopicSearchSession() {\n \treturn $this->manager->getTopicSearchSession();\n\t}", "public function getAll() {\n return $_SESSION;\n }", "public function all()\n {\n return $_SESSION;\n }", "function getindex_sessionbykey($id, $key, $sessions)\n{\n if (!$sessions) {\n return -1;\n }\n $i = -1;\n while (++$i < count($sessions)) {\n if (property_exists($sessions[$i], $key)) {\n if (password_verify($id, $sessions[$i]->$key)) {\n return $i;\n }\n }\n }\n return $i;\n}", "public function index()\n {\n //\n return $this->respond($this->_repo->sessions());\n }", "public function startsessionAction()\r\n {\r\n // initialise the session for a new search\r\n $sid = $this->engine->initializePazpar2Client();\r\n //$ns = new Zend_Session_Namespace($this->id);\r\n //$ns->sid = $sid;\r\n $_SESSION[$this->id]['sid'] = $sid;\r\n\t\t// then redirect to search action\r\n $params = $this->query->getAllSearchParams();\r\n\t\t$params['lang'] = $this->request->getParam('lang');\r\n\t $params['controller'] = $this->request->getParam('controller');\r\n\t $params['action'] = 'search';\r\n\t\t$url = $this->request->url_for($params);\r\n\t\treturn $this->redirect()->toUrl($url);\r\n\t}", "public function getSessionInstances()\n {\n $sessionObjects = [];\n foreach ($this->objects as $information) {\n if (isset($information['i']) && $information['s'] === ObjectConfiguration::SCOPE_SESSION) {\n $sessionObjects[] = $information['i'];\n }\n }\n return $sessionObjects;\n }", "public function session()\n {\n return $this->sessions()->where('last_activity', '<=', now()->addMinutes(config('laragram.auth.session.lifetime')))->first();\n }", "public static function getAll()\n\t{\n\t\treturn $_SESSION;\n\t}", "private function getSessionShortList()\n {\n return DataObject::get_one('ShortList',\n $filter = array('SessionID' => self::getSecurityToken()),\n $cache = false\n );\n }", "FUNCTION ServiceChat_get_ChatSessions( &$dbh,\n\t\t\t\t\t\t\t$aspid )\n\t{\n\t\tif ( $aspid == \"\" )\n\t\t{\n\t\t\treturn false ;\n\t\t}\n\t\t$aspid = database_mysql_quote( $aspid ) ;\n\t\t$sessions = ARRAY() ;\n\n\t\t$query = \"SELECT * FROM chatsessions, chatrequests WHERE chatrequests.aspID = '$aspid' AND chatrequests.sessionID = chatsessions.sessionID ORDER BY chatrequests.created DESC\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\t\t\n\t\tif ( $dbh[ 'ok' ] )\n\t\t{\n\t\t\twhile( $data = database_mysql_fetchrow( $dbh ) )\n\t\t\t{\n\t\t\t\t$sessions[] = $data ;\n\t\t\t}\n\t\t\treturn $sessions ;\n\t\t}\n\t\treturn false ;\n\t}", "public function viewSession(){\n\t\t\t$query = $this->connection()->prepare(\"SELECT * FROM sessionz ORDER BY id DESC\");\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t}", "function getSession() {\n\t\treturn $this->getSessionRelatedBySessionId();\n\t}", "function select_usrsess(){\n\t\t$username = $this->session->userdata('username');\n\t\t$query = $this->db->query(\"SELECT * from sys_user_session order by ses_id desc limit 5\");\n\t\treturn $query;\n\t}", "function getSession($key){\n return Yii::app()->getSession()->get($key);\n}", "public function sessionStatus() {\n $query = \"SELECT * FROM sessions WHERE activity_status = '1' \";\n $result = mysqli_query($db, $query);\n if (mysqli_num_rows($result) == 1) {\n while($row = mysqli_fetch_assoc($result)) {\n echo \":session_id \" . $row[\"session_id\"]. \"&nbsp&nbspSession&nbspName&nbsp\" .$row['session_name'].\n \"&nbsp&nbspStart&nbspDate&nbsp\" .$row['start_date'].\"&nbsp&nbspEnd&nbspDate&nbsp\" .$row['end_date'].\"&nbsp&nbspActivity&nbsp\" .$row['activity_status']. \"<br>\" ;\n }\n } else {\n echo \"0 results\";\n }\n }", "public function hasSession() {}", "public function get_sessions($id=FALSE, $recursive=FALSE, $where=FALSE, $data=FALSE, $sort=FALSE, $limit=FALSE)\n\t{\n\t\t// Setup\n\t\t$method = 'sessions';\n\t\t$base = $this->setup_db($method, $method, $id, $where, $data, $sort, $limit);\n\t\tif (empty($base)) return false;\n\n\t\t// Walk the query result\n\t\t$result = array();\n\t\tforeach ($base as $i) {\n\t\t\t// Handle recursive elements\n\t\t\tif ($recursive) $i['eventid'] = (isset($GLOBALS['get_data'][$method]['events'][$i['eventid']])) ? $GLOBALS['get_data'][$method]['events'][$i['eventid']]: $this->get_data($method, 'events', $i['eventid']);\n\n\t\t\t// Additional Processing\n\t\t\tif ($recursive) $i['nicetitle'] = (empty($i['title'])) ? $i['eventid']['sessiontitle'].' '.$i['sessionnum']: $i['title'];\n\n\t\t\t// Update the key and add to result array\n\t\t\t$result[$i['id']] = $i;\n\t\t}\n\n\t\t// Return our processed array, or single row\n\t\treturn ($id !== false && count($result) == 1) ? $result[$i['id']]: $result;\n\t}", "public function list($account)\n {\n return $this->httpGet('customservice/kfsession/getsessionlist', ['kf_account' => $account]);\n }", "function geefSession() {\n echo '<pre>';\n print_r( $_SESSION );\n echo '</pre>';\n}", "public function checkUsersSession(){\n\t}", "function MyApp_Session_SID_Read($sid)\n {\n $this->Session=$this->Sql_Select_Hash\n (\n array\n (\n \"SID\" => $sid\n ),\n array(),\n TRUE,\n $this->GetSessionsTable()\n );\n }", "function loadSession() {}", "public function searchAction()\n\t{\n\t\t$userSession = new Container('fo_user');\n\t\t$this->layout('frontend');\n\t\t$request \t\t= $this->getRequest();\n\t\t$message\t\t= '';\n\t\t$errorMessage\t= '';\n\t\t\n\t\t//\tDestroy listing Session Vars\n\t\t$listingSession = new Container('fo_listing');\n\t\t$sessionArray\t= array();\n\t\tforeach($listingSession->getIterator() as $key => $value) {\n\t\t\t$sessionArray[]\t= $key;\n\t\t}\n\t\tforeach($sessionArray as $key => $value) {\n\t\t\t$listingSession->offsetUnset($value);\n\t\t}\n\t\t\n\t\tif ($request->isPost()) {\n\t\t\t$formData\t= $request->getPost();\n\t\t\tif(isset($formData['search']) && $formData['search'] != '')\n\t\t\t\t$listingSession->keyword\t= $formData['search'];\n\t\t\telse\n\t\t\t\t$listingSession->keyword\t= '';\n\t\t\t\n\t\t}\n\t\t\n\t\treturn new ViewModel(array(\n\t\t\t'userObject'\t=> $userSession->userSession,\n\t\t\t'message'\t\t=> $message,\n\t\t\t'errorMessage'\t=> $errorMessage,\n\t\t\t'action'\t\t=> $this->params('action'),\n\t\t\t'controller'\t=> $this->params('controller'),\n\t\t));\n }", "public function getSession() {\n\t\ttry {\n\n\t\t\t$sessionQuery = \"SELECT * FROM session\";\n\t\t\treturn DB::select($sessionQuery);\n\n\t\t} catch (\\Exception $ex) {\n\t\t\tprint_r($ex->getMessage());\n\n\t\t}\n\t}", "function check_session() {\n \n global $CONF;\n \n \t#error_log( \"check session\" );\n \t$s \t\t\t\t\t\t= new Session;\n\tsession_start ();\n \n \t#if (!session_is_registered (\"svn_sessid\")) {\n \tif (! isset($_SESSION['svn_sessid']) ) {\n \t\n \theader (\"Location: login.php\");\n \texit;\n \n \t}\n \n \t$SESSID_USERNAME \t\t= $_SESSION['svn_sessid']['username'];\n \t\n \tif(isset($CONF['ldap_bind_use_login_data']) and ($CONF['ldap_bind_use_login_data'] == 1)) {\n \t\t\n \t\tif( isset( $CONF['ldap_bind_dn_suffix'] ) ) {\n\t\t\n\t\t\t$CONF['bind_dn'] \t= $_SESSION['svn_sessid']['username'].$CONF['ldap_bind_dn_suffix'];\n \t\t\t$CONF['bind_pw'] \t= $_SESSION['svn_sessid']['password'];\t\n \t\t}\n\t\t\t\t\n\t}\n \n \treturn $SESSID_USERNAME;\n}", "function getMemberInfoBySessionId($sessionId){\n\t\n\t\t$dbname = \"forums\";\n\t\t$conn = new PDO(\"mysql:host=\".servername.\";dbname=$dbname\", username, password);\n\t\t$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t$stmt = $conn->prepare(\"SELECT m.member_id, m.donator_points_overall, m.donator_points_current FROM `sessions` s, `members` m where s.id = :sessionId and s.member_id = m.member_id\");\n\t\t$stmt->execute(array(':sessionId'=> $sessionId));\n\n\t\t$rows = $stmt->fetchAll();\n\n\t\t\t\t\t\t\t\t\t\t\n\t\treturn $rows;\n\t}", "public function getSession() {\n\t\t$msg[]=\"<details><summary>SESSION AND COOKIES</summary>\";\n\t\t$msg[]=$this->show();\n\t\t$msg[]=\"</details>\";\n\t\treturn implode(\"\\n\",$msg);\n\t}", "Function GetAlias_sys_session($sid) {\n $this->db->db_Query(\"SELECT `email` FROM `\" . TblSysSession . \"` WHERE `session_id`='$sid'\");\n if (!$this->db->result) {\n //show_error('_ERROR_NORESULT_SQL_QUERY');\n return false;\n }\n if (!$this->db->db_GetNumRows()) {\n //show_error('_ERROR_NORESULT_SQL_QUERY');\n return false;\n }\n $line = $this->db->db_FetchAssoc();\n $res = $line['email'];\n return $res;\n }", "function get_db_session_data()\r\n\t{\r\n\t\t$query = $this->mongo_db->select('user_data')->get('ci_sessions');\r\n\t\t$user = array(); /* array to store the user data we fetch */\r\n\t\tforeach ($query->result() as $row)\r\n\t\t{\r\n\t\t $udata = unserialize($row->user_data);\r\n\t\t /* put data in array using username as key */\r\n\t\t $user['user_name'] = $udata['user_name']; \r\n\t\t $user['is_logged_in'] = $udata['is_logged_in']; \r\n\t\t}\r\n\t\treturn $user;\r\n\t}", "#[Pure]\n public function getAll() : array\n {\n return $_SESSION;\n }", "private function get_session()\n\t\t{\n\t\t\t$auto = $this->use_token();\n\n\t\t\tglobal $user;\n\t\t\tif ($user)\n\t\t\t\treturn (object)['id' => $user->id, 'name' => $user->name, 'state' => $_SESSION['state']];\n\t\t\telse if ($auto)\n\t\t\t\treturn (object)['id' => $auto->id, 'name' => $auto->name, 'state' => $_SESSION['state']];\n\t\t\telse\n\t\t\t\treturn (object)['id' => null, 'name' => null, 'state' => 0];\n\t\t}", "Function GetUserInfo_sys_session($sid) {\n $q = \"SELECT `user_id`,`user_type`,`login`,`email` FROM `\" . TblSysSession . \"` WHERE `session_id`='$sid'\";\n $this->db->db_Query($q);\n //echo '<br>$q='.$q;\n if (!$this->db->result) {\n //show_error('_ERROR_NORESULT_SQL_QUERY');\n return false;\n }\n if (!$this->db->db_GetNumRows()) {\n //show_error('_ERROR_NORESULT_SQL_QUERY');\n return false;\n }\n $line = $this->db->db_FetchAssoc();\n $res['user_id'] = $line['user_id'];\n $res['user_type'] = $line['user_type'];\n $res['login'] = $line['login'];\n $res['email'] = $line['email'];\n //echo '<br>$res='.$res;\n return $res;\n }", "function search() {}", "function get_for_session($session_id, $type = null)\n {\n return $this->get_all(array('session_id' => $session_id));\n }", "function sessionFields($resultSet){\r\n\t\t$_SESSION['id'] = $resultSet[0]->id;\r\n\t\t$_SESSION['username'] = $resultSet[0]->username;\r\n\t\t$_SESSION['name'] = $resultSet[0]->name;\r\n\t\t$_SESSION['surname'] = $resultSet[0]->surname;\r\n\t\t$_SESSION['email'] = $resultSet[0]->email;\r\n\t\t$_SESSION['role'] = $resultSet[0]->role;\r\n\t\t$_SESSION['picture'] = $resultSet[0]->picture;\r\n\t}", "public function get_session()\n\t{\n\t\t$query=$this->db->get('session');\n\t\treturn $query->result();\n\t}", "function parseSessionsList($content, $organization_id)\n{\n\n $data = str_get_html($content);\n\n //\tCheck for single sessions\n $islist = $data->find('table.dataTableExHov', 0);\n if (!empty ($islist)) {\n $content = $data->find('table.dataTableExHov', 0)->find('tbody a.outputLink');\n } else {\n return false;\n }\n\n global $http_response_header;\n foreach ($content as $link) {\n\n $session_name = $link->text();\n var_dumpp($session_name);\n $session_link = $link->href;\n $session_nouid = preg_replace('/\\&uid.*$/is', '', $session_link);\n\n // Date\n if ($organization_id != 95) {\n $date = trim($link->parent()->next_sibling()->next_sibling()->next_sibling()->text());\n } else {\n $date = trim($link->parent()->next_sibling()->next_sibling()->text());\n }\n $date = str_replace('(', '', $date);\n $date = str_replace(')', '', $date);\n $date = DateTime::createFromFormat('d.m.Y', $date);\n $session_date = $date->format('Y-m-d');\n\n $tmp = array(\n 'name' => trim($session_name),\n 'link' => trim($session_link),\n 'link_noid' => trim($session_nouid),\n 'date' => trim($session_date),\n 'review' => false,\n 'review_ext' => false\n );\n\n if ($date <= new DateTime('NOW')) {\n\n if(sessionDeleted($session_nouid)){\n continue;\n }\n // Check if session already imported\n if ($exists = sessionExists($session_nouid)) {\n if ($exists['in_review'] == 'f' || ($exists['in_review'] == 't' && !UPDATE_SESSIONS_IN_REVIEW)) continue;\n $tmp['id'] = $exists['id']; // Set that session exists\n $tmp['review_ext'] = true;\n }\n var_dumpp($tmp);\n var_dumpp($exists);\n\n // Log\n logger('FETCH SESSION: ' . DZ_URL . $session_link);\n\n // Get session\n $session_link = str_replace('&amp;', '&', $session_link); // Some weird shit changed recently on DZRS server\n $session = str_get_html(downloadPage(DZ_URL . $session_link));\n\n //\tRetrieve cookies\n $cookiess = '';\n if (isset($http_response_header)) {\n foreach ($http_response_header as $s) {\n if (preg_match('/^Set-Cookie:\\s*([^=]+)=([^;]+);(.+)$/', $s, $parts))\n $cookiess .= $parts[1] . '=' . $parts[2] . '; ';\n }\n }\n $cookiess = substr($cookiess, 0, -2);\n\n // Parse data\n $tmp['speeches'] = array();\n $k = 0;\n if (PARSE_SPEECHES) {\n if ($session->find('td.vaTop', 3)) {\n $sptable = $session->find('td.vaTop', 3)->find('a.outputLink');\n\n if (!empty ($sptable)) {\n $parseSpeeches = array();\n foreach ($sptable as $speeches) {\n $in_review = (bool)(stripos($speeches->innerText(), \"pregled\") !== false);\n if ($in_review && SKIP_WHEN_REVIEWS) continue 2;\n\n if ($in_review) $tmp['review'] = true;\n\n $datum = '';\n if (preg_match('/(\\d{2}\\.\\d{2}\\.\\d{4})/is', $speeches->innerText(), $matches)) {\n $datum = DateTime::createFromFormat('d.m.Y', $matches[1])->format('Y-m-d');\n }\n\n //check here\n $parseSpeeches[$k]['dateStart'] = $datum;\n $parseSpeeches[$k]['url'] = DZ_URL . $speeches->href;\n $parseSpeeches[$k]['in_review'] = $tmp['review'];\n $parseSpeeches[$k]['sessionId'] = $tmp['id'];\n\n $k++;\n }\n if (count($parseSpeeches) > 0) {\n foreach ($parseSpeeches as $parseSpeeche) {\n var_dumpp($parseSpeeche);\n if (!$parseSpeeche['sessionId']) {\n\n $speech = parseSpeeches($parseSpeeche['url'], $parseSpeeche['dateStart']);\n $tmp['speeches'][$speech['datum']] = $speech;\n $tmp['speeches'][$speech['datum']]['review'] = $parseSpeeche['in_review'];\n $tmp['speeches'][$speech['datum']]['insertToDb'] = 'parladata_speechinreview';\n sleep(FETCH_TIMEOUT);\n\n } else {\n\n $speech = parseSpeeches($parseSpeeche['url'], $parseSpeeche['dateStart']);\n $tmp['speeches'][$speech['datum']] = $speech;\n $tmp['speeches'][$speech['datum']]['review'] = $parseSpeeche['in_review'];\n sleep(FETCH_TIMEOUT);\n\n if(isSpeechInReviewStatusChanged($parseSpeeche['sessionId'], $parseSpeeche['in_review'])){\n $tmp['speeches'][$speech['datum']]['insertToDb'] = 'parladata_speech';\n }else{\n $tmp['speeches'][$speech['datum']]['insertToDb'] = 'parladata_speechinreview';\n }\n\n }\n }\n //var_dumpp($tmp['speeches'][$speech['datum']]);\n }\n\n }\n }\n }\n\n $tmp['documents'] = array();\n if (PARSE_DOCS) {\n if ($session->find('td.vaTop', 3)) {\n $doctable = $session->find('td.vaTop', 2)->find('a');\n\n if (!empty ($doctable)) {\n foreach ($doctable as $doc) {\n if (stripos($doc->innerText(), \"pregled\") === false) {\n $tmp['documents'][] = parseDocument(DZ_URL . $doc->href);\n sleep(FETCH_TIMEOUT);\n\n if(empty($tmp['id'])){\n var_dump($tmp['link_noid']);\n //continue 2;\n }\n var_dump(\"documetn parse\" . $tmp['id']);\n\n\n } else {\n if (SKIP_WHEN_REVIEWS) continue 2;\n }\n }\n }\n }\n }\n\n // Parse voting data\n $tmp['voting'] = array();\n if (PARSE_VOTES) {\n var_dump(\"VOTES\");\n // Search on DT page or not TODO: better solution needed\n preg_match('/form id=\"(.*?):form1\"/', $session, $fmatches);\n $form_id = $fmatches[1];\n\n //\tRetreive pager form action\n preg_match('/form id=\"' . $form_id . ':form1\".*?action=\"(.*?)\"/', $session, $matches);\n\n //\tRetreive some ViewState I have no fucking clue what it is for, but it must be present in POST\n preg_match('/id=\"javax\\.faces\\.ViewState\" value=\"(.*?)\"/', $session, $matchess);\n\n //\tRetreive number of pages\n preg_match('/Page 1 of (\\d+)/i', $session, $matchesp);\n\n if (!empty($matchesp[1]) && (int)$matchesp[1] > 0) {\n\n\n for ($i = 1; $i <= (int)$matchesp[1]; $i++) {\n\n var_dumpp($i);\n\n //\tGet next page\n $postdata = http_build_query(\n array(\n $form_id . ':form1' => $form_id . ':form1',\n // $form_id . ':form1:menu1' => CURRENT_SESSION,\n $form_id . ':form1:tableEx1:goto1__pagerGoButton.x' => 11,\n $form_id . ':form1:tableEx1:goto1__pagerGoButton.y' => 11,\n $form_id . ':form1:tableEx1:goto1__pagerGoText' => $i,\n $form_id . ':form1_SUBMIT' => 1,\n 'javax.faces.ViewState' => $matchess[1],\n // 'javax.faces.ViewState' => '/wps/PA_DZ-LN-Seje/portlet/SejeIzbranaSejaView.jsp',\n )\n );\n $opts = array('http' =>\n array(\n 'method' => 'POST',\n 'header' => 'Cookie: ' . $cookiess . \"\\r\\n\" . 'Content-type: application/x-www-form-urlencoded',\n 'content' => $postdata\n )\n );\n $context = stream_context_create($opts);\n\n if ($subpage = file_get_contents(DZ_URL . $matches[1], false, $context)) {\n\n $votearea = str_get_html($subpage)->find('table.dataTableExHov', 0);\n if (!empty ($votearea)) {\n\n foreach ($votearea->find('tbody td a.outputLink') as $votes) {\n if (preg_match('/\\d{2}\\.\\d{2}\\.\\d{4}/is', $votes->text())) {\n $tmp['voting'][] = parseVotes(DZ_URL . $votes->href);\n sleep(FETCH_TIMEOUT);\n }\n }\n }\n }\n }\n\n //saveVotes($tmp, $organization_id);\n\n }\n\n }\n\n //\tTest: Izpis podatkov celotne seje\n //print_r ($tmp);\n //exit();\n\n\n //\tAdd to DB\n saveSession($tmp, $organization_id);\n var_dumpp(\"SAVE:\");\n var_dumpp($organization_id);\n }\n }\n}", "public function getSessionUsers($vid_id){\n\t$currentuserid = Yii::$app->user->identity->id;\n\t $data = array();\n\t\t$connection = \\Yii::$app->db; \n\t\t$model = $connection->createCommand('SELECT * FROM video_call_details where (pet_owner_id='.$currentuserid.' OR pet_sitter_id='.$currentuserid.') AND id='.$vid_id );\n\t\t$data = $model->queryOne();\n\t\treturn $data;\n\t\t\n\t}", "static function retrieveBySessionId($value) {\n\t\treturn static::retrieveByColumn('session_id', $value);\n\t}", "function getSession() {\n global $session, $conn, $MAX_SESSION_AGE;\n if (isset($_COOKIE[\"sessionID\"])) {\n $sessionID = $_COOKIE[\"sessionID\"];\n\n $sessClear = $conn -> prepare(\"\ndelete from session\nwhere utc_timestamp() - lastupdatetime > :maxAge\");\n $sessClear -> bindParam(\":maxAge\", $MAX_SESSION_AGE);\n $sessClear -> execute();\n\n $user = $conn -> prepare(\"\nselect u.username username, u.pk_user_id user_id, s.pk_session_id session_id from session s\njoin user u on s.fk_user_id = u.pk_user_id\nwhere pk_session_id = :session_id\");\n $user -> bindParam(\":session_id\", $sessionID);\n $user -> execute();\n if ($user -> rowCount() > 0) {\n $session = $user -> fetch(PDO::FETCH_ASSOC);\n $updateTimer = $conn -> prepare(\"\nupdate session\nset lastupdatetime = utc_timestamp()\nwhere pk_session_id = :session_id\");\n $updateTimer -> bindParam(\":session_id\", $sessionID);\n $updateTimer -> execute();\n } else {\n $session = null;\n logOutAndForward(true);\n }\n }\n return null;\n}", "function checkLDAP() {\n $ldap = LDAPConnection();\n // search entries based on Localhost IP\n // DN : uid=127.0.0.1,l=devices,cn=username,ou=users\n $result = ldap_search($ldap[0],$ldap[1], \"(uid=\".getIP().\")\") or die (\"Error in search query: \".ldap_error($ldap[0]));\n $data = ldap_get_entries($ldap[0], $result);\n $_SESSION['users'] = [];\n \n // put data value to $value variable and set the index\n foreach ($data as $index => $value) {\n // if index value and data type are equals to count, skip the process\n if ($index === 'count') {\n continue;\n }\n \n // splitting DN with a coma separator\n $splittedDN = explode(',', $value['dn']);\n // take the username string from splittedDN\n $dnUser = substr($splittedDN[2], 3);\n // searh entries based on l=connected with sn=username\n $data2 = checkUserLDAP($dnUser);\n \n // if there is data found on the array, put it on user-list array on login page to be displayed on the user list\n if ($data2['count'] == 1) {\n $_SESSION['users'] []= $dnUser;\n }\n }\n\n // if there's no data found, destroy the session\n if (count($_SESSION['users']) <= 0) {\n session_destroy();\n }\n}", "public function getSession()\n {\n $session = array(null, null);\n foreach ($this->readAll() as $cookie) {\n // Check for http || https\n if (strpos($cookie['name'], 'SESS') === 0\n || strpos($cookie['name'], 'SSESS') === 0\n ) {\n $session = array($cookie['name'], $cookie['value']);\n break;\n }\n }\n\n return $session;\n }", "public function getSessionsProperty(): Collection\n {\n if (config('session.driver') !== 'database') {\n return collect();\n }\n\n return collect(\n DB::connection(config('session.connection'))->table(config('session.table', 'sessions'))\n ->where('user_id', Auth::user()?->getAuthIdentifier())\n ->orderBy('last_activity', 'desc')\n ->get()\n )->map(function ($session) {\n $deviceDetector = $this->createAgent($session);\n\n return (object) [\n 'device' => $deviceDetector->getDeviceName(),\n 'client_name' => $deviceDetector->getClient('name'),\n 'os_name' => $deviceDetector->getOs('name'),\n 'os_version' => $deviceDetector->getOs('version'),\n 'ip_address' => $session->ip_address,\n 'is_current_device' => $session->id === session()->getId(),\n 'last_active' => Carbon::createFromTimestamp($session->last_activity)->diffForHumans(),\n ];\n });\n }", "function phpAds_SessionDataFetch()\n{\n global $session;\n $dal = new MAX_Dal_Admin_Session();\n\n // Guard clause: Can't fetch a session without an ID\n\tif (empty($_COOKIE['sessionRPID'])) {\n return;\n }\n\n $serialized_session = $dal->getSerializedSession($_COOKIE['sessionRPID']);\n // This is required because 'sessionRPID' cookie is set to new during logout.\n // According to comments in the file it is because some servers do not\n // support setting cookies during redirect.\n if (empty($serialized_session)) {\n return;\n }\n\n $loaded_session = unserialize($serialized_session);\n\tif (!$loaded_session) {\n // XXX: Consider raising an error\n return;\n }\n\t$session = $loaded_session;\n $dal->refreshSession($_COOKIE['sessionRPID']);\n}", "protected function fetchUserSessionFromDB() {}", "public static function getSessionid();", "public function search($resultsPerPage=null, $uniqueId=null, $excludeAPI=false){\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->distinct = true;\n $criteria->compare('id', $this->id);\n $criteria->compare('fullName', $this->fullName, true);\n $criteria->compare('username', $this->username, true);\n $criteria->compare('username', '<>'.self::GUEST_PROFILE_USERNAME, true);\n $criteria->compare('officePhone', $this->officePhone, true);\n $criteria->compare('cellPhone', $this->cellPhone, true);\n $criteria->compare('emailAddress', $this->emailAddress, true);\n $criteria->compare('status', $this->status);\n $criteria->compare('tagLine',$this->tagLine,true);\n\n // Filter on is active model property\n if (!isset ($this->isActive)) { // invalid isActive value\n } else if ($this->isActive) { // select all users with new session records\n $criteria->join = \n 'JOIN x2_sessions ON x2_sessions.user=username and '.\n 'x2_sessions.lastUpdated > \"'.(time () - 900).'\"';\n } else { // select all users with old session records or no session records\n $criteria->join = \n 'JOIN x2_sessions ON (x2_sessions.user=username and '.\n 'x2_sessions.lastUpdated <= \"'.(time () - 900).'\") OR '.\n 'username not in (select x2_sessions.user from x2_sessions as x2_sessions)';\n }\n\n if ($excludeAPI) {\n if ($criteria->condition !== '') {\n $criteria->condition .= ' AND username!=\\'API\\'';\n } else { \n $criteria->condition = 'username!=\\'API\\'';\n }\n }\n\n return $this->smartSearch ($criteria, $resultsPerPage);\n }", "public function get($sessions)\n\t\t{\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif($this->index >= $this->max)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif(isset($this->item))\n\t\t\t\t\treturn;\n\t\t\t\t\t\n\t\t\t\t$session = $sessions[$this->index];\n\t\t\t\t\n\t\t\t\tif($session[\"Day\"] == $this->day_no)\n\t\t\t\t{\t\t\n\t\t\t\t\tif($session[\"Start Time\"] == $this->start_time)\n\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\tif($session[\"End Time\"] == $this->end_time)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($session[\"Room\"] == $this->room_no)\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this->item = $session;\t\n\t\t\t\t\t\t\t\t\treturn;\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t$this->index++;\n\t\t\t\t$this->get($sessions);\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\tcatch (Exception $e)\n {\n // trigger (big, orange) error\n trigger_error($e->getMessage(), E_USER_ERROR);\n }\t\n\t\t}", "public function search();", "public function search();", "public function getSession()\r\n {\r\n return $this->sessionID;\r\n }", "static function getSession($name){\n return $_SESSION[$name];\n }" ]
[ "0.70819956", "0.671118", "0.6690345", "0.6572358", "0.6548378", "0.6491341", "0.64078474", "0.6306489", "0.6287855", "0.62685126", "0.6259252", "0.62564576", "0.62456465", "0.6197596", "0.61722875", "0.6155564", "0.61540556", "0.60828817", "0.6079546", "0.60365796", "0.60362905", "0.60186654", "0.60164577", "0.5997036", "0.5982874", "0.59355134", "0.5908121", "0.5899959", "0.58789897", "0.58704036", "0.5865178", "0.58596826", "0.584483", "0.58436483", "0.58338165", "0.58310044", "0.5819829", "0.581471", "0.58115864", "0.5793161", "0.57931", "0.57873607", "0.57495815", "0.57336396", "0.57317567", "0.5726799", "0.57231885", "0.57132053", "0.5707016", "0.57030064", "0.5698477", "0.5698274", "0.5695231", "0.5692206", "0.5682091", "0.5681598", "0.5679951", "0.5660422", "0.5657362", "0.5651226", "0.56454563", "0.56414247", "0.56358063", "0.563214", "0.5631906", "0.56296027", "0.56164193", "0.5601006", "0.559738", "0.5593066", "0.5589454", "0.55888975", "0.5586672", "0.5582309", "0.5581563", "0.5575279", "0.55693984", "0.55633944", "0.55627227", "0.55403745", "0.55294627", "0.55170846", "0.5509366", "0.5508821", "0.5503538", "0.54978746", "0.5494411", "0.54924965", "0.5490324", "0.5484793", "0.5474812", "0.5457692", "0.5455936", "0.5449247", "0.54457223", "0.5439211", "0.54383826", "0.54383826", "0.5436139", "0.5435843" ]
0.61959517
14